diff --git a/assets/index-BWHJTPSl.js b/assets/index-BWHJTPSl.js new file mode 100644 index 0000000..d3e139b --- /dev/null +++ b/assets/index-BWHJTPSl.js @@ -0,0 +1,4191 @@ +var hj=Object.defineProperty;var Z3=t=>{throw TypeError(t)};var pj=(t,e,n)=>e in t?hj(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Vt=(t,e,n)=>pj(t,typeof e!="symbol"?e+"":e,n),cS=(t,e,n)=>e.has(t)||Z3("Cannot "+n);var Vo=(t,e,n)=>(cS(t,e,"read from private field"),n?n.call(t):e.get(t)),uS=(t,e,n)=>e.has(t)?Z3("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),L0=(t,e,n,r)=>(cS(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),fS=(t,e,n)=>(cS(t,e,"access private method"),n);function mj(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var k0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ws(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var f5={exports:{}},$x={},d5={exports:{}},Gt={};/** + * @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 Ym=Symbol.for("react.element"),gj=Symbol.for("react.portal"),vj=Symbol.for("react.fragment"),yj=Symbol.for("react.strict_mode"),xj=Symbol.for("react.profiler"),bj=Symbol.for("react.provider"),_j=Symbol.for("react.context"),wj=Symbol.for("react.forward_ref"),Sj=Symbol.for("react.suspense"),Mj=Symbol.for("react.memo"),Ej=Symbol.for("react.lazy"),J3=Symbol.iterator;function Cj(t){return t===null||typeof t!="object"?null:(t=J3&&t[J3]||t["@@iterator"],typeof t=="function"?t:null)}var h5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p5=Object.assign,m5={};function Dd(t,e,n){this.props=t,this.context=e,this.refs=m5,this.updater=n||h5}Dd.prototype.isReactComponent={};Dd.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Dd.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function g5(){}g5.prototype=Dd.prototype;function QC(t,e,n){this.props=t,this.context=e,this.refs=m5,this.updater=n||h5}var eT=QC.prototype=new g5;eT.constructor=QC;p5(eT,Dd.prototype);eT.isPureReactComponent=!0;var Q3=Array.isArray,v5=Object.prototype.hasOwnProperty,tT={current:null},y5={key:!0,ref:!0,__self:!0,__source:!0};function x5(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)v5.call(e,r)&&!y5.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,me=F[ee];if(0>>1;eei(ae,K))gei(Me,ae)?(F[ee]=Me,F[ge]=K,ee=ge):(F[ee]=ae,F[Q]=K,ee=Q);else if(gei(Me,K))F[ee]=Me,F[ge]=K,ee=ge;else break e}}return Y}function i(F,Y){var K=F.sortIndex-Y.sortIndex;return K!==0?K:F.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,h=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(F){for(var Y=n(c);Y!==null;){if(Y.callback===null)r(c);else if(Y.startTime<=F)r(c),Y.sortIndex=Y.expirationTime,e(l,Y);else break;Y=n(c)}}function S(F){if(x=!1,_(F),!v)if(n(l)!==null)v=!0,H(P);else{var Y=n(c);Y!==null&&Z(S,Y.startTime-F)}}function P(F,Y){v=!1,x&&(x=!1,g(L),L=-1),m=!0;var K=h;try{for(_(Y),f=n(l);f!==null&&(!(f.expirationTime>Y)||F&&!R());){var ee=f.callback;if(typeof ee=="function"){f.callback=null,h=f.priorityLevel;var me=ee(f.expirationTime<=Y);Y=t.unstable_now(),typeof me=="function"?f.callback=me:f===n(l)&&r(l),_(Y)}else r(l);f=n(l)}if(f!==null)var le=!0;else{var Q=n(c);Q!==null&&Z(S,Q.startTime-Y),le=!1}return le}finally{f=null,h=K,m=!1}}var N=!1,T=null,L=-1,U=5,M=-1;function R(){return!(t.unstable_now()-MF||125ee?(F.sortIndex=K,e(c,F),n(l)===null&&F===n(c)&&(x?(g(L),L=-1):x=!0,Z(S,K-ee))):(F.sortIndex=me,e(l,F),v||m||(v=!0,H(P))),F},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(F){var Y=h;return function(){var K=h;h=Y;try{return F.apply(this,arguments)}finally{h=K}}}})(M5);S5.exports=M5;var Fj=S5.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 zj=A,no=Fj;function Be(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),UE=Object.prototype.hasOwnProperty,Uj=/^[: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]*$/,tN={},nN={};function Bj(t){return UE.call(nN,t)?!0:UE.call(tN,t)?!1:Uj.test(t)?nN[t]=!0:(tN[t]=!0,!1)}function jj(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Vj(t,e,n,r){if(e===null||typeof e>"u"||jj(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 hi(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Nr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Nr[t]=new hi(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Nr[e]=new hi(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Nr[t]=new hi(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Nr[t]=new hi(t,2,!1,t,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(t){Nr[t]=new hi(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Nr[t]=new hi(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Nr[t]=new hi(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Nr[t]=new hi(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Nr[t]=new hi(t,5,!1,t.toLowerCase(),null,!1,!1)});var rT=/[\-:]([a-z])/g;function iT(t){return t[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(t){var e=t.replace(rT,iT);Nr[e]=new hi(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(rT,iT);Nr[e]=new hi(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(rT,iT);Nr[e]=new hi(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Nr[t]=new hi(t,1,!1,t.toLowerCase(),null,!1,!1)});Nr.xlinkHref=new hi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Nr[t]=new hi(t,1,!1,t.toLowerCase(),null,!0,!0)});function oT(t,e,n,r){var i=Nr.hasOwnProperty(e)?Nr[e]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` +`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{pS=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ap(t):""}function $j(t){switch(t.tag){case 5:return ap(t.type);case 16:return ap("Lazy");case 13:return ap("Suspense");case 19:return ap("SuspenseList");case 0:case 2:case 15:return t=mS(t.type,!1),t;case 11:return t=mS(t.type.render,!1),t;case 1:return t=mS(t.type,!0),t;default:return""}}function $E(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Pf:return"Fragment";case Af:return"Portal";case BE:return"Profiler";case sT:return"StrictMode";case jE:return"Suspense";case VE:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case T5:return(t.displayName||"Context")+".Consumer";case C5:return(t._context.displayName||"Context")+".Provider";case aT:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case lT:return e=t.displayName||null,e!==null?e:$E(t.type)||"Memo";case ll:e=t._payload,t=t._init;try{return $E(t(e))}catch{}}return null}function Wj(t){var e=t.type;switch(t.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 t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $E(e);case 8:return e===sT?"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 Al(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function A5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Hj(t){var e=A5(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function F0(t){t._valueTracker||(t._valueTracker=Hj(t))}function P5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=A5(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Gy(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function WE(t,e){var n=e.checked;return On({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function iN(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Al(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function N5(t,e){e=e.checked,e!=null&&oT(t,"checked",e,!1)}function HE(t,e){N5(t,e);var n=Al(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?GE(t,e.type,n):e.hasOwnProperty("defaultValue")&&GE(t,e.type,Al(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function oN(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function GE(t,e,n){(e!=="number"||Gy(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var lp=Array.isArray;function Kf(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=z0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Xp(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var vp={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},Gj=["Webkit","ms","Moz","O"];Object.keys(vp).forEach(function(t){Gj.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),vp[e]=vp[t]})});function O5(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||vp.hasOwnProperty(t)&&vp[t]?(""+e).trim():e+"px"}function D5(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=O5(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Xj=On({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 YE(t,e){if(e){if(Xj[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Be(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Be(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Be(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Be(62))}}function KE(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 ZE=null;function cT(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var JE=null,Zf=null,Jf=null;function lN(t){if(t=Jm(t)){if(typeof JE!="function")throw Error(Be(280));var e=t.stateNode;e&&(e=qx(e),JE(t.stateNode,t.type,e))}}function F5(t){Zf?Jf?Jf.push(t):Jf=[t]:Zf=t}function z5(){if(Zf){var t=Zf,e=Jf;if(Jf=Zf=null,lN(t),e)for(t=0;t>>=0,t===0?32:31-(iV(t)/oV|0)|0}var U0=64,B0=4194304;function cp(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Ky(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=cp(a):(o&=s,o!==0&&(r=cp(o)))}else s=n&~i,s!==0?r=cp(s):o!==0&&(r=cp(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Km(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ts(e),t[e]=n}function cV(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=xp),vN=" ",yN=!1;function iD(t,e){switch(t){case"keyup":return FV.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oD(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Nf=!1;function UV(t,e){switch(t){case"compositionend":return oD(e);case"keypress":return e.which!==32?null:(yN=!0,vN);case"textInput":return t=e.data,t===vN&&yN?null:t;default:return null}}function BV(t,e){if(Nf)return t==="compositionend"||!vT&&iD(t,e)?(t=nD(),vy=pT=pl=null,Nf=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wN(n)}}function cD(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?cD(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function uD(){for(var t=window,e=Gy();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Gy(t.document)}return e}function yT(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function YV(t){var e=uD(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&cD(n.ownerDocument.documentElement,n)){if(r!==null&&yT(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=SN(n,o);var s=SN(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,If=null,i2=null,_p=null,o2=!1;function MN(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;o2||If==null||If!==Gy(r)||(r=If,"selectionStart"in r&&yT(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_p&&Qp(_p,r)||(_p=r,r=Qy(i2,"onSelect"),0Of||(t.current=f2[Of],f2[Of]=null,Of--)}function bn(t,e){Of++,f2[Of]=t.current,t.current=e}var Pl={},Yr=zl(Pl),Ri=zl(!1),Jc=Pl;function ud(t,e){var n=t.type.contextTypes;if(!n)return Pl;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ai(t){return t=t.childContextTypes,t!=null}function t1(){Sn(Ri),Sn(Yr)}function NN(t,e,n){if(Yr.current!==Pl)throw Error(Be(168));bn(Yr,e),bn(Ri,n)}function xD(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Be(108,Wj(t)||"Unknown",i));return On({},n,r)}function n1(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Pl,Jc=Yr.current,bn(Yr,t),bn(Ri,Ri.current),!0}function IN(t,e,n){var r=t.stateNode;if(!r)throw Error(Be(169));n?(t=xD(t,e,Jc),r.__reactInternalMemoizedMergedChildContext=t,Sn(Ri),Sn(Yr),bn(Yr,t)):Sn(Ri),bn(Ri,n)}var ua=null,Yx=!1,AS=!1;function bD(t){ua===null?ua=[t]:ua.push(t)}function a$(t){Yx=!0,bD(t)}function Ul(){if(!AS&&ua!==null){AS=!0;var t=0,e=dn;try{var n=ua;for(dn=1;t>=s,i-=s,ma=1<<32-ts(e)+i|n<L?(U=T,T=null):U=T.sibling;var M=h(g,T,_[L],S);if(M===null){T===null&&(T=U);break}t&&T&&M.alternate===null&&e(g,T),b=o(M,b,L),N===null?P=M:N.sibling=M,N=M,T=U}if(L===_.length)return n(g,T),Tn&&mc(g,L),P;if(T===null){for(;L<_.length;L++)T=f(g,_[L],S),T!==null&&(b=o(T,b,L),N===null?P=T:N.sibling=T,N=T);return Tn&&mc(g,L),P}for(T=r(g,T);L<_.length;L++)U=m(T,g,L,_[L],S),U!==null&&(t&&U.alternate!==null&&T.delete(U.key===null?L:U.key),b=o(U,b,L),N===null?P=U:N.sibling=U,N=U);return t&&T.forEach(function(R){return e(g,R)}),Tn&&mc(g,L),P}function x(g,b,_,S){var P=Ch(_);if(typeof P!="function")throw Error(Be(150));if(_=P.call(_),_==null)throw Error(Be(151));for(var N=P=null,T=b,L=b=0,U=null,M=_.next();T!==null&&!M.done;L++,M=_.next()){T.index>L?(U=T,T=null):U=T.sibling;var R=h(g,T,M.value,S);if(R===null){T===null&&(T=U);break}t&&T&&R.alternate===null&&e(g,T),b=o(R,b,L),N===null?P=R:N.sibling=R,N=R,T=U}if(M.done)return n(g,T),Tn&&mc(g,L),P;if(T===null){for(;!M.done;L++,M=_.next())M=f(g,M.value,S),M!==null&&(b=o(M,b,L),N===null?P=M:N.sibling=M,N=M);return Tn&&mc(g,L),P}for(T=r(g,T);!M.done;L++,M=_.next())M=m(T,g,L,M.value,S),M!==null&&(t&&M.alternate!==null&&T.delete(M.key===null?L:M.key),b=o(M,b,L),N===null?P=M:N.sibling=M,N=M);return t&&T.forEach(function(D){return e(g,D)}),Tn&&mc(g,L),P}function y(g,b,_,S){if(typeof _=="object"&&_!==null&&_.type===Pf&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case D0:e:{for(var P=_.key,N=b;N!==null;){if(N.key===P){if(P=_.type,P===Pf){if(N.tag===7){n(g,N.sibling),b=i(N,_.props.children),b.return=g,g=b;break e}}else if(N.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===ll&&ON(P)===N.type){n(g,N.sibling),b=i(N,_.props),b.ref=Nh(g,N,_),b.return=g,g=b;break e}n(g,N);break}else e(g,N);N=N.sibling}_.type===Pf?(b=Fc(_.props.children,g.mode,S,_.key),b.return=g,g=b):(S=Ey(_.type,_.key,_.props,null,g.mode,S),S.ref=Nh(g,b,_),S.return=g,g=S)}return s(g);case Af:e:{for(N=_.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===_.containerInfo&&b.stateNode.implementation===_.implementation){n(g,b.sibling),b=i(b,_.children||[]),b.return=g,g=b;break e}else{n(g,b);break}else e(g,b);b=b.sibling}b=FS(_,g.mode,S),b.return=g,g=b}return s(g);case ll:return N=_._init,y(g,b,N(_._payload),S)}if(lp(_))return v(g,b,_,S);if(Ch(_))return x(g,b,_,S);X0(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,b!==null&&b.tag===6?(n(g,b.sibling),b=i(b,_),b.return=g,g=b):(n(g,b),b=DS(_,g.mode,S),b.return=g,g=b),s(g)):n(g,b)}return y}var dd=MD(!0),ED=MD(!1),o1=zl(null),s1=null,zf=null,wT=null;function ST(){wT=zf=s1=null}function MT(t){var e=o1.current;Sn(o1),t._currentValue=e}function p2(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function ed(t,e){s1=t,wT=zf=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Ci=!0),t.firstContext=null)}function Io(t){var e=t._currentValue;if(wT!==t)if(t={context:t,memoizedValue:e,next:null},zf===null){if(s1===null)throw Error(Be(308));zf=t,s1.dependencies={lanes:0,firstContext:t}}else zf=zf.next=t;return e}var Tc=null;function ET(t){Tc===null?Tc=[t]:Tc.push(t)}function CD(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,ET(e)):(n.next=i.next,i.next=n),e.interleaved=n,Ca(t,r)}function Ca(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var cl=!1;function CT(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function TD(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ba(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function wl(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,en&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Ca(t,n)}return i=r.interleaved,i===null?(e.next=e,ET(r)):(e.next=i.next,i.next=e),r.interleaved=e,Ca(t,n)}function xy(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fT(t,n)}}function DN(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function a1(t,e,n,r){var i=t.updateQueue;cl=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var h=a.lane,m=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=t,x=a;switch(h=e,m=n,x.tag){case 1:if(v=x.payload,typeof v=="function"){f=v.call(m,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,h=typeof v=="function"?v.call(m,f,h):v,h==null)break e;f=On({},f,h);break e;case 2:cl=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else m={eventTime:m,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=m,l=f):u=u.next=m,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);tu|=s,t.lanes=s,t.memoizedState=f}}function FN(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=NS.transition;NS.transition={};try{t(!1),e()}finally{dn=n,NS.transition=r}}function WD(){return Lo().memoizedState}function f$(t,e,n){var r=Ml(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},HD(t))GD(e,n);else if(n=CD(t,e,n,r),n!==null){var i=ci();ns(n,t,r,i),XD(n,e,r)}}function d$(t,e,n){var r=Ml(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(HD(t))GD(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,is(a,s)){var l=e.interleaved;l===null?(i.next=i,ET(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=CD(t,e,i,r),n!==null&&(i=ci(),ns(n,t,r,i),XD(n,e,r))}}function HD(t){var e=t.alternate;return t===Ln||e!==null&&e===Ln}function GD(t,e){wp=c1=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function XD(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fT(t,n)}}var u1={readContext:Io,useCallback:Ur,useContext:Ur,useEffect:Ur,useImperativeHandle:Ur,useInsertionEffect:Ur,useLayoutEffect:Ur,useMemo:Ur,useReducer:Ur,useRef:Ur,useState:Ur,useDebugValue:Ur,useDeferredValue:Ur,useTransition:Ur,useMutableSource:Ur,useSyncExternalStore:Ur,useId:Ur,unstable_isNewReconciler:!1},h$={readContext:Io,useCallback:function(t,e){return Ss().memoizedState=[t,e===void 0?null:e],t},useContext:Io,useEffect:UN,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,_y(4194308,4,UD.bind(null,e,t),n)},useLayoutEffect:function(t,e){return _y(4194308,4,t,e)},useInsertionEffect:function(t,e){return _y(4,2,t,e)},useMemo:function(t,e){var n=Ss();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Ss();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=f$.bind(null,Ln,t),[r.memoizedState,t]},useRef:function(t){var e=Ss();return t={current:t},e.memoizedState=t},useState:zN,useDebugValue:kT,useDeferredValue:function(t){return Ss().memoizedState=t},useTransition:function(){var t=zN(!1),e=t[0];return t=u$.bind(null,t[1]),Ss().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ln,i=Ss();if(Tn){if(n===void 0)throw Error(Be(407));n=n()}else{if(n=e(),br===null)throw Error(Be(349));eu&30||ND(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,UN(LD.bind(null,r,o,t),[t]),r.flags|=2048,am(9,ID.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Ss(),e=br.identifierPrefix;if(Tn){var n=ga,r=ma;n=(r&~(1<<32-ts(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=om++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Cs]=e,t[nm]=r,rF(t,e,!1,!1),e.stateNode=t;e:{switch(s=KE(n,r),n){case"dialog":_n("cancel",t),_n("close",t),i=r;break;case"iframe":case"object":case"embed":_n("load",t),i=r;break;case"video":case"audio":for(i=0;imd&&(e.flags|=128,r=!0,Ih(o,!1),e.lanes=4194304)}else{if(!r)if(t=l1(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Ih(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Tn)return Br(e),null}else 2*Xn()-o.renderingStartTime>md&&n!==1073741824&&(e.flags|=128,r=!0,Ih(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Xn(),e.sibling=null,n=Nn.current,bn(Nn,r?n&1|2:n&1),e):(Br(e),null);case 22:case 23:return BT(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Gi&1073741824&&(Br(e),e.subtreeFlags&6&&(e.flags|=8192)):Br(e),null;case 24:return null;case 25:return null}throw Error(Be(156,e.tag))}function _$(t,e){switch(bT(e),e.tag){case 1:return Ai(e.type)&&t1(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return hd(),Sn(Ri),Sn(Yr),AT(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return RT(e),null;case 13:if(Sn(Nn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Be(340));fd()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sn(Nn),null;case 4:return hd(),null;case 10:return MT(e.type._context),null;case 22:case 23:return BT(),null;case 24:return null;default:return null}}var Y0=!1,Xr=!1,w$=typeof WeakSet=="function"?WeakSet:Set,at=null;function Uf(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vn(t,e,r)}else n.current=null}function S2(t,e,n){try{n()}catch(r){Vn(t,e,r)}}var KN=!1;function S$(t,e){if(s2=Zy,t=uD(),yT(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===t)break t;if(h===n&&++c===i&&(a=s),h===o&&++u===r&&(l=s),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(a2={focusedElem:t,selectionRange:n},Zy=!1,at=e;at!==null;)if(e=at,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,at=t;else for(;at!==null;){e=at;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,y=v.memoizedState,g=e.stateNode,b=g.getSnapshotBeforeUpdate(e.elementType===e.type?x:qo(e.type,x),y);g.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Be(163))}}catch(S){Vn(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,at=t;break}at=e.return}return v=KN,KN=!1,v}function Sp(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&S2(e,n,o)}i=i.next}while(i!==r)}}function Jx(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function M2(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function sF(t){var e=t.alternate;e!==null&&(t.alternate=null,sF(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Cs],delete e[nm],delete e[u2],delete e[o$],delete e[s$])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function aF(t){return t.tag===5||t.tag===3||t.tag===4}function ZN(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||aF(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function E2(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=e1));else if(r!==4&&(t=t.child,t!==null))for(E2(t,e,n),t=t.sibling;t!==null;)E2(t,e,n),t=t.sibling}function C2(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(C2(t,e,n),t=t.sibling;t!==null;)C2(t,e,n),t=t.sibling}var Cr=null,Ko=!1;function Ya(t,e,n){for(n=n.child;n!==null;)lF(t,e,n),n=n.sibling}function lF(t,e,n){if(Ns&&typeof Ns.onCommitFiberUnmount=="function")try{Ns.onCommitFiberUnmount(Wx,n)}catch{}switch(n.tag){case 5:Xr||Uf(n,e);case 6:var r=Cr,i=Ko;Cr=null,Ya(t,e,n),Cr=r,Ko=i,Cr!==null&&(Ko?(t=Cr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Cr.removeChild(n.stateNode));break;case 18:Cr!==null&&(Ko?(t=Cr,n=n.stateNode,t.nodeType===8?RS(t.parentNode,n):t.nodeType===1&&RS(t,n),Zp(t)):RS(Cr,n.stateNode));break;case 4:r=Cr,i=Ko,Cr=n.stateNode.containerInfo,Ko=!0,Ya(t,e,n),Cr=r,Ko=i;break;case 0:case 11:case 14:case 15:if(!Xr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&S2(n,e,s),i=i.next}while(i!==r)}Ya(t,e,n);break;case 1:if(!Xr&&(Uf(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Vn(n,e,a)}Ya(t,e,n);break;case 21:Ya(t,e,n);break;case 22:n.mode&1?(Xr=(r=Xr)||n.memoizedState!==null,Ya(t,e,n),Xr=r):Ya(t,e,n);break;default:Ya(t,e,n)}}function JN(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new w$),e.forEach(function(r){var i=I$.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function $o(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Xn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*E$(r/1960))-r,10t?16:t,ml===null)var r=!1;else{if(t=ml,ml=null,h1=0,en&6)throw Error(Be(331));var i=en;for(en|=4,at=t.current;at!==null;){var o=at,s=o.child;if(at.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lXn()-zT?Dc(t,0):FT|=n),Pi(t,e)}function gF(t,e){e===0&&(t.mode&1?(e=B0,B0<<=1,!(B0&130023424)&&(B0=4194304)):e=1);var n=ci();t=Ca(t,e),t!==null&&(Km(t,e,n),Pi(t,n))}function N$(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),gF(t,n)}function I$(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Be(314))}r!==null&&r.delete(e),gF(t,n)}var vF;vF=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ri.current)Ci=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Ci=!1,x$(t,e,n);Ci=!!(t.flags&131072)}else Ci=!1,Tn&&e.flags&1048576&&_D(e,i1,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;wy(t,e),t=e.pendingProps;var i=ud(e,Yr.current);ed(e,n),i=NT(null,e,r,t,i,n);var o=IT();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ai(r)?(o=!0,n1(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,CT(e),i.updater=Zx,e.stateNode=i,i._reactInternals=e,g2(e,r,t,n),e=x2(null,e,r,!0,o,n)):(e.tag=0,Tn&&o&&xT(e),ii(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(wy(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=k$(r),t=qo(r,t),i){case 0:e=y2(null,e,r,t,n);break e;case 1:e=XN(null,e,r,t,n);break e;case 11:e=HN(null,e,r,t,n);break e;case 14:e=GN(null,e,r,qo(r.type,t),n);break e}throw Error(Be(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:qo(r,i),y2(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:qo(r,i),XN(t,e,r,i,n);case 3:e:{if(eF(e),t===null)throw Error(Be(387));r=e.pendingProps,o=e.memoizedState,i=o.element,TD(t,e),a1(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=pd(Error(Be(423)),e),e=qN(t,e,r,n,i);break e}else if(r!==i){i=pd(Error(Be(424)),e),e=qN(t,e,r,n,i);break e}else for(Ki=_l(e.stateNode.containerInfo.firstChild),Zi=e,Tn=!0,Zo=null,n=ED(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fd(),r===i){e=Ta(t,e,n);break e}ii(t,e,r,n)}e=e.child}return e;case 5:return RD(e),t===null&&h2(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,l2(r,i)?s=null:o!==null&&l2(r,o)&&(e.flags|=32),QD(t,e),ii(t,e,s,n),e.child;case 6:return t===null&&h2(e),null;case 13:return tF(t,e,n);case 4:return TT(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=dd(e,null,r,n):ii(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:qo(r,i),HN(t,e,r,i,n);case 7:return ii(t,e,e.pendingProps,n),e.child;case 8:return ii(t,e,e.pendingProps.children,n),e.child;case 12:return ii(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,bn(o1,r._currentValue),r._currentValue=s,o!==null)if(is(o.value,s)){if(o.children===i.children&&!Ri.current){e=Ta(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=ba(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),p2(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Be(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),p2(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ii(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,ed(e,n),i=Io(i),r=r(i),e.flags|=1,ii(t,e,r,n),e.child;case 14:return r=e.type,i=qo(r,e.pendingProps),i=qo(r.type,i),GN(t,e,r,i,n);case 15:return ZD(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:qo(r,i),wy(t,e),e.tag=1,Ai(r)?(t=!0,n1(e)):t=!1,ed(e,n),qD(e,r,i),g2(e,r,i,n),x2(null,e,r,!0,t,n);case 19:return nF(t,e,n);case 22:return JD(t,e,n)}throw Error(Be(156,e.tag))};function yF(t,e){return H5(t,e)}function L$(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ao(t,e,n,r){return new L$(t,e,n,r)}function VT(t){return t=t.prototype,!(!t||!t.isReactComponent)}function k$(t){if(typeof t=="function")return VT(t)?1:0;if(t!=null){if(t=t.$$typeof,t===aT)return 11;if(t===lT)return 14}return 2}function El(t,e){var n=t.alternate;return n===null?(n=Ao(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ey(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")VT(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Pf:return Fc(n.children,i,o,e);case sT:s=8,i|=8;break;case BE:return t=Ao(12,n,e,i|2),t.elementType=BE,t.lanes=o,t;case jE:return t=Ao(13,n,e,i),t.elementType=jE,t.lanes=o,t;case VE:return t=Ao(19,n,e,i),t.elementType=VE,t.lanes=o,t;case R5:return eb(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case C5:s=10;break e;case T5:s=9;break e;case aT:s=11;break e;case lT:s=14;break e;case ll:s=16,r=null;break e}throw Error(Be(130,t==null?t:typeof t,""))}return e=Ao(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Fc(t,e,n,r){return t=Ao(7,t,r,e),t.lanes=n,t}function eb(t,e,n,r){return t=Ao(22,t,r,e),t.elementType=R5,t.lanes=n,t.stateNode={isHidden:!1},t}function DS(t,e,n){return t=Ao(6,t,null,e),t.lanes=n,t}function FS(t,e,n){return e=Ao(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function O$(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vS(0),this.expirationTimes=vS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vS(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $T(t,e,n,r,i,o,s,a,l){return t=new O$(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Ao(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},CT(o),t}function D$(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wF)}catch(t){console.error(t)}}wF(),w5.exports=so;var Bl=w5.exports;const fp=$s(Bl);var XT,sI=Bl;XT=sI.createRoot,sI.hydrateRoot;function SF(t,e){return function(){return t.apply(e,arguments)}}const{toString:j$}=Object.prototype,{getPrototypeOf:qT}=Object,ob=(t=>e=>{const n=j$.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),cs=t=>(t=t.toLowerCase(),e=>ob(e)===t),sb=t=>e=>typeof e===t,{isArray:Ud}=Array,cm=sb("undefined");function V$(t){return t!==null&&!cm(t)&&t.constructor!==null&&!cm(t.constructor)&&Ji(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const MF=cs("ArrayBuffer");function $$(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&MF(t.buffer),e}const W$=sb("string"),Ji=sb("function"),EF=sb("number"),ab=t=>t!==null&&typeof t=="object",H$=t=>t===!0||t===!1,Cy=t=>{if(ob(t)!=="object")return!1;const e=qT(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},G$=cs("Date"),X$=cs("File"),q$=cs("Blob"),Y$=cs("FileList"),K$=t=>ab(t)&&Ji(t.pipe),Z$=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ji(t.append)&&((e=ob(t))==="formdata"||e==="object"&&Ji(t.toString)&&t.toString()==="[object FormData]"))},J$=cs("URLSearchParams"),[Q$,eW,tW,nW]=["ReadableStream","Request","Response","Headers"].map(cs),rW=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function eg(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),Ud(t))for(r=0,i=t.length;r0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Ac=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,TF=t=>!cm(t)&&t!==Ac;function N2(){const{caseless:t}=TF(this)&&this||{},e={},n=(r,i)=>{const o=t&&CF(e,i)||i;Cy(e[o])&&Cy(r)?e[o]=N2(e[o],r):Cy(r)?e[o]=N2({},r):Ud(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r(eg(e,(i,o)=>{n&&Ji(i)?t[o]=SF(i,n):t[o]=i},{allOwnKeys:r}),t),oW=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),sW=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},aW=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&qT(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},lW=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},cW=t=>{if(!t)return null;if(Ud(t))return t;let e=t.length;if(!EF(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},uW=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&qT(Uint8Array)),fW=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},dW=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},hW=cs("HTMLFormElement"),pW=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),aI=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),mW=cs("RegExp"),RF=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};eg(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},gW=t=>{RF(t,(e,n)=>{if(Ji(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Ji(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},vW=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Ud(t)?r(t):r(String(t).split(e)),n},yW=()=>{},xW=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,zS="abcdefghijklmnopqrstuvwxyz",lI="0123456789",AF={DIGIT:lI,ALPHA:zS,ALPHA_DIGIT:zS+zS.toUpperCase()+lI},bW=(t=16,e=AF.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function _W(t){return!!(t&&Ji(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const wW=t=>{const e=new Array(10),n=(r,i)=>{if(ab(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=Ud(r)?[]:{};return eg(r,(s,a)=>{const l=n(s,i+1);!cm(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},SW=cs("AsyncFunction"),MW=t=>t&&(ab(t)||Ji(t))&&Ji(t.then)&&Ji(t.catch),PF=((t,e)=>t?setImmediate:e?((n,r)=>(Ac.addEventListener("message",({source:i,data:o})=>{i===Ac&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Ac.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ji(Ac.postMessage)),EW=typeof queueMicrotask<"u"?queueMicrotask.bind(Ac):typeof process<"u"&&process.nextTick||PF,_e={isArray:Ud,isArrayBuffer:MF,isBuffer:V$,isFormData:Z$,isArrayBufferView:$$,isString:W$,isNumber:EF,isBoolean:H$,isObject:ab,isPlainObject:Cy,isReadableStream:Q$,isRequest:eW,isResponse:tW,isHeaders:nW,isUndefined:cm,isDate:G$,isFile:X$,isBlob:q$,isRegExp:mW,isFunction:Ji,isStream:K$,isURLSearchParams:J$,isTypedArray:uW,isFileList:Y$,forEach:eg,merge:N2,extend:iW,trim:rW,stripBOM:oW,inherits:sW,toFlatObject:aW,kindOf:ob,kindOfTest:cs,endsWith:lW,toArray:cW,forEachEntry:fW,matchAll:dW,isHTMLForm:hW,hasOwnProperty:aI,hasOwnProp:aI,reduceDescriptors:RF,freezeMethods:gW,toObjectSet:vW,toCamelCase:pW,noop:yW,toFiniteNumber:xW,findKey:CF,global:Ac,isContextDefined:TF,ALPHABET:AF,generateString:bW,isSpecCompliantForm:_W,toJSONObject:wW,isAsyncFn:SW,isThenable:MW,setImmediate:PF,asap:EW};function Ft(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}_e.inherits(Ft,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_e.toJSONObject(this.config),code:this.code,status:this.status}}});const NF=Ft.prototype,IF={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{IF[t]={value:t}});Object.defineProperties(Ft,IF);Object.defineProperty(NF,"isAxiosError",{value:!0});Ft.from=(t,e,n,r,i,o)=>{const s=Object.create(NF);return _e.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Ft.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const CW=null;function I2(t){return _e.isPlainObject(t)||_e.isArray(t)}function LF(t){return _e.endsWith(t,"[]")?t.slice(0,-2):t}function cI(t,e,n){return t?t.concat(e).map(function(i,o){return i=LF(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function TW(t){return _e.isArray(t)&&!t.some(I2)}const RW=_e.toFlatObject(_e,{},null,function(e){return/^is[A-Z]/.test(e)});function lb(t,e,n){if(!_e.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=_e.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,y){return!_e.isUndefined(y[x])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&_e.isSpecCompliantForm(e);if(!_e.isFunction(i))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(_e.isDate(v))return v.toISOString();if(!l&&_e.isBlob(v))throw new Ft("Blob is not supported. Use a Buffer instead.");return _e.isArrayBuffer(v)||_e.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function u(v,x,y){let g=v;if(v&&!y&&typeof v=="object"){if(_e.endsWith(x,"{}"))x=r?x:x.slice(0,-2),v=JSON.stringify(v);else if(_e.isArray(v)&&TW(v)||(_e.isFileList(v)||_e.endsWith(x,"[]"))&&(g=_e.toArray(v)))return x=LF(x),g.forEach(function(_,S){!(_e.isUndefined(_)||_===null)&&e.append(s===!0?cI([x],S,o):s===null?x:x+"[]",c(_))}),!1}return I2(v)?!0:(e.append(cI(y,x,o),c(v)),!1)}const f=[],h=Object.assign(RW,{defaultVisitor:u,convertValue:c,isVisitable:I2});function m(v,x){if(!_e.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+x.join("."));f.push(v),_e.forEach(v,function(g,b){(!(_e.isUndefined(g)||g===null)&&i.call(e,g,_e.isString(b)?b.trim():b,x,h))===!0&&m(g,x?x.concat(b):[b])}),f.pop()}}if(!_e.isObject(t))throw new TypeError("data must be an object");return m(t),e}function uI(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function YT(t,e){this._pairs=[],t&&lb(t,this,e)}const kF=YT.prototype;kF.append=function(e,n){this._pairs.push([e,n])};kF.toString=function(e){const n=e?function(r){return e.call(this,r,uI)}:uI;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function AW(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function OF(t,e,n){if(!e)return t;const r=n&&n.encode||AW,i=n&&n.serialize;let o;if(i?o=i(e,n):o=_e.isURLSearchParams(e)?e.toString():new YT(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class fI{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){_e.forEach(this.handlers,function(r){r!==null&&e(r)})}}const DF={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},PW=typeof URLSearchParams<"u"?URLSearchParams:YT,NW=typeof FormData<"u"?FormData:null,IW=typeof Blob<"u"?Blob:null,LW={isBrowser:!0,classes:{URLSearchParams:PW,FormData:NW,Blob:IW},protocols:["http","https","file","blob","url","data"]},KT=typeof window<"u"&&typeof document<"u",L2=typeof navigator=="object"&&navigator||void 0,kW=KT&&(!L2||["ReactNative","NativeScript","NS"].indexOf(L2.product)<0),OW=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",DW=KT&&window.location.href||"http://localhost",FW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:KT,hasStandardBrowserEnv:kW,hasStandardBrowserWebWorkerEnv:OW,navigator:L2,origin:DW},Symbol.toStringTag,{value:"Module"})),Ni={...FW,...LW};function zW(t,e){return lb(t,new Ni.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Ni.isNode&&_e.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function UW(t){return _e.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function BW(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&_e.isArray(i)?i.length:s,l?(_e.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!_e.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&_e.isArray(i[s])&&(i[s]=BW(i[s])),!a)}if(_e.isFormData(t)&&_e.isFunction(t.entries)){const n={};return _e.forEachEntry(t,(r,i)=>{e(UW(r),i,n,0)}),n}return null}function jW(t,e,n){if(_e.isString(t))try{return(e||JSON.parse)(t),_e.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(t)}const tg={transitional:DF,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=_e.isObject(e);if(o&&_e.isHTMLForm(e)&&(e=new FormData(e)),_e.isFormData(e))return i?JSON.stringify(FF(e)):e;if(_e.isArrayBuffer(e)||_e.isBuffer(e)||_e.isStream(e)||_e.isFile(e)||_e.isBlob(e)||_e.isReadableStream(e))return e;if(_e.isArrayBufferView(e))return e.buffer;if(_e.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return zW(e,this.formSerializer).toString();if((a=_e.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return lb(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),jW(e)):e}],transformResponse:[function(e){const n=this.transitional||tg.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(_e.isResponse(e)||_e.isReadableStream(e))return e;if(e&&_e.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?Ft.from(a,Ft.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ni.classes.FormData,Blob:Ni.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_e.forEach(["delete","get","head","post","put","patch"],t=>{tg.headers[t]={}});const VW=_e.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$W=t=>{const e={};let n,r,i;return t&&t.split(` +`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&VW[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},dI=Symbol("internals");function kh(t){return t&&String(t).trim().toLowerCase()}function Ty(t){return t===!1||t==null?t:_e.isArray(t)?t.map(Ty):String(t)}function WW(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const HW=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function US(t,e,n,r,i){if(_e.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!_e.isString(e)){if(_e.isString(r))return e.indexOf(r)!==-1;if(_e.isRegExp(r))return r.test(e)}}function GW(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function XW(t,e){const n=_e.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}class Ii{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,l,c){const u=kh(l);if(!u)throw new Error("header name must be a non-empty string");const f=_e.findKey(i,u);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||l]=Ty(a))}const s=(a,l)=>_e.forEach(a,(c,u)=>o(c,u,l));if(_e.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(_e.isString(e)&&(e=e.trim())&&!HW(e))s($W(e),n);else if(_e.isHeaders(e))for(const[a,l]of e.entries())o(l,a,r);else e!=null&&o(n,e,r);return this}get(e,n){if(e=kh(e),e){const r=_e.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return WW(i);if(_e.isFunction(n))return n.call(this,i,r);if(_e.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=kh(e),e){const r=_e.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||US(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=kh(s),s){const a=_e.findKey(r,s);a&&(!n||US(r,r[a],a,n))&&(delete r[a],i=!0)}}return _e.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||US(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return _e.forEach(this,(i,o)=>{const s=_e.findKey(r,o);if(s){n[s]=Ty(i),delete n[o];return}const a=e?GW(o):String(o).trim();a!==o&&delete n[o],n[a]=Ty(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return _e.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&_e.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[dI]=this[dI]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=kh(s);r[a]||(XW(i,s),r[a]=!0)}return _e.isArray(e)?e.forEach(o):o(e),this}}Ii.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_e.reduceDescriptors(Ii.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});_e.freezeMethods(Ii);function BS(t,e){const n=this||tg,r=e||n,i=Ii.from(r.headers);let o=r.data;return _e.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function zF(t){return!!(t&&t.__CANCEL__)}function Bd(t,e,n){Ft.call(this,t??"canceled",Ft.ERR_CANCELED,e,n),this.name="CanceledError"}_e.inherits(Bd,Ft,{__CANCEL__:!0});function UF(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Ft("Request failed with status code "+n.status,[Ft.ERR_BAD_REQUEST,Ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function qW(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function YW(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[o];s||(s=c),n[i]=l,r[i]=c;let f=o,h=0;for(;f!==i;)h+=n[f++],f=f%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),c-s{n=u,i=null,o&&(clearTimeout(o),o=null),t.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?s(c,u):(i=c,o||(o=setTimeout(()=>{o=null,s(i)},r-f)))},()=>i&&s(i)]}const g1=(t,e,n=3)=>{let r=0;const i=YW(50,250);return KW(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-r,c=i(l),u=s<=a;r=s;const f={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-s)/c:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(f)},n)},hI=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},pI=t=>(...e)=>_e.asap(()=>t(...e)),ZW=Ni.hasStandardBrowserEnv?function(){const e=Ni.navigator&&/(msie|trident)/i.test(Ni.navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=_e.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),JW=Ni.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];_e.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),_e.isString(r)&&s.push("path="+r),_e.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function QW(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function eH(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function BF(t,e){return t&&!QW(e)?eH(t,e):e}const mI=t=>t instanceof Ii?{...t}:t;function ru(t,e){e=e||{};const n={};function r(c,u,f){return _e.isPlainObject(c)&&_e.isPlainObject(u)?_e.merge.call({caseless:f},c,u):_e.isPlainObject(u)?_e.merge({},u):_e.isArray(u)?u.slice():u}function i(c,u,f){if(_e.isUndefined(u)){if(!_e.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function o(c,u){if(!_e.isUndefined(u))return r(void 0,u)}function s(c,u){if(_e.isUndefined(u)){if(!_e.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in e)return r(c,u);if(f in t)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>i(mI(c),mI(u),!0)};return _e.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,h=f(t[u],e[u],u);_e.isUndefined(h)&&f!==a||(n[u]=h)}),n}const jF=t=>{const e=ru({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=e;e.headers=s=Ii.from(s),e.url=OF(BF(e.baseURL,e.url),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(_e.isFormData(n)){if(Ni.hasStandardBrowserEnv||Ni.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[c,...u]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Ni.hasStandardBrowserEnv&&(r&&_e.isFunction(r)&&(r=r(e)),r||r!==!1&&ZW(e.url))){const c=i&&o&&JW.read(o);c&&s.set(i,c)}return e},tH=typeof XMLHttpRequest<"u",nH=tH&&function(t){return new Promise(function(n,r){const i=jF(t);let o=i.data;const s=Ii.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,f,h,m,v;function x(){m&&m(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function g(){if(!y)return;const _=Ii.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),P={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:t,request:y};UF(function(T){n(T),x()},function(T){r(T),x()},P),y=null}"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(g)},y.onabort=function(){y&&(r(new Ft("Request aborted",Ft.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new Ft("Network Error",Ft.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const P=i.transitional||DF;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),r(new Ft(S,P.clarifyTimeoutError?Ft.ETIMEDOUT:Ft.ECONNABORTED,t,y)),y=null},o===void 0&&s.setContentType(null),"setRequestHeader"in y&&_e.forEach(s.toJSON(),function(S,P){y.setRequestHeader(P,S)}),_e.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),a&&a!=="json"&&(y.responseType=i.responseType),c&&([h,v]=g1(c,!0),y.addEventListener("progress",h)),l&&y.upload&&([f,m]=g1(l),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(u=_=>{y&&(r(!_||_.type?new Bd(null,t,y):_),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const b=qW(i.url);if(b&&Ni.protocols.indexOf(b)===-1){r(new Ft("Unsupported protocol "+b+":",Ft.ERR_BAD_REQUEST,t));return}y.send(o||null)})},rH=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const o=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof Ft?u:new Bd(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,o(new Ft(`timeout ${e} of ms exceeded`,Ft.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),t=null)};t.forEach(c=>c.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>_e.asap(a),l}},iH=function*(t,e){let n=t.byteLength;if(n{const i=oH(t,e);let o=0,s,a=l=>{s||(s=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let f=u.byteLength;if(n){let h=o+=f;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},cb=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",VF=cb&&typeof ReadableStream=="function",aH=cb&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),$F=(t,...e)=>{try{return!!t(...e)}catch{return!1}},lH=VF&&$F(()=>{let t=!1;const e=new Request(Ni.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),vI=64*1024,k2=VF&&$F(()=>_e.isReadableStream(new Response("").body)),v1={stream:k2&&(t=>t.body)};cb&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!v1[e]&&(v1[e]=_e.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new Ft(`Response type '${e}' is not supported`,Ft.ERR_NOT_SUPPORT,r)})})})(new Response);const cH=async t=>{if(t==null)return 0;if(_e.isBlob(t))return t.size;if(_e.isSpecCompliantForm(t))return(await new Request(Ni.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(_e.isArrayBufferView(t)||_e.isArrayBuffer(t))return t.byteLength;if(_e.isURLSearchParams(t)&&(t=t+""),_e.isString(t))return(await aH(t)).byteLength},uH=async(t,e)=>{const n=_e.toFiniteNumber(t.getContentLength());return n??cH(e)},fH=cb&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:h}=jF(t);c=c?(c+"").toLowerCase():"text";let m=rH([i,o&&o.toAbortSignal()],s),v;const x=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let y;try{if(l&&lH&&n!=="get"&&n!=="head"&&(y=await uH(u,r))!==0){let P=new Request(e,{method:"POST",body:r,duplex:"half"}),N;if(_e.isFormData(r)&&(N=P.headers.get("content-type"))&&u.setContentType(N),P.body){const[T,L]=hI(y,g1(pI(l)));r=gI(P.body,vI,T,L)}}_e.isString(f)||(f=f?"include":"omit");const g="credentials"in Request.prototype;v=new Request(e,{...h,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:g?f:void 0});let b=await fetch(v);const _=k2&&(c==="stream"||c==="response");if(k2&&(a||_&&x)){const P={};["status","statusText","headers"].forEach(U=>{P[U]=b[U]});const N=_e.toFiniteNumber(b.headers.get("content-length")),[T,L]=a&&hI(N,g1(pI(a),!0))||[];b=new Response(gI(b.body,vI,T,()=>{L&&L(),x&&x()}),P)}c=c||"text";let S=await v1[_e.findKey(v1,c)||"text"](b,t);return!_&&x&&x(),await new Promise((P,N)=>{UF(P,N,{data:S,headers:Ii.from(b.headers),status:b.status,statusText:b.statusText,config:t,request:v})})}catch(g){throw x&&x(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new Ft("Network Error",Ft.ERR_NETWORK,t,v),{cause:g.cause||g}):Ft.from(g,g&&g.code,t,v)}}),O2={http:CW,xhr:nH,fetch:fH};_e.forEach(O2,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const yI=t=>`- ${t}`,dH=t=>_e.isFunction(t)||t===null||t===!1,WF={getAdapter:t=>{t=_e.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since : +`+o.map(yI).join(` +`):" "+yI(o[0]):"as no adapter specified";throw new Ft("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:O2};function jS(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Bd(null,t)}function xI(t){return jS(t),t.headers=Ii.from(t.headers),t.data=BS.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),WF.getAdapter(t.adapter||tg.adapter)(t).then(function(r){return jS(t),r.data=BS.call(t,t.transformResponse,r),r.headers=Ii.from(r.headers),r},function(r){return zF(r)||(jS(t),r&&r.response&&(r.response.data=BS.call(t,t.transformResponse,r.response),r.response.headers=Ii.from(r.response.headers))),Promise.reject(r)})}const HF="1.7.7",ZT={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ZT[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const bI={};ZT.transitional=function(e,n,r){function i(o,s){return"[Axios v"+HF+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new Ft(i(s," has been removed"+(n?" in "+n:"")),Ft.ERR_DEPRECATED);return n&&!bI[s]&&(bI[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function hH(t,e,n){if(typeof t!="object")throw new Ft("options must be an object",Ft.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new Ft("option "+o+" must be "+l,Ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ft("Unknown option "+o,Ft.ERR_BAD_OPTION)}}const D2={assertOptions:hH,validators:ZT},Ka=D2.validators;class zc{constructor(e){this.defaults=e,this.interceptors={request:new fI,response:new fI}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ru(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&D2.assertOptions(r,{silentJSONParsing:Ka.transitional(Ka.boolean),forcedJSONParsing:Ka.transitional(Ka.boolean),clarifyTimeoutError:Ka.transitional(Ka.boolean)},!1),i!=null&&(_e.isFunction(i)?n.paramsSerializer={serialize:i}:D2.assertOptions(i,{encode:Ka.function,serialize:Ka.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&_e.merge(o.common,o[n.method]);o&&_e.forEach(["delete","get","head","post","put","patch","common"],v=>{delete o[v]}),n.headers=Ii.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(l=l&&x.synchronous,a.unshift(x.fulfilled,x.rejected))});const c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let u,f=0,h;if(!l){const v=[xI.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),h=v.length,u=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new Bd(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new JT(function(i){e=i}),cancel:e}}}function pH(t){return function(n){return t.apply(null,n)}}function mH(t){return _e.isObject(t)&&t.isAxiosError===!0}const F2={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(F2).forEach(([t,e])=>{F2[e]=t});function GF(t){const e=new zc(t),n=SF(zc.prototype.request,e);return _e.extend(n,zc.prototype,e,{allOwnKeys:!0}),_e.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return GF(ru(t,i))},n}const Dn=GF(tg);Dn.Axios=zc;Dn.CanceledError=Bd;Dn.CancelToken=JT;Dn.isCancel=zF;Dn.VERSION=HF;Dn.toFormData=lb;Dn.AxiosError=Ft;Dn.Cancel=Dn.CanceledError;Dn.all=function(e){return Promise.all(e)};Dn.spread=pH;Dn.isAxiosError=mH;Dn.mergeConfig=ru;Dn.AxiosHeaders=Ii;Dn.formToJSON=t=>FF(_e.isHTMLForm(t)?new FormData(t):t);Dn.getAdapter=WF.getAdapter;Dn.HttpStatusCode=F2;Dn.default=Dn;const um={black:"#000",white:"#fff"},Wu={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Hu={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Gu={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Xu={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},qu={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Oh={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},gH={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function Ra(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;n0?Tr(jd,--Oi):0,vd--,Qn===10&&(vd=1,fb--),Qn}function Qi(){return Qn=Oi2||dm(Qn)>3?"":" "}function kH(t,e){for(;--e&&Qi()&&!(Qn<48||Qn>102||Qn>57&&Qn<65||Qn>70&&Qn<97););return ng(t,Ry()+(e<6&&Ls()==32&&Qi()==32))}function U2(t){for(;Qi();)switch(Qn){case t:return Oi;case 34:case 39:t!==34&&t!==39&&U2(Qn);break;case 40:t===41&&U2(t);break;case 92:Qi();break}return Oi}function OH(t,e){for(;Qi()&&t+Qn!==57;)if(t+Qn===84&&Ls()===47)break;return"/*"+ng(e,Oi-1)+"*"+ub(t===47?t:Qi())}function DH(t){for(;!dm(Ls());)Qi();return ng(t,Oi)}function FH(t){return QF(Py("",null,null,null,[""],t=JF(t),0,[0],t))}function Py(t,e,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,h=0,m=0,v=0,x=1,y=1,g=1,b=0,_="",S=i,P=o,N=r,T=_;y;)switch(v=b,b=Qi()){case 40:if(v!=108&&Tr(T,f-1)==58){z2(T+=un(Ay(b),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:T+=Ay(b);break;case 9:case 10:case 13:case 32:T+=LH(v);break;case 92:T+=kH(Ry()-1,7);continue;case 47:switch(Ls()){case 42:case 47:J0(zH(OH(Qi(),Ry()),e,n),l);break;default:T+="/"}break;case 123*x:a[c++]=Ms(T)*g;case 125*x:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+u:g==-1&&(T=un(T,/\f/g,"")),m>0&&Ms(T)-f&&J0(m>32?wI(T+";",r,n,f-1):wI(un(T," ","")+";",r,n,f-2),l);break;case 59:T+=";";default:if(J0(N=_I(T,e,n,c,u,i,a,_,S=[],P=[],f),o),b===123)if(u===0)Py(T,e,N,N,S,o,f,a,P);else switch(h===99&&Tr(T,3)===110?100:h){case 100:case 108:case 109:case 115:Py(t,N,N,r&&J0(_I(t,N,N,0,0,i,a,_,i,S=[],f),P),i,P,f,a,r?S:P);break;default:Py(T,N,N,N,[""],P,0,a,P)}}c=u=m=0,x=g=1,_=T="",f=s;break;case 58:f=1+Ms(T),m=v;default:if(x<1){if(b==123)--x;else if(b==125&&x++==0&&IH()==125)continue}switch(T+=ub(b),b*x){case 38:g=u>0?1:(T+="\f",-1);break;case 44:a[c++]=(Ms(T)-1)*g,g=1;break;case 64:Ls()===45&&(T+=Ay(Qi())),h=Ls(),u=f=Ms(_=T+=DH(Ry())),b++;break;case 45:v===45&&Ms(T)==2&&(x=0)}}return o}function _I(t,e,n,r,i,o,s,a,l,c,u){for(var f=i-1,h=i===0?o:[""],m=tR(h),v=0,x=0,y=0;v0?h[g]+" "+b:un(b,/&\f/g,h[g])))&&(l[y++]=_);return db(t,e,n,i===0?QT:a,l,c,u)}function zH(t,e,n){return db(t,e,n,qF,ub(NH()),fm(t,2,-2),0)}function wI(t,e,n,r){return db(t,e,n,eR,fm(t,0,r),fm(t,r+1,-1),r)}function nd(t,e){for(var n="",r=tR(t),i=0;i6)switch(Tr(t,e+1)){case 109:if(Tr(t,e+4)!==45)break;case 102:return un(t,/(.+:)(.+)-([^]+)/,"$1"+cn+"$2-$3$1"+y1+(Tr(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~z2(t,"stretch")?ez(un(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Tr(t,e+1)!==115)break;case 6444:switch(Tr(t,Ms(t)-3-(~z2(t,"!important")&&10))){case 107:return un(t,":",":"+cn)+t;case 101:return un(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+cn+(Tr(t,14)===45?"inline-":"")+"box$3$1"+cn+"$2$3$1"+Wr+"$2box$3")+t}break;case 5936:switch(Tr(t,e+11)){case 114:return cn+t+Wr+un(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return cn+t+Wr+un(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return cn+t+Wr+un(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return cn+t+Wr+t+t}return t}var XH=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case eR:e.return=ez(e.value,e.length);break;case YF:return nd([Dh(e,{value:un(e.value,"@","@"+cn)})],i);case QT:if(e.length)return PH(e.props,function(o){switch(AH(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return nd([Dh(e,{props:[un(o,/:(read-\w+)/,":"+y1+"$1")]})],i);case"::placeholder":return nd([Dh(e,{props:[un(o,/:(plac\w+)/,":"+cn+"input-$1")]}),Dh(e,{props:[un(o,/:(plac\w+)/,":"+y1+"$1")]}),Dh(e,{props:[un(o,/:(plac\w+)/,Wr+"input-$1")]})],i)}return""})}},qH=[XH],tz=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(x){var y=x.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var i=e.stylisPlugins||qH,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var y=x.getAttribute("data-emotion").split(" "),g=1;g=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var sG={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},aG=!1,lG=/[A-Z]|^ms/g,cG=/_EMO_([^_]+?)_([^]*?)_EMO_/g,lz=function(e){return e.charCodeAt(1)===45},MI=function(e){return e!=null&&typeof e!="boolean"},VS=XF(function(t){return lz(t)?t:t.replace(lG,"-$&").toLowerCase()}),EI=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(cG,function(r,i,o){return Es={name:i,styles:o,next:Es},i})}return sG[e]!==1&&!lz(e)&&typeof n=="number"&&n!==0?n+"px":n},uG="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function hm(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Es={name:i.name,styles:i.styles,next:Es},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Es={name:s.name,styles:s.styles,next:Es},s=s.next;var a=o.styles+";";return a}return fG(t,e,n)}case"function":{if(t!==void 0){var l=Es,c=n(t);return Es=l,hm(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function fG(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?gG:vG},AI=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(s){return e.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},yG=!1,xG=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return sz(n,r,i),hG(function(){return az(n,r,i)}),null},bG=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,s;n!==void 0&&(o=n.label,s=n.target);var a=AI(e,n,r),l=a||RI(i),c=!l("as");return function(){var u=arguments,f=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var h=u.length,m=1;me(RG(i)?n:i):e;return C.jsx(mG,{styles:r})}function sR(t,e){return B2(t,e)}const vz=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},AG=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:gz,StyledEngineProvider:TG,ThemeContext:rg,css:dz,default:sR,internal_processStyles:vz,keyframes:Sb},Symbol.toStringTag,{value:"Module"}));function da(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function yz(t){if(!da(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=yz(t[n])}),e}function ui(t,e,n={clone:!0}){const r=n.clone?W({},t):t;return da(t)&&da(e)&&Object.keys(e).forEach(i=>{da(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&da(t[i])?r[i]=ui(t[i],e[i],n):n.clone?r[i]=da(e[i])?yz(e[i]):e[i]:r[i]=e[i]}),r}const PG=Object.freeze(Object.defineProperty({__proto__:null,default:ui,isPlainObject:da},Symbol.toStringTag,{value:"Module"})),NG=["values","unit","step"],IG=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>W({},n,{[r.key]:r.val}),{})};function xz(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Qe(t,NG),o=IG(e),s=Object.keys(o);function a(h){return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof e[h]=="number"?e[h]:h)-r/100}${n})`}function c(h,m){const v=s.indexOf(m);return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${n}) and (max-width:${(v!==-1&&typeof e[s[v]]=="number"?e[s[v]]:m)-r/100}${n})`}function u(h){return s.indexOf(h)+1`@media (min-width:${aR[t]}px)`};function Di(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||PI;return e.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(e[l]),s),{})}if(typeof e=="object"){const o=r.breakpoints||PI;return Object.keys(e).reduce((s,a)=>{if(Object.keys(o.values||aR).indexOf(a)!==-1){const l=o.up(a);s[l]=n(e[a],a)}else{const l=a;s[l]=e[l]}return s},{})}return n(e)}function bz(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function _z(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function kG(t,...e){const n=bz(t),r=[n,...e].reduce((i,o)=>ui(i,o),{});return _z(Object.keys(n),r)}function OG(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o{t[i]!=null&&(n[i]=!0)}),n}function Uc({values:t,breakpoints:e,base:n}){const r=n||OG(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((s,a,l)=>(Array.isArray(t)?(s[a]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(s[a]=t[a]!=null?t[a]:t[o],o=a):s[a]=t,s),{})}function bt(t){if(typeof t!="string")throw new Error(Ra(7));return t.charAt(0).toUpperCase()+t.slice(1)}const DG=Object.freeze(Object.defineProperty({__proto__:null,default:bt},Symbol.toStringTag,{value:"Module"}));function yd(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function x1(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=yd(t,n)||r,e&&(i=e(i,r,t)),i}function qn(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=s=>{if(s[e]==null)return null;const a=s[e],l=s.theme,c=yd(l,r)||{};return Di(s,a,f=>{let h=x1(c,i,f);return f===h&&typeof f=="string"&&(h=x1(c,i,`${e}${f==="default"?"":bt(f)}`,f)),n===!1?h:{[n]:h}})};return o.propTypes={},o.filterProps=[e],o}function FG(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const zG={m:"margin",p:"padding"},UG={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},NI={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},BG=FG(t=>{if(t.length>2)if(NI[t])t=NI[t];else return[t];const[e,n]=t.split(""),r=zG[e],i=UG[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),lR=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],cR=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...lR,...cR];function ig(t,e,n,r){var i;const o=(i=yd(t,e,!1))!=null?i:n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}function uR(t){return ig(t,"spacing",8)}function iu(t,e){if(typeof e=="string"||e==null)return e;const n=Math.abs(e),r=t(n);return e>=0?r:typeof r=="number"?-r:`-${r}`}function jG(t,e){return n=>t.reduce((r,i)=>(r[i]=iu(e,n),r),{})}function VG(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=BG(n),o=jG(i,r),s=t[n];return Di(t,s,o)}function wz(t,e){const n=uR(t.theme);return Object.keys(t).map(r=>VG(t,e,r,n)).reduce(Cp,{})}function Bn(t){return wz(t,lR)}Bn.propTypes={};Bn.filterProps=lR;function jn(t){return wz(t,cR)}jn.propTypes={};jn.filterProps=cR;function $G(t=8){if(t.mui)return t;const e=uR({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=e(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function Mb(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?Cp(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Ro(t){return typeof t!="number"?t:`${t}px solid`}function Do(t,e){return qn({prop:t,themeKey:"borders",transform:e})}const WG=Do("border",Ro),HG=Do("borderTop",Ro),GG=Do("borderRight",Ro),XG=Do("borderBottom",Ro),qG=Do("borderLeft",Ro),YG=Do("borderColor"),KG=Do("borderTopColor"),ZG=Do("borderRightColor"),JG=Do("borderBottomColor"),QG=Do("borderLeftColor"),eX=Do("outline",Ro),tX=Do("outlineColor"),Eb=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=ig(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:iu(e,r)});return Di(t,t.borderRadius,n)}return null};Eb.propTypes={};Eb.filterProps=["borderRadius"];Mb(WG,HG,GG,XG,qG,YG,KG,ZG,JG,QG,Eb,eX,tX);const Cb=t=>{if(t.gap!==void 0&&t.gap!==null){const e=ig(t.theme,"spacing",8),n=r=>({gap:iu(e,r)});return Di(t,t.gap,n)}return null};Cb.propTypes={};Cb.filterProps=["gap"];const Tb=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=ig(t.theme,"spacing",8),n=r=>({columnGap:iu(e,r)});return Di(t,t.columnGap,n)}return null};Tb.propTypes={};Tb.filterProps=["columnGap"];const Rb=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=ig(t.theme,"spacing",8),n=r=>({rowGap:iu(e,r)});return Di(t,t.rowGap,n)}return null};Rb.propTypes={};Rb.filterProps=["rowGap"];const nX=qn({prop:"gridColumn"}),rX=qn({prop:"gridRow"}),iX=qn({prop:"gridAutoFlow"}),oX=qn({prop:"gridAutoColumns"}),sX=qn({prop:"gridAutoRows"}),aX=qn({prop:"gridTemplateColumns"}),lX=qn({prop:"gridTemplateRows"}),cX=qn({prop:"gridTemplateAreas"}),uX=qn({prop:"gridArea"});Mb(Cb,Tb,Rb,nX,rX,iX,oX,sX,aX,lX,cX,uX);function rd(t,e){return e==="grey"?e:t}const fX=qn({prop:"color",themeKey:"palette",transform:rd}),dX=qn({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:rd}),hX=qn({prop:"backgroundColor",themeKey:"palette",transform:rd});Mb(fX,dX,hX);function qi(t){return t<=1&&t!==0?`${t*100}%`:t}const pX=qn({prop:"width",transform:qi}),fR=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var r,i;const o=((r=t.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||aR[n];return o?((i=t.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${t.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:qi(n)}};return Di(t,t.maxWidth,e)}return null};fR.filterProps=["maxWidth"];const mX=qn({prop:"minWidth",transform:qi}),gX=qn({prop:"height",transform:qi}),vX=qn({prop:"maxHeight",transform:qi}),yX=qn({prop:"minHeight",transform:qi});qn({prop:"size",cssProperty:"width",transform:qi});qn({prop:"size",cssProperty:"height",transform:qi});const xX=qn({prop:"boxSizing"});Mb(pX,fR,mX,gX,vX,yX,xX);const og={border:{themeKey:"borders",transform:Ro},borderTop:{themeKey:"borders",transform:Ro},borderRight:{themeKey:"borders",transform:Ro},borderBottom:{themeKey:"borders",transform:Ro},borderLeft:{themeKey:"borders",transform:Ro},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Ro},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Eb},color:{themeKey:"palette",transform:rd},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:rd},backgroundColor:{themeKey:"palette",transform:rd},p:{style:jn},pt:{style:jn},pr:{style:jn},pb:{style:jn},pl:{style:jn},px:{style:jn},py:{style:jn},padding:{style:jn},paddingTop:{style:jn},paddingRight:{style:jn},paddingBottom:{style:jn},paddingLeft:{style:jn},paddingX:{style:jn},paddingY:{style:jn},paddingInline:{style:jn},paddingInlineStart:{style:jn},paddingInlineEnd:{style:jn},paddingBlock:{style:jn},paddingBlockStart:{style:jn},paddingBlockEnd:{style:jn},m:{style:Bn},mt:{style:Bn},mr:{style:Bn},mb:{style:Bn},ml:{style:Bn},mx:{style:Bn},my:{style:Bn},margin:{style:Bn},marginTop:{style:Bn},marginRight:{style:Bn},marginBottom:{style:Bn},marginLeft:{style:Bn},marginX:{style:Bn},marginY:{style:Bn},marginInline:{style:Bn},marginInlineStart:{style:Bn},marginInlineEnd:{style:Bn},marginBlock:{style:Bn},marginBlockStart:{style:Bn},marginBlockEnd:{style:Bn},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Cb},rowGap:{style:Rb},columnGap:{style:Tb},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:qi},maxWidth:{style:fR},minWidth:{transform:qi},height:{transform:qi},maxHeight:{transform:qi},minHeight:{transform:qi},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function bX(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function _X(t,e){return typeof t=="function"?t(e):t}function Sz(){function t(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const h=yd(i,c)||{};return f?f(s):Di(s,r,v=>{let x=x1(h,u,v);return v===x&&typeof v=="string"&&(x=x1(h,u,`${n}${v==="default"?"":bt(v)}`,v)),l===!1?x:{[l]:x}})}function e(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const s=(r=o.unstable_sxConfig)!=null?r:og;function a(l){let c=l;if(typeof l=="function")c=l(o);else if(typeof l!="object")return l;if(!c)return null;const u=bz(o.breakpoints),f=Object.keys(u);let h=u;return Object.keys(c).forEach(m=>{const v=_X(c[m],o);if(v!=null)if(typeof v=="object")if(s[m])h=Cp(h,t(m,v,o,s));else{const x=Di({theme:o},v,y=>({[m]:y}));bX(x,v)?h[m]=e({sx:v,theme:o}):h=Cp(h,x)}else h=Cp(h,t(m,v,o,s))}),_z(f,h)}return Array.isArray(i)?i.map(a):a(i)}return e}const Vd=Sz();Vd.filterProps=["sx"];function Mz(t,e){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:n.palette.mode===t?e:{}}const wX=["breakpoints","palette","spacing","shape"];function $d(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,s=Qe(t,wX),a=xz(n),l=$G(i);let c=ui({breakpoints:a,direction:"ltr",components:{},palette:W({mode:"light"},r),spacing:l,shape:W({},LG,o)},s);return c.applyStyles=Mz,c=e.reduce((u,f)=>ui(u,f),c),c.unstable_sxConfig=W({},og,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(f){return Vd({sx:f,theme:this})},c}const SX=Object.freeze(Object.defineProperty({__proto__:null,default:$d,private_createBreakpoints:xz,unstable_applyStyles:Mz},Symbol.toStringTag,{value:"Module"}));function MX(t){return Object.keys(t).length===0}function dR(t=null){const e=A.useContext(rg);return!e||MX(e)?t:e}const EX=$d();function Ab(t=EX){return dR(t)}function CX({styles:t,themeId:e,defaultTheme:n={}}){const r=Ab(n),i=typeof t=="function"?t(e&&r[e]||r):t;return C.jsx(gz,{styles:i})}const TX=["sx"],RX=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:og;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function sg(t){const{sx:e}=t,n=Qe(t,TX),{systemProps:r,otherProps:i}=RX(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...s)=>{const a=e(...s);return da(a)?W({},r,a):r}:o=W({},r,e),W({},i,{sx:o})}const AX=Object.freeze(Object.defineProperty({__proto__:null,default:Vd,extendSxProp:sg,unstable_createStyleFunctionSx:Sz,unstable_defaultSxConfig:og},Symbol.toStringTag,{value:"Module"})),II=t=>t,PX=()=>{let t=II;return{configure(e){t=e},generate(e){return t(e)},reset(){t=II}}},Ez=PX();function Cz(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;ea!=="theme"&&a!=="sx"&&a!=="as"})(Vd);return A.forwardRef(function(l,c){const u=Ab(n),f=sg(l),{className:h,component:m="div"}=f,v=Qe(f,NX);return C.jsx(o,W({as:m,ref:c,className:st(h,i?i(r):r),theme:e&&u[e]||u},v))})}const LX={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Tt(t,e,n="Mui"){const r=LX[e];return r?`${n}-${r}`:`${Ez.generate(t)}-${e}`}function Ct(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=Tt(t,i,n)}),r}var Tz={exports:{}},mn={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hR=Symbol.for("react.element"),pR=Symbol.for("react.portal"),Pb=Symbol.for("react.fragment"),Nb=Symbol.for("react.strict_mode"),Ib=Symbol.for("react.profiler"),Lb=Symbol.for("react.provider"),kb=Symbol.for("react.context"),kX=Symbol.for("react.server_context"),Ob=Symbol.for("react.forward_ref"),Db=Symbol.for("react.suspense"),Fb=Symbol.for("react.suspense_list"),zb=Symbol.for("react.memo"),Ub=Symbol.for("react.lazy"),OX=Symbol.for("react.offscreen"),Rz;Rz=Symbol.for("react.module.reference");function Fo(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case hR:switch(t=t.type,t){case Pb:case Ib:case Nb:case Db:case Fb:return t;default:switch(t=t&&t.$$typeof,t){case kX:case kb:case Ob:case Ub:case zb:case Lb:return t;default:return e}}case pR:return e}}}mn.ContextConsumer=kb;mn.ContextProvider=Lb;mn.Element=hR;mn.ForwardRef=Ob;mn.Fragment=Pb;mn.Lazy=Ub;mn.Memo=zb;mn.Portal=pR;mn.Profiler=Ib;mn.StrictMode=Nb;mn.Suspense=Db;mn.SuspenseList=Fb;mn.isAsyncMode=function(){return!1};mn.isConcurrentMode=function(){return!1};mn.isContextConsumer=function(t){return Fo(t)===kb};mn.isContextProvider=function(t){return Fo(t)===Lb};mn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===hR};mn.isForwardRef=function(t){return Fo(t)===Ob};mn.isFragment=function(t){return Fo(t)===Pb};mn.isLazy=function(t){return Fo(t)===Ub};mn.isMemo=function(t){return Fo(t)===zb};mn.isPortal=function(t){return Fo(t)===pR};mn.isProfiler=function(t){return Fo(t)===Ib};mn.isStrictMode=function(t){return Fo(t)===Nb};mn.isSuspense=function(t){return Fo(t)===Db};mn.isSuspenseList=function(t){return Fo(t)===Fb};mn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Pb||t===Ib||t===Nb||t===Db||t===Fb||t===OX||typeof t=="object"&&t!==null&&(t.$$typeof===Ub||t.$$typeof===zb||t.$$typeof===Lb||t.$$typeof===kb||t.$$typeof===Ob||t.$$typeof===Rz||t.getModuleId!==void 0)};mn.typeOf=Fo;Tz.exports=mn;var V2=Tz.exports;const DX=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Az(t){const e=`${t}`.match(DX);return e&&e[1]||""}function Pz(t,e=""){return t.displayName||t.name||Az(t)||e}function LI(t,e,n){const r=Pz(e);return t.displayName||(r!==""?`${n}(${r})`:n)}function FX(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return Pz(t,"Component");if(typeof t=="object")switch(t.$$typeof){case V2.ForwardRef:return LI(t,t.render,"ForwardRef");case V2.Memo:return LI(t,t.type,"memo");default:return}}}const zX=Object.freeze(Object.defineProperty({__proto__:null,default:FX,getFunctionName:Az},Symbol.toStringTag,{value:"Module"})),UX=["ownerState"],BX=["variants"],jX=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function VX(t){return Object.keys(t).length===0}function $X(t){return typeof t=="string"&&t.charCodeAt(0)>96}function $S(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const WX=$d(),HX=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function Q0({defaultTheme:t,theme:e,themeId:n}){return VX(e)?t:e[n]||e}function GX(t){return t?(e,n)=>n[t]:null}function Ny(t,e){let{ownerState:n}=e,r=Qe(e,UX);const i=typeof t=="function"?t(W({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>Ny(o,W({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=Qe(i,BX);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props(W({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style(W({ownerState:n},r,n)):l.style))}),a}return i}function XX(t={}){const{themeId:e,defaultTheme:n=WX,rootShouldForwardProp:r=$S,slotShouldForwardProp:i=$S}=t,o=s=>Vd(W({},s,{theme:Q0(W({},s,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(s,a={})=>{vz(s,P=>P.filter(N=>!(N!=null&&N.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:h=GX(HX(c))}=a,m=Qe(a,jX),v=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,x=f||!1;let y,g=$S;c==="Root"||c==="root"?g=r:c?g=i:$X(s)&&(g=void 0);const b=sR(s,W({shouldForwardProp:g,label:y},m)),_=P=>typeof P=="function"&&P.__emotion_real!==P||da(P)?N=>Ny(P,W({},N,{theme:Q0({theme:N.theme,defaultTheme:n,themeId:e})})):P,S=(P,...N)=>{let T=_(P);const L=N?N.map(_):[];l&&h&&L.push(R=>{const D=Q0(W({},R,{defaultTheme:n,themeId:e}));if(!D.components||!D.components[l]||!D.components[l].styleOverrides)return null;const O=D.components[l].styleOverrides,B={};return Object.entries(O).forEach(([X,H])=>{B[X]=Ny(H,W({},R,{theme:D}))}),h(R,B)}),l&&!v&&L.push(R=>{var D;const O=Q0(W({},R,{defaultTheme:n,themeId:e})),B=O==null||(D=O.components)==null||(D=D[l])==null?void 0:D.variants;return Ny({variants:B},W({},R,{theme:O}))}),x||L.push(o);const U=L.length-N.length;if(Array.isArray(P)&&U>0){const R=new Array(U).fill("");T=[...P,...R],T.raw=[...P.raw,...R]}const M=b(T,...L);return s.muiName&&(M.muiName=s.muiName),M};return b.withConfig&&(S.withConfig=b.withConfig),S}}const Nz=XX();function pm(t,e){const n=W({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=W({},t[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=t[r]||{},o=e[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=W({},o),Object.keys(i).forEach(s=>{n[r][s]=pm(i[s],o[s])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function Iz(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:pm(e.components[n].defaultProps,r)}function Lz({props:t,name:e,defaultTheme:n,themeId:r}){let i=Ab(n);return r&&(i=i[r]||i),Iz({theme:i,name:e,props:t})}const ko=typeof window<"u"?A.useLayoutEffect:A.useEffect;function qX(t,e,n,r,i){const[o,s]=A.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return ko(()=>{let a=!0;if(!n)return;const l=n(t),c=()=>{a&&s(l.matches)};return c(),l.addListener(c),()=>{a=!1,l.removeListener(c)}},[t,n]),o}const kz=A.useSyncExternalStore;function YX(t,e,n,r,i){const o=A.useCallback(()=>e,[e]),s=A.useMemo(()=>{if(i&&n)return()=>n(t).matches;if(r!==null){const{matches:u}=r(t);return()=>u}return o},[o,t,r,i,n]),[a,l]=A.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,f=>(u.addListener(f),()=>{u.removeListener(f)})]},[o,n,t]);return kz(l,a,s)}function Oz(t,e={}){const n=dR(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:a=!1}=Iz({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(kz!==void 0?YX:qX)(l,i,o,s,a)}function Dz(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const KX=Object.freeze(Object.defineProperty({__proto__:null,default:Dz},Symbol.toStringTag,{value:"Module"}));function Fz(t,e=0,n=1){return Dz(t,e,n)}function ZX(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function mR(t){if(t.type)return t;if(t.charAt(0)==="#")return mR(ZX(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(Ra(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(Ra(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function zz(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function WS(t,e){if(t=mR(t),e=Fz(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return zz(t)}function HS(t,e){if(t=mR(t),e=Fz(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return zz(t)}function kI(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function Bb(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function Iy(t,e){var n,r;return A.isValidElement(t)&&e.indexOf((n=t.type.muiName)!=null?n:(r=t.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Li(t){return t&&t.ownerDocument||document}function Aa(t){return Li(t).defaultView||window}function $2(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let OI=0;function JX(t){const[e,n]=A.useState(t),r=t||e;return A.useEffect(()=>{e==null&&(OI+=1,n(`mui-${OI}`))},[e]),r}const DI=Hp.useId;function Uz(t){if(DI!==void 0){const e=DI();return t??e}return JX(t)}function W2({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=A.useRef(t!==void 0),[o,s]=A.useState(e),a=i?t:o,l=A.useCallback(c=>{i||s(c)},[]);return[a,l]}function va(t){const e=A.useRef(t);return ko(()=>{e.current=t}),A.useRef((...n)=>(0,e.current)(...n)).current}function _r(...t){return A.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{$2(n,e)})},t)}const FI={};function QX(t,e){const n=A.useRef(FI);return n.current===FI&&(n.current=t(e)),n}const eq=[];function tq(t){A.useEffect(t,eq)}class jb{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new jb}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function Bz(){const t=QX(jb.create).current;return tq(t.disposeEffect),t}let Vb=!0,H2=!1;const nq=new jb,rq={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function iq(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&rq[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function oq(t){t.metaKey||t.altKey||t.ctrlKey||(Vb=!0)}function GS(){Vb=!1}function sq(){this.visibilityState==="hidden"&&H2&&(Vb=!0)}function aq(t){t.addEventListener("keydown",oq,!0),t.addEventListener("mousedown",GS,!0),t.addEventListener("pointerdown",GS,!0),t.addEventListener("touchstart",GS,!0),t.addEventListener("visibilitychange",sq,!0)}function lq(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return Vb||iq(e)}function jz(){const t=A.useCallback(i=>{i!=null&&aq(i.ownerDocument)},[]),e=A.useRef(!1);function n(){return e.current?(H2=!0,nq.start(100,()=>{H2=!1}),e.current=!1,!0):!1}function r(i){return lq(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function Vz(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}let Yu;function $z(){if(Yu)return Yu;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),Yu="reverse",t.scrollLeft>0?Yu="default":(t.scrollLeft=1,t.scrollLeft===0&&(Yu="negative")),document.body.removeChild(t),Yu}function cq(t,e){const n=t.scrollLeft;if(e!=="rtl")return n;switch($z()){case"negative":return t.scrollWidth-t.clientWidth+n;case"reverse":return t.scrollWidth-t.clientWidth-n;default:return n}}function Rt(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((o,s)=>{if(s){const a=e(s);a!==""&&o.push(a),n&&n[s]&&o.push(n[s])}return o},[]).join(" ")}),r}function xd(t){return typeof t=="string"}function uq(t,e,n){return t===void 0||xd(t)?e:W({},e,{ownerState:W({},e.ownerState,n)})}function Wz(t,e=[]){if(t===void 0)return{};const n={};return Object.keys(t).filter(r=>r.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function zI(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function fq(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const m=st(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),v=W({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),x=W({},n,i,r);return m.length>0&&(x.className=m),Object.keys(v).length>0&&(x.style=v),{props:x,internalRef:void 0}}const s=Wz(W({},i,r)),a=zI(r),l=zI(i),c=e(s),u=st(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),f=W({},c==null?void 0:c.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),h=W({},c,n,l,a);return u.length>0&&(h.className=u),Object.keys(f).length>0&&(h.style=f),{props:h,internalRef:c.ref}}function dq(t,e,n){return typeof t=="function"?t(e,n):t}const hq=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Us(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,s=Qe(t,hq),a=o?{}:dq(r,i),{props:l,internalRef:c}=fq(W({},s,{externalSlotProps:a})),u=_r(c,a==null?void 0:a.ref,(e=t.additionalProps)==null?void 0:e.ref);return uq(n,W({},l,{ref:u}),i)}const Hz=A.createContext(null);function Gz(){return A.useContext(Hz)}const pq=typeof Symbol=="function"&&Symbol.for,mq=pq?Symbol.for("mui.nested"):"__THEME_NESTED__";function gq(t,e){return typeof e=="function"?e(t):W({},t,e)}function vq(t){const{children:e,theme:n}=t,r=Gz(),i=A.useMemo(()=>{const o=r===null?n:gq(r,n);return o!=null&&(o[mq]=r!==null),o},[n,r]);return C.jsx(Hz.Provider,{value:i,children:e})}const yq=["value"],Xz=A.createContext();function xq(t){let{value:e}=t,n=Qe(t,yq);return C.jsx(Xz.Provider,W({value:e??!0},n))}const gR=()=>{const t=A.useContext(Xz);return t??!1},qz=A.createContext(void 0);function bq({value:t,children:e}){return C.jsx(qz.Provider,{value:t,children:e})}function _q(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n])return r;const i=e.components[n];return i.defaultProps?pm(i.defaultProps,r):!i.styleOverrides&&!i.variants?pm(i,r):r}function wq({props:t,name:e}){const n=A.useContext(qz);return _q({props:t,name:e,theme:{components:n}})}const UI={};function BI(t,e,n,r=!1){return A.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),s=t?W({},e,{[t]:o}):o;return r?()=>s:s}return t?W({},e,{[t]:n}):W({},e,n)},[t,e,n,r])}function Sq(t){const{children:e,theme:n,themeId:r}=t,i=dR(UI),o=Gz()||UI,s=BI(r,i,n),a=BI(r,o,n,!0),l=s.direction==="rtl";return C.jsx(vq,{theme:a,children:C.jsx(rg.Provider,{value:s,children:C.jsx(xq,{value:l,children:C.jsx(bq,{value:s==null?void 0:s.components,children:e})})})})}const Mq=["className","component","disableGutters","fixed","maxWidth","classes"],Eq=$d(),Cq=Nz("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`maxWidth${bt(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),Tq=t=>Lz({props:t,name:"MuiContainer",defaultTheme:Eq}),Rq=(t,e)=>{const n=l=>Tt(e,l),{classes:r,fixed:i,disableGutters:o,maxWidth:s}=t,a={root:["root",s&&`maxWidth${bt(String(s))}`,i&&"fixed",o&&"disableGutters"]};return Rt(a,n,r)};function Aq(t={}){const{createStyledComponent:e=Cq,useThemeProps:n=Tq,componentName:r="MuiContainer"}=t,i=e(({theme:s,ownerState:a})=>W({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:s.spacing(2),paddingRight:s.spacing(2),[s.breakpoints.up("sm")]:{paddingLeft:s.spacing(3),paddingRight:s.spacing(3)}}),({theme:s,ownerState:a})=>a.fixed&&Object.keys(s.breakpoints.values).reduce((l,c)=>{const u=c,f=s.breakpoints.values[u];return f!==0&&(l[s.breakpoints.up(u)]={maxWidth:`${f}${s.breakpoints.unit}`}),l},{}),({theme:s,ownerState:a})=>W({},a.maxWidth==="xs"&&{[s.breakpoints.up("xs")]:{maxWidth:Math.max(s.breakpoints.values.xs,444)}},a.maxWidth&&a.maxWidth!=="xs"&&{[s.breakpoints.up(a.maxWidth)]:{maxWidth:`${s.breakpoints.values[a.maxWidth]}${s.breakpoints.unit}`}}));return A.forwardRef(function(a,l){const c=n(a),{className:u,component:f="div",disableGutters:h=!1,fixed:m=!1,maxWidth:v="lg"}=c,x=Qe(c,Mq),y=W({},c,{component:f,disableGutters:h,fixed:m,maxWidth:v}),g=Rq(y,r);return C.jsx(i,W({as:f,ownerState:y,className:st(g.root,u),ref:l},x))})}const Pq=["component","direction","spacing","divider","children","className","useFlexGap"],Nq=$d(),Iq=Nz("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function Lq(t){return Lz({props:t,name:"MuiStack",defaultTheme:Nq})}function kq(t,e){const n=A.Children.toArray(t).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],Dq=({ownerState:t,theme:e})=>{let n=W({display:"flex",flexDirection:"column"},Di({theme:e},Uc({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=uR(e),i=Object.keys(e.breakpoints.values).reduce((l,c)=>((typeof t.spacing=="object"&&t.spacing[c]!=null||typeof t.direction=="object"&&t.direction[c]!=null)&&(l[c]=!0),l),{}),o=Uc({values:t.direction,base:i}),s=Uc({values:t.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,c,u)=>{if(!o[l]){const h=c>0?o[u[c-1]]:"column";o[l]=h}}),n=ui(n,Di({theme:e},s,(l,c)=>t.useFlexGap?{gap:iu(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Oq(c?o[c]:t.direction)}`]:iu(r,l)}}))}return n=kG(e.breakpoints,n),n};function Fq(t={}){const{createStyledComponent:e=Iq,useThemeProps:n=Lq,componentName:r="MuiStack"}=t,i=()=>Rt({root:["root"]},l=>Tt(r,l),{}),o=e(Dq);return A.forwardRef(function(l,c){const u=n(l),f=sg(u),{component:h="div",direction:m="column",spacing:v=0,divider:x,children:y,className:g,useFlexGap:b=!1}=f,_=Qe(f,Pq),S={direction:m,spacing:v,useFlexGap:b},P=i();return C.jsx(o,W({as:h,ownerState:S,ref:c,className:st(P.root,g)},_,{children:x?kq(y,x):y}))})}function zq(t,e){return W({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var Yn={},Yz={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(Yz);var Kz=Yz.exports;const Uq=Ws(vH),Bq=Ws(KX);var Zz=Kz;Object.defineProperty(Yn,"__esModule",{value:!0});var Rn=Yn.alpha=r6;Yn.blend=Zq;Yn.colorChannel=void 0;var Jz=Yn.darken=yR;Yn.decomposeColor=Oo;Yn.emphasize=i6;var jq=Yn.getContrastRatio=Gq;Yn.getLuminance=b1;Yn.hexToRgb=e6;Yn.hslToRgb=n6;var Qz=Yn.lighten=xR;Yn.private_safeAlpha=Xq;Yn.private_safeColorChannel=void 0;Yn.private_safeDarken=qq;Yn.private_safeEmphasize=Kq;Yn.private_safeLighten=Yq;Yn.recomposeColor=Wd;Yn.rgbToHex=Hq;var jI=Zz(Uq),Vq=Zz(Bq);function vR(t,e=0,n=1){return(0,Vq.default)(t,e,n)}function e6(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function $q(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function Oo(t){if(t.type)return t;if(t.charAt(0)==="#")return Oo(e6(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,jI.default)(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,jI.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const t6=t=>{const e=Oo(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};Yn.colorChannel=t6;const Wq=(t,e)=>{try{return t6(t)}catch{return t}};Yn.private_safeColorChannel=Wq;function Wd(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Hq(t){if(t.indexOf("#")===0)return t;const{values:e}=Oo(t);return`#${e.map((n,r)=>$q(r===3?Math.round(255*n):n)).join("")}`}function n6(t){t=Oo(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),Wd({type:a,values:l})}function b1(t){t=Oo(t);let e=t.type==="hsl"||t.type==="hsla"?Oo(n6(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function Gq(t,e){const n=b1(t),r=b1(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function r6(t,e){return t=Oo(t),e=vR(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Wd(t)}function Xq(t,e,n){try{return r6(t,e)}catch{return t}}function yR(t,e){if(t=Oo(t),e=vR(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Wd(t)}function qq(t,e,n){try{return yR(t,e)}catch{return t}}function xR(t,e){if(t=Oo(t),e=vR(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Wd(t)}function Yq(t,e,n){try{return xR(t,e)}catch{return t}}function i6(t,e=.15){return b1(t)>.5?yR(t,e):xR(t,e)}function Kq(t,e,n){try{return i6(t,e)}catch{return t}}function Zq(t,e,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=Oo(t),s=Oo(e),a=[i(o.values[0],s.values[0]),i(o.values[1],s.values[1]),i(o.values[2],s.values[2])];return Wd({type:"rgb",values:a})}const Jq=["mode","contrastThreshold","tonalOffset"],VI={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:um.white,default:um.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},XS={text:{primary:um.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:um.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function $I(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=Qz(t.main,i):e==="dark"&&(t.dark=Jz(t.main,o)))}function Qq(t="light"){return t==="dark"?{main:Gu[200],light:Gu[50],dark:Gu[400]}:{main:Gu[700],light:Gu[400],dark:Gu[800]}}function eY(t="light"){return t==="dark"?{main:Hu[200],light:Hu[50],dark:Hu[400]}:{main:Hu[500],light:Hu[300],dark:Hu[700]}}function tY(t="light"){return t==="dark"?{main:Wu[500],light:Wu[300],dark:Wu[700]}:{main:Wu[700],light:Wu[400],dark:Wu[800]}}function nY(t="light"){return t==="dark"?{main:Xu[400],light:Xu[300],dark:Xu[700]}:{main:Xu[700],light:Xu[500],dark:Xu[900]}}function rY(t="light"){return t==="dark"?{main:qu[400],light:qu[300],dark:qu[700]}:{main:qu[800],light:qu[500],dark:qu[900]}}function iY(t="light"){return t==="dark"?{main:Oh[400],light:Oh[300],dark:Oh[700]}:{main:"#ed6c02",light:Oh[500],dark:Oh[900]}}function oY(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Qe(t,Jq),o=t.primary||Qq(e),s=t.secondary||eY(e),a=t.error||tY(e),l=t.info||nY(e),c=t.success||rY(e),u=t.warning||iY(e);function f(x){return jq(x,XS.text.primary)>=n?XS.text.primary:VI.text.primary}const h=({color:x,name:y,mainShade:g=500,lightShade:b=300,darkShade:_=700})=>{if(x=W({},x),!x.main&&x[g]&&(x.main=x[g]),!x.hasOwnProperty("main"))throw new Error(Ra(11,y?` (${y})`:"",g));if(typeof x.main!="string")throw new Error(Ra(12,y?` (${y})`:"",JSON.stringify(x.main)));return $I(x,"light",b,r),$I(x,"dark",_,r),x.contrastText||(x.contrastText=f(x.main)),x},m={dark:XS,light:VI};return ui(W({common:W({},um),mode:e,primary:h({color:o,name:"primary"}),secondary:h({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:a,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:l,name:"info"}),success:h({color:c,name:"success"}),grey:gH,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:r},m[e]),i)}const sY=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function aY(t){return Math.round(t*1e5)/1e5}const WI={textTransform:"uppercase"},HI='"Roboto", "Helvetica", "Arial", sans-serif';function lY(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=HI,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=n,h=Qe(n,sY),m=i/14,v=f||(g=>`${g/c*m}rem`),x=(g,b,_,S,P)=>W({fontFamily:r,fontWeight:g,fontSize:v(b),lineHeight:_},r===HI?{letterSpacing:`${aY(S/b)}em`}:{},P,u),y={h1:x(o,96,1.167,-1.5),h2:x(o,60,1.2,-.5),h3:x(s,48,1.167,0),h4:x(s,34,1.235,.25),h5:x(s,24,1.334,0),h6:x(a,20,1.6,.15),subtitle1:x(s,16,1.75,.15),subtitle2:x(a,14,1.57,.1),body1:x(s,16,1.5,.15),body2:x(s,14,1.43,.15),button:x(a,14,1.75,.4,WI),caption:x(s,12,1.66,.4),overline:x(s,12,2.66,1,WI),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ui(W({htmlFontSize:c,pxToRem:v,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},y),h,{clone:!1})}const cY=.2,uY=.14,fY=.12;function Cn(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${cY})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${uY})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${fY})`].join(",")}const dY=["none",Cn(0,2,1,-1,0,1,1,0,0,1,3,0),Cn(0,3,1,-2,0,2,2,0,0,1,5,0),Cn(0,3,3,-2,0,3,4,0,0,1,8,0),Cn(0,2,4,-1,0,4,5,0,0,1,10,0),Cn(0,3,5,-1,0,5,8,0,0,1,14,0),Cn(0,3,5,-1,0,6,10,0,0,1,18,0),Cn(0,4,5,-2,0,7,10,1,0,2,16,1),Cn(0,5,5,-3,0,8,10,1,0,3,14,2),Cn(0,5,6,-3,0,9,12,1,0,3,16,2),Cn(0,6,6,-3,0,10,14,1,0,4,18,3),Cn(0,6,7,-4,0,11,15,1,0,4,20,3),Cn(0,7,8,-4,0,12,17,2,0,5,22,4),Cn(0,7,8,-4,0,13,19,2,0,5,24,4),Cn(0,7,9,-4,0,14,21,2,0,5,26,4),Cn(0,8,9,-5,0,15,22,2,0,6,28,5),Cn(0,8,10,-5,0,16,24,2,0,6,30,5),Cn(0,8,11,-5,0,17,26,2,0,6,32,5),Cn(0,9,11,-5,0,18,28,2,0,7,34,6),Cn(0,9,12,-6,0,19,29,2,0,7,36,6),Cn(0,10,13,-6,0,20,31,3,0,8,38,7),Cn(0,10,13,-6,0,21,33,3,0,8,40,7),Cn(0,10,14,-6,0,22,35,3,0,8,42,7),Cn(0,11,14,-7,0,23,36,3,0,9,44,8),Cn(0,11,15,-7,0,24,38,3,0,9,46,8)],hY=["duration","easing","delay"],pY={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},mY={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function GI(t){return`${Math.round(t)}ms`}function gY(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function vY(t){const e=W({},pY,t.easing),n=W({},mY,t.duration);return W({getAutoHeightDuration:gY,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=e.easeInOut,delay:l=0}=o;return Qe(o,hY),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof s=="string"?s:GI(s)} ${a} ${typeof l=="string"?l:GI(l)}`).join(",")}},t,{easing:e,duration:n})}const yY={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},xY=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function bR(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,s=Qe(t,xY);if(t.vars)throw new Error(Ra(18));const a=oY(r),l=$d(t);let c=ui(l,{mixins:zq(l.breakpoints,n),palette:a,shadows:dY.slice(),typography:lY(a,o),transitions:vY(i),zIndex:W({},yY)});return c=ui(c,s),c=e.reduce((u,f)=>ui(u,f),c),c.unstable_sxConfig=W({},og,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(f){return Vd({sx:f,theme:this})},c}const _R=bR();function mu(){const t=Ab(_R);return t[gd]||t}var ag={},qS={exports:{}},XI;function bY(){return XI||(XI=1,function(t){function e(){return t.exports=e=Object.assign?Object.assign.bind():function(n){for(var r=1;r96}function Ly(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const zY=ag.systemDefaultTheme=(0,PY.default)(),UY=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function ev({defaultTheme:t,theme:e,themeId:n}){return DY(e)?t:e[n]||e}function BY(t){return t?(e,n)=>n[t]:null}function ky(t,e){let{ownerState:n}=e,r=(0,G2.default)(e,IY);const i=typeof t=="function"?t((0,wo.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>ky(o,(0,wo.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=(0,G2.default)(i,LY);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,wo.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style((0,wo.default)({ownerState:n},r,n)):l.style))}),a}return i}function jY(t={}){const{themeId:e,defaultTheme:n=zY,rootShouldForwardProp:r=Ly,slotShouldForwardProp:i=Ly}=t,o=s=>(0,NY.default)((0,wo.default)({},s,{theme:ev((0,wo.default)({},s,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(s,a={})=>{(0,YI.internal_processStyles)(s,P=>P.filter(N=>!(N!=null&&N.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:h=BY(UY(c))}=a,m=(0,G2.default)(a,kY),v=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,x=f||!1;let y,g=Ly;c==="Root"||c==="root"?g=r:c?g=i:FY(s)&&(g=void 0);const b=(0,YI.default)(s,(0,wo.default)({shouldForwardProp:g,label:y},m)),_=P=>typeof P=="function"&&P.__emotion_real!==P||(0,AY.isPlainObject)(P)?N=>ky(P,(0,wo.default)({},N,{theme:ev({theme:N.theme,defaultTheme:n,themeId:e})})):P,S=(P,...N)=>{let T=_(P);const L=N?N.map(_):[];l&&h&&L.push(R=>{const D=ev((0,wo.default)({},R,{defaultTheme:n,themeId:e}));if(!D.components||!D.components[l]||!D.components[l].styleOverrides)return null;const O=D.components[l].styleOverrides,B={};return Object.entries(O).forEach(([X,H])=>{B[X]=ky(H,(0,wo.default)({},R,{theme:D}))}),h(R,B)}),l&&!v&&L.push(R=>{var D;const O=ev((0,wo.default)({},R,{defaultTheme:n,themeId:e})),B=O==null||(D=O.components)==null||(D=D[l])==null?void 0:D.variants;return ky({variants:B},(0,wo.default)({},R,{theme:O}))}),x||L.push(o);const U=L.length-N.length;if(Array.isArray(P)&&U>0){const R=new Array(U).fill("");T=[...P,...R],T.raw=[...P.raw,...R]}const M=b(T,...L);return s.muiName&&(M.muiName=s.muiName),M};return b.withConfig&&(S.withConfig=b.withConfig),S}}function s6(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const pi=t=>s6(t)&&t!=="classes",qe=RY({themeId:gd,defaultTheme:_R,rootShouldForwardProp:pi}),VY=["theme"];function $Y(t){let{theme:e}=t,n=Qe(t,VY);const r=e[gd];return C.jsx(Sq,W({},n,{themeId:r?gd:void 0,theme:r||e}))}const KI=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function At(t){return wq(t)}function WY(t){return Tt("MuiSvgIcon",t)}Ct("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const HY=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],GY=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${bt(e)}`,`fontSize${bt(n)}`]};return Rt(i,WY,r)},XY=qe("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${bt(n.color)}`],e[`fontSize${bt(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,o,s,a,l,c,u,f,h,m,v;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=t.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=t.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=t.typography)==null||(s=o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem",medium:((a=t.typography)==null||(l=a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem",large:((c=t.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[e.fontSize],color:(f=(h=(t.vars||t).palette)==null||(h=h[e.color])==null?void 0:h.main)!=null?f:{action:(m=(t.vars||t).palette)==null||(m=m.action)==null?void 0:m.active,disabled:(v=(t.vars||t).palette)==null||(v=v.action)==null?void 0:v.disabled,inherit:void 0}[e.color]}}),_1=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:h="0 0 24 24"}=r,m=Qe(r,HY),v=A.isValidElement(i)&&i.type==="svg",x=W({},r,{color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:v}),y={};u||(y.viewBox=h);const g=GY(x);return C.jsxs(XY,W({as:a,className:st(g.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},y,m,v&&i.props,{ownerState:x,children:[v?i.props.children:i,f?C.jsx("title",{children:f}):null]}))});_1.muiName="SvgIcon";function Gd(t,e){function n(r,i){return C.jsx(_1,W({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=_1.muiName,A.memo(A.forwardRef(n))}function X2(t,e){return X2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},X2(t,e)}function wR(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,X2(t,e)}const ZI={disabled:!1},w1=Mt.createContext(null);var qY=function(e){return e.scrollTop},dp="unmounted",vc="exited",yc="entering",wf="entered",q2="exiting",Hs=function(t){wR(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=vc,o.appearStatus=yc):l=wf:r.unmountOnExit||r.mountOnEnter?l=dp:l=vc,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===dp?{status:vc}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==yc&&s!==wf&&(o=yc):(s===yc||s===wf)&&(o=q2)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===yc){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:fp.findDOMNode(this);s&&qY(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===vc&&this.setState({status:dp})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[fp.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),h=a?f.appear:f.enter;if(!i&&!s||ZI.disabled){this.safeSetState({status:wf},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:yc},function(){o.props.onEntering(c,u),o.onTransitionEnd(h,function(){o.safeSetState({status:wf},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:fp.findDOMNode(this);if(!o||ZI.disabled){this.safeSetState({status:vc},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:q2},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:vc},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:fp.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===dp)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=Qe(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Mt.createElement(w1.Provider,{value:null},typeof s=="function"?s(i,a):Mt.cloneElement(Mt.Children.only(s),a))},e}(Mt.Component);Hs.contextType=w1;Hs.propTypes={};function Ku(){}Hs.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ku,onEntering:Ku,onEntered:Ku,onExit:Ku,onExiting:Ku,onExited:Ku};Hs.UNMOUNTED=dp;Hs.EXITED=vc;Hs.ENTERING=yc;Hs.ENTERED=wf;Hs.EXITING=q2;function YY(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function SR(t,e){var n=function(o){return e&&A.isValidElement(o)?e(o):o},r=Object.create(null);return t&&A.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function KY(t,e){t=t||{},e=e||{};function n(u){return u in e?e[u]:t[u]}var r=Object.create(null),i=[];for(var o in t)o in e?i.length&&(r[o]=i,i=[]):i.push(o);var s,a={};for(var l in e){if(r[l])for(s=0;st.scrollTop;function S1(t,e){var n,r;const{timeout:i,easing:o,style:s={}}=t;return{duration:(n=s.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=s.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:s.transitionDelay}}function tK(t){return Tt("MuiPaper",t)}Ct("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const nK=["className","component","elevation","square","variant"],rK=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Rt(o,tK,i)},iK=qe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(({theme:t,ownerState:e})=>{var n;return W({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&W({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Rn("#fff",KI(e.elevation))}, ${Rn("#fff",KI(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),gu=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiPaper"}),{className:i,component:o="div",elevation:s=1,square:a=!1,variant:l="elevation"}=r,c=Qe(r,nK),u=W({},r,{component:o,elevation:s,square:a,variant:l}),f=rK(u);return C.jsx(iK,W({as:o,ownerState:u,className:st(f.root,i),ref:n},c))});function oK(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:c}=t,[u,f]=A.useState(!1),h=st(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),m={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},v=st(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),A.useEffect(()=>{if(!a&&l!=null){const x=setTimeout(l,c);return()=>{clearTimeout(x)}}},[l,a,c]),C.jsx("span",{className:h,style:m,children:C.jsx("span",{className:v})})}const Mo=Ct("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),sK=["center","classes","className"];let $b=t=>t,JI,QI,e4,t4;const Y2=550,aK=80,lK=Sb(JI||(JI=$b` + 0% { + transform: scale(0); + opacity: 0.1; + } + + 100% { + transform: scale(1); + opacity: 0.3; + } +`)),cK=Sb(QI||(QI=$b` + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +`)),uK=Sb(e4||(e4=$b` + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.92); + } + + 100% { + transform: scale(1); + } +`)),fK=qe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),dK=qe(oK,{name:"MuiTouchRipple",slot:"Ripple"})(t4||(t4=$b` + opacity: 0; + position: absolute; + + &.${0} { + opacity: 0.3; + transform: scale(1); + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + &.${0} { + animation-duration: ${0}ms; + } + + & .${0} { + opacity: 1; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: currentColor; + } + + & .${0} { + opacity: 0; + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + & .${0} { + position: absolute; + /* @noflip */ + left: 0px; + top: 0; + animation-name: ${0}; + animation-duration: 2500ms; + animation-timing-function: ${0}; + animation-iteration-count: infinite; + animation-delay: 200ms; + } +`),Mo.rippleVisible,lK,Y2,({theme:t})=>t.transitions.easing.easeInOut,Mo.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Mo.child,Mo.childLeaving,cK,Y2,({theme:t})=>t.transitions.easing.easeInOut,Mo.childPulsate,uK,({theme:t})=>t.transitions.easing.easeInOut),hK=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s}=r,a=Qe(r,sK),[l,c]=A.useState([]),u=A.useRef(0),f=A.useRef(null);A.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const h=A.useRef(!1),m=Bz(),v=A.useRef(null),x=A.useRef(null),y=A.useCallback(S=>{const{pulsate:P,rippleX:N,rippleY:T,rippleSize:L,cb:U}=S;c(M=>[...M,C.jsx(dK,{classes:{ripple:st(o.ripple,Mo.ripple),rippleVisible:st(o.rippleVisible,Mo.rippleVisible),ripplePulsate:st(o.ripplePulsate,Mo.ripplePulsate),child:st(o.child,Mo.child),childLeaving:st(o.childLeaving,Mo.childLeaving),childPulsate:st(o.childPulsate,Mo.childPulsate)},timeout:Y2,pulsate:P,rippleX:N,rippleY:T,rippleSize:L},u.current)]),u.current+=1,f.current=U},[o]),g=A.useCallback((S={},P={},N=()=>{})=>{const{pulsate:T=!1,center:L=i||P.pulsate,fakeElement:U=!1}=P;if((S==null?void 0:S.type)==="mousedown"&&h.current){h.current=!1;return}(S==null?void 0:S.type)==="touchstart"&&(h.current=!0);const M=U?null:x.current,R=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let D,O,B;if(L||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)D=Math.round(R.width/2),O=Math.round(R.height/2);else{const{clientX:X,clientY:H}=S.touches&&S.touches.length>0?S.touches[0]:S;D=Math.round(X-R.left),O=Math.round(H-R.top)}if(L)B=Math.sqrt((2*R.width**2+R.height**2)/3),B%2===0&&(B+=1);else{const X=Math.max(Math.abs((M?M.clientWidth:0)-D),D)*2+2,H=Math.max(Math.abs((M?M.clientHeight:0)-O),O)*2+2;B=Math.sqrt(X**2+H**2)}S!=null&&S.touches?v.current===null&&(v.current=()=>{y({pulsate:T,rippleX:D,rippleY:O,rippleSize:B,cb:N})},m.start(aK,()=>{v.current&&(v.current(),v.current=null)})):y({pulsate:T,rippleX:D,rippleY:O,rippleSize:B,cb:N})},[i,y,m]),b=A.useCallback(()=>{g({},{pulsate:!0})},[g]),_=A.useCallback((S,P)=>{if(m.clear(),(S==null?void 0:S.type)==="touchend"&&v.current){v.current(),v.current=null,m.start(0,()=>{_(S,P)});return}v.current=null,c(N=>N.length>0?N.slice(1):N),f.current=P},[m]);return A.useImperativeHandle(n,()=>({pulsate:b,start:g,stop:_}),[b,g,_]),C.jsx(fK,W({className:st(Mo.root,o.root,s),ref:x},a,{children:C.jsx(MR,{component:null,exit:!0,children:l})}))});function pK(t){return Tt("MuiButtonBase",t)}const mK=Ct("MuiButtonBase",["root","disabled","focusVisible"]),gK=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],vK=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,s=Rt({root:["root",e&&"disabled",n&&"focusVisible"]},pK,i);return n&&r&&(s.root+=` ${r}`),s},yK=qe("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${mK.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),vu=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:h=!1,LinkComponent:m="a",onBlur:v,onClick:x,onContextMenu:y,onDragLeave:g,onFocus:b,onFocusVisible:_,onKeyDown:S,onKeyUp:P,onMouseDown:N,onMouseLeave:T,onMouseUp:L,onTouchEnd:U,onTouchMove:M,onTouchStart:R,tabIndex:D=0,TouchRippleProps:O,touchRippleRef:B,type:X}=r,H=Qe(r,gK),Z=A.useRef(null),F=A.useRef(null),Y=_r(F,B),{isFocusVisibleRef:K,onFocus:ee,onBlur:me,ref:le}=jz(),[Q,ae]=A.useState(!1);c&&Q&&ae(!1),A.useImperativeHandle(i,()=>({focusVisible:()=>{ae(!0),Z.current.focus()}}),[]);const[ge,Me]=A.useState(!1);A.useEffect(()=>{Me(!0)},[]);const tt=ge&&!u&&!c;A.useEffect(()=>{Q&&h&&!u&&ge&&F.current.pulsate()},[u,h,Q,ge]);function He(ze,Le,Xe=f){return va(xt=>(Le&&Le(xt),!Xe&&F.current&&F.current[ze](xt),!0))}const rt=He("start",N),Ve=He("stop",y),se=He("stop",g),j=He("stop",L),ye=He("stop",ze=>{Q&&ze.preventDefault(),T&&T(ze)}),xe=He("start",R),Re=He("stop",U),Pe=He("stop",M),Ee=He("stop",ze=>{me(ze),K.current===!1&&ae(!1),v&&v(ze)},!1),De=va(ze=>{Z.current||(Z.current=ze.currentTarget),ee(ze),K.current===!0&&(ae(!0),_&&_(ze)),b&&b(ze)}),$=()=>{const ze=Z.current;return l&&l!=="button"&&!(ze.tagName==="A"&&ze.href)},z=A.useRef(!1),re=va(ze=>{h&&!z.current&&Q&&F.current&&ze.key===" "&&(z.current=!0,F.current.stop(ze,()=>{F.current.start(ze)})),ze.target===ze.currentTarget&&$()&&ze.key===" "&&ze.preventDefault(),S&&S(ze),ze.target===ze.currentTarget&&$()&&ze.key==="Enter"&&!c&&(ze.preventDefault(),x&&x(ze))}),he=va(ze=>{h&&ze.key===" "&&F.current&&Q&&!ze.defaultPrevented&&(z.current=!1,F.current.stop(ze,()=>{F.current.pulsate(ze)})),P&&P(ze),x&&ze.target===ze.currentTarget&&$()&&ze.key===" "&&!ze.defaultPrevented&&x(ze)});let pe=l;pe==="button"&&(H.href||H.to)&&(pe=m);const be={};pe==="button"?(be.type=X===void 0?"button":X,be.disabled=c):(!H.href&&!H.to&&(be.role="button"),c&&(be["aria-disabled"]=c));const Ge=_r(n,le,Z),Fe=W({},r,{centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:h,tabIndex:D,focusVisible:Q}),Ne=vK(Fe);return C.jsxs(yK,W({as:pe,className:st(Ne.root,a),ownerState:Fe,onBlur:Ee,onClick:x,onContextMenu:Ve,onFocus:De,onKeyDown:re,onKeyUp:he,onMouseDown:rt,onMouseLeave:ye,onMouseUp:j,onDragLeave:se,onTouchEnd:Re,onTouchMove:Pe,onTouchStart:xe,ref:Ge,tabIndex:c?-1:D,type:X},be,H,{children:[s,tt?C.jsx(hK,W({ref:Y,center:o},O)):null]}))});function xK(t){return Tt("MuiTypography",t)}Ct("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const bK=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],_K=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=t,a={root:["root",o,t.align!=="inherit"&&`align${bt(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Rt(a,xK,s)},wK=qe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${bt(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>W({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),n4={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},SK={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},MK=t=>SK[t]||t,sr=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTypography"}),i=MK(r.color),o=sg(W({},r,{color:i})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:f=!1,variant:h="body1",variantMapping:m=n4}=o,v=Qe(o,bK),x=W({},o,{align:s,color:i,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:f,variant:h,variantMapping:m}),y=l||(f?"p":m[h]||n4[h])||"span",g=_K(x);return C.jsx(wK,W({as:y,ref:n,ownerState:x,className:st(g.root,a)},v))});function EK(t){return Tt("MuiAppBar",t)}Ct("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const CK=["className","color","enableColorOnDark","position"],TK=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${bt(e)}`,`position${bt(n)}`]};return Rt(i,EK,r)},tv=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,RK=qe(gu,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${bt(n.position)}`],e[`color${bt(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return W({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&W({},e.color==="default"&&{backgroundColor:n,color:t.palette.getContrastText(n)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&W({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&W({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:tv(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:tv(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:tv(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:tv(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},!["inherit","transparent"].includes(e.color)&&{backgroundColor:"var(--AppBar-background)"},{color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),AK=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed"}=r,l=Qe(r,CK),c=W({},r,{color:o,position:a,enableColorOnDark:s}),u=TK(c);return C.jsx(RK,W({square:!0,component:"header",ownerState:c,elevation:4,className:st(u.root,i,a==="fixed"&&"mui-fixed"),ref:n},l))});function PK(t){return typeof t=="function"?t():t}const NK=A.forwardRef(function(e,n){const{children:r,container:i,disablePortal:o=!1}=e,[s,a]=A.useState(null),l=_r(A.isValidElement(r)?r.ref:null,n);if(ko(()=>{o||a(PK(i)||document.body)},[i,o]),ko(()=>{if(s&&!o)return $2(n,s),()=>{$2(n,null)}},[n,s,o]),o){if(A.isValidElement(r)){const c={ref:l};return A.cloneElement(r,c)}return C.jsx(A.Fragment,{children:r})}return C.jsx(A.Fragment,{children:s&&Bl.createPortal(r,s)})}),IK=["onChange","maxRows","minRows","style","value"];function nv(t){return parseInt(t,10)||0}const LK={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function kK(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const OK=A.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a}=e,l=Qe(e,IK),{current:c}=A.useRef(a!=null),u=A.useRef(null),f=_r(n,u),h=A.useRef(null),m=A.useRef(null),v=A.useCallback(()=>{const g=u.current,_=Aa(g).getComputedStyle(g);if(_.width==="0px")return{outerHeightStyle:0,overflowing:!1};const S=m.current;S.style.width=_.width,S.value=g.value||e.placeholder||"x",S.value.slice(-1)===` +`&&(S.value+=" ");const P=_.boxSizing,N=nv(_.paddingBottom)+nv(_.paddingTop),T=nv(_.borderBottomWidth)+nv(_.borderTopWidth),L=S.scrollHeight;S.value="x";const U=S.scrollHeight;let M=L;o&&(M=Math.max(Number(o)*U,M)),i&&(M=Math.min(Number(i)*U,M)),M=Math.max(M,U);const R=M+(P==="border-box"?N+T:0),D=Math.abs(M-L)<=1;return{outerHeightStyle:R,overflowing:D}},[i,o,e.placeholder]),x=A.useCallback(()=>{const g=v();if(kK(g))return;const b=g.outerHeightStyle,_=u.current;h.current!==b&&(h.current=b,_.style.height=`${b}px`),_.style.overflow=g.overflowing?"hidden":""},[v]);ko(()=>{const g=()=>{x()};let b;const _=Bb(g),S=u.current,P=Aa(S);P.addEventListener("resize",_);let N;return typeof ResizeObserver<"u"&&(N=new ResizeObserver(g),N.observe(S)),()=>{_.clear(),cancelAnimationFrame(b),P.removeEventListener("resize",_),N&&N.disconnect()}},[v,x]),ko(()=>{x()});const y=g=>{c||x(),r&&r(g)};return C.jsxs(A.Fragment,{children:[C.jsx("textarea",W({value:a,onChange:y,ref:f,rows:o,style:s},l)),C.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:m,tabIndex:-1,style:W({},LK.shadow,s,{paddingTop:0,paddingBottom:0})})]})});function Xd({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const ER=A.createContext(void 0);function yu(){return A.useContext(ER)}function l6(t){return C.jsx(CX,W({},t,{defaultTheme:_R,themeId:gd}))}function r4(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function M1(t,e=!1){return t&&(r4(t.value)&&t.value!==""||e&&r4(t.defaultValue)&&t.defaultValue!=="")}function DK(t){return t.startAdornment}function FK(t){return Tt("MuiInputBase",t)}const bd=Ct("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),zK=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],Wb=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${bt(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},Hb=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},UK=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:h,startAdornment:m,type:v}=t,x={root:["root",`color${bt(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",h&&h!=="medium"&&`size${bt(h)}`,u&&"multiline",m&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",v==="search"&&"inputTypeSearch",u&&"inputMultiline",h==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",m&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return Rt(x,FK,e)},Gb=qe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Wb})(({theme:t,ownerState:e})=>W({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${bd.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&W({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),Xb=qe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Hb})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=W({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),i={opacity:"0 !important"},o=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return W({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${bd.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${bd.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),BK=C.jsx(l6,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),CR=A.forwardRef(function(e,n){var r;const i=At({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:s,autoFocus:a,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:h,disableInjectingGlobalStyles:m,endAdornment:v,fullWidth:x=!1,id:y,inputComponent:g="input",inputProps:b={},inputRef:_,maxRows:S,minRows:P,multiline:N=!1,name:T,onBlur:L,onChange:U,onClick:M,onFocus:R,onKeyDown:D,onKeyUp:O,placeholder:B,readOnly:X,renderSuffix:H,rows:Z,slotProps:F={},slots:Y={},startAdornment:K,type:ee="text",value:me}=i,le=Qe(i,zK),Q=b.value!=null?b.value:me,{current:ae}=A.useRef(Q!=null),ge=A.useRef(),Me=A.useCallback(Ne=>{},[]),tt=_r(ge,_,b.ref,Me),[He,rt]=A.useState(!1),Ve=yu(),se=Xd({props:i,muiFormControl:Ve,states:["color","disabled","error","hiddenLabel","size","required","filled"]});se.focused=Ve?Ve.focused:He,A.useEffect(()=>{!Ve&&h&&He&&(rt(!1),L&&L())},[Ve,h,He,L]);const j=Ve&&Ve.onFilled,ye=Ve&&Ve.onEmpty,xe=A.useCallback(Ne=>{M1(Ne)?j&&j():ye&&ye()},[j,ye]);ko(()=>{ae&&xe({value:Q})},[Q,xe,ae]);const Re=Ne=>{if(se.disabled){Ne.stopPropagation();return}R&&R(Ne),b.onFocus&&b.onFocus(Ne),Ve&&Ve.onFocus?Ve.onFocus(Ne):rt(!0)},Pe=Ne=>{L&&L(Ne),b.onBlur&&b.onBlur(Ne),Ve&&Ve.onBlur?Ve.onBlur(Ne):rt(!1)},Ee=(Ne,...ze)=>{if(!ae){const Le=Ne.target||ge.current;if(Le==null)throw new Error(Ra(1));xe({value:Le.value})}b.onChange&&b.onChange(Ne,...ze),U&&U(Ne,...ze)};A.useEffect(()=>{xe(ge.current)},[]);const De=Ne=>{ge.current&&Ne.currentTarget===Ne.target&&ge.current.focus(),M&&M(Ne)};let $=g,z=b;N&&$==="input"&&(Z?z=W({type:void 0,minRows:Z,maxRows:Z},z):z=W({type:void 0,maxRows:S,minRows:P},z),$=OK);const re=Ne=>{xe(Ne.animationName==="mui-auto-fill-cancel"?ge.current:{value:"x"})};A.useEffect(()=>{Ve&&Ve.setAdornedStart(!!K)},[Ve,K]);const he=W({},i,{color:se.color||"primary",disabled:se.disabled,endAdornment:v,error:se.error,focused:se.focused,formControl:Ve,fullWidth:x,hiddenLabel:se.hiddenLabel,multiline:N,size:se.size,startAdornment:K,type:ee}),pe=UK(he),be=Y.root||c.Root||Gb,Ge=F.root||u.root||{},Fe=Y.input||c.Input||Xb;return z=W({},z,(r=F.input)!=null?r:u.input),C.jsxs(A.Fragment,{children:[!m&&BK,C.jsxs(be,W({},Ge,!xd(be)&&{ownerState:W({},he,Ge.ownerState)},{ref:n,onClick:De},le,{className:st(pe.root,Ge.className,l,X&&"MuiInputBase-readOnly"),children:[K,C.jsx(ER.Provider,{value:null,children:C.jsx(Fe,W({ownerState:he,"aria-invalid":se.error,"aria-describedby":o,autoComplete:s,autoFocus:a,defaultValue:f,disabled:se.disabled,id:y,onAnimationStart:re,name:T,placeholder:B,readOnly:X,required:se.required,rows:Z,value:Q,onKeyDown:D,onKeyUp:O,type:ee},z,!xd(Fe)&&{as:$,ownerState:W({},he,z.ownerState)},{ref:tt,className:st(pe.input,z.className,X&&"MuiInputBase-readOnly"),onBlur:Pe,onChange:Ee,onFocus:Re}))}),v,H?H(W({},se,{startAdornment:K})):null]}))]})});function jK(t){return Tt("MuiInput",t)}const Fh=W({},bd,Ct("MuiInput",["root","underline","input"]));function VK(t){return Tt("MuiOutlinedInput",t)}const Za=W({},bd,Ct("MuiOutlinedInput",["root","notchedOutline","input"]));function $K(t){return Tt("MuiFilledInput",t)}const nc=W({},bd,Ct("MuiFilledInput",["root","underline","input"])),WK=Gd(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),HK=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],GK={entering:{opacity:1},entered:{opacity:1}},XK=A.forwardRef(function(e,n){const r=mu(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:h,onExit:m,onExited:v,onExiting:x,style:y,timeout:g=i,TransitionComponent:b=Hs}=e,_=Qe(e,HK),S=A.useRef(null),P=_r(S,a.ref,n),N=B=>X=>{if(B){const H=S.current;X===void 0?B(H):B(H,X)}},T=N(h),L=N((B,X)=>{a6(B);const H=S1({style:y,timeout:g,easing:l},{mode:"enter"});B.style.webkitTransition=r.transitions.create("opacity",H),B.style.transition=r.transitions.create("opacity",H),u&&u(B,X)}),U=N(f),M=N(x),R=N(B=>{const X=S1({style:y,timeout:g,easing:l},{mode:"exit"});B.style.webkitTransition=r.transitions.create("opacity",X),B.style.transition=r.transitions.create("opacity",X),m&&m(B)}),D=N(v),O=B=>{o&&o(S.current,B)};return C.jsx(b,W({appear:s,in:c,nodeRef:S,onEnter:L,onEntered:U,onEntering:T,onExit:R,onExited:D,onExiting:M,addEndListener:O,timeout:g},_,{children:(B,X)=>A.cloneElement(a,W({style:W({opacity:0,visibility:B==="exited"&&!c?"hidden":void 0},GK[B],y,a.props.style),ref:P},X))}))});function qK(t){return Tt("MuiBackdrop",t)}Ct("MuiBackdrop",["root","invisible"]);const YK=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],KK=t=>{const{classes:e,invisible:n}=t;return Rt({root:["root",n&&"invisible"]},qK,e)},ZK=qe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>W({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})),JK=A.forwardRef(function(e,n){var r,i,o;const s=At({props:e,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:f={},invisible:h=!1,open:m,slotProps:v={},slots:x={},TransitionComponent:y=XK,transitionDuration:g}=s,b=Qe(s,YK),_=W({},s,{component:c,invisible:h}),S=KK(_),P=(r=v.root)!=null?r:f.root;return C.jsx(y,W({in:m,timeout:g},b,{children:C.jsx(ZK,W({"aria-hidden":!0},P,{as:(i=(o=x.root)!=null?o:u.Root)!=null?i:c,className:st(S.root,l,P==null?void 0:P.className),ownerState:W({},_,P==null?void 0:P.ownerState),classes:S,ref:n,children:a}))}))}),QK=Ct("MuiBox",["root"]),eZ=bR(),Bs=IX({themeId:gd,defaultTheme:eZ,defaultClassName:QK.root,generateClassName:Ez.generate});function tZ(t){return Tt("MuiButton",t)}const rv=Ct("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),nZ=A.createContext({}),rZ=A.createContext(void 0),iZ=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],oZ=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:s}=t,a={root:["root",o,`${o}${bt(e)}`,`size${bt(i)}`,`${o}Size${bt(i)}`,`color${bt(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${bt(i)}`],endIcon:["icon","endIcon",`iconSize${bt(i)}`]},l=Rt(a,tZ,s);return W({},s,l)},c6=t=>W({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),sZ=qe(vu,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${bt(n.color)}`],e[`size${bt(n.size)}`],e[`${n.variant}Size${bt(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var n,r;const i=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],o=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return W({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":W({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Rn(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Rn(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Rn(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":W({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${rv.focusVisible}`]:W({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${rv.disabled}`]:W({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${Rn(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(n=(r=t.palette).getContrastText)==null?void 0:n.call(r,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:i,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${rv.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${rv.disabled}`]:{boxShadow:"none"}}),aZ=qe("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${bt(n.size)}`]]}})(({ownerState:t})=>W({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},c6(t))),lZ=qe("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${bt(n.size)}`]]}})(({ownerState:t})=>W({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},c6(t))),ou=A.forwardRef(function(e,n){const r=A.useContext(nZ),i=A.useContext(rZ),o=pm(r,e),s=At({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:h=!1,disableFocusRipple:m=!1,endIcon:v,focusVisibleClassName:x,fullWidth:y=!1,size:g="medium",startIcon:b,type:_,variant:S="text"}=s,P=Qe(s,iZ),N=W({},s,{color:l,component:c,disabled:f,disableElevation:h,disableFocusRipple:m,fullWidth:y,size:g,type:_,variant:S}),T=oZ(N),L=b&&C.jsx(aZ,{className:T.startIcon,ownerState:N,children:b}),U=v&&C.jsx(lZ,{className:T.endIcon,ownerState:N,children:v}),M=i||"";return C.jsxs(sZ,W({ownerState:N,className:st(r.className,T.root,u,M),component:c,disabled:f,focusRipple:!m,focusVisibleClassName:st(T.focusVisible,x),ref:n,type:_},P,{classes:T,children:[L,a,U]}))});function cZ(t){return Tt("MuiCard",t)}Ct("MuiCard",["root"]);const uZ=["className","raised"],fZ=t=>{const{classes:e}=t;return Rt({root:["root"]},cZ,e)},dZ=qe(gu,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),hZ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,s=Qe(r,uZ),a=W({},r,{raised:o}),l=fZ(a);return C.jsx(dZ,W({className:st(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a},s))});function pZ(t){return Tt("MuiCardActions",t)}Ct("MuiCardActions",["root","spacing"]);const mZ=["disableSpacing","className"],gZ=t=>{const{classes:e,disableSpacing:n}=t;return Rt({root:["root",!n&&"spacing"]},pZ,e)},vZ=qe("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})(({ownerState:t})=>W({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),yZ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o}=r,s=Qe(r,mZ),a=W({},r,{disableSpacing:i}),l=gZ(a);return C.jsx(vZ,W({className:st(l.root,o),ownerState:a,ref:n},s))});function xZ(t){return Tt("MuiCardContent",t)}Ct("MuiCardContent",["root"]);const bZ=["className","component"],_Z=t=>{const{classes:e}=t;return Rt({root:["root"]},xZ,e)},wZ=qe("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),SZ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,s=Qe(r,bZ),a=W({},r,{component:o}),l=_Z(a);return C.jsx(wZ,W({as:o,className:st(l.root,i),ownerState:a,ref:n},s))});function MZ(t){return Tt("PrivateSwitchBase",t)}Ct("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const EZ=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],CZ=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${bt(i)}`],input:["input"]};return Rt(o,MZ,e)},TZ=qe(vu)(({ownerState:t})=>W({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),RZ=qe("input",{shouldForwardProp:pi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),AZ=A.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:s,defaultChecked:a,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:h,inputProps:m,inputRef:v,name:x,onBlur:y,onChange:g,onFocus:b,readOnly:_,required:S=!1,tabIndex:P,type:N,value:T}=e,L=Qe(e,EZ),[U,M]=W2({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),R=yu(),D=Y=>{b&&b(Y),R&&R.onFocus&&R.onFocus(Y)},O=Y=>{y&&y(Y),R&&R.onBlur&&R.onBlur(Y)},B=Y=>{if(Y.nativeEvent.defaultPrevented)return;const K=Y.target.checked;M(K),g&&g(Y,K)};let X=l;R&&typeof X>"u"&&(X=R.disabled);const H=N==="checkbox"||N==="radio",Z=W({},e,{checked:U,disabled:X,disableFocusRipple:c,edge:u}),F=CZ(Z);return C.jsxs(TZ,W({component:"span",className:st(F.root,s),centerRipple:!0,focusRipple:!c,disabled:X,tabIndex:null,role:void 0,onFocus:D,onBlur:O,ownerState:Z,ref:n},L,{children:[C.jsx(RZ,W({autoFocus:r,checked:i,defaultChecked:a,className:F.input,disabled:X,id:H?h:void 0,name:x,onChange:B,readOnly:_,ref:v,required:S,ownerState:Z,tabIndex:P,type:N},N==="checkbox"&&T===void 0?{}:{value:T},m)),U?o:f]}))}),PZ=Gd(C.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),NZ=Gd(C.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),IZ=Gd(C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function LZ(t){return Tt("MuiCheckbox",t)}const KS=Ct("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),kZ=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],OZ=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${bt(r)}`,`size${bt(i)}`]},s=Rt(o,LZ,e);return W({},e,s)},DZ=qe(AZ,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${bt(n.size)}`],n.color!=="default"&&e[`color${bt(n.color)}`]]}})(({theme:t,ownerState:e})=>W({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Rn(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${KS.checked}, &.${KS.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${KS.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),FZ=C.jsx(NZ,{}),zZ=C.jsx(PZ,{}),UZ=C.jsx(IZ,{}),BZ=A.forwardRef(function(e,n){var r,i;const o=At({props:e,name:"MuiCheckbox"}),{checkedIcon:s=FZ,color:a="primary",icon:l=zZ,indeterminate:c=!1,indeterminateIcon:u=UZ,inputProps:f,size:h="medium",className:m}=o,v=Qe(o,kZ),x=c?u:l,y=c?u:s,g=W({},o,{color:a,indeterminate:c,size:h}),b=OZ(g);return C.jsx(DZ,W({type:"checkbox",inputProps:W({"data-indeterminate":c},f),icon:A.cloneElement(x,{fontSize:(r=x.props.fontSize)!=null?r:h}),checkedIcon:A.cloneElement(y,{fontSize:(i=y.props.fontSize)!=null?i:h}),ownerState:g,ref:n,className:st(b.root,m)},v,{classes:b}))}),jZ=Aq({createStyledComponent:qe("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`maxWidth${bt(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),useThemeProps:t=>At({props:t,name:"MuiContainer"})}),VZ=(t,e)=>W({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),$Z=t=>W({color:(t.vars||t).palette.text.primary},t.typography.body1,{backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),WZ=(t,e=!1)=>{var n;const r={};e&&t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([s,a])=>{var l;r[t.getColorSchemeSelector(s).replace(/\s*&/,"")]={colorScheme:(l=a.palette)==null?void 0:l.mode}});let i=W({html:VZ(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:W({margin:0},$Z(t),{"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}})},r);const o=(n=t.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return o&&(i=[i,o]),i};function HZ(t){const e=At({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return C.jsxs(A.Fragment,{children:[C.jsx(l6,{styles:i=>WZ(i,r)}),n]})}function GZ(t){const e=Li(t);return e.body===t?Aa(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Tp(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function i4(t){return parseInt(Aa(t).getComputedStyle(t).paddingRight,10)||0}function XZ(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function o4(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,s=>{const a=o.indexOf(s)===-1,l=!XZ(s);a&&l&&Tp(s,i)})}function ZS(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function qZ(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(GZ(r)){const s=Vz(Li(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${i4(r)+s}px`;const a=Li(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${i4(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=Li(r).body;else{const s=r.parentElement,a=Aa(r);o=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function YZ(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class KZ{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&Tp(e.modalRef,!1);const i=YZ(n);o4(n,e.mount,e.modalRef,i,!0);const o=ZS(this.containers,s=>s.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=ZS(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=qZ(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=ZS(this.containers,s=>s.modals.indexOf(e)!==-1),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&Tp(e.modalRef,n),o4(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&Tp(s.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}const ZZ=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function JZ(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function QZ(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function eJ(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||QZ(t))}function tJ(t){const e=[],n=[];return Array.from(t.querySelectorAll(ZZ)).forEach((r,i)=>{const o=JZ(r);o===-1||!eJ(r)||(o===0?e.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function nJ(){return!0}function rJ(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=tJ,isEnabled:s=nJ,open:a}=t,l=A.useRef(!1),c=A.useRef(null),u=A.useRef(null),f=A.useRef(null),h=A.useRef(null),m=A.useRef(!1),v=A.useRef(null),x=_r(e.ref,v),y=A.useRef(null);A.useEffect(()=>{!a||!v.current||(m.current=!n)},[n,a]),A.useEffect(()=>{if(!a||!v.current)return;const _=Li(v.current);return v.current.contains(_.activeElement)||(v.current.hasAttribute("tabIndex")||v.current.setAttribute("tabIndex","-1"),m.current&&v.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),A.useEffect(()=>{if(!a||!v.current)return;const _=Li(v.current),S=T=>{y.current=T,!(r||!s()||T.key!=="Tab")&&_.activeElement===v.current&&T.shiftKey&&(l.current=!0,u.current&&u.current.focus())},P=()=>{const T=v.current;if(T===null)return;if(!_.hasFocus()||!s()||l.current){l.current=!1;return}if(T.contains(_.activeElement)||r&&_.activeElement!==c.current&&_.activeElement!==u.current)return;if(_.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!m.current)return;let L=[];if((_.activeElement===c.current||_.activeElement===u.current)&&(L=o(v.current)),L.length>0){var U,M;const R=!!((U=y.current)!=null&&U.shiftKey&&((M=y.current)==null?void 0:M.key)==="Tab"),D=L[0],O=L[L.length-1];typeof D!="string"&&typeof O!="string"&&(R?O.focus():D.focus())}else T.focus()};_.addEventListener("focusin",P),_.addEventListener("keydown",S,!0);const N=setInterval(()=>{_.activeElement&&_.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(N),_.removeEventListener("focusin",P),_.removeEventListener("keydown",S,!0)}},[n,r,i,s,a,o]);const g=_=>{f.current===null&&(f.current=_.relatedTarget),m.current=!0,h.current=_.target;const S=e.props.onFocus;S&&S(_)},b=_=>{f.current===null&&(f.current=_.relatedTarget),m.current=!0};return C.jsxs(A.Fragment,{children:[C.jsx("div",{tabIndex:a?0:-1,onFocus:b,ref:c,"data-testid":"sentinelStart"}),A.cloneElement(e,{ref:x,onFocus:g}),C.jsx("div",{tabIndex:a?0:-1,onFocus:b,ref:u,"data-testid":"sentinelEnd"})]})}function iJ(t){return typeof t=="function"?t():t}function oJ(t){return t?t.props.hasOwnProperty("in"):!1}const sJ=new KZ;function aJ(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=sJ,closeAfterTransition:o=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:f}=t,h=A.useRef({}),m=A.useRef(null),v=A.useRef(null),x=_r(v,f),[y,g]=A.useState(!u),b=oJ(l);let _=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(_=!1);const S=()=>Li(m.current),P=()=>(h.current.modalRef=v.current,h.current.mount=m.current,h.current),N=()=>{i.mount(P(),{disableScrollLock:r}),v.current&&(v.current.scrollTop=0)},T=va(()=>{const H=iJ(e)||S().body;i.add(P(),H),v.current&&N()}),L=A.useCallback(()=>i.isTopModal(P()),[i]),U=va(H=>{m.current=H,H&&(u&&L()?N():v.current&&Tp(v.current,_))}),M=A.useCallback(()=>{i.remove(P(),_)},[_,i]);A.useEffect(()=>()=>{M()},[M]),A.useEffect(()=>{u?T():(!b||!o)&&M()},[u,M,b,o,T]);const R=H=>Z=>{var F;(F=H.onKeyDown)==null||F.call(H,Z),!(Z.key!=="Escape"||Z.which===229||!L())&&(n||(Z.stopPropagation(),c&&c(Z,"escapeKeyDown")))},D=H=>Z=>{var F;(F=H.onClick)==null||F.call(H,Z),Z.target===Z.currentTarget&&c&&c(Z,"backdropClick")};return{getRootProps:(H={})=>{const Z=Wz(t);delete Z.onTransitionEnter,delete Z.onTransitionExited;const F=W({},Z,H);return W({role:"presentation"},F,{onKeyDown:R(F),ref:x})},getBackdropProps:(H={})=>{const Z=H;return W({"aria-hidden":!0},Z,{onClick:D(Z),open:u})},getTransitionProps:()=>{const H=()=>{g(!1),s&&s()},Z=()=>{g(!0),a&&a(),o&&M()};return{onEnter:kI(H,l==null?void 0:l.props.onEnter),onExited:kI(Z,l==null?void 0:l.props.onExited)}},rootRef:x,portalRef:U,isTopModal:L,exited:y,hasTransition:b}}function lJ(t){return Tt("MuiModal",t)}Ct("MuiModal",["root","hidden","backdrop"]);const cJ=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],uJ=t=>{const{open:e,exited:n,classes:r}=t;return Rt({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},lJ,r)},fJ=qe("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(({theme:t,ownerState:e})=>W({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),dJ=qe(JK,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),hJ=A.forwardRef(function(e,n){var r,i,o,s,a,l;const c=At({name:"MuiModal",props:e}),{BackdropComponent:u=dJ,BackdropProps:f,className:h,closeAfterTransition:m=!1,children:v,container:x,component:y,components:g={},componentsProps:b={},disableAutoFocus:_=!1,disableEnforceFocus:S=!1,disableEscapeKeyDown:P=!1,disablePortal:N=!1,disableRestoreFocus:T=!1,disableScrollLock:L=!1,hideBackdrop:U=!1,keepMounted:M=!1,onBackdropClick:R,open:D,slotProps:O,slots:B}=c,X=Qe(c,cJ),H=W({},c,{closeAfterTransition:m,disableAutoFocus:_,disableEnforceFocus:S,disableEscapeKeyDown:P,disablePortal:N,disableRestoreFocus:T,disableScrollLock:L,hideBackdrop:U,keepMounted:M}),{getRootProps:Z,getBackdropProps:F,getTransitionProps:Y,portalRef:K,isTopModal:ee,exited:me,hasTransition:le}=aJ(W({},H,{rootRef:n})),Q=W({},H,{exited:me}),ae=uJ(Q),ge={};if(v.props.tabIndex===void 0&&(ge.tabIndex="-1"),le){const{onEnter:j,onExited:ye}=Y();ge.onEnter=j,ge.onExited=ye}const Me=(r=(i=B==null?void 0:B.root)!=null?i:g.Root)!=null?r:fJ,tt=(o=(s=B==null?void 0:B.backdrop)!=null?s:g.Backdrop)!=null?o:u,He=(a=O==null?void 0:O.root)!=null?a:b.root,rt=(l=O==null?void 0:O.backdrop)!=null?l:b.backdrop,Ve=Us({elementType:Me,externalSlotProps:He,externalForwardedProps:X,getSlotProps:Z,additionalProps:{ref:n,as:y},ownerState:Q,className:st(h,He==null?void 0:He.className,ae==null?void 0:ae.root,!Q.open&&Q.exited&&(ae==null?void 0:ae.hidden))}),se=Us({elementType:tt,externalSlotProps:rt,additionalProps:f,getSlotProps:j=>F(W({},j,{onClick:ye=>{R&&R(ye),j!=null&&j.onClick&&j.onClick(ye)}})),className:st(rt==null?void 0:rt.className,f==null?void 0:f.className,ae==null?void 0:ae.backdrop),ownerState:Q});return!M&&!D&&(!le||me)?null:C.jsx(NK,{ref:K,container:x,disablePortal:N,children:C.jsxs(Me,W({},Ve,{children:[!U&&u?C.jsx(tt,W({},se)):null,C.jsx(rJ,{disableEnforceFocus:S,disableAutoFocus:_,disableRestoreFocus:T,isEnabled:ee,open:D,children:A.cloneElement(v,ge)})]}))})}),s4=Ct("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),pJ=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],mJ=t=>{const{classes:e,disableUnderline:n}=t,i=Rt({root:["root",!n&&"underline"],input:["input"]},$K,e);return W({},e,i)},gJ=qe(Gb,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...Wb(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var n;const r=t.palette.mode==="light",i=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return W({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${nc.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${nc.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:a}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(t.vars||t).palette[e.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${nc.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${nc.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${nc.disabled}, .${nc.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${nc.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&W({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),vJ=qe(Xb,{name:"MuiFilledInput",slot:"Input",overridesResolver:Hb})(({theme:t,ownerState:e})=>W({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),TR=A.forwardRef(function(e,n){var r,i,o,s;const a=At({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:f="input",multiline:h=!1,slotProps:m,slots:v={},type:x="text"}=a,y=Qe(a,pJ),g=W({},a,{fullWidth:u,inputComponent:f,multiline:h,type:x}),b=mJ(a),_={root:{ownerState:g},input:{ownerState:g}},S=m??c?ui(_,m??c):_,P=(r=(i=v.root)!=null?i:l.Root)!=null?r:gJ,N=(o=(s=v.input)!=null?s:l.Input)!=null?o:vJ;return C.jsx(CR,W({slots:{root:P,input:N},componentsProps:S,fullWidth:u,inputComponent:f,multiline:h,ref:n,type:x},y,{classes:b}))});TR.muiName="Input";function yJ(t){return Tt("MuiFormControl",t)}Ct("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const xJ=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],bJ=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${bt(n)}`,r&&"fullWidth"]};return Rt(i,yJ,e)},_J=qe("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>W({},e.root,e[`margin${bt(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>W({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),u6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:h=!1,margin:m="none",required:v=!1,size:x="medium",variant:y="outlined"}=r,g=Qe(r,xJ),b=W({},r,{color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:h,margin:m,required:v,size:x,variant:y}),_=bJ(b),[S,P]=A.useState(()=>{let O=!1;return i&&A.Children.forEach(i,B=>{if(!Iy(B,["Input","Select"]))return;const X=Iy(B,["Select"])?B.props.input:B;X&&DK(X.props)&&(O=!0)}),O}),[N,T]=A.useState(()=>{let O=!1;return i&&A.Children.forEach(i,B=>{Iy(B,["Input","Select"])&&(M1(B.props,!0)||M1(B.props.inputProps,!0))&&(O=!0)}),O}),[L,U]=A.useState(!1);l&&L&&U(!1);const M=u!==void 0&&!l?u:L;let R;const D=A.useMemo(()=>({adornedStart:S,setAdornedStart:P,color:s,disabled:l,error:c,filled:N,focused:M,fullWidth:f,hiddenLabel:h,size:x,onBlur:()=>{U(!1)},onEmpty:()=>{T(!1)},onFilled:()=>{T(!0)},onFocus:()=>{U(!0)},registerEffect:R,required:v,variant:y}),[S,s,l,c,N,M,f,h,R,v,x,y]);return C.jsx(ER.Provider,{value:D,children:C.jsx(_J,W({as:a,ownerState:b,className:st(_.root,o),ref:n},g,{children:i}))})}),rs=Fq({createStyledComponent:qe("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>At({props:t,name:"MuiStack"})});function wJ(t){return Tt("MuiFormHelperText",t)}const a4=Ct("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var l4;const SJ=["children","className","component","disabled","error","filled","focused","margin","required","variant"],MJ=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${bt(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Rt(c,wJ,e)},EJ=qe("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${bt(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>W({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${a4.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${a4.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),CJ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p"}=r,a=Qe(r,SJ),l=yu(),c=Xd({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=W({},r,{component:s,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=MJ(u);return C.jsx(EJ,W({as:s,ownerState:u,className:st(f.root,o),ref:n},a,{children:i===" "?l4||(l4=C.jsx("span",{className:"notranslate",children:"​"})):i}))});function TJ(t){return Tt("MuiFormLabel",t)}const Rp=Ct("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),RJ=["children","className","color","component","disabled","error","filled","focused","required"],AJ=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=t,l={root:["root",`color${bt(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return Rt(l,TJ,e)},PJ=qe("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>W({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>W({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Rp.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Rp.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Rp.error}`]:{color:(t.vars||t).palette.error.main}})),NJ=qe("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Rp.error}`]:{color:(t.vars||t).palette.error.main}})),IJ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:s="label"}=r,a=Qe(r,RJ),l=yu(),c=Xd({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=W({},r,{color:c.color||"primary",component:s,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=AJ(u);return C.jsxs(PJ,W({as:s,ownerState:u,className:st(f.root,o),ref:n},a,{children:[i,c.required&&C.jsxs(NJ,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),c4=A.createContext();function LJ(t){return Tt("MuiGrid",t)}const kJ=[0,1,2,3,4,5,6,7,8,9,10],OJ=["column-reverse","column","row-reverse","row"],DJ=["nowrap","wrap-reverse","wrap"],zh=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],mm=Ct("MuiGrid",["root","container","item","zeroMinWidth",...kJ.map(t=>`spacing-xs-${t}`),...OJ.map(t=>`direction-xs-${t}`),...DJ.map(t=>`wrap-xs-${t}`),...zh.map(t=>`grid-xs-${t}`),...zh.map(t=>`grid-sm-${t}`),...zh.map(t=>`grid-md-${t}`),...zh.map(t=>`grid-lg-${t}`),...zh.map(t=>`grid-xl-${t}`)]),FJ=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function id(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function zJ({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=Uc({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${id(u)})`;c={flexBasis:f,maxWidth:f}}}o=W({flexBasis:l,flexGrow:0,maxWidth:l},c)}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function UJ({theme:t,ownerState:e}){const n=Uc({values:e.direction,breakpoints:t.breakpoints.values});return Di({theme:t},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${mm.item}`]={maxWidth:"none"}),i})}function f6({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function BJ({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=Uc({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=f6({breakpoints:t.breakpoints.values,values:o})),i=Di({theme:t},o,(a,l)=>{var c;const u=t.spacing(a);return u!=="0px"?{marginTop:`-${id(u)}`,[`& > .${mm.item}`]:{paddingTop:id(u)}}:(c=s)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${mm.item}`]:{paddingTop:0}}})}return i}function jJ({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=Uc({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=f6({breakpoints:t.breakpoints.values,values:o})),i=Di({theme:t},o,(a,l)=>{var c;const u=t.spacing(a);return u!=="0px"?{width:`calc(100% + ${id(u)})`,marginLeft:`-${id(u)}`,[`& > .${mm.item}`]:{paddingLeft:id(u)}}:(c=s)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${mm.item}`]:{paddingLeft:0}}})}return i}function VJ(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const $J=qe("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=VJ(s,c,e));const f=[];return c.forEach(h=>{const m=n[h];m&&f.push(e[`grid-${h}-${String(m)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...u,i!=="row"&&e[`direction-xs-${String(i)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...f]}})(({ownerState:t})=>W({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),UJ,BJ,jJ,zJ);function WJ(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const HJ=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let c=[];n&&(c=WJ(o,l));const u=[];l.forEach(h=>{const m=t[h];m&&u.push(`grid-${h}-${String(m)}`)});const f={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return Rt(f,LJ,e)},_a=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiGrid"}),{breakpoints:i}=mu(),o=sg(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:h=!1,rowSpacing:m,spacing:v=0,wrap:x="wrap",zeroMinWidth:y=!1}=o,g=Qe(o,FJ),b=m||v,_=l||v,S=A.useContext(c4),P=u?a||12:S,N={},T=W({},g);i.keys.forEach(M=>{g[M]!=null&&(N[M]=g[M],delete T[M])});const L=W({},o,{columns:P,container:u,direction:f,item:h,rowSpacing:b,columnSpacing:_,wrap:x,zeroMinWidth:y,spacing:v},N,{breakpoints:i.keys}),U=HJ(L);return C.jsx(c4.Provider,{value:P,children:C.jsx($J,W({ownerState:L,className:st(U.root,s),as:c,ref:n},T))})}),GJ=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function K2(t){return`scale(${t}, ${t**2})`}const XJ={entering:{opacity:1,transform:K2(1)},entered:{opacity:1,transform:"none"}},JS=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),d6=A.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:h,onExiting:m,style:v,timeout:x="auto",TransitionComponent:y=Hs}=e,g=Qe(e,GJ),b=Bz(),_=A.useRef(),S=mu(),P=A.useRef(null),N=_r(P,o.ref,n),T=X=>H=>{if(X){const Z=P.current;H===void 0?X(Z):X(Z,H)}},L=T(u),U=T((X,H)=>{a6(X);const{duration:Z,delay:F,easing:Y}=S1({style:v,timeout:x,easing:s},{mode:"enter"});let K;x==="auto"?(K=S.transitions.getAutoHeightDuration(X.clientHeight),_.current=K):K=Z,X.style.transition=[S.transitions.create("opacity",{duration:K,delay:F}),S.transitions.create("transform",{duration:JS?K:K*.666,delay:F,easing:Y})].join(","),l&&l(X,H)}),M=T(c),R=T(m),D=T(X=>{const{duration:H,delay:Z,easing:F}=S1({style:v,timeout:x,easing:s},{mode:"exit"});let Y;x==="auto"?(Y=S.transitions.getAutoHeightDuration(X.clientHeight),_.current=Y):Y=H,X.style.transition=[S.transitions.create("opacity",{duration:Y,delay:Z}),S.transitions.create("transform",{duration:JS?Y:Y*.666,delay:JS?Z:Z||Y*.333,easing:F})].join(","),X.style.opacity=0,X.style.transform=K2(.75),f&&f(X)}),O=T(h),B=X=>{x==="auto"&&b.start(_.current||0,X),r&&r(P.current,X)};return C.jsx(y,W({appear:i,in:a,nodeRef:P,onEnter:U,onEntered:M,onEntering:L,onExit:D,onExited:O,onExiting:R,addEndListener:B,timeout:x==="auto"?null:x},g,{children:(X,H)=>A.cloneElement(o,W({style:W({opacity:0,transform:K2(.75),visibility:X==="exited"&&!a?"hidden":void 0},XJ[X],v,o.props.style),ref:N},H))}))});d6.muiSupportAuto=!0;const qJ=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],YJ=t=>{const{classes:e,disableUnderline:n}=t,i=Rt({root:["root",!n&&"underline"],input:["input"]},jK,e);return W({},e,i)},KJ=qe(Gb,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...Wb(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),W({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Fh.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Fh.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Fh.disabled}, .${Fh.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Fh.disabled}:before`]:{borderBottomStyle:"dotted"}})}),ZJ=qe(Xb,{name:"MuiInput",slot:"Input",overridesResolver:Hb})({}),RR=A.forwardRef(function(e,n){var r,i,o,s;const a=At({props:e,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:f=!1,inputComponent:h="input",multiline:m=!1,slotProps:v,slots:x={},type:y="text"}=a,g=Qe(a,qJ),b=YJ(a),S={root:{ownerState:{disableUnderline:l}}},P=v??u?ui(v??u,S):S,N=(r=(i=x.root)!=null?i:c.Root)!=null?r:KJ,T=(o=(s=x.input)!=null?s:c.Input)!=null?o:ZJ;return C.jsx(CR,W({slots:{root:N,input:T},slotProps:P,fullWidth:f,inputComponent:h,multiline:m,ref:n,type:y},g,{classes:b}))});RR.muiName="Input";function JJ(t){return Tt("MuiInputLabel",t)}Ct("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const QJ=["disableAnimation","margin","shrink","variant","className"],eQ=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${bt(r)}`,s],asterisk:[a&&"asterisk"]},c=Rt(l,JJ,e);return W({},e,c)},tQ=qe(IJ,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Rp.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(({theme:t,ownerState:e})=>W({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&W({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&W({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&W({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),h6=A.forwardRef(function(e,n){const r=At({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:s}=r,a=Qe(r,QJ),l=yu();let c=o;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=Xd({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=W({},r,{disableAnimation:i,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),h=eQ(f);return C.jsx(tQ,W({"data-shrink":c,ownerState:f,ref:n,className:st(h.root,s)},a,{classes:h}))});function nQ(t){return Tt("MuiLink",t)}const rQ=Ct("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),p6={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},iQ=t=>p6[t]||t,oQ=({theme:t,ownerState:e})=>{const n=iQ(e.color),r=yd(t,`palette.${n}`,!1)||e.color,i=yd(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:Rn(r,.4)},sQ=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],aQ=t=>{const{classes:e,component:n,focusVisible:r,underline:i}=t,o={root:["root",`underline${bt(i)}`,n==="button"&&"button",r&&"focusVisible"]};return Rt(o,nQ,e)},lQ=qe(sr,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${bt(n.underline)}`],n.component==="button"&&e.button]}})(({theme:t,ownerState:e})=>W({},e.underline==="none"&&{textDecoration:"none"},e.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},e.underline==="always"&&W({textDecoration:"underline"},e.color!=="inherit"&&{textDecorationColor:oQ({theme:t,ownerState:e})},{"&:hover":{textDecorationColor:"inherit"}}),e.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${rQ.focusVisible}`]:{outline:"auto"}})),u4=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiLink"}),{className:i,color:o="primary",component:s="a",onBlur:a,onFocus:l,TypographyClasses:c,underline:u="always",variant:f="inherit",sx:h}=r,m=Qe(r,sQ),{isFocusVisibleRef:v,onBlur:x,onFocus:y,ref:g}=jz(),[b,_]=A.useState(!1),S=_r(n,g),P=U=>{x(U),v.current===!1&&_(!1),a&&a(U)},N=U=>{y(U),v.current===!0&&_(!0),l&&l(U)},T=W({},r,{color:o,component:s,focusVisible:b,underline:u,variant:f}),L=aQ(T);return C.jsx(lQ,W({color:o,className:st(L.root,i),classes:c,component:s,onBlur:P,onFocus:N,ref:S,ownerState:T,variant:f,sx:[...Object.keys(p6).includes(o)?[]:[{color:o}],...Array.isArray(h)?h:[h]]},m))}),ks=A.createContext({});function cQ(t){return Tt("MuiList",t)}Ct("MuiList",["root","padding","dense","subheader"]);const uQ=["children","className","component","dense","disablePadding","subheader"],fQ=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Rt({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},cQ,e)},dQ=qe("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})(({ownerState:t})=>W({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),m6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=r,u=Qe(r,uQ),f=A.useMemo(()=>({dense:a}),[a]),h=W({},r,{component:s,dense:a,disablePadding:l}),m=fQ(h);return C.jsx(ks.Provider,{value:f,children:C.jsxs(dQ,W({as:s,className:st(m.root,o),ref:n,ownerState:h},u,{children:[c,i]}))})});function hQ(t){return Tt("MuiListItem",t)}const Sf=Ct("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);function pQ(t){return Tt("MuiListItemButton",t)}const Mf=Ct("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),mQ=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],gQ=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},vQ=t=>{const{alignItems:e,classes:n,dense:r,disabled:i,disableGutters:o,divider:s,selected:a}=t,c=Rt({root:["root",r&&"dense",!o&&"gutters",s&&"divider",i&&"disabled",e==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},pQ,n);return W({},n,c)},yQ=qe(vu,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:gQ})(({theme:t,ownerState:e})=>W({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Mf.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Mf.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Mf.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Mf.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Mf.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.alignItems==="flex-start"&&{alignItems:"flex-start"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.dense&&{paddingTop:4,paddingBottom:4})),xQ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:s="div",children:a,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:h=!1,className:m}=r,v=Qe(r,mQ),x=A.useContext(ks),y=A.useMemo(()=>({dense:l||x.dense||!1,alignItems:i,disableGutters:c}),[i,x.dense,l,c]),g=A.useRef(null);ko(()=>{o&&g.current&&g.current.focus()},[o]);const b=W({},r,{alignItems:i,dense:y.dense,disableGutters:c,divider:u,selected:h}),_=vQ(b),S=_r(g,n);return C.jsx(ks.Provider,{value:y,children:C.jsx(yQ,W({ref:S,href:v.href||v.to,component:(v.href||v.to)&&s==="div"?"button":s,focusVisibleClassName:st(_.focusVisible,f),ownerState:b,className:st(_.root,m)},v,{classes:_,children:a}))})});function bQ(t){return Tt("MuiListItemSecondaryAction",t)}Ct("MuiListItemSecondaryAction",["root","disableGutters"]);const _Q=["className"],wQ=t=>{const{disableGutters:e,classes:n}=t;return Rt({root:["root",e&&"disableGutters"]},bQ,n)},SQ=qe("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})(({ownerState:t})=>W({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),g6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,o=Qe(r,_Q),s=A.useContext(ks),a=W({},r,{disableGutters:s.disableGutters}),l=wQ(a);return C.jsx(SQ,W({className:st(l.root,i),ownerState:a,ref:n},o))});g6.muiName="ListItemSecondaryAction";const MQ=["className"],EQ=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],CQ=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.button&&e.button,n.hasSecondaryAction&&e.secondaryAction]},TQ=t=>{const{alignItems:e,button:n,classes:r,dense:i,disabled:o,disableGutters:s,disablePadding:a,divider:l,hasSecondaryAction:c,selected:u}=t;return Rt({root:["root",i&&"dense",!s&&"gutters",!a&&"padding",l&&"divider",o&&"disabled",n&&"button",e==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",u&&"selected"],container:["container"]},hQ,r)},RQ=qe("div",{name:"MuiListItem",slot:"Root",overridesResolver:CQ})(({theme:t,ownerState:e})=>W({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&W({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${Mf.root}`]:{paddingRight:48}},{[`&.${Sf.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Sf.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Sf.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Sf.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.alignItems==="flex-start"&&{alignItems:"flex-start"},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Sf.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),AQ=qe("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),PQ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiListItem"}),{alignItems:i="center",autoFocus:o=!1,button:s=!1,children:a,className:l,component:c,components:u={},componentsProps:f={},ContainerComponent:h="li",ContainerProps:{className:m}={},dense:v=!1,disabled:x=!1,disableGutters:y=!1,disablePadding:g=!1,divider:b=!1,focusVisibleClassName:_,secondaryAction:S,selected:P=!1,slotProps:N={},slots:T={}}=r,L=Qe(r.ContainerProps,MQ),U=Qe(r,EQ),M=A.useContext(ks),R=A.useMemo(()=>({dense:v||M.dense||!1,alignItems:i,disableGutters:y}),[i,M.dense,v,y]),D=A.useRef(null);ko(()=>{o&&D.current&&D.current.focus()},[o]);const O=A.Children.toArray(a),B=O.length&&Iy(O[O.length-1],["ListItemSecondaryAction"]),X=W({},r,{alignItems:i,autoFocus:o,button:s,dense:R.dense,disabled:x,disableGutters:y,disablePadding:g,divider:b,hasSecondaryAction:B,selected:P}),H=TQ(X),Z=_r(D,n),F=T.root||u.Root||RQ,Y=N.root||f.root||{},K=W({className:st(H.root,Y.className,l),disabled:x},U);let ee=c||"li";return s&&(K.component=c||"div",K.focusVisibleClassName=st(Sf.focusVisible,_),ee=vu),B?(ee=!K.component&&!c?"div":ee,h==="li"&&(ee==="li"?ee="div":K.component==="li"&&(K.component="div")),C.jsx(ks.Provider,{value:R,children:C.jsxs(AQ,W({as:h,className:st(H.container,m),ref:Z,ownerState:X},L,{children:[C.jsx(F,W({},Y,!xd(F)&&{as:ee,ownerState:W({},X,Y.ownerState)},K,{children:O})),O.pop()]}))})):C.jsx(ks.Provider,{value:R,children:C.jsxs(F,W({},Y,{as:ee,ref:Z},!xd(F)&&{ownerState:W({},X,Y.ownerState)},K,{children:[O,S&&C.jsx(g6,{children:S})]}))})}),f4=Ct("MuiListItemIcon",["root","alignItemsFlexStart"]);function NQ(t){return Tt("MuiListItemText",t)}const E1=Ct("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),IQ=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],LQ=t=>{const{classes:e,inset:n,primary:r,secondary:i,dense:o}=t;return Rt({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},NQ,e)},kQ=qe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${E1.primary}`]:e.primary},{[`& .${E1.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})(({ownerState:t})=>W({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},t.primary&&t.secondary&&{marginTop:6,marginBottom:6},t.inset&&{paddingLeft:56})),OQ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiListItemText"}),{children:i,className:o,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f}=r,h=Qe(r,IQ),{dense:m}=A.useContext(ks);let v=l??i,x=u;const y=W({},r,{disableTypography:s,inset:a,primary:!!v,secondary:!!x,dense:m}),g=LQ(y);return v!=null&&v.type!==sr&&!s&&(v=C.jsx(sr,W({variant:m?"body2":"body1",className:g.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:v}))),x!=null&&x.type!==sr&&!s&&(x=C.jsx(sr,W({variant:"body2",className:g.secondary,color:"text.secondary",display:"block"},f,{children:x}))),C.jsxs(kQ,W({className:st(g.root,o),ownerState:y,ref:n},h,{children:[v,x]}))}),DQ=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function QS(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function d4(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function v6(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.indexOf(e.keys.join(""))===0}function Uh(t,e,n,r,i,o){let s=!1,a=i(t,e,e?n:!1);for(;a;){if(a===t.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!v6(a,o)||l)a=i(t,a,n);else return a.focus(),!0}return!1}const FQ=A.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu"}=e,h=Qe(e,DQ),m=A.useRef(null),v=A.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});ko(()=>{i&&m.current.focus()},[i]),A.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(_,{direction:S})=>{const P=!m.current.style.width;if(_.clientHeight{const S=m.current,P=_.key,N=Li(S).activeElement;if(P==="ArrowDown")_.preventDefault(),Uh(S,N,c,l,QS);else if(P==="ArrowUp")_.preventDefault(),Uh(S,N,c,l,d4);else if(P==="Home")_.preventDefault(),Uh(S,null,c,l,QS);else if(P==="End")_.preventDefault(),Uh(S,null,c,l,d4);else if(P.length===1){const T=v.current,L=P.toLowerCase(),U=performance.now();T.keys.length>0&&(U-T.lastTime>500?(T.keys=[],T.repeating=!0,T.previousKeyMatched=!0):T.repeating&&L!==T.keys[0]&&(T.repeating=!1)),T.lastTime=U,T.keys.push(L);const M=N&&!T.repeating&&v6(N,T);T.previousKeyMatched&&(M||Uh(S,N,!1,l,QS,T))?_.preventDefault():T.previousKeyMatched=!1}u&&u(_)},y=_r(m,n);let g=-1;A.Children.forEach(s,(_,S)=>{if(!A.isValidElement(_)){g===S&&(g+=1,g>=s.length&&(g=-1));return}_.props.disabled||(f==="selectedMenu"&&_.props.selected||g===-1)&&(g=S),g===S&&(_.props.disabled||_.props.muiSkipListHighlight||_.type.muiSkipListHighlight)&&(g+=1,g>=s.length&&(g=-1))});const b=A.Children.map(s,(_,S)=>{if(S===g){const P={};return o&&(P.autoFocus=!0),_.props.tabIndex===void 0&&f==="selectedMenu"&&(P.tabIndex=0),A.cloneElement(_,P)}return _});return C.jsx(m6,W({role:"menu",ref:y,className:a,onKeyDown:x,tabIndex:i?0:-1},h,{children:b}))});function zQ(t){return Tt("MuiPopover",t)}Ct("MuiPopover",["root","paper"]);const UQ=["onEntering"],BQ=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],jQ=["slotProps"];function h4(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function p4(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function m4(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function eM(t){return typeof t=="function"?t():t}const VQ=t=>{const{classes:e}=t;return Rt({root:["root"],paper:["paper"]},zQ,e)},$Q=qe(hJ,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),y6=qe(gu,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),x6=A.forwardRef(function(e,n){var r,i,o;const s=At({props:e,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:f="anchorEl",children:h,className:m,container:v,elevation:x=8,marginThreshold:y=16,open:g,PaperProps:b={},slots:_,slotProps:S,transformOrigin:P={vertical:"top",horizontal:"left"},TransitionComponent:N=d6,transitionDuration:T="auto",TransitionProps:{onEntering:L}={},disableScrollLock:U=!1}=s,M=Qe(s.TransitionProps,UQ),R=Qe(s,BQ),D=(r=S==null?void 0:S.paper)!=null?r:b,O=A.useRef(),B=_r(O,D.ref),X=W({},s,{anchorOrigin:c,anchorReference:f,elevation:x,marginThreshold:y,externalPaperSlotProps:D,transformOrigin:P,TransitionComponent:N,transitionDuration:T,TransitionProps:M}),H=VQ(X),Z=A.useCallback(()=>{if(f==="anchorPosition")return u;const j=eM(l),xe=(j&&j.nodeType===1?j:Li(O.current).body).getBoundingClientRect();return{top:xe.top+h4(xe,c.vertical),left:xe.left+p4(xe,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),F=A.useCallback(j=>({vertical:h4(j,P.vertical),horizontal:p4(j,P.horizontal)}),[P.horizontal,P.vertical]),Y=A.useCallback(j=>{const ye={width:j.offsetWidth,height:j.offsetHeight},xe=F(ye);if(f==="none")return{top:null,left:null,transformOrigin:m4(xe)};const Re=Z();let Pe=Re.top-xe.vertical,Ee=Re.left-xe.horizontal;const De=Pe+ye.height,$=Ee+ye.width,z=Aa(eM(l)),re=z.innerHeight-y,he=z.innerWidth-y;if(y!==null&&Pere){const pe=De-re;Pe-=pe,xe.vertical+=pe}if(y!==null&&Eehe){const pe=$-he;Ee-=pe,xe.horizontal+=pe}return{top:`${Math.round(Pe)}px`,left:`${Math.round(Ee)}px`,transformOrigin:m4(xe)}},[l,f,Z,F,y]),[K,ee]=A.useState(g),me=A.useCallback(()=>{const j=O.current;if(!j)return;const ye=Y(j);ye.top!==null&&(j.style.top=ye.top),ye.left!==null&&(j.style.left=ye.left),j.style.transformOrigin=ye.transformOrigin,ee(!0)},[Y]);A.useEffect(()=>(U&&window.addEventListener("scroll",me),()=>window.removeEventListener("scroll",me)),[l,U,me]);const le=(j,ye)=>{L&&L(j,ye),me()},Q=()=>{ee(!1)};A.useEffect(()=>{g&&me()}),A.useImperativeHandle(a,()=>g?{updatePosition:()=>{me()}}:null,[g,me]),A.useEffect(()=>{if(!g)return;const j=Bb(()=>{me()}),ye=Aa(l);return ye.addEventListener("resize",j),()=>{j.clear(),ye.removeEventListener("resize",j)}},[l,g,me]);let ae=T;T==="auto"&&!N.muiSupportAuto&&(ae=void 0);const ge=v||(l?Li(eM(l)).body:void 0),Me=(i=_==null?void 0:_.root)!=null?i:$Q,tt=(o=_==null?void 0:_.paper)!=null?o:y6,He=Us({elementType:tt,externalSlotProps:W({},D,{style:K?D.style:W({},D.style,{opacity:0})}),additionalProps:{elevation:x,ref:B},ownerState:X,className:st(H.paper,D==null?void 0:D.className)}),rt=Us({elementType:Me,externalSlotProps:(S==null?void 0:S.root)||{},externalForwardedProps:R,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:ge,open:g},ownerState:X,className:st(H.root,m)}),{slotProps:Ve}=rt,se=Qe(rt,jQ);return C.jsx(Me,W({},se,!xd(Me)&&{slotProps:Ve,disableScrollLock:U},{children:C.jsx(N,W({appear:!0,in:g,onEntering:le,onExited:Q,timeout:ae},M,{children:C.jsx(tt,W({},He,{children:h}))}))}))});function WQ(t){return Tt("MuiMenu",t)}Ct("MuiMenu",["root","paper","list"]);const HQ=["onEntering"],GQ=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],XQ={vertical:"top",horizontal:"right"},qQ={vertical:"top",horizontal:"left"},YQ=t=>{const{classes:e}=t;return Rt({root:["root"],paper:["paper"],list:["list"]},WQ,e)},KQ=qe(x6,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),ZQ=qe(y6,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),JQ=qe(FQ,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),QQ=A.forwardRef(function(e,n){var r,i;const o=At({props:e,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:h,PaperProps:m={},PopoverClasses:v,transitionDuration:x="auto",TransitionProps:{onEntering:y}={},variant:g="selectedMenu",slots:b={},slotProps:_={}}=o,S=Qe(o.TransitionProps,HQ),P=Qe(o,GQ),N=gR(),T=W({},o,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:y,PaperProps:m,transitionDuration:x,TransitionProps:S,variant:g}),L=YQ(T),U=s&&!c&&h,M=A.useRef(null),R=(F,Y)=>{M.current&&M.current.adjustStyleForScrollbar(F,{direction:N?"rtl":"ltr"}),y&&y(F,Y)},D=F=>{F.key==="Tab"&&(F.preventDefault(),f&&f(F,"tabKeyDown"))};let O=-1;A.Children.map(a,(F,Y)=>{A.isValidElement(F)&&(F.props.disabled||(g==="selectedMenu"&&F.props.selected||O===-1)&&(O=Y))});const B=(r=b.paper)!=null?r:ZQ,X=(i=_.paper)!=null?i:m,H=Us({elementType:b.root,externalSlotProps:_.root,ownerState:T,className:[L.root,l]}),Z=Us({elementType:B,externalSlotProps:X,ownerState:T,className:L.paper});return C.jsx(KQ,W({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:N?"right":"left"},transformOrigin:N?XQ:qQ,slots:{paper:B,root:b.root},slotProps:{root:H,paper:Z},open:h,ref:n,transitionDuration:x,TransitionProps:W({onEntering:R},S),ownerState:T},P,{classes:v,children:C.jsx(JQ,W({onKeyDown:D,actions:M,autoFocus:s&&(O===-1||c),autoFocusItem:U,variant:g},u,{className:st(L.list,u.className),children:a}))}))});function eee(t){return Tt("MuiMenuItem",t)}const Bh=Ct("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),tee=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],nee=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},ree=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=t,l=Rt({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},eee,s);return W({},s,l)},iee=qe(vu,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:nee})(({theme:t,ownerState:e})=>W({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Bh.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Bh.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Bh.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Bh.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Bh.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${s4.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${s4.inset}`]:{marginLeft:52},[`& .${E1.root}`]:{marginTop:0,marginBottom:0},[`& .${E1.inset}`]:{paddingLeft:36},[`& .${f4.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&W({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${f4.root} svg`]:{fontSize:"1.25rem"}}))),g4=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:h}=r,m=Qe(r,tee),v=A.useContext(ks),x=A.useMemo(()=>({dense:s||v.dense||!1,disableGutters:l}),[v.dense,s,l]),y=A.useRef(null);ko(()=>{i&&y.current&&y.current.focus()},[i]);const g=W({},r,{dense:x.dense,divider:a,disableGutters:l}),b=ree(r),_=_r(y,n);let S;return r.disabled||(S=f!==void 0?f:-1),C.jsx(ks.Provider,{value:x,children:C.jsx(iee,W({ref:_,role:u,tabIndex:S,component:o,focusVisibleClassName:st(b.focusVisible,c),className:st(b.root,h)},m,{ownerState:g,classes:b}))})});function oee(t){return Tt("MuiNativeSelect",t)}const AR=Ct("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),see=["className","disabled","error","IconComponent","inputRef","variant"],aee=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${bt(n)}`,o&&"iconOpen",r&&"disabled"]};return Rt(a,oee,e)},b6=({ownerState:t,theme:e})=>W({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":W({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${AR.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),lee=qe("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:pi,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${AR.multiple}`]:e.multiple}]}})(b6),_6=({ownerState:t,theme:e})=>W({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${AR.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),cee=qe("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${bt(n.variant)}`],n.open&&e.iconOpen]}})(_6),uee=A.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard"}=e,c=Qe(e,see),u=W({},e,{disabled:i,variant:l,error:o}),f=aee(u);return C.jsxs(A.Fragment,{children:[C.jsx(lee,W({ownerState:u,className:st(f.select,r),disabled:i,ref:a||n},c)),e.multiple?null:C.jsx(cee,{as:s,ownerState:u,className:f.icon})]})});var v4;const fee=["children","classes","className","label","notched"],dee=qe("fieldset",{shouldForwardProp:pi})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),hee=qe("legend",{shouldForwardProp:pi})(({ownerState:t,theme:e})=>W({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&W({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function pee(t){const{className:e,label:n,notched:r}=t,i=Qe(t,fee),o=n!=null&&n!=="",s=W({},t,{notched:r,withLabel:o});return C.jsx(dee,W({"aria-hidden":!0,className:e,ownerState:s},i,{children:C.jsx(hee,{ownerState:s,children:o?C.jsx("span",{children:n}):v4||(v4=C.jsx("span",{className:"notranslate",children:"​"}))})}))}const mee=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],gee=t=>{const{classes:e}=t,r=Rt({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},VK,e);return W({},e,r)},vee=qe(Gb,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Wb})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return W({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Za.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Za.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Za.focused} .${Za.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${Za.error} .${Za.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Za.disabled} .${Za.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&W({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),yee=qe(pee,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),xee=qe(Xb,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Hb})(({theme:t,ownerState:e})=>W({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),PR=A.forwardRef(function(e,n){var r,i,o,s,a;const l=At({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:f="input",label:h,multiline:m=!1,notched:v,slots:x={},type:y="text"}=l,g=Qe(l,mee),b=gee(l),_=yu(),S=Xd({props:l,muiFormControl:_,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),P=W({},l,{color:S.color||"primary",disabled:S.disabled,error:S.error,focused:S.focused,formControl:_,fullWidth:u,hiddenLabel:S.hiddenLabel,multiline:m,size:S.size,type:y}),N=(r=(i=x.root)!=null?i:c.Root)!=null?r:vee,T=(o=(s=x.input)!=null?s:c.Input)!=null?o:xee;return C.jsx(CR,W({slots:{root:N,input:T},renderSuffix:L=>C.jsx(yee,{ownerState:P,className:b.notchedOutline,label:h!=null&&h!==""&&S.required?a||(a=C.jsxs(A.Fragment,{children:[h," ","*"]})):h,notched:typeof v<"u"?v:!!(L.startAdornment||L.filled||L.focused)}),fullWidth:u,inputComponent:f,multiline:m,ref:n,type:y},g,{classes:W({},b,{notchedOutline:null})}))});PR.muiName="Input";function bee(t){return Tt("MuiSelect",t)}const jh=Ct("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var y4;const _ee=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],wee=qe("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${jh.select}`]:e.select},{[`&.${jh.select}`]:e[n.variant]},{[`&.${jh.error}`]:e.error},{[`&.${jh.multiple}`]:e.multiple}]}})(b6,{[`&.${jh.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),See=qe("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${bt(n.variant)}`],n.open&&e.iconOpen]}})(_6),Mee=qe("input",{shouldForwardProp:t=>s6(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function x4(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function Eee(t){return t==null||typeof t=="string"&&!t.trim()}const Cee=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${bt(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Rt(a,bee,e)},Tee=A.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":o,autoFocus:s,autoWidth:a,children:l,className:c,defaultOpen:u,defaultValue:f,disabled:h,displayEmpty:m,error:v=!1,IconComponent:x,inputRef:y,labelId:g,MenuProps:b={},multiple:_,name:S,onBlur:P,onChange:N,onClose:T,onFocus:L,onOpen:U,open:M,readOnly:R,renderValue:D,SelectDisplayProps:O={},tabIndex:B,value:X,variant:H="standard"}=e,Z=Qe(e,_ee),[F,Y]=W2({controlled:X,default:f,name:"Select"}),[K,ee]=W2({controlled:M,default:u,name:"Select"}),me=A.useRef(null),le=A.useRef(null),[Q,ae]=A.useState(null),{current:ge}=A.useRef(M!=null),[Me,tt]=A.useState(),He=_r(n,y),rt=A.useCallback(Oe=>{le.current=Oe,Oe&&ae(Oe)},[]),Ve=Q==null?void 0:Q.parentNode;A.useImperativeHandle(He,()=>({focus:()=>{le.current.focus()},node:me.current,value:F}),[F]),A.useEffect(()=>{u&&K&&Q&&!ge&&(tt(a?null:Ve.clientWidth),le.current.focus())},[Q,a]),A.useEffect(()=>{s&&le.current.focus()},[s]),A.useEffect(()=>{if(!g)return;const Oe=Li(le.current).getElementById(g);if(Oe){const Ue=()=>{getSelection().isCollapsed&&le.current.focus()};return Oe.addEventListener("click",Ue),()=>{Oe.removeEventListener("click",Ue)}}},[g]);const se=(Oe,Ue)=>{Oe?U&&U(Ue):T&&T(Ue),ge||(tt(a?null:Ve.clientWidth),ee(Oe))},j=Oe=>{Oe.button===0&&(Oe.preventDefault(),le.current.focus(),se(!0,Oe))},ye=Oe=>{se(!1,Oe)},xe=A.Children.toArray(l),Re=Oe=>{const Ue=xe.find(Ae=>Ae.props.value===Oe.target.value);Ue!==void 0&&(Y(Ue.props.value),N&&N(Oe,Ue))},Pe=Oe=>Ue=>{let Ae;if(Ue.currentTarget.hasAttribute("tabindex")){if(_){Ae=Array.isArray(F)?F.slice():[];const ke=F.indexOf(Oe.props.value);ke===-1?Ae.push(Oe.props.value):Ae.splice(ke,1)}else Ae=Oe.props.value;if(Oe.props.onClick&&Oe.props.onClick(Ue),F!==Ae&&(Y(Ae),N)){const ke=Ue.nativeEvent||Ue,dt=new ke.constructor(ke.type,ke);Object.defineProperty(dt,"target",{writable:!0,value:{value:Ae,name:S}}),N(dt,Oe)}_||se(!1,Ue)}},Ee=Oe=>{R||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Oe.key)!==-1&&(Oe.preventDefault(),se(!0,Oe))},De=Q!==null&&K,$=Oe=>{!De&&P&&(Object.defineProperty(Oe,"target",{writable:!0,value:{value:F,name:S}}),P(Oe))};delete Z["aria-invalid"];let z,re;const he=[];let pe=!1;(M1({value:F})||m)&&(D?z=D(F):pe=!0);const be=xe.map(Oe=>{if(!A.isValidElement(Oe))return null;let Ue;if(_){if(!Array.isArray(F))throw new Error(Ra(2));Ue=F.some(Ae=>x4(Ae,Oe.props.value)),Ue&&pe&&he.push(Oe.props.children)}else Ue=x4(F,Oe.props.value),Ue&&pe&&(re=Oe.props.children);return A.cloneElement(Oe,{"aria-selected":Ue?"true":"false",onClick:Pe(Oe),onKeyUp:Ae=>{Ae.key===" "&&Ae.preventDefault(),Oe.props.onKeyUp&&Oe.props.onKeyUp(Ae)},role:"option",selected:Ue,value:void 0,"data-value":Oe.props.value})});pe&&(_?he.length===0?z=null:z=he.reduce((Oe,Ue,Ae)=>(Oe.push(Ue),Ae{const{classes:e}=t;return e},NR={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>pi(t)&&t!=="variant",slot:"Root"},Nee=qe(RR,NR)(""),Iee=qe(PR,NR)(""),Lee=qe(TR,NR)(""),IR=A.forwardRef(function(e,n){const r=At({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=WK,id:f,input:h,inputProps:m,label:v,labelId:x,MenuProps:y,multiple:g=!1,native:b=!1,onClose:_,onOpen:S,open:P,renderValue:N,SelectDisplayProps:T,variant:L="outlined"}=r,U=Qe(r,Ree),M=b?uee:Tee,R=yu(),D=Xd({props:r,muiFormControl:R,states:["variant","error"]}),O=D.variant||L,B=W({},r,{variant:O,classes:s}),X=Pee(B),H=Qe(X,Aee),Z=h||{standard:C.jsx(Nee,{ownerState:B}),outlined:C.jsx(Iee,{label:v,ownerState:B}),filled:C.jsx(Lee,{ownerState:B})}[O],F=_r(n,Z.ref);return C.jsx(A.Fragment,{children:A.cloneElement(Z,W({inputComponent:M,inputProps:W({children:o,error:D.error,IconComponent:u,variant:O,type:void 0,multiple:g},b?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:x,MenuProps:y,onClose:_,onOpen:S,open:P,renderValue:N,SelectDisplayProps:W({id:f},T)},m,{classes:m?ui(H,m.classes):H},h?h.props.inputProps:{})},(g&&b||c)&&O==="outlined"?{notched:!0}:{},{ref:F,className:st(Z.props.className,a,X.root)},!h&&{variant:O},U))})});IR.muiName="Select";function kee(t){return Tt("MuiTab",t)}const Ja=Ct("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),Oee=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],Dee=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:i,icon:o,label:s,selected:a,disabled:l}=t,c={root:["root",o&&s&&"labelIcon",`textColor${bt(n)}`,r&&"fullWidth",i&&"wrapped",a&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return Rt(c,kee,e)},Fee=qe(vu,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${bt(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped,{[`& .${Ja.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>W({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${Ja.iconWrapper}`]:W({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${Ja.selected}`]:{opacity:1},[`&.${Ja.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Ja.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Ja.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Ja.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Ja.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),tM=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:s=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:h,onClick:m,onFocus:v,selected:x,selectionFollowsFocus:y,textColor:g="inherit",value:b,wrapped:_=!1}=r,S=Qe(r,Oee),P=W({},r,{disabled:o,disableFocusRipple:s,selected:x,icon:!!l,iconPosition:c,label:!!f,fullWidth:a,textColor:g,wrapped:_}),N=Dee(P),T=l&&f&&A.isValidElement(l)?A.cloneElement(l,{className:st(N.iconWrapper,l.props.className)}):l,L=M=>{!x&&h&&h(M,b),m&&m(M)},U=M=>{y&&!x&&h&&h(M,b),v&&v(M)};return C.jsxs(Fee,W({focusRipple:!s,className:st(N.root,i),ref:n,role:"tab","aria-selected":x,disabled:o,onClick:L,onFocus:U,ownerState:P,tabIndex:x?0:-1},S,{children:[c==="top"||c==="start"?C.jsxs(A.Fragment,{children:[T,f]}):C.jsxs(A.Fragment,{children:[f,T]}),u]}))}),w6=A.createContext();function zee(t){return Tt("MuiTable",t)}Ct("MuiTable",["root","stickyHeader"]);const Uee=["className","component","padding","size","stickyHeader"],Bee=t=>{const{classes:e,stickyHeader:n}=t;return Rt({root:["root",n&&"stickyHeader"]},zee,e)},jee=qe("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>W({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":W({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),b4="table",S6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTable"}),{className:i,component:o=b4,padding:s="normal",size:a="medium",stickyHeader:l=!1}=r,c=Qe(r,Uee),u=W({},r,{component:o,padding:s,size:a,stickyHeader:l}),f=Bee(u),h=A.useMemo(()=>({padding:s,size:a,stickyHeader:l}),[s,a,l]);return C.jsx(w6.Provider,{value:h,children:C.jsx(jee,W({as:o,role:o===b4?null:"table",ref:n,className:st(f.root,i),ownerState:u},c))})}),qb=A.createContext();function Vee(t){return Tt("MuiTableBody",t)}Ct("MuiTableBody",["root"]);const $ee=["className","component"],Wee=t=>{const{classes:e}=t;return Rt({root:["root"]},Vee,e)},Hee=qe("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),Gee={variant:"body"},_4="tbody",M6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableBody"}),{className:i,component:o=_4}=r,s=Qe(r,$ee),a=W({},r,{component:o}),l=Wee(a);return C.jsx(qb.Provider,{value:Gee,children:C.jsx(Hee,W({className:st(l.root,i),as:o,ref:n,role:o===_4?null:"rowgroup",ownerState:a},s))})});function Xee(t){return Tt("MuiTableCell",t)}const gm=Ct("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),qee=["align","className","component","padding","scope","size","sortDirection","variant"],Yee=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:s}=t,a={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${bt(r)}`,i!=="normal"&&`padding${bt(i)}`,`size${bt(o)}`]};return Rt(a,Xee,e)},Kee=qe("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${bt(n.size)}`],n.padding!=="normal"&&e[`padding${bt(n.padding)}`],n.align!=="inherit"&&e[`align${bt(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>W({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid + ${t.palette.mode==="light"?Qz(Rn(t.palette.divider,1),.88):Jz(Rn(t.palette.divider,1),.68)}`,textAlign:"left",padding:16},e.variant==="head"&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},e.variant==="body"&&{color:(t.vars||t).palette.text.primary},e.variant==="footer"&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},e.size==="small"&&{padding:"6px 16px",[`&.${gm.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},e.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},e.padding==="none"&&{padding:0},e.align==="left"&&{textAlign:"left"},e.align==="center"&&{textAlign:"center"},e.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},e.align==="justify"&&{textAlign:"justify"},e.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),Ts=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:c,sortDirection:u,variant:f}=r,h=Qe(r,qee),m=A.useContext(w6),v=A.useContext(qb),x=v&&v.variant==="head";let y;s?y=s:y=x?"th":"td";let g=l;y==="td"?g=void 0:!g&&x&&(g="col");const b=f||v&&v.variant,_=W({},r,{align:i,component:y,padding:a||(m&&m.padding?m.padding:"normal"),size:c||(m&&m.size?m.size:"medium"),sortDirection:u,stickyHeader:b==="head"&&m&&m.stickyHeader,variant:b}),S=Yee(_);let P=null;return u&&(P=u==="asc"?"ascending":"descending"),C.jsx(Kee,W({as:y,ref:n,className:st(S.root,o),"aria-sort":P,scope:g,ownerState:_},h))});function Zee(t){return Tt("MuiTableContainer",t)}Ct("MuiTableContainer",["root"]);const Jee=["className","component"],Qee=t=>{const{classes:e}=t;return Rt({root:["root"]},Zee,e)},ete=qe("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),E6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,s=Qe(r,Jee),a=W({},r,{component:o}),l=Qee(a);return C.jsx(ete,W({ref:n,as:o,className:st(l.root,i),ownerState:a},s))});function tte(t){return Tt("MuiTableHead",t)}Ct("MuiTableHead",["root"]);const nte=["className","component"],rte=t=>{const{classes:e}=t;return Rt({root:["root"]},tte,e)},ite=qe("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),ote={variant:"head"},w4="thead",C6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableHead"}),{className:i,component:o=w4}=r,s=Qe(r,nte),a=W({},r,{component:o}),l=rte(a);return C.jsx(qb.Provider,{value:ote,children:C.jsx(ite,W({as:o,className:st(l.root,i),ref:n,role:o===w4?null:"rowgroup",ownerState:a},s))})});function ste(t){return Tt("MuiToolbar",t)}Ct("MuiToolbar",["root","gutters","regular","dense"]);const ate=["className","component","disableGutters","variant"],lte=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Rt({root:["root",!n&&"gutters",r]},ste,e)},cte=qe("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(({theme:t,ownerState:e})=>W({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),ute=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular"}=r,l=Qe(r,ate),c=W({},r,{component:o,disableGutters:s,variant:a}),u=lte(c);return C.jsx(cte,W({as:o,className:st(u.root,i),ref:n,ownerState:c},l))}),fte=Gd(C.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),dte=Gd(C.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function hte(t){return Tt("MuiTableRow",t)}const S4=Ct("MuiTableRow",["root","selected","hover","head","footer"]),pte=["className","component","hover","selected"],mte=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return Rt({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},hte,e)},gte=qe("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${S4.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${S4.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),M4="tr",Yb=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableRow"}),{className:i,component:o=M4,hover:s=!1,selected:a=!1}=r,l=Qe(r,pte),c=A.useContext(qb),u=W({},r,{component:o,hover:s,selected:a,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),f=mte(u);return C.jsx(gte,W({as:o,ref:n,className:st(f.root,i),role:o===M4?null:"row",ownerState:u},l))});function vte(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function yte(t,e,n,r={},i=()=>{}){const{ease:o=vte,duration:s=300}=r;let a=null;const l=e[t];let c=!1;const u=()=>{c=!0},f=h=>{if(c){i(new Error("Animation cancelled"));return}a===null&&(a=h);const m=Math.min(1,(h-a)/s);if(e[t]=o(m)*(n-l)+l,m>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(f)};return l===n?(i(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const xte=["onChange"],bte={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function _te(t){const{onChange:e}=t,n=Qe(t,xte),r=A.useRef(),i=A.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return ko(()=>{const s=Bb(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),a=Aa(i.current);return a.addEventListener("resize",s),()=>{s.clear(),a.removeEventListener("resize",s)}},[e]),A.useEffect(()=>{o(),e(r.current)},[e]),C.jsx("div",W({style:bte,ref:i},n))}function wte(t){return Tt("MuiTabScrollButton",t)}const Ste=Ct("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Mte=["className","slots","slotProps","direction","orientation","disabled"],Ete=t=>{const{classes:e,orientation:n,disabled:r}=t;return Rt({root:["root",n,r&&"disabled"]},wte,e)},Cte=qe(vu,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})(({ownerState:t})=>W({width:40,flexShrink:0,opacity:.8,[`&.${Ste.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),Tte=A.forwardRef(function(e,n){var r,i;const o=At({props:e,name:"MuiTabScrollButton"}),{className:s,slots:a={},slotProps:l={},direction:c}=o,u=Qe(o,Mte),f=gR(),h=W({isRtl:f},o),m=Ete(h),v=(r=a.StartScrollButtonIcon)!=null?r:fte,x=(i=a.EndScrollButtonIcon)!=null?i:dte,y=Us({elementType:v,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h}),g=Us({elementType:x,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h});return C.jsx(Cte,W({component:"div",className:st(m.root,s),ref:n,role:null,ownerState:h,tabIndex:null},u,{children:c==="left"?C.jsx(v,W({},y)):C.jsx(x,W({},g))}))});function Rte(t){return Tt("MuiTabs",t)}const nM=Ct("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Ate=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],E4=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,C4=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,iv=(t,e,n)=>{let r=!1,i=n(t,e);for(;i;){if(i===t.firstChild){if(r)return;r=!0}const o=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||o)i=n(t,i);else{i.focus();return}}},Pte=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:s,scrollButtonsHideMobile:a,classes:l}=t;return Rt({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",a&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},Rte,l)},Nte=qe("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${nM.scrollButtons}`]:e.scrollButtons},{[`& .${nM.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>W({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${nM.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Ite=qe("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.scroller,n.fixed&&e.fixed,n.hideScrollbar&&e.hideScrollbar,n.scrollableX&&e.scrollableX,n.scrollableY&&e.scrollableY]}})(({ownerState:t})=>W({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Lte=qe("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})(({ownerState:t})=>W({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),kte=qe("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>W({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Ote=qe(_te)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),T4={},Dte=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTabs"}),i=mu(),o=gR(),{"aria-label":s,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:f,component:h="div",allowScrollButtonsMobile:m=!1,indicatorColor:v="primary",onChange:x,orientation:y="horizontal",ScrollButtonComponent:g=Tte,scrollButtons:b="auto",selectionFollowsFocus:_,slots:S={},slotProps:P={},TabIndicatorProps:N={},TabScrollButtonProps:T={},textColor:L="primary",value:U,variant:M="standard",visibleScrollbar:R=!1}=r,D=Qe(r,Ate),O=M==="scrollable",B=y==="vertical",X=B?"scrollTop":"scrollLeft",H=B?"top":"left",Z=B?"bottom":"right",F=B?"clientHeight":"clientWidth",Y=B?"height":"width",K=W({},r,{component:h,allowScrollButtonsMobile:m,indicatorColor:v,orientation:y,vertical:B,scrollButtons:b,textColor:L,variant:M,visibleScrollbar:R,fixed:!O,hideScrollbar:O&&!R,scrollableX:O&&!B,scrollableY:O&&B,centered:c&&!O,scrollButtonsHideMobile:!m}),ee=Pte(K),me=Us({elementType:S.StartScrollButtonIcon,externalSlotProps:P.startScrollButtonIcon,ownerState:K}),le=Us({elementType:S.EndScrollButtonIcon,externalSlotProps:P.endScrollButtonIcon,ownerState:K}),[Q,ae]=A.useState(!1),[ge,Me]=A.useState(T4),[tt,He]=A.useState(!1),[rt,Ve]=A.useState(!1),[se,j]=A.useState(!1),[ye,xe]=A.useState({overflow:"hidden",scrollbarWidth:0}),Re=new Map,Pe=A.useRef(null),Ee=A.useRef(null),De=()=>{const Ae=Pe.current;let ke;if(Ae){const J=Ae.getBoundingClientRect();ke={clientWidth:Ae.clientWidth,scrollLeft:Ae.scrollLeft,scrollTop:Ae.scrollTop,scrollLeftNormalized:cq(Ae,o?"rtl":"ltr"),scrollWidth:Ae.scrollWidth,top:J.top,bottom:J.bottom,left:J.left,right:J.right}}let dt;if(Ae&&U!==!1){const J=Ee.current.children;if(J.length>0){const je=J[Re.get(U)];dt=je?je.getBoundingClientRect():null}}return{tabsMeta:ke,tabMeta:dt}},$=va(()=>{const{tabsMeta:Ae,tabMeta:ke}=De();let dt=0,J;if(B)J="top",ke&&Ae&&(dt=ke.top-Ae.top+Ae.scrollTop);else if(J=o?"right":"left",ke&&Ae){const fe=o?Ae.scrollLeftNormalized+Ae.clientWidth-Ae.scrollWidth:Ae.scrollLeft;dt=(o?-1:1)*(ke[J]-Ae[J]+fe)}const je={[J]:dt,[Y]:ke?ke[Y]:0};if(isNaN(ge[J])||isNaN(ge[Y]))Me(je);else{const fe=Math.abs(ge[J]-je[J]),Te=Math.abs(ge[Y]-je[Y]);(fe>=1||Te>=1)&&Me(je)}}),z=(Ae,{animation:ke=!0}={})=>{ke?yte(X,Pe.current,Ae,{duration:i.transitions.duration.standard}):Pe.current[X]=Ae},re=Ae=>{let ke=Pe.current[X];B?ke+=Ae:(ke+=Ae*(o?-1:1),ke*=o&&$z()==="reverse"?-1:1),z(ke)},he=()=>{const Ae=Pe.current[F];let ke=0;const dt=Array.from(Ee.current.children);for(let J=0;JAe){J===0&&(ke=Ae);break}ke+=je[F]}return ke},pe=()=>{re(-1*he())},be=()=>{re(he())},Ge=A.useCallback(Ae=>{xe({overflow:null,scrollbarWidth:Ae})},[]),Fe=()=>{const Ae={};Ae.scrollbarSizeListener=O?C.jsx(Ote,{onChange:Ge,className:st(ee.scrollableX,ee.hideScrollbar)}):null;const dt=O&&(b==="auto"&&(tt||rt)||b===!0);return Ae.scrollButtonStart=dt?C.jsx(g,W({slots:{StartScrollButtonIcon:S.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:me},orientation:y,direction:o?"right":"left",onClick:pe,disabled:!tt},T,{className:st(ee.scrollButtons,T.className)})):null,Ae.scrollButtonEnd=dt?C.jsx(g,W({slots:{EndScrollButtonIcon:S.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:le},orientation:y,direction:o?"left":"right",onClick:be,disabled:!rt},T,{className:st(ee.scrollButtons,T.className)})):null,Ae},Ne=va(Ae=>{const{tabsMeta:ke,tabMeta:dt}=De();if(!(!dt||!ke)){if(dt[H]ke[Z]){const J=ke[X]+(dt[Z]-ke[Z]);z(J,{animation:Ae})}}}),ze=va(()=>{O&&b!==!1&&j(!se)});A.useEffect(()=>{const Ae=Bb(()=>{Pe.current&&$()});let ke;const dt=fe=>{fe.forEach(Te=>{Te.removedNodes.forEach(Ke=>{var Ye;(Ye=ke)==null||Ye.unobserve(Ke)}),Te.addedNodes.forEach(Ke=>{var Ye;(Ye=ke)==null||Ye.observe(Ke)})}),Ae(),ze()},J=Aa(Pe.current);J.addEventListener("resize",Ae);let je;return typeof ResizeObserver<"u"&&(ke=new ResizeObserver(Ae),Array.from(Ee.current.children).forEach(fe=>{ke.observe(fe)})),typeof MutationObserver<"u"&&(je=new MutationObserver(dt),je.observe(Ee.current,{childList:!0})),()=>{var fe,Te;Ae.clear(),J.removeEventListener("resize",Ae),(fe=je)==null||fe.disconnect(),(Te=ke)==null||Te.disconnect()}},[$,ze]),A.useEffect(()=>{const Ae=Array.from(Ee.current.children),ke=Ae.length;if(typeof IntersectionObserver<"u"&&ke>0&&O&&b!==!1){const dt=Ae[0],J=Ae[ke-1],je={root:Pe.current,threshold:.99},fe=Bt=>{He(!Bt[0].isIntersecting)},Te=new IntersectionObserver(fe,je);Te.observe(dt);const Ke=Bt=>{Ve(!Bt[0].isIntersecting)},Ye=new IntersectionObserver(Ke,je);return Ye.observe(J),()=>{Te.disconnect(),Ye.disconnect()}}},[O,b,se,u==null?void 0:u.length]),A.useEffect(()=>{ae(!0)},[]),A.useEffect(()=>{$()}),A.useEffect(()=>{Ne(T4!==ge)},[Ne,ge]),A.useImperativeHandle(l,()=>({updateIndicator:$,updateScrollButtons:ze}),[$,ze]);const Le=C.jsx(kte,W({},N,{className:st(ee.indicator,N.className),ownerState:K,style:W({},ge,N.style)}));let Xe=0;const xt=A.Children.map(u,Ae=>{if(!A.isValidElement(Ae))return null;const ke=Ae.props.value===void 0?Xe:Ae.props.value;Re.set(ke,Xe);const dt=ke===U;return Xe+=1,A.cloneElement(Ae,W({fullWidth:M==="fullWidth",indicator:dt&&!Q&&Le,selected:dt,selectionFollowsFocus:_,onChange:x,textColor:L,value:ke},Xe===1&&U===!1&&!Ae.props.tabIndex?{tabIndex:0}:{}))}),Oe=Ae=>{const ke=Ee.current,dt=Li(ke).activeElement;if(dt.getAttribute("role")!=="tab")return;let je=y==="horizontal"?"ArrowLeft":"ArrowUp",fe=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&o&&(je="ArrowRight",fe="ArrowLeft"),Ae.key){case je:Ae.preventDefault(),iv(ke,dt,C4);break;case fe:Ae.preventDefault(),iv(ke,dt,E4);break;case"Home":Ae.preventDefault(),iv(ke,null,E4);break;case"End":Ae.preventDefault(),iv(ke,null,C4);break}},Ue=Fe();return C.jsxs(Nte,W({className:st(ee.root,f),ownerState:K,ref:n,as:h},D,{children:[Ue.scrollButtonStart,Ue.scrollbarSizeListener,C.jsxs(Ite,{className:ee.scroller,ownerState:K,style:{overflow:ye.overflow,[B?`margin${o?"Left":"Right"}`:"marginBottom"]:R?void 0:-ye.scrollbarWidth},ref:Pe,children:[C.jsx(Lte,{"aria-label":s,"aria-labelledby":a,"aria-orientation":y==="vertical"?"vertical":null,className:ee.flexContainer,ownerState:K,onKeyDown:Oe,ref:Ee,role:"tablist",children:xt}),Q&&Le]}),Ue.scrollButtonEnd]}))});function Fte(t){return Tt("MuiTextField",t)}Ct("MuiTextField",["root"]);const zte=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Ute={standard:RR,filled:TR,outlined:PR},Bte=t=>{const{classes:e}=t;return Rt({root:["root"]},Fte,e)},jte=qe(u6,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Vte=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:h,fullWidth:m=!1,helperText:v,id:x,InputLabelProps:y,inputProps:g,InputProps:b,inputRef:_,label:S,maxRows:P,minRows:N,multiline:T=!1,name:L,onBlur:U,onChange:M,onFocus:R,placeholder:D,required:O=!1,rows:B,select:X=!1,SelectProps:H,type:Z,value:F,variant:Y="outlined"}=r,K=Qe(r,zte),ee=W({},r,{autoFocus:o,color:l,disabled:u,error:f,fullWidth:m,multiline:T,required:O,select:X,variant:Y}),me=Bte(ee),le={};Y==="outlined"&&(y&&typeof y.shrink<"u"&&(le.notched=y.shrink),le.label=S),X&&((!H||!H.native)&&(le.id=void 0),le["aria-describedby"]=void 0);const Q=Uz(x),ae=v&&Q?`${Q}-helper-text`:void 0,ge=S&&Q?`${Q}-label`:void 0,Me=Ute[Y],tt=C.jsx(Me,W({"aria-describedby":ae,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:m,multiline:T,name:L,rows:B,maxRows:P,minRows:N,type:Z,value:F,id:Q,inputRef:_,onBlur:U,onChange:M,onFocus:R,placeholder:D,inputProps:g},le,b));return C.jsxs(jte,W({className:st(me.root,a),disabled:u,error:f,fullWidth:m,ref:n,required:O,color:l,variant:Y,ownerState:ee},K,{children:[S!=null&&S!==""&&C.jsx(h6,W({htmlFor:Q,id:ge},y,{children:S})),X?C.jsx(IR,W({"aria-describedby":ae,id:Q,labelId:ge,value:F,input:tt},H,{children:s})):tt,v&&C.jsx(CJ,W({id:ae},h,{children:v}))]}))});function $te(t){var n;const e=t.standard;return C.jsxs(hZ,{variant:"outlined",children:[C.jsxs(SZ,{children:[C.jsx(sr,{sx:{fontSize:14},color:"text.secondary",gutterBottom:!0,children:"XAS Metadata"}),C.jsx(sr,{variant:"h5",component:"div",children:e.sample.name}),C.jsx(sr,{variant:"h6",component:"div",children:e.sample.formula}),C.jsx(sr,{sx:{mb:1.5},color:"text.secondary",children:e.sample.prep}),C.jsxs(sr,{sx:{mb:1.5},children:["Measured at ",(n=e.facility)==null?void 0:n.name," on beamline"," ",e.beamline.name]}),C.jsx(sr,{sx:{mb:1.5},children:e.start_time})]}),t.showDownload&&C.jsx(yZ,{children:C.jsxs(rs,{children:[C.jsx(u4,{href:"/webxdiviewer/xdidata/"+String(e.location),download:String(e.id)+".xdi",children:"Download XDI"}),C.jsx(u4,{href:"/#/xdi/"+String(e.location),children:"Persistent Link"})]})})]})}const lg=A.createContext({xdiFile:null,setXDIFile:()=>{},comparisonFiles:[],setComparisonFiles:()=>{}});function LR(t){const{children:e}=t;return C.jsx(lg.Provider,{value:t.value,children:e})}function Wte(){const t=A.useContext(lg);return C.jsx(Bs,{children:C.jsx(sr,{sx:{whiteSpace:"pre-line",overflow:"scroll",maxHeight:"20em"},children:t.xdiFile===null?"":t.xdiFile.rawText()})})}const rM=qe(Ts)(({theme:t})=>({[`&.${gm.head}`]:{backgroundColor:t.palette.common.black,color:t.palette.common.white},[`&.${gm.body}`]:{fontSize:14,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}})),Hte=qe(Yb)(({theme:t})=>({"&:nth-of-type(odd):not(:hover):not(.activeclicked)":{backgroundColor:t.palette.action.selected},"&:last-child td, &:last-child th":{border:0}}));function Gte(t){var e,n,r,i;return C.jsxs(Hte,{hover:!0,sx:{"&:last-child td, &:last-child th":{border:0}},children:[C.jsx(rM,{align:"left",children:((e=t.xdiFile)==null?void 0:e.element)??" "}),C.jsx(rM,{align:"center",children:((n=t.xdiFile)==null?void 0:n.edge)??""}),C.jsx(rM,{align:"center",children:((i=(r=t.xdiFile)==null?void 0:r.sample)==null?void 0:i.name)??""})]},t.key)}function Xte(){const t=A.useContext(lg),e=()=>{const r=t.xdiFile;if(r!=null&&!t.comparisonFiles.some(i=>i.id==(r==null?void 0:r.id))){const o=[...t.comparisonFiles.length>=3?t.comparisonFiles.slice(1,3):t.comparisonFiles,r];t.setComparisonFiles(o)}},n=()=>{t.setComparisonFiles([])};return C.jsxs(Bs,{children:[C.jsx(ou,{variant:"contained",onClick:e,children:"Store Selected"}),C.jsx(ou,{variant:"outlined",onClick:n,children:"Clear All"}),C.jsx(E6,{component:gu,children:C.jsxs(S6,{sx:{minWidth:650},size:"small","aria-label":"a dense table",children:[C.jsx(C6,{children:C.jsxs(Yb,{children:[C.jsx(Ts,{children:"Element"}),C.jsx(Ts,{align:"center",children:"Edge"}),C.jsx(Ts,{align:"center",children:"Name"})]})}),C.jsx(M6,{children:t.comparisonFiles.map((r,i)=>Gte({key:i,xdiFile:r}))})]})})]})}function iM(t){const{children:e,value:n,index:r,...i}=t;return C.jsx("div",{role:"tabpanel",hidden:n!==r,id:`simple-tabpanel-${r}`,"aria-labelledby":`simple-tab-${r}`,...i,children:n===r&&C.jsx(Bs,{sx:{p:1},children:e})})}function oM(t){return{id:`simple-tab-${t}`,"aria-controls":`simple-tabpanel-${t}`}}function kR(t){const[e,n]=A.useState(0),r=(i,o)=>{n(o)};return C.jsxs(Bs,{sx:{width:"100%"},children:[C.jsx(Bs,{sx:{borderBottom:1,borderColor:"divider"},children:C.jsxs(Dte,{value:e,onChange:r,"aria-label":"basic tabs example",children:[C.jsx(tM,{label:"Metadata",...oM(0)}),C.jsx(tM,{label:"Raw File",...oM(1)}),t.showCompare&&C.jsx(tM,{label:"Comparison",...oM(2)})]})}),C.jsx(iM,{value:e,index:0,children:C.jsx($te,{standard:t.standard,showDownload:t.showDownload})}),C.jsx(iM,{value:e,index:1,children:C.jsx(Wte,{})}),t.showCompare&&C.jsx(iM,{value:e,index:2,children:C.jsx(Xte,{})})]})}const T6=[{Number:"1",Type:"nonmetal","Atomic Weight":"1.008",Name:"Hydrogen",Symbol:"H","Melting Point":"-259","Boiling Point":"-253",Density:"0.09",Earth:"0.14",Group:"1","Electron Configuration":"1s1"},{Number:"2",Type:"noble gas","Atomic Weight":"4.003",Name:"Helium",Symbol:"He","Melting Point":"-272","Boiling Point":"-269",Density:"0.18",Earth:"",Group:"18","Electron Configuration":"1s2"},{Number:"3",Type:"alkali metal","Atomic Weight":"6.941",Name:"Lithium",Symbol:"Li","Melting Point":"180","Boiling Point":"1347",Density:"0.53",Earth:"",Group:"1","Electron Configuration":"[He] 2s1"},{Number:"4",Type:"alkaline earth metal","Atomic Weight":"9.012",Name:"Beryllium",Symbol:"Be","Melting Point":"1278","Boiling Point":"2970",Density:"1.85",Earth:"",Group:"2","Electron Configuration":"[He] 2s2"},{Number:"5",Type:"metalloid","Atomic Weight":"10.811",Name:"Boron",Symbol:"B","Melting Point":"2300","Boiling Point":"2550",Density:"2.34",Earth:"",Group:"13","Electron Configuration":"[He] 2s2 2p1"},{Number:"6",Type:"nonmetal","Atomic Weight":"12.011",Name:"Carbon",Symbol:"C","Melting Point":"3500","Boiling Point":"4827",Density:"2.26",Earth:"0.09",Group:"14","Electron Configuration":"[He] 2s2 2p2"},{Number:"7",Type:"nonmetal","Atomic Weight":"14.007",Name:"Nitrogen",Symbol:"N","Melting Point":"-210","Boiling Point":"-196",Density:"1.25",Earth:"",Group:"15","Electron Configuration":"[He] 2s2 2p3"},{Number:"8",Type:"nonmetal","Atomic Weight":"15.999",Name:"Oxygen",Symbol:"O","Melting Point":"-218","Boiling Point":"-183",Density:"1.43",Earth:"46.71",Group:"16","Electron Configuration":"[He] 2s2 2p4"},{Number:"9",Type:"halogen","Atomic Weight":"18.998",Name:"Fluorine",Symbol:"F","Melting Point":"-220","Boiling Point":"-188",Density:"1.7",Earth:"0.03",Group:"17","Electron Configuration":"[He] 2s2 2p5"},{Number:"10",Type:"noble gas","Atomic Weight":"20.18",Name:"Neon",Symbol:"Ne","Melting Point":"-249","Boiling Point":"-246",Density:"0.9",Earth:"",Group:"18","Electron Configuration":"[He] 2s2 2p6"},{Number:"11",Type:"alkali metal","Atomic Weight":"22.99",Name:"Sodium",Symbol:"Na","Melting Point":"98","Boiling Point":"883",Density:"0.97",Earth:"2.75",Group:"1","Electron Configuration":"[Ne] 3s1"},{Number:"12",Type:"alkaline earth metal","Atomic Weight":"24.305",Name:"Magnesium",Symbol:"Mg","Melting Point":"639","Boiling Point":"1090",Density:"1.74",Earth:"2.08",Group:"2","Electron Configuration":"[Ne] 3s2"},{Number:"13",Type:"post transition metal","Atomic Weight":"26.982",Name:"Aluminum",Symbol:"Al","Melting Point":"660","Boiling Point":"2467",Density:"2.7",Earth:"8.07",Group:"13","Electron Configuration":"[Ne] 3s2 3p1"},{Number:"14",Type:"metalloid","Atomic Weight":"28.086",Name:"Silicon",Symbol:"Si","Melting Point":"1410","Boiling Point":"2355",Density:"2.33",Earth:"27.69",Group:"14","Electron Configuration":"[Ne] 3s2 3p2"},{Number:"15",Type:"nonmetal","Atomic Weight":"30.974",Name:"Phosphorus",Symbol:"P","Melting Point":"44","Boiling Point":"280",Density:"1.82",Earth:"0.13",Group:"15","Electron Configuration":"[Ne] 3s2 3p3"},{Number:"16",Type:"nonmetal","Atomic Weight":"32.065",Name:"Sulfur",Symbol:"S","Melting Point":"113","Boiling Point":"445",Density:"2.07",Earth:"0.05",Group:"16","Electron Configuration":"[Ne] 3s2 3p4"},{Number:"17",Type:"halogen","Atomic Weight":"35.453",Name:"Chlorine",Symbol:"Cl","Melting Point":"-101","Boiling Point":"-35",Density:"3.21",Earth:"0.05",Group:"17","Electron Configuration":"[Ne] 3s2 3p5"},{Number:"18",Type:"noble gas","Atomic Weight":"39.948",Name:"Argon",Symbol:"Ar","Melting Point":"-189","Boiling Point":"-186",Density:"1.78",Earth:"",Group:"18","Electron Configuration":"[Ne] 3s2 3p6"},{Number:"19",Type:"alkali metal","Atomic Weight":"39.098",Name:"Potassium",Symbol:"K","Melting Point":"64","Boiling Point":"774",Density:"0.86",Earth:"2.58",Group:"1","Electron Configuration":"[Ar] 4s1"},{Number:"20",Type:"alkaline earth metal","Atomic Weight":"40.078",Name:"Calcium",Symbol:"Ca","Melting Point":"839","Boiling Point":"1484",Density:"1.55",Earth:"3.65",Group:"2","Electron Configuration":"[Ar] 4s2"},{Number:"21",Type:"transition metal","Atomic Weight":"44.956",Name:"Scandium",Symbol:"Sc","Melting Point":"1539","Boiling Point":"2832",Density:"2.99",Earth:"",Group:"3","Electron Configuration":"[Ar] 3d1 4s2"},{Number:"22",Type:"transition metal","Atomic Weight":"47.867",Name:"Titanium",Symbol:"Ti","Melting Point":"1660","Boiling Point":"3287",Density:"4.54",Earth:"0.62",Group:"4","Electron Configuration":"[Ar] 3d2 4s2"},{Number:"23",Type:"transition metal","Atomic Weight":"50.942",Name:"Vanadium",Symbol:"V","Melting Point":"1890","Boiling Point":"3380",Density:"6.11",Earth:"",Group:"5","Electron Configuration":"[Ar] 3d3 4s2"},{Number:"24",Type:"transition metal","Atomic Weight":"51.996",Name:"Chromium",Symbol:"Cr","Melting Point":"1857","Boiling Point":"2672",Density:"7.19",Earth:"0.04",Group:"6","Electron Configuration":"[Ar] 3d5 4s1"},{Number:"25",Type:"transition metal","Atomic Weight":"54.938",Name:"Manganese",Symbol:"Mn","Melting Point":"1245","Boiling Point":"1962",Density:"7.43",Earth:"0.09",Group:"7","Electron Configuration":"[Ar] 3d5 4s2"},{Number:"26",Type:"transition metal","Atomic Weight":"55.845",Name:"Iron",Symbol:"Fe","Melting Point":"1535","Boiling Point":"2750",Density:"7.87",Earth:"5.05",Group:"8","Electron Configuration":"[Ar] 3d6 4s2"},{Number:"27",Type:"transition metal","Atomic Weight":"58.933",Name:"Cobalt",Symbol:"Co","Melting Point":"1495","Boiling Point":"2870",Density:"8.9",Earth:"",Group:"9","Electron Configuration":"[Ar] 3d7 4s2"},{Number:"28",Type:"transition metal","Atomic Weight":"58.693",Name:"Nickel",Symbol:"Ni","Melting Point":"1453","Boiling Point":"2732",Density:"8.9",Earth:"0.02",Group:"10","Electron Configuration":"[Ar] 3d8 4s2"},{Number:"29",Type:"transition metal","Atomic Weight":"63.546",Name:"Copper",Symbol:"Cu","Melting Point":"1083","Boiling Point":"2567",Density:"8.96",Earth:"",Group:"11","Electron Configuration":"[Ar] 3d10 4s1"},{Number:"30",Type:"transition metal","Atomic Weight":"65.39",Name:"Zinc",Symbol:"Zn","Melting Point":"420","Boiling Point":"907",Density:"7.13",Earth:"",Group:"12","Electron Configuration":"[Ar] 3d10 4s2"},{Number:"31",Type:"post transition metal","Atomic Weight":"69.723",Name:"Gallium",Symbol:"Ga","Melting Point":"30","Boiling Point":"2403",Density:"5.91",Earth:"",Group:"13","Electron Configuration":"[Ar] 3d10 4s2 4p1"},{Number:"32",Type:"metalloid","Atomic Weight":"72.64",Name:"Germanium",Symbol:"Ge","Melting Point":"937","Boiling Point":"2830",Density:"5.32",Earth:"",Group:"14","Electron Configuration":"[Ar] 3d10 4s2 4p2"},{Number:"33",Type:"metalloid","Atomic Weight":"74.922",Name:"Arsenic",Symbol:"As","Melting Point":"81","Boiling Point":"613",Density:"5.72",Earth:"",Group:"15","Electron Configuration":"[Ar] 3d10 4s2 4p3"},{Number:"34",Type:"nonmetal","Atomic Weight":"78.96",Name:"Selenium",Symbol:"Se","Melting Point":"217","Boiling Point":"685",Density:"4.79",Earth:"",Group:"16","Electron Configuration":"[Ar] 3d10 4s2 4p4"},{Number:"35",Type:"halogen","Atomic Weight":"79.904",Name:"Bromine",Symbol:"Br","Melting Point":"-7","Boiling Point":"59",Density:"3.12",Earth:"",Group:"17","Electron Configuration":"[Ar] 3d10 4s2 4p5"},{Number:"36",Type:"noble gas","Atomic Weight":"83.8",Name:"Krypton",Symbol:"Kr","Melting Point":"-157","Boiling Point":"-153",Density:"3.75",Earth:"",Group:"18","Electron Configuration":"[Ar] 3d10 4s2 4p6"},{Number:"37",Type:"alkali metal","Atomic Weight":"85.468",Name:"Rubidium",Symbol:"Rb","Melting Point":"39","Boiling Point":"688",Density:"1.63",Earth:"",Group:"1","Electron Configuration":"[Kr] 5s1"},{Number:"38",Type:"alkaline earth metal","Atomic Weight":"87.62",Name:"Strontium",Symbol:"Sr","Melting Point":"769","Boiling Point":"1384",Density:"2.54",Earth:"",Group:"2","Electron Configuration":"[Kr] 5s2"},{Number:"39",Type:"transition metal","Atomic Weight":"88.906",Name:"Yttrium",Symbol:"Y","Melting Point":"1523","Boiling Point":"3337",Density:"4.47",Earth:"",Group:"3","Electron Configuration":"[Kr] 4d1 5s2"},{Number:"40",Type:"transition metal","Atomic Weight":"91.224",Name:"Zirconium",Symbol:"Zr","Melting Point":"1852","Boiling Point":"4377",Density:"6.51",Earth:"0.03",Group:"4","Electron Configuration":"[Kr] 4d2 5s2"},{Number:"41",Type:"transition metal","Atomic Weight":"92.906",Name:"Niobium",Symbol:"Nb","Melting Point":"2468","Boiling Point":"4927",Density:"8.57",Earth:"",Group:"5","Electron Configuration":"[Kr] 4d4 5s1"},{Number:"42",Type:"transition metal","Atomic Weight":"95.94",Name:"Molybdenum",Symbol:"Mo","Melting Point":"2617","Boiling Point":"4612",Density:"10.22",Earth:"",Group:"6","Electron Configuration":"[Kr] 4d5 5s1"},{Number:"43",Type:"transition metal","Atomic Weight":"98",Name:"Technetium",Symbol:"Tc","Melting Point":"2200","Boiling Point":"4877",Density:"11.5",Earth:"",Group:"7","Electron Configuration":"[Kr] 4d5 5s2"},{Number:"44",Type:"transition metal","Atomic Weight":"101.07",Name:"Ruthenium",Symbol:"Ru","Melting Point":"2250","Boiling Point":"3900",Density:"12.37",Earth:"",Group:"8","Electron Configuration":"[Kr] 4d7 5s1"},{Number:"45",Type:"transition metal","Atomic Weight":"102.906",Name:"Rhodium",Symbol:"Rh","Melting Point":"1966","Boiling Point":"3727",Density:"12.41",Earth:"",Group:"9","Electron Configuration":"[Kr] 4d8 5s1"},{Number:"46",Type:"transition metal","Atomic Weight":"106.42",Name:"Palladium",Symbol:"Pd","Melting Point":"1552","Boiling Point":"2927",Density:"12.02",Earth:"",Group:"10","Electron Configuration":"[Kr] 4d10"},{Number:"47",Type:"transition metal","Atomic Weight":"107.868",Name:"Silver",Symbol:"Ag","Melting Point":"962","Boiling Point":"2212",Density:"10.5",Earth:"",Group:"11","Electron Configuration":"[Kr] 4d10 5s1"},{Number:"48",Type:"transition metal","Atomic Weight":"112.411",Name:"Cadmium",Symbol:"Cd","Melting Point":"321","Boiling Point":"765",Density:"8.65",Earth:"",Group:"12","Electron Configuration":"[Kr] 4d10 5s2"},{Number:"49",Type:"post transition metal","Atomic Weight":"114.818",Name:"Indium",Symbol:"In","Melting Point":"157","Boiling Point":"2000",Density:"7.31",Earth:"",Group:"13","Electron Configuration":"[Kr] 4d10 5s2 5p1"},{Number:"50",Type:"post transition metal","Atomic Weight":"118.71",Name:"Tin",Symbol:"Sn","Melting Point":"232","Boiling Point":"2270",Density:"7.31",Earth:"",Group:"14","Electron Configuration":"[Kr] 4d10 5s2 5p2"},{Number:"51",Type:"metalloid","Atomic Weight":"121.76",Name:"Antimony",Symbol:"Sb","Melting Point":"630","Boiling Point":"1750",Density:"6.68",Earth:"",Group:"15","Electron Configuration":"[Kr] 4d10 5s2 5p3"},{Number:"52",Type:"metalloid","Atomic Weight":"127.6",Name:"Tellurium",Symbol:"Te","Melting Point":"449","Boiling Point":"990",Density:"6.24",Earth:"",Group:"16","Electron Configuration":"[Kr] 4d10 5s2 5p4"},{Number:"53",Type:"halogen","Atomic Weight":"126.905",Name:"Iodine",Symbol:"I","Melting Point":"114","Boiling Point":"184",Density:"4.93",Earth:"",Group:"17","Electron Configuration":"[Kr] 4d10 5s2 5p5"},{Number:"54",Type:"noble gas","Atomic Weight":"131.293",Name:"Xenon",Symbol:"Xe","Melting Point":"-112","Boiling Point":"-108",Density:"5.9",Earth:"",Group:"18","Electron Configuration":"[Kr] 4d10 5s2 5p6"},{Number:"55",Type:"alkali metal","Atomic Weight":"132.906",Name:"Cesium",Symbol:"Cs","Melting Point":"29","Boiling Point":"678",Density:"1.87",Earth:"",Group:"1","Electron Configuration":"[Xe] 6s1"},{Number:"56",Type:"alkaline earth metal","Atomic Weight":"137.327",Name:"Barium",Symbol:"Ba","Melting Point":"725","Boiling Point":"1140",Density:"3.59",Earth:"0.05",Group:"2","Electron Configuration":"[Xe] 6s2"},{Number:"57",Type:"lanthanide","Atomic Weight":"138.906",Name:"Lanthanum",Symbol:"La","Melting Point":"920","Boiling Point":"3469",Density:"6.15",Earth:"",Group:"3","Electron Configuration":"[Xe] 5d1 6s2"},{Number:"58",Type:"lanthanide","Atomic Weight":"140.116",Name:"Cerium",Symbol:"Ce","Melting Point":"795","Boiling Point":"3257",Density:"6.77",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f1 5d1 6s2"},{Number:"59",Type:"lanthanide","Atomic Weight":"140.908",Name:"Praseodymium",Symbol:"Pr","Melting Point":"935","Boiling Point":"3127",Density:"6.77",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f3 6s2"},{Number:"60",Type:"lanthanide","Atomic Weight":"144.24",Name:"Neodymium",Symbol:"Nd","Melting Point":"1010","Boiling Point":"3127",Density:"7.01",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f4 6s2"},{Number:"61",Type:"lanthanide","Atomic Weight":"145",Name:"Promethium",Symbol:"Pm","Melting Point":"1100","Boiling Point":"3000",Density:"7.3",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f5 6s2"},{Number:"62",Type:"lanthanide","Atomic Weight":"150.36",Name:"Samarium",Symbol:"Sm","Melting Point":"1072","Boiling Point":"1900",Density:"7.52",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f6 6s2"},{Number:"63",Type:"lanthanide","Atomic Weight":"151.964",Name:"Europium",Symbol:"Eu","Melting Point":"822","Boiling Point":"1597",Density:"5.24",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f7 6s2"},{Number:"64",Type:"lanthanide","Atomic Weight":"157.25",Name:"Gadolinium",Symbol:"Gd","Melting Point":"1311","Boiling Point":"3233",Density:"7.9",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f7 5d1 6s2"},{Number:"65",Type:"lanthanide","Atomic Weight":"158.925",Name:"Terbium",Symbol:"Tb","Melting Point":"1360","Boiling Point":"3041",Density:"8.23",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f9 6s2"},{Number:"66",Type:"lanthanide","Atomic Weight":"162.5",Name:"Dysprosium",Symbol:"Dy","Melting Point":"1412","Boiling Point":"2562",Density:"8.55",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f10 6s2"},{Number:"67",Type:"lanthanide","Atomic Weight":"164.93",Name:"Holmium",Symbol:"Ho","Melting Point":"1470","Boiling Point":"2720",Density:"8.8",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f11 6s2"},{Number:"68",Type:"lanthanide","Atomic Weight":"167.259",Name:"Erbium",Symbol:"Er","Melting Point":"1522","Boiling Point":"2510",Density:"9.07",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f12 6s2"},{Number:"69",Type:"lanthanide","Atomic Weight":"168.934",Name:"Thulium",Symbol:"Tm","Melting Point":"1545","Boiling Point":"1727",Density:"9.32",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f13 6s2"},{Number:"70",Type:"lanthanide","Atomic Weight":"173.04",Name:"Ytterbium",Symbol:"Yb","Melting Point":"824","Boiling Point":"1466",Density:"6.9",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f14 6s2"},{Number:"71",Type:"lanthanide","Atomic Weight":"174.967",Name:"Lutetium",Symbol:"Lu","Melting Point":"1656","Boiling Point":"3315",Density:"9.84",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f14 5d1 6s2"},{Number:"72",Type:"transition metal","Atomic Weight":"178.49",Name:"Hafnium",Symbol:"Hf","Melting Point":"2150","Boiling Point":"5400",Density:"13.31",Earth:"",Group:"4","Electron Configuration":"[Xe] 4f14 5d2 6s2"},{Number:"73",Type:"transition metal","Atomic Weight":"180.948",Name:"Tantalum",Symbol:"Ta","Melting Point":"2996","Boiling Point":"5425",Density:"16.65",Earth:"",Group:"5","Electron Configuration":"[Xe] 4f14 5d3 6s2"},{Number:"74",Type:"transition metal","Atomic Weight":"183.84",Name:"Tungsten",Symbol:"W","Melting Point":"3410","Boiling Point":"5660",Density:"19.35",Earth:"",Group:"6","Electron Configuration":"[Xe] 4f14 5d4 6s2"},{Number:"75",Type:"transition metal","Atomic Weight":"186.207",Name:"Rhenium",Symbol:"Re","Melting Point":"3180","Boiling Point":"5627",Density:"21.04",Earth:"",Group:"7","Electron Configuration":"[Xe] 4f14 5d5 6s2"},{Number:"76",Type:"transition metal","Atomic Weight":"190.23",Name:"Osmium",Symbol:"Os","Melting Point":"3045","Boiling Point":"5027",Density:"22.6",Earth:"",Group:"8","Electron Configuration":"[Xe] 4f14 5d6 6s2"},{Number:"77",Type:"transition metal","Atomic Weight":"192.217",Name:"Iridium",Symbol:"Ir","Melting Point":"2410","Boiling Point":"4527",Density:"22.4",Earth:"",Group:"9","Electron Configuration":"[Xe] 4f14 5d7 6s2"},{Number:"78",Type:"transition metal","Atomic Weight":"195.078",Name:"Platinum",Symbol:"Pt","Melting Point":"1772","Boiling Point":"3827",Density:"21.45",Earth:"",Group:"10","Electron Configuration":"[Xe] 4f14 5d9 6s1"},{Number:"79",Type:"transition metal","Atomic Weight":"196.967",Name:"Gold",Symbol:"Au","Melting Point":"1064","Boiling Point":"2807",Density:"19.32",Earth:"",Group:"11","Electron Configuration":"[Xe] 4f14 5d10 6s1"},{Number:"80",Type:"transition metal","Atomic Weight":"200.59",Name:"Mercury",Symbol:"Hg","Melting Point":"-39","Boiling Point":"357",Density:"13.55",Earth:"",Group:"12","Electron Configuration":"[Xe] 4f14 5d10 6s2"},{Number:"81",Type:"post transition metal","Atomic Weight":"204.383",Name:"Thallium",Symbol:"Tl","Melting Point":"303","Boiling Point":"1457",Density:"11.85",Earth:"",Group:"13","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p1"},{Number:"82",Type:"post transition metal","Atomic Weight":"207.2",Name:"Lead",Symbol:"Pb","Melting Point":"327","Boiling Point":"1740",Density:"11.35",Earth:"",Group:"14","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p2"},{Number:"83",Type:"post transition metal","Atomic Weight":"208.98",Name:"Bismuth",Symbol:"Bi","Melting Point":"271","Boiling Point":"1560",Density:"9.75",Earth:"",Group:"15","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p3"},{Number:"84",Type:"metalloid","Atomic Weight":"209",Name:"Polonium",Symbol:"Po","Melting Point":"254","Boiling Point":"962",Density:"9.3",Earth:"",Group:"16","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p4"},{Number:"85",Type:"halogen","Atomic Weight":"210",Name:"Astatine",Symbol:"At","Melting Point":"302","Boiling Point":"337",Density:"0",Earth:"",Group:"17","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p5"},{Number:"86",Type:"noble gas","Atomic Weight":"222",Name:"Radon",Symbol:"Rn","Melting Point":"-71","Boiling Point":"-62",Density:"9.73",Earth:"",Group:"18","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p6"},{Number:"87",Type:"alkali metal","Atomic Weight":"223",Name:"Francium",Symbol:"Fr","Melting Point":"27","Boiling Point":"677",Density:"0",Earth:"",Group:"1","Electron Configuration":"[Rn] 7s1"},{Number:"88",Type:"alkaline earth metal","Atomic Weight":"226",Name:"Radium",Symbol:"Ra","Melting Point":"700","Boiling Point":"1737",Density:"5.5",Earth:"",Group:"2","Electron Configuration":"[Rn] 7s2"},{Number:"89",Type:"actinide","Atomic Weight":"227",Name:"Actinium",Symbol:"Ac","Melting Point":"1050","Boiling Point":"3200",Density:"10.07",Earth:"",Group:"3","Electron Configuration":"[Rn] 6d1 7s2"},{Number:"90",Type:"actinide","Atomic Weight":"232.038",Name:"Thorium",Symbol:"Th","Melting Point":"1750","Boiling Point":"4790",Density:"11.72",Earth:"",Group:"102","Electron Configuration":"[Rn] 6d2 7s2"},{Number:"91",Type:"actinide","Atomic Weight":"231.036",Name:"Protactinium",Symbol:"Pa","Melting Point":"1568","Boiling Point":"0",Density:"15.4",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f2 6d1 7s2"},{Number:"92",Type:"actinide","Atomic Weight":"238.029",Name:"Uranium",Symbol:"U","Melting Point":"1132","Boiling Point":"3818",Density:"18.95",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f3 6d1 7s2"},{Number:"93",Type:"actinide","Atomic Weight":"237",Name:"Neptunium",Symbol:"Np","Melting Point":"640","Boiling Point":"3902",Density:"20.2",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f4 6d1 7s2"},{Number:"94",Type:"actinide","Atomic Weight":"244",Name:"Plutonium",Symbol:"Pu","Melting Point":"640","Boiling Point":"3235",Density:"19.84",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f6 7s2"},{Number:"95",Type:"actinide","Atomic Weight":"243",Name:"Americium",Symbol:"Am","Melting Point":"994","Boiling Point":"2607",Density:"13.67",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f7 7s2"},{Number:"96",Type:"actinide","Atomic Weight":"247",Name:"Curium",Symbol:"Cm","Melting Point":"1340","Boiling Point":"0",Density:"13.5",Earth:"",Group:"102","Electron Configuration":""},{Number:"97",Type:"actinide","Atomic Weight":"247",Name:"Berkelium",Symbol:"Bk","Melting Point":"986","Boiling Point":"0",Density:"14.78",Earth:"",Group:"102","Electron Configuration":""},{Number:"98",Type:"actinide","Atomic Weight":"251",Name:"Californium",Symbol:"Cf","Melting Point":"900","Boiling Point":"0",Density:"15.1",Earth:"",Group:"102","Electron Configuration":""},{Number:"99",Type:"actinide","Atomic Weight":"252",Name:"Einsteinium",Symbol:"Es","Melting Point":"860","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"100",Type:"actinide","Atomic Weight":"257",Name:"Fermium",Symbol:"Fm","Melting Point":"1527","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"101",Type:"actinide","Atomic Weight":"258",Name:"Mendelevium",Symbol:"Md","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"102",Type:"actinide","Atomic Weight":"259",Name:"Nobelium",Symbol:"No","Melting Point":"827","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"103",Type:"actinide","Atomic Weight":"262",Name:"Lawrencium",Symbol:"Lr","Melting Point":"1627","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"104",Type:"transition metal","Atomic Weight":"261",Name:"Rutherfordium",Symbol:"Rf","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"4","Electron Configuration":""},{Number:"105",Type:"transition metal","Atomic Weight":"262",Name:"Dubnium",Symbol:"Db","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"5","Electron Configuration":""},{Number:"106",Type:"transition metal","Atomic Weight":"266",Name:"Seaborgium",Symbol:"Sg","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"6","Electron Configuration":""},{Number:"107",Type:"transition metal","Atomic Weight":"264",Name:"Bohrium",Symbol:"Bh","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"7","Electron Configuration":""},{Number:"108",Type:"transition metal","Atomic Weight":"277",Name:"Hassium",Symbol:"Hs","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"8","Electron Configuration":""},{Number:"109",Type:"transition metal","Atomic Weight":"268",Name:"Meitnerium",Symbol:"Mt","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"9","Electron Configuration":""}];var wc=function(){return wc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{s==null||s.apply(null,[l,a])},style:{backgroundColor:t.has(a.Symbol)?e:r,textAlign:"center",position:"relative",display:"flex",flexDirection:"column",border:"1px solid black",borderRadius:3,height:"100%",justifyContent:"center",alignItems:"center"},children:C.jsx("div",{className:"symbol",style:{color:t.has(a.Symbol)?n:e,fontSize:"small",width:"100%",overflow:"hidden",textOverflow:"ellipsis"},children:a.Symbol})}):C.jsx("div",{})}}function ane(t){const e=(a,l)=>{t.onClickElement(l.Symbol)},n=mu(),r=n.palette.background.default,i=n.palette.primary.main,o=n.palette.primary.contrastText,s=n.palette.primary.dark;return C.jsx(Bs,{sx:{bgcolor:r},children:C.jsx(Kte,{onClick:e,Element:sne({availableElements:t.availableElements,backgroundColor:i,textColor:o,disabledColor:s}),squareSize:t.elementSize,margin:0})})}function lne(t){const e=t.availableElements,[n,r]=A.useState(null),i=mu(),o=Oz(i.breakpoints.down("lg")),s=f=>{r(f.currentTarget)},a=()=>{r(null)},l=!!n,c=l?"simple-popover":void 0,u=o?30:55;return C.jsxs(rs,{direction:"row",spacing:2,children:[C.jsxs(u6,{children:[C.jsx(h6,{id:"Element",children:"Element"}),C.jsxs(IR,{sx:{minWidth:150},labelId:"Element",id:"Element",value:t.selectedElement,label:"Element",onChange:f=>t.setSelectedElement(f.target.value),children:[C.jsx(g4,{value:"all",children:"All Elements"}),[...e].map((f,h)=>C.jsx(g4,{value:f,children:f},h))]})]}),C.jsx(ou,{"aria-describedby":c,variant:"outlined",sx:{textTransform:"none"},onClick:s,children:"Periodic Table"}),C.jsx(x6,{id:c,open:l,anchorEl:n,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:C.jsx(ane,{availableElements:t.availableElements,onClickElement:f=>{t.availableElements.has(f)&&t.setSelectedElement(f),r(null)},elementSize:u})})]})}const Qa=7,Vh=qe(Ts)(({theme:t})=>({[`&.${gm.head}`]:{backgroundColor:t.palette.common.black,color:t.palette.common.white},[`&.${gm.body}`]:{fontSize:14,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}})),cne=qe(Yb)(({theme:t})=>({"&:nth-of-type(odd):not(:hover):not(.activeclicked)":{backgroundColor:t.palette.action.selected},"&:last-child td, &:last-child th":{border:0}}));function une(t){var n,r,i,o,s;const e=t.xasstandard===t.selected?"activeclicked":"";return C.jsxs(cne,{onClick:()=>{t.setSelectedRow(t.key),t.updatePlot(t.xasstandard)},className:e,hover:!0,selected:t.selectedRow===t.key,sx:{"&:last-child td, &:last-child th":{border:0}},children:[C.jsx(Vh,{align:"left",children:((n=t.xasstandard)==null?void 0:n.element.symbol)??" "}),C.jsx(Vh,{align:"center",children:((r=t.xasstandard)==null?void 0:r.edge.name)??""}),C.jsx(Vh,{align:"center",children:((i=t.xasstandard)==null?void 0:i.sample.name)??""}),C.jsx(Vh,{align:"center",children:((o=t.xasstandard)==null?void 0:o.sample.prep)??""}),C.jsx(Vh,{align:"right",children:((s=t.xasstandard)==null?void 0:s.beamline.name)??""})]},t.key)}function fne(t){const[e,n]=A.useState(-1),r=()=>{t.setOffset(t.offset+Qa)},i=()=>{t.setOffset(t.offset-Qa)},o=a=>{t.updatePlot(a.location),t.setSelectedStandard(a)};let s=[...t.standards];if(s.length<=Qa)for(;s.lengthune({key:l,xasstandard:a,selected:t.selectedStandard,updatePlot:o,selectedRow:e,setSelectedRow:n}))})]})}),C.jsxs(rs,{direction:"row",spacing:2,children:[C.jsx(ou,{variant:"contained",disabled:t.offset===0,onClick:i,children:"<"}),C.jsx(ou,{variant:"contained",disabled:t.standards.length"})]})]})}function dne(t){const[e,n]=A.useState(),[r,i]=A.useState("all"),[o,s]=A.useState(0),a=t.standards.map(f=>f.element.symbol),l=new Set(a);let c=[];r!="all"?c=t.standards.filter(f=>f.element.symbol==r):c=t.standards;const u=f=>{i(f),s(0)};return C.jsxs(rs,{spacing:2,children:[C.jsx(lne,{availableElements:l,selectedElement:r,setSelectedElement:u}),C.jsx(fne,{standards:c,updatePlot:t.updatePlot,selectedStandard:e,setSelectedStandard:n,offset:o,setOffset:s}),e&&C.jsx(kR,{standard:e,showDownload:!0,showCompare:!0})]})}class hne{constructor(e,n,r,i){Vt(this,"namespace");Vt(this,"tag");Vt(this,"value");Vt(this,"unit");this.namespace=e,this.tag=n,this.value=r,this.unit=i}}const ht=class ht{constructor(e,n,r,i,o,s,a,l,c,u){Vt(this,"element");Vt(this,"edge");Vt(this,"sample");Vt(this,"beamline");Vt(this,"date");Vt(this,"columns");Vt(this,"comments");Vt(this,"data");Vt(this,"raw");Vt(this,"id");this.element=e,this.edge=n,this.sample=r,this.beamline=i,this.date=o,this.columns=s,this.comments=a,this.data=l,this.raw=c,this.id=u}static parseFile(e,n){const r=e.split(` +`),i={},o=[];let s=null,a=null,l=null,c=null;const u=[];let f=!1,h="";for(let v=0;vMath.log2(v/m.itrans[x]))),!("murefer"in m)&&"irefer"in m&&"i0"in m&&(m.murefer=m.i0.map((v,x)=>Math.log2(v/m.irefer[x]))),!("mufluor"in m)&&"ifluor"in m&&"i0"in m&&(m.mufluor=m.i0.map((v,x)=>m.ifluor[x]/v)),new ht(a,l,i,s,c,o,h,m,e,n)}static checkHeaderLine(e){const n=e.slice(1).trim();if(n.slice(0,3)!="XDI")throw new Error("XDI header not matched by: "+n)}muTrans(){return ht.MUSPEC[0]in this.data?this.data[ht.MUSPEC[0]]:null}muFluor(){return ht.MUSPEC[1]in this.data?this.data[ht.MUSPEC[1]]:null}energy(){return this.data[ht.ENERGY]}build_sample(){return this.sample?{name:"name"in this.sample?this.sample.name:"Unknown name",prep:"prep"in this.sample?this.sample.prep:"Unknown prep",formula:"formula"in this.sample?this.sample.formula:"Unknown formula"}:null}muRefer(){return ht.MUREFER in this.data?this.data[ht.MUREFER]:null}rawText(){return this.raw}checkValid(){if(!this.columns.includes(ht.ENERGY))throw new Error("Required column energy is missing!");const e=this.columns.includes(ht.I0);if(!(this.columns.includes(ht.IREFER)&&e)||!this.columns.includes(ht.MUREFER))throw new Error("Required reference data is missing!");const n=(o,s)=>s.some(a=>o.includes(a));return!!(n(this.columns,ht.MUSPEC)||n(this.columns,ht.ISPEC)&&e)}static parseMetadataLine(e){const n=e.slice(1).trim(),r=n.indexOf(ht.HEADER_SPLIT_TOKEN),i=n.slice(0,r).trim(),o=n.slice(r+1).trim(),s=i.indexOf("."),a=i.slice(0,s),l=i.slice(s+1).toLowerCase(),c=a===ht.COLUMN;let u=o,f=null;if(c){const h=o.split(" ");u=h[0].trim(),f=c&&h.length>1?h[1].trim():null}return new hne(a,l,u,f)}};Vt(ht,"COMMENT_TOKEN","#"),Vt(ht,"HEADER_SPLIT_TOKEN",":"),Vt(ht,"NAMESPACE_SEPARATOR","."),Vt(ht,"SAMPLE","Sample"),Vt(ht,"ELEMENT","Element"),Vt(ht,"BEAMLINE","Beamline"),Vt(ht,"SCAN","Scan"),Vt(ht,"SYMBOL","symbol"),Vt(ht,"EDGE","edge"),Vt(ht,"PREP","prep"),Vt(ht,"STOICHIOMETRY","stoichiometry"),Vt(ht,"COLUMN","Column"),Vt(ht,"START_TIME","start_time"),Vt(ht,"NAME","name"),Vt(ht,"ENERGY","energy"),Vt(ht,"IREFER","irefer"),Vt(ht,"MUREFER","murefer"),Vt(ht,"TRANS","trans"),Vt(ht,"FLUOR","fluor"),Vt(ht,"MU","mu"),Vt(ht,"I","i"),Vt(ht,"I0","i0"),Vt(ht,"MUSPEC",[ht.MU+ht.TRANS,ht.MU+ht.FLUOR]),Vt(ht,"ISPEC",[ht.I+ht.TRANS,ht.I+ht.FLUOR]);let _d=ht;const pne="/webxdiviewer/xdidata/db.json";function mne(){const[t,e]=A.useState([]);return A.useEffect(()=>{Dn.get(pne).then(n=>{e(n.data)})},[]),t}const OR=A.createContext([]);function gne(t){const{children:e}=t,n=mne();return C.jsx(OR.Provider,{value:n,children:e})}function gr(t){const e=A.useRef(t);return e.current=t,A.useMemo(()=>Object.freeze({get current(){return e.current}}),[])}function DR(t){const e=gr(t);A.useEffect(()=>()=>{e.current()},[])}const C1=typeof window<"u"&&typeof navigator<"u"&&typeof document<"u";function P6(t){const e=gr(t),n=A.useRef(0),r=A.useCallback(()=>{C1&&n.current&&(cancelAnimationFrame(n.current),n.current=0)},[]);return DR(r),[A.useMemo(()=>{const i=(...o)=>{C1&&(r(),n.current=requestAnimationFrame(()=>{e.current(...o),n.current=0}))};return Object.defineProperties(i,{length:{value:t.length},name:{value:`${t.name||"anonymous"}__raf`}}),i},[]),r]}function vne(t,e,n,r=!1){const i=A.useRef(),o=A.useRef();return DR(()=>{i.current&&(clearTimeout(i.current),i.current=void 0)}),A.useMemo(()=>{const s=(l,c)=>{o.current=void 0,t.apply(l,c),i.current=setTimeout(()=>{i.current=void 0,!r&&o.current&&(s(o.current.this,o.current.args),o.current=void 0)},n)},a=function(...l){if(i.current){o.current={args:l,this:this};return}s(this,l)};return Object.defineProperties(a,{length:{value:t.length},name:{value:`${t.name||"anonymous"}__throttled__${n}`}}),a},[n,r,...e])}function N6(t,...e){var n;(n=t==null?void 0:t.addEventListener)==null||n.call(t,...e)}function I6(t,...e){var n;(n=t==null?void 0:t.removeEventListener)==null||n.call(t,...e)}const yne=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function xne(t=!1){const e=A.useRef(t),n=A.useCallback(()=>e.current,[]);return A.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),n}const bne=t=>(t+1)%Number.MAX_SAFE_INTEGER;function L6(){const[,t]=A.useState(0);return A.useCallback(()=>{t(bne)},[])}function _ne(t,e){return typeof t=="function"?t(e):t}const sM=Map.prototype;function wne(t){const e=A.useRef(),n=L6();if(!e.current){const r=new Map(t);e.current=r,r.set=(...i)=>(sM.set.apply(r,i),n(),r),r.clear=(...i)=>{sM.clear.apply(r,i),n()},r.delete=(...i)=>{const o=sM.delete.apply(r,i);return n(),o}}return e.current}function R4(t){const e=A.useRef();return A.useEffect(()=>{e.current=t}),e.current}function Sne(t){const[e,n]=A.useState(t),[r,i]=P6(n);return DR(i),[e,r]}function Kb(t=!1,e=!0){const[n,r]=A.useState(t),i=gr(e);return[n,A.useCallback(o=>{r(s=>o===void 0||i.current&&typeof o=="object"&&(o.constructor.name==="SyntheticBaseEvent"||typeof o._reactName=="string")?!s:!!_ne(o,s))},[])]}function Mne(t,e,n){const r=gr(e),i=gr(n);return A.useMemo(()=>{let o=t;return{get current(){return i.current===void 0?o:i.current(o)},set current(s){o=r.current===void 0?s:r.current(s)}}},[])}let ov;function Ene(){if(!C1)return;if(ov)return ov;const t=new Map,e=new ResizeObserver(n=>{var r;for(const i of n)(r=t.get(i.target))==null||r.forEach(o=>setTimeout(()=>{o(i)},0))});return ov={observer:e,subscribe(n,r){let i=t.get(n);i||(i=new Set,t.set(n,i),e.observe(n)),i.add(r)},unsubscribe(n,r){const i=t.get(n);i&&(i.delete(r),i.size===0&&(t.delete(n),e.unobserve(n)))}},ov}function Cne(t,e,n=!0){const r=n&&Ene(),i=gr(e),o=t&&"current"in t?t.current:t;A.useEffect(()=>{const s=t&&"current"in t?t.current:t;if(!r||!s)return;let a=!0;const l=(...c)=>{a&&i.current(...c)};return r.subscribe(s,l),()=>{a=!1,r.unsubscribe(s,l)}},[o,r])}function Tne(t=!0){const[e,n]=A.useState(null),r=Mne(null,a=>(n(a),a)),[i,o]=A.useState(),[s]=P6(a=>{o({width:a.contentRect.width,height:a.contentRect.height})});return Cne(e,s,t),[i,r]}function Bc(t,...e){const n=xne(),r=gr(e[1]),i=A.useMemo(()=>function(...o){n()&&(typeof r.current=="function"?r.current.apply(this,o):typeof r.current.handleEvent=="function"&&r.current.handleEvent.apply(this,o))},[]);A.useEffect(()=>{const o=Rne(t)?t.current:t;if(!o)return;const s=e.slice(2);return N6(o,e[0],i,...s),()=>{I6(o,e[0],i,...s)}},[t,e[0]])}function Rne(t){return t!==null&&typeof t=="object"&&yne(t,"current")}const Ane=t=>e=>e.key===t,Pne=C1?window:null;function k6(t,e,n=[],r={}){const{event:i="keydown",target:o=Pne,eventOptions:s}=r,a=gr(e),l=A.useMemo(()=>{const c=Ane(t);return function(u){c(u)&&a.current.call(this,u)}},n);Bc(o,i,l,s)}const Nne=["mousedown","touchstart"];function Ine(t,e,n=Nne){const r=gr(e),i=gr(t);A.useEffect(()=>{function o(s){if(!i.current.current)return;const{target:a}=s,l=r.current;(!a||a&&!i.current.current.contains(a))&&l.call(this,s)}for(const s of n)N6(document,s,o,{passive:!0});return()=>{for(const s of n)I6(document,s,o,{passive:!0})}},[...n])}function Oy(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Lne(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function O6(t){let e,n,r;t.length!==2?(e=Oy,n=(a,l)=>Oy(t(a),l),r=(a,l)=>t(a)-l):(e=t===Oy||t===Lne?t:kne,n=t,r=t);function i(a,l,c=0,u=a.length){if(c>>1;n(a[f],l)<0?c=f+1:u=f}while(c>>1;n(a[f],l)<=0?c=f+1:u=f}while(cc&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function kne(){return 0}function One(t){return t===null?NaN:+t}const Dne=O6(Oy),Fne=Dne.right;O6(One).center;const zne=Math.sqrt(50),Une=Math.sqrt(10),Bne=Math.sqrt(2);function T1(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=zne?10:o>=Une?5:o>=Bne?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(t*c),l=Math.round(e*c),a/ce&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(t/c),l=Math.round(e/c),a*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function R1(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function wd(t){return t=R1(Math.abs(t)),t?t[1]:NaN}function Vne(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function $ne(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Wne=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vm(t){if(!(e=Wne.exec(t)))throw new Error("invalid format: "+t);var e;return new FR({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}vm.prototype=FR.prototype;function FR(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}FR.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Hne(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var z6;function Gne(t,e){var n=R1(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(z6=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+R1(t,Math.max(0,e+o-1))[0]}function A4(t,e){var n=R1(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const P4={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:jne,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>A4(t*100,e),r:A4,s:Gne,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function N4(t){return t}var I4=Array.prototype.map,L4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xne(t){var e=t.grouping===void 0||t.thousands===void 0?N4:Vne(I4.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?N4:$ne(I4.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=vm(f);var h=f.fill,m=f.align,v=f.sign,x=f.symbol,y=f.zero,g=f.width,b=f.comma,_=f.precision,S=f.trim,P=f.type;P==="n"?(b=!0,P="g"):P4[P]||(_===void 0&&(_=12),S=!0,P="g"),(y||h==="0"&&m==="=")&&(y=!0,h="0",m="=");var N=x==="$"?n:x==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():"",T=x==="$"?r:/[%p]/.test(P)?s:"",L=P4[P],U=/[defgprs%]/.test(P);_=_===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function M(R){var D=N,O=T,B,X,H;if(P==="c")O=L(R)+O,R="";else{R=+R;var Z=R<0||1/R<0;if(R=isNaN(R)?l:L(Math.abs(R),_),S&&(R=Hne(R)),Z&&+R==0&&v!=="+"&&(Z=!1),D=(Z?v==="("?v:a:v==="-"||v==="("?"":v)+D,O=(P==="s"?L4[8+z6/3]:"")+O+(Z&&v==="("?")":""),U){for(B=-1,X=R.length;++BH||H>57){O=(H===46?i+R.slice(B+1):R.slice(B))+O,R=R.slice(0,B);break}}}b&&!y&&(R=e(R,1/0));var F=D.length+R.length+O.length,Y=F>1)+D+R+O+Y.slice(F);break;default:R=Y+D+R+O;break}return o(R)}return M.toString=function(){return f+""},M}function u(f,h){var m=c((f=vm(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(wd(h)/3)))*3,x=Math.pow(10,-v),y=L4[8+v/3];return function(g){return m(x*g)+y}}return{format:c,formatPrefix:u}}var sv,Gs,U6;qne({thousands:",",grouping:[3],currency:["$",""]});function qne(t){return sv=Xne(t),Gs=sv.format,U6=sv.formatPrefix,sv}function Yne(t){return Math.max(0,-wd(Math.abs(t)))}function Kne(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(wd(e)/3)))*3-wd(Math.abs(t)))}function Zne(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,wd(e)-wd(t))+1}function Jne(t){for(var e=new Array(t),n=0;n + * @license MIT + */var ere=function(t){return t!=null&&(B6(t)||tre(t)||!!t._isBuffer)};function B6(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function tre(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&B6(t.slice(0,0))}var nre=Qne,rre=ere,ire=typeof Float64Array<"u";function ore(t,e){return t[0]-e[0]}function sre(){var t=this.stride,e=new Array(t.length),n;for(n=0;nMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):e===3&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+n+"_set("+s.join(",")+",v){"),r?i.push("return this.data.set("+a+",v)}"):i.push("return this.data["+a+"]=v}"),i.push("proto.get=function "+n+"_get("+s.join(",")+"){"),r?i.push("return this.data.get("+a+")}"):i.push("return this.data["+a+"]}"),i.push("proto.index=function "+n+"_index(",s.join(),"){return "+a+"}"),i.push("proto.hi=function "+n+"_hi("+s.join(",")+"){return new "+n+"(this.data,"+o.map(function(y){return["(typeof i",y,"!=='number'||i",y,"<0)?this.shape[",y,"]:i",y,"|0"].join("")}).join(",")+","+o.map(function(y){return"this.stride["+y+"]"}).join(",")+",this.offset)}");var u=o.map(function(y){return"a"+y+"=this.shape["+y+"]"}),f=o.map(function(y){return"c"+y+"=this.stride["+y+"]"});i.push("proto.lo=function "+n+"_lo("+s.join(",")+"){var b=this.offset,d=0,"+u.join(",")+","+f.join(","));for(var h=0;h=0){d=i"+h+"|0;b+=c"+h+"*d;a"+h+"-=d}");i.push("return new "+n+"(this.data,"+o.map(function(y){return"a"+y}).join(",")+","+o.map(function(y){return"c"+y}).join(",")+",b)}"),i.push("proto.step=function "+n+"_step("+s.join(",")+"){var "+o.map(function(y){return"a"+y+"=this.shape["+y+"]"}).join(",")+","+o.map(function(y){return"b"+y+"=this.stride["+y+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var h=0;h=0){c=(c+this.stride["+h+"]*i"+h+")|0}else{a.push(this.shape["+h+"]);b.push(this.stride["+h+"])}");i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+o.map(function(y){return"shape["+y+"]"}).join(",")+","+o.map(function(y){return"stride["+y+"]"}).join(",")+",offset)}");var x=new Function("CTOR_LIST","ORDER",i.join(` +`));return x(A1[t],sre)}function lre(t){if(rre(t))return"buffer";if(ire)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(t)?"array":"generic"}var A1={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function cre(t,e,n,r){if(t===void 0){var c=A1.array[0];return c([])}else typeof t=="number"&&(t=[t]);e===void 0&&(e=[t.length]);var i=e.length;if(n===void 0){n=new Array(i);for(var o=i-1,s=1;o>=0;--o)n[o]=s,s*=e[o]}if(r===void 0){r=0;for(var o=0;o0,s=[],a=[],l=0,c=0,u,f;for(u=0;u0&&s.push("var "+a.join(",")),u=r-1;u>=0;--u)l=t[u],s.push(["for(i",u,"=0;i",u,"0&&s.push(["index[",c,"]-=s",c].join("")),s.push(["++index[",l,"]"].join(""))),s.push("}")}return s.join(` +`)}function vre(t,e,n,r){for(var i=e.length,o=n.arrayArgs.length,s=n.blockSize,a=n.indexArgs.length>0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",e[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",e[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),a&&l.push(["index[",e[c],"]=j",c].join(""));for(var c=0;c0&&(n=n&&e[r]===e[r-1])}return n?e[0]:e.join("")}function bre(t,e){for(var n=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,r=new Array(t.arrayArgs.length),i=new Array(t.arrayArgs.length),o=0;o0&&x.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var y=new Array(n),o=0;o0&&v.push("var "+x.join(","));for(var o=0;o3&&v.push(aM(t.pre,t,i));var S=aM(t.body,t,i),P=yre(u);P3&&v.push(aM(t.post,t,i)),t.debug&&console.log("-----Generated cwise routine for ",e,`: +`+v.join(` +`)+` +----------`);var N=[t.funcName||"unnamed","_cwise_loop_",r[0].join("s"),"m",P,xre(i)].join(""),T=new Function(["function ",N,"(",m.join(","),"){",v.join(` +`),"} return ",N].join(""));return T()}var _re=bre,wre=_re;function Sre(t){var e=["'use strict'","var CACHED={}"],n=[],r=t.funcName+"_cwise_thunk";e.push(["return function ",r,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],a=[],l=[],c=0;c0&&(a.push("array"+t.arrayArgs[0]+".shape.length===array"+u+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),l.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+u+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+a.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;c0)throw new Error("cwise: pre() block may not reference array args");if(r0)throw new Error("cwise: post() block may not reference array args")}else if(i==="scalar")e.scalarArgs.push(r),e.shimArgs.push("scalar"+r);else if(i==="index"){if(e.indexArgs.push(r),r0)throw new Error("cwise: pre() block may not reference array index");if(r0)throw new Error("cwise: post() block may not reference array index")}else if(i==="shape"){if(e.shapeArgs.push(r),rn.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,Ere(e)}var Rre=Tre;(function(t){var e=Rre,n={body:"",args:[],thisVars:[],localVars:[]};function r(h){if(!h)return n;for(var m=0;m>",rrshift:">>>"};(function(){for(var h in s){var m=s[h];t[h]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+m+"c"},funcName:h}),t[h+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+m+"=b"},rvalue:!0,funcName:h+"eq"}),t[h+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+m+"s"},funcName:h+"s"}),t[h+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+m+"=s"},rvalue:!0,funcName:h+"seq"})}})();var a={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var h in a){var m=a[h];t[h]=o({args:["array","array"],body:{args:["a","b"],body:"a="+m+"b"},funcName:h}),t[h+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+m+"a"},rvalue:!0,count:2,funcName:h+"eq"})}})();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var h in l){var m=l[h];t[h]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+m+"c"},funcName:h}),t[h+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+m+"s"},funcName:h+"s"}),t[h+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+m+"b"},rvalue:!0,count:2,funcName:h+"eq"}),t[h+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+m+"s"},rvalue:!0,count:2,funcName:h+"seq"})}})();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var h=0;hthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),t.norm1=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),t.sup=e({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),t.inf=e({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),t.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),t.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),t.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),t.equals=e({args:["array","array"],pre:n,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})})(fre);/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */const Zb="169",Are={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Pre={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},$6=0,eC=1,W6=2,Nre=3,H6=0,Jb=1,Ap=2,Yo=3,Pa=0,fi=1,Qo=2,wa=0,jc=1,tC=2,nC=3,rC=4,G6=5,hl=100,X6=101,q6=102,Y6=103,K6=104,Z6=200,J6=201,Q6=202,eU=203,P1=204,N1=205,tU=206,nU=207,rU=208,iU=209,oU=210,sU=211,aU=212,lU=213,cU=214,I1=0,L1=1,k1=2,su=3,O1=4,D1=5,F1=6,z1=7,cg=0,uU=1,fU=2,Os=0,dU=1,hU=2,pU=3,zR=4,mU=5,gU=6,vU=7,iC="attached",yU="detached",ug=300,Na=301,Nl=302,ym=303,xm=304,qd=306,bm=1e3,Ti=1001,_m=1002,lr=1003,UR=1004,Ire=1004,jf=1005,Lre=1005,tr=1006,Pp=1007,kre=1007,Rs=1008,Ore=1008,Fi=1009,BR=1010,jR=1011,Sd=1012,Qb=1013,Ia=1014,ai=1015,xu=1016,e_=1017,t_=1018,au=1020,VR=35902,$R=1021,WR=1022,Rr=1023,HR=1024,GR=1025,Vc=1026,lu=1027,fg=1028,dg=1029,XR=1030,n_=1031,Dre=1032,r_=1033,Np=33776,Ip=33777,Lp=33778,kp=33779,U1=35840,B1=35841,j1=35842,V1=35843,$1=36196,W1=37492,H1=37496,G1=37808,X1=37809,q1=37810,Y1=37811,K1=37812,Z1=37813,J1=37814,Q1=37815,ex=37816,tx=37817,nx=37818,rx=37819,ix=37820,ox=37821,Op=36492,sx=36494,ax=36495,qR=36283,lx=36284,cx=36285,ux=36286,xU=2200,bU=2201,_U=2202,wm=2300,fx=2301,Dy=2302,Nc=2400,Ic=2401,Sm=2402,i_=2500,YR=2501,Fre=0,zre=1,Ure=2,wU=3200,SU=3201,Bre=3202,jre=3203,jl=0,MU=1,ha="",Eo="srgb",Fa="srgb-linear",o_="display-p3",hg="display-p3-linear",Mm="linear",xn="srgb",Em="rec709",Cm="p3",Vre=0,xc=7680,$re=7681,Wre=7682,Hre=7683,Gre=34055,Xre=34056,qre=5386,Yre=512,Kre=513,Zre=514,Jre=515,Qre=516,eie=517,tie=518,oC=519,EU=512,CU=513,TU=514,KR=515,RU=516,AU=517,PU=518,NU=519,Tm=35044,nie=35048,rie=35040,iie=35045,oie=35049,sie=35041,aie=35046,lie=35050,cie=35042,uie="100",sC="300 es",As=2e3,Rm=2001;class Xs{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let o=0,s=i.length;o>8&255]+jr[t>>16&255]+jr[t>>24&255]+"-"+jr[e&255]+jr[e>>8&255]+"-"+jr[e>>16&15|64]+jr[e>>24&255]+"-"+jr[n&63|128]+jr[n>>8&255]+"-"+jr[n>>16&255]+jr[n>>24&255]+jr[r&255]+jr[r>>8&255]+jr[r>>16&255]+jr[r>>24&255]).toLowerCase()}function $n(t,e,n){return Math.max(e,Math.min(n,t))}function ZR(t,e){return(t%e+e)%e}function fie(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function die(t,e,n){return t!==e?(n-t)/(e-t):0}function Dp(t,e,n){return(1-n)*t+n*e}function hie(t,e,n,r){return Dp(t,e,1-Math.exp(-n*r))}function pie(t,e=1){return e-Math.abs(ZR(t,e*2)-e)}function mie(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function gie(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function vie(t,e){return t+Math.floor(Math.random()*(e-t+1))}function yie(t,e){return t+Math.random()*(e-t)}function xie(t){return t*(.5-Math.random())}function bie(t){t!==void 0&&(k4=t);let e=k4+=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 _ie(t){return t*$c}function wie(t){return t*Md}function Sie(t){return(t&t-1)===0&&t!==0}function Mie(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Eie(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Cie(t,e,n,r,i){const o=Math.cos,s=Math.sin,a=o(n/2),l=s(n/2),c=o((e+r)/2),u=s((e+r)/2),f=o((e-r)/2),h=s((e-r)/2),m=o((r-e)/2),v=s((r-e)/2);switch(i){case"XYX":t.set(a*u,l*f,l*h,a*c);break;case"YZY":t.set(l*h,a*u,l*f,a*c);break;case"ZXZ":t.set(l*f,l*h,a*u,a*c);break;case"XZX":t.set(a*u,l*v,l*m,a*c);break;case"YXY":t.set(l*m,a*u,l*v,a*c);break;case"ZYZ":t.set(l*v,l*m,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function si(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Dt(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const IU={DEG2RAD:$c,RAD2DEG:Md,generateUUID:eo,clamp:$n,euclideanModulo:ZR,mapLinear:fie,inverseLerp:die,lerp:Dp,damp:hie,pingpong:pie,smoothstep:mie,smootherstep:gie,randInt:vie,randFloat:yie,randFloatSpread:xie,seededRandom:bie,degToRad:_ie,radToDeg:wie,isPowerOfTwo:Sie,ceilPowerOfTwo:Mie,floorPowerOfTwo:Eie,setQuaternionFromProperEuler:Cie,normalize:Dt,denormalize:si};class Ie{constructor(e=0,n=0){Ie.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.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 n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos($n(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,s=this.y-e.y;return this.x=o*r-s*i+e.x,this.y=o*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ot{constructor(e,n,r,i,o,s,a,l,c){Ot.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,s,a,l,c)}set(e,n,r,i,o,s,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[3],l=r[6],c=r[1],u=r[4],f=r[7],h=r[2],m=r[5],v=r[8],x=i[0],y=i[3],g=i[6],b=i[1],_=i[4],S=i[7],P=i[2],N=i[5],T=i[8];return o[0]=s*x+a*b+l*P,o[3]=s*y+a*_+l*N,o[6]=s*g+a*S+l*T,o[1]=c*x+u*b+f*P,o[4]=c*y+u*_+f*N,o[7]=c*g+u*S+f*T,o[2]=h*x+m*b+v*P,o[5]=h*y+m*_+v*N,o[8]=h*g+m*S+v*T,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*s*u-n*a*c-r*o*u+r*a*l+i*o*c-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*s-a*c,h=a*l-u*o,m=c*o-s*l,v=n*f+r*h+i*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/v;return e[0]=f*x,e[1]=(i*c-u*r)*x,e[2]=(a*r-i*s)*x,e[3]=h*x,e[4]=(u*n-i*l)*x,e[5]=(i*o-a*n)*x,e[6]=m*x,e[7]=(r*l-c*n)*x,e[8]=(s*n-r*o)*x,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,s,a){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*s+c*a)+s+e,-i*c,i*l,-i*(-c*s+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(lM.makeScale(e,n)),this}rotate(e){return this.premultiply(lM.makeRotation(-e)),this}translate(e,n){return this.premultiply(lM.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const lM=new Ot;function LU(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Tie={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Vf(t,e){return new Tie[t](e)}function Am(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function kU(){const t=Am("canvas");return t.style.display="block",t}const O4={};function Fy(t){t in O4||(O4[t]=!0,console.warn(t))}function Rie(t,e,n){return new Promise(function(r,i){function o(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:r()}}setTimeout(o,n)})}function Aie(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function Pie(t){const e=t.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const D4=new Ot().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),F4=new Ot().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),$h={[Fa]:{transfer:Mm,primaries:Em,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t,fromReference:t=>t},[Eo]:{transfer:xn,primaries:Em,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[hg]:{transfer:Mm,primaries:Cm,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.applyMatrix3(F4),fromReference:t=>t.applyMatrix3(D4)},[o_]:{transfer:xn,primaries:Cm,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.convertSRGBToLinear().applyMatrix3(F4),fromReference:t=>t.applyMatrix3(D4).convertLinearToSRGB()}},Nie=new Set([Fa,hg]),an={enabled:!0,_workingColorSpace:Fa,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Nie.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const r=$h[e].toReference,i=$h[n].fromReference;return i(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return $h[t].primaries},getTransfer:function(t){return t===ha?Mm:$h[t].transfer},getLuminanceCoefficients:function(t,e=this._workingColorSpace){return t.fromArray($h[e].luminanceCoefficients)}};function od(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function cM(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Zu;class OU{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Zu===void 0&&(Zu=Am("canvas")),Zu.width=e.width,Zu.height=e.height;const r=Zu.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=Zu}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.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 n=Am("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let s=0;s0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ug)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case bm:e.x=e.x-Math.floor(e.x);break;case Ti:e.x=e.x<0?0:1;break;case _m: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 bm:e.y=e.y-Math.floor(e.y);break;case Ti:e.y=e.y<0?0:1;break;case _m:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}kn.DEFAULT_IMAGE=null;kn.DEFAULT_MAPPING=ug;kn.DEFAULT_ANISOTROPY=1;class Zt{constructor(e=0,n=0,r=0,i=1){Zt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.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 n=this.x,r=this.y,i=this.z,o=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],f=l[8],h=l[1],m=l[5],v=l[9],x=l[2],y=l[6],g=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-x)<.01&&Math.abs(v-y)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+x)<.1&&Math.abs(v+y)<.1&&Math.abs(c+m+g-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const _=(c+1)/2,S=(m+1)/2,P=(g+1)/2,N=(u+h)/4,T=(f+x)/4,L=(v+y)/4;return _>S&&_>P?_<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(_),i=N/r,o=T/r):S>P?S<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(S),r=N/i,o=L/i):P<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(P),r=T/o,i=L/o),this.set(r,i,o,n),this}let b=Math.sqrt((y-v)*(y-v)+(f-x)*(f-x)+(h-u)*(h-u));return Math.abs(b)<.001&&(b=1),this.x=(y-v)/b,this.y=(f-x)/b,this.z=(h-u)/b,this.w=Math.acos((c+m+g-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 DU extends Xs{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Zt(0,0,e,n),this.scissorTest=!1,this.viewport=new Zt(0,0,e,n);const i={width:e,height:n,depth:1};r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},r);const o=new kn(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace);o.flipY=!1,o.generateMipmaps=r.generateMipmaps,o.internalFormat=r.internalFormat,this.textures=[];const s=r.count;for(let a=0;a=0?1:-1,_=1-g*g;if(_>Number.EPSILON){const P=Math.sqrt(_),N=Math.atan2(P,g*b);y=Math.sin(y*N)/P,a=Math.sin(a*N)/P}const S=a*b;if(l=l*y+h*S,c=c*y+m*S,u=u*y+v*S,f=f*y+x*S,y===1-a){const P=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=P,c*=P,u*=P,f*=P}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[s],h=o[s+1],m=o[s+2],v=o[s+3];return e[n]=a*v+u*f+l*m-c*h,e[n+1]=l*v+u*h+c*f-a*m,e[n+2]=c*v+u*m+a*h-l*f,e[n+3]=u*v-a*f-l*h-c*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,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),f=a(o/2),h=l(r/2),m=l(i/2),v=l(o/2);switch(s){case"XYZ":this._x=h*u*f+c*m*v,this._y=c*m*f-h*u*v,this._z=c*u*v+h*m*f,this._w=c*u*f-h*m*v;break;case"YXZ":this._x=h*u*f+c*m*v,this._y=c*m*f-h*u*v,this._z=c*u*v-h*m*f,this._w=c*u*f+h*m*v;break;case"ZXY":this._x=h*u*f-c*m*v,this._y=c*m*f+h*u*v,this._z=c*u*v+h*m*f,this._w=c*u*f-h*m*v;break;case"ZYX":this._x=h*u*f-c*m*v,this._y=c*m*f+h*u*v,this._z=c*u*v-h*m*f,this._w=c*u*f+h*m*v;break;case"YZX":this._x=h*u*f+c*m*v,this._y=c*m*f+h*u*v,this._z=c*u*v-h*m*f,this._w=c*u*f-h*m*v;break;case"XZY":this._x=h*u*f-c*m*v,this._y=c*m*f-h*u*v,this._z=c*u*v+h*m*f,this._w=c*u*f+h*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],f=n[10],h=r+a+f;if(h>0){const m=.5/Math.sqrt(h+1);this._w=.25/m,this._x=(u-l)*m,this._y=(o-c)*m,this._z=(s-i)*m}else if(r>a&&r>f){const m=2*Math.sqrt(1+r-a-f);this._w=(u-l)/m,this._x=.25*m,this._y=(i+s)/m,this._z=(o+c)/m}else if(a>f){const m=2*Math.sqrt(1+a-r-f);this._w=(o-c)/m,this._x=(i+s)/m,this._y=.25*m,this._z=(l+u)/m}else{const m=2*Math.sqrt(1+f-r-a);this._w=(s-i)/m,this._x=(o+c)/m,this._y=(l+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs($n(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,s=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,s=this._w;let a=s*e._w+r*e._x+i*e._y+o*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=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-n;return this._w=m*s+n*this._w,this._x=m*r+n*this._x,this._y=m*i+n*this._y,this._z=m*o+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-n)*u)/c,h=Math.sin(n*u)/c;return this._w=s*f+this._w*h,this._x=r*f+this._x*h,this._y=i*f+this._y*h,this._z=o*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(n),o*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,n=0,r=0){G.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.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,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(z4.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(z4.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,c=2*(s*i-a*r),u=2*(a*n-o*i),f=2*(o*r-s*n);return this.x=n+l*c+s*f-a*u,this.y=r+l*u+a*c-o*f,this.z=i+l*f+o*u-s*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return fM.copy(this).projectOnVector(e),this.sub(fM)}reflect(e){return this.sub(fM.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos($n(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const fM=new G,z4=new ki;class Pr{constructor(e=new G(1/0,1/0,1/0),n=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,r=e.length;n=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,n){return n.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,Wo),Wo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Wh),lv.subVectors(this.max,Wh),Ju.subVectors(e.a,Wh),Qu.subVectors(e.b,Wh),ef.subVectors(e.c,Wh),el.subVectors(Qu,Ju),tl.subVectors(ef,Qu),rc.subVectors(Ju,ef);let n=[0,-el.z,el.y,0,-tl.z,tl.y,0,-rc.z,rc.y,el.z,0,-el.x,tl.z,0,-tl.x,rc.z,0,-rc.x,-el.y,el.x,0,-tl.y,tl.x,0,-rc.y,rc.x,0];return!dM(n,Ju,Qu,ef,lv)||(n=[1,0,0,0,1,0,0,0,1],!dM(n,Ju,Qu,ef,lv))?!1:(cv.crossVectors(el,tl),n=[cv.x,cv.y,cv.z],dM(n,Ju,Qu,ef,lv))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Wo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Wo).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:(ra[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ra[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ra[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ra[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ra[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ra[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ra[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ra[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ra),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 ra=[new G,new G,new G,new G,new G,new G,new G,new G],Wo=new G,av=new Pr,Ju=new G,Qu=new G,ef=new G,el=new G,tl=new G,rc=new G,Wh=new G,lv=new G,cv=new G,ic=new G;function dM(t,e,n,r,i){for(let o=0,s=t.length-3;o<=s;o+=3){ic.fromArray(t,o);const a=i.x*Math.abs(ic.x)+i.y*Math.abs(ic.y)+i.z*Math.abs(ic.z),l=e.dot(ic),c=n.dot(ic),u=r.dot(ic);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const Die=new Pr,Hh=new G,hM=new G;class qr{constructor(e=new G,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):Die.setFromPoints(e).getCenter(r);let i=0;for(let o=0,s=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}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;Hh.subVectors(e,this.center);const n=Hh.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(Hh,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(hM.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Hh.copy(e.center).add(hM)),this.expandByPoint(Hh.copy(e.center).sub(hM))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ia=new G,pM=new G,uv=new G,nl=new G,mM=new G,fv=new G,gM=new G;class Yd{constructor(e=new G,n=new G(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.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,ia)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=ia.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(ia.copy(this.origin).addScaledVector(this.direction,n),ia.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){pM.copy(e).add(n).multiplyScalar(.5),uv.copy(n).sub(e).normalize(),nl.copy(this.origin).sub(pM);const o=e.distanceTo(n)*.5,s=-this.direction.dot(uv),a=nl.dot(this.direction),l=-nl.dot(uv),c=nl.lengthSq(),u=Math.abs(1-s*s);let f,h,m,v;if(u>0)if(f=s*l-a,h=s*a-l,v=o*u,f>=0)if(h>=-v)if(h<=v){const x=1/u;f*=x,h*=x,m=f*(f+s*h+2*a)+h*(s*f+h+2*l)+c}else h=o,f=Math.max(0,-(s*h+a)),m=-f*f+h*(h+2*l)+c;else h=-o,f=Math.max(0,-(s*h+a)),m=-f*f+h*(h+2*l)+c;else h<=-v?(f=Math.max(0,-(-s*o+a)),h=f>0?-o:Math.min(Math.max(-o,-l),o),m=-f*f+h*(h+2*l)+c):h<=v?(f=0,h=Math.min(Math.max(-o,-l),o),m=h*(h+2*l)+c):(f=Math.max(0,-(s*o+a)),h=f>0?o:Math.min(Math.max(-o,-l),o),m=-f*f+h*(h+2*l)+c);else h=s>0?-o:o,f=Math.max(0,-(s*h+a)),m=-f*f+h*(h+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(pM).addScaledVector(uv,h),m}intersectSphere(e,n){ia.subVectors(e.center,this.origin);const r=ia.dot(this.direction),i=ia.dot(ia)-r*r,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,s,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(r=(e.min.x-h.x)*c,i=(e.max.x-h.x)*c):(r=(e.max.x-h.x)*c,i=(e.min.x-h.x)*c),u>=0?(o=(e.min.y-h.y)*u,s=(e.max.y-h.y)*u):(o=(e.max.y-h.y)*u,s=(e.min.y-h.y)*u),r>s||o>i||((o>r||isNaN(r))&&(r=o),(s=0?(a=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(a=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,ia)!==null}intersectTriangle(e,n,r,i,o){mM.subVectors(n,e),fv.subVectors(r,e),gM.crossVectors(mM,fv);let s=this.direction.dot(gM),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;nl.subVectors(this.origin,e);const l=a*this.direction.dot(fv.crossVectors(nl,fv));if(l<0)return null;const c=a*this.direction.dot(mM.cross(nl));if(c<0||l+c>s)return null;const u=-a*nl.dot(gM);return u<0?null:this.at(u/s,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class wt{constructor(e,n,r,i,o,s,a,l,c,u,f,h,m,v,x,y){wt.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,n,r,i,o,s,a,l,c,u,f,h,m,v,x,y)}set(e,n,r,i,o,s,a,l,c,u,f,h,m,v,x,y){const g=this.elements;return g[0]=e,g[4]=n,g[8]=r,g[12]=i,g[1]=o,g[5]=s,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=f,g[14]=h,g[3]=m,g[7]=v,g[11]=x,g[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new wt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/tf.setFromMatrixColumn(e,0).length(),o=1/tf.setFromMatrixColumn(e,1).length(),s=1/tf.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,s=Math.cos(r),a=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),f=Math.sin(o);if(e.order==="XYZ"){const h=s*u,m=s*f,v=a*u,x=a*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=m+v*c,n[5]=h-x*c,n[9]=-a*l,n[2]=x-h*c,n[6]=v+m*c,n[10]=s*l}else if(e.order==="YXZ"){const h=l*u,m=l*f,v=c*u,x=c*f;n[0]=h+x*a,n[4]=v*a-m,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-a,n[2]=m*a-v,n[6]=x+h*a,n[10]=s*l}else if(e.order==="ZXY"){const h=l*u,m=l*f,v=c*u,x=c*f;n[0]=h-x*a,n[4]=-s*f,n[8]=v+m*a,n[1]=m+v*a,n[5]=s*u,n[9]=x-h*a,n[2]=-s*c,n[6]=a,n[10]=s*l}else if(e.order==="ZYX"){const h=s*u,m=s*f,v=a*u,x=a*f;n[0]=l*u,n[4]=v*c-m,n[8]=h*c+x,n[1]=l*f,n[5]=x*c+h,n[9]=m*c-v,n[2]=-c,n[6]=a*l,n[10]=s*l}else if(e.order==="YZX"){const h=s*l,m=s*c,v=a*l,x=a*c;n[0]=l*u,n[4]=x-h*f,n[8]=v*f+m,n[1]=f,n[5]=s*u,n[9]=-a*u,n[2]=-c*u,n[6]=m*f+v,n[10]=h-x*f}else if(e.order==="XZY"){const h=s*l,m=s*c,v=a*l,x=a*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=h*f+x,n[5]=s*u,n[9]=m*f-v,n[2]=v*f-m,n[6]=a*u,n[10]=x*f+h}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Fie,e,zie)}lookAt(e,n,r){const i=this.elements;return Wi.subVectors(e,n),Wi.lengthSq()===0&&(Wi.z=1),Wi.normalize(),rl.crossVectors(r,Wi),rl.lengthSq()===0&&(Math.abs(r.z)===1?Wi.x+=1e-4:Wi.z+=1e-4,Wi.normalize(),rl.crossVectors(r,Wi)),rl.normalize(),dv.crossVectors(Wi,rl),i[0]=rl.x,i[4]=dv.x,i[8]=Wi.x,i[1]=rl.y,i[5]=dv.y,i[9]=Wi.y,i[2]=rl.z,i[6]=dv.z,i[10]=Wi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[4],l=r[8],c=r[12],u=r[1],f=r[5],h=r[9],m=r[13],v=r[2],x=r[6],y=r[10],g=r[14],b=r[3],_=r[7],S=r[11],P=r[15],N=i[0],T=i[4],L=i[8],U=i[12],M=i[1],R=i[5],D=i[9],O=i[13],B=i[2],X=i[6],H=i[10],Z=i[14],F=i[3],Y=i[7],K=i[11],ee=i[15];return o[0]=s*N+a*M+l*B+c*F,o[4]=s*T+a*R+l*X+c*Y,o[8]=s*L+a*D+l*H+c*K,o[12]=s*U+a*O+l*Z+c*ee,o[1]=u*N+f*M+h*B+m*F,o[5]=u*T+f*R+h*X+m*Y,o[9]=u*L+f*D+h*H+m*K,o[13]=u*U+f*O+h*Z+m*ee,o[2]=v*N+x*M+y*B+g*F,o[6]=v*T+x*R+y*X+g*Y,o[10]=v*L+x*D+y*H+g*K,o[14]=v*U+x*O+y*Z+g*ee,o[3]=b*N+_*M+S*B+P*F,o[7]=b*T+_*R+S*X+P*Y,o[11]=b*L+_*D+S*H+P*K,o[15]=b*U+_*O+S*Z+P*ee,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],h=e[10],m=e[14],v=e[3],x=e[7],y=e[11],g=e[15];return v*(+o*l*f-i*c*f-o*a*h+r*c*h+i*a*m-r*l*m)+x*(+n*l*m-n*c*h+o*s*h-i*s*m+i*c*u-o*l*u)+y*(+n*c*f-n*a*m-o*s*f+r*s*m+o*a*u-r*c*u)+g*(-i*a*u-n*l*f+n*a*h+i*s*f-r*s*h+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],m=e[11],v=e[12],x=e[13],y=e[14],g=e[15],b=f*y*c-x*h*c+x*l*m-a*y*m-f*l*g+a*h*g,_=v*h*c-u*y*c-v*l*m+s*y*m+u*l*g-s*h*g,S=u*x*c-v*f*c+v*a*m-s*x*m-u*a*g+s*f*g,P=v*f*l-u*x*l-v*a*h+s*x*h+u*a*y-s*f*y,N=n*b+r*_+i*S+o*P;if(N===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/N;return e[0]=b*T,e[1]=(x*h*o-f*y*o-x*i*m+r*y*m+f*i*g-r*h*g)*T,e[2]=(a*y*o-x*l*o+x*i*c-r*y*c-a*i*g+r*l*g)*T,e[3]=(f*l*o-a*h*o-f*i*c+r*h*c+a*i*m-r*l*m)*T,e[4]=_*T,e[5]=(u*y*o-v*h*o+v*i*m-n*y*m-u*i*g+n*h*g)*T,e[6]=(v*l*o-s*y*o-v*i*c+n*y*c+s*i*g-n*l*g)*T,e[7]=(s*h*o-u*l*o+u*i*c-n*h*c-s*i*m+n*l*m)*T,e[8]=S*T,e[9]=(v*f*o-u*x*o-v*r*m+n*x*m+u*r*g-n*f*g)*T,e[10]=(s*x*o-v*a*o+v*r*c-n*x*c-s*r*g+n*a*g)*T,e[11]=(u*a*o-s*f*o-u*r*c+n*f*c+s*r*m-n*a*m)*T,e[12]=P*T,e[13]=(u*x*i-v*f*i+v*r*h-n*x*h-u*r*y+n*f*y)*T,e[14]=(v*a*i-s*x*i-v*r*l+n*x*l+s*r*y-n*a*y)*T,e[15]=(s*f*i-u*a*i+u*r*l-n*f*l-s*r*h+n*a*h)*T,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){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,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,s=e.x,a=e.y,l=e.z,c=o*s,u=o*a;return this.set(c*s+r,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+r,u*l-i*s,0,c*l-i*a,u*l+i*s,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,s){return this.set(1,r,o,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,c=o+o,u=s+s,f=a+a,h=o*c,m=o*u,v=o*f,x=s*u,y=s*f,g=a*f,b=l*c,_=l*u,S=l*f,P=r.x,N=r.y,T=r.z;return i[0]=(1-(x+g))*P,i[1]=(m+S)*P,i[2]=(v-_)*P,i[3]=0,i[4]=(m-S)*N,i[5]=(1-(h+g))*N,i[6]=(y+b)*N,i[7]=0,i[8]=(v+_)*T,i[9]=(y-b)*T,i[10]=(1-(h+x))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=tf.set(i[0],i[1],i[2]).length();const s=tf.set(i[4],i[5],i[6]).length(),a=tf.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],Ho.copy(this);const c=1/o,u=1/s,f=1/a;return Ho.elements[0]*=c,Ho.elements[1]*=c,Ho.elements[2]*=c,Ho.elements[4]*=u,Ho.elements[5]*=u,Ho.elements[6]*=u,Ho.elements[8]*=f,Ho.elements[9]*=f,Ho.elements[10]*=f,n.setFromRotationMatrix(Ho),r.x=o,r.y=s,r.z=a,this}makePerspective(e,n,r,i,o,s,a=As){const l=this.elements,c=2*o/(n-e),u=2*o/(r-i),f=(n+e)/(n-e),h=(r+i)/(r-i);let m,v;if(a===As)m=-(s+o)/(s-o),v=-2*s*o/(s-o);else if(a===Rm)m=-s/(s-o),v=-s*o/(s-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,s,a=As){const l=this.elements,c=1/(n-e),u=1/(r-i),f=1/(s-o),h=(n+e)*c,m=(r+i)*u;let v,x;if(a===As)v=(s+o)*f,x=-2*f;else if(a===Rm)v=o*f,x=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=x,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const tf=new G,Ho=new wt,Fie=new G(0,0,0),zie=new G(1,1,1),rl=new G,dv=new G,Wi=new G,U4=new wt,B4=new ki;class ro{constructor(e=0,n=0,r=0,i=ro.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],s=i[4],a=i[8],l=i[1],c=i[5],u=i[9],f=i[2],h=i[6],m=i[10];switch(n){case"XYZ":this._y=Math.asin($n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-$n(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin($n(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-$n(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,m),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin($n(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-$n(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return U4.makeRotationFromQuaternion(e),this.setFromRotationMatrix(U4,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return B4.setFromEuler(this),this.setFromQuaternion(B4,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=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+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}}ro.DEFAULT_ORDER="XYZ";class Wc{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(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 c=0,u=l.length;c0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),h.length>0&&(r.skeletons=h),m.length>0&&(r.animations=m),v.length>0&&(r.nodes=v)}return r.object=i,r;function s(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){Go.subVectors(i,n),sa.subVectors(r,n),yM.subVectors(e,n);const s=Go.dot(Go),a=Go.dot(sa),l=Go.dot(yM),c=sa.dot(sa),u=sa.dot(yM),f=s*c-a*a;if(f===0)return o.set(0,0,0),null;const h=1/f,m=(c*l-a*u)*h,v=(s*u-a*l)*h;return o.set(1-m-v,v,m)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,aa)===null?!1:aa.x>=0&&aa.y>=0&&aa.x+aa.y<=1}static getInterpolation(e,n,r,i,o,s,a,l){return this.getBarycoord(e,n,r,i,aa)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,aa.x),l.addScaledVector(s,aa.y),l.addScaledVector(a,aa.z),l)}static getInterpolatedAttribute(e,n,r,i,o,s){return wM.setScalar(0),SM.setScalar(0),MM.setScalar(0),wM.fromBufferAttribute(e,n),SM.fromBufferAttribute(e,r),MM.fromBufferAttribute(e,i),s.setScalar(0),s.addScaledVector(wM,o.x),s.addScaledVector(SM,o.y),s.addScaledVector(MM,o.z),s}static isFrontFacing(e,n,r,i){return Go.subVectors(r,n),sa.subVectors(e,n),Go.cross(sa).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Go.subVectors(this.c,this.b),sa.subVectors(this.a,this.b),Go.cross(sa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Mi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Mi.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,o){return Mi.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Mi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Mi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let s,a;of.subVectors(i,r),sf.subVectors(o,r),xM.subVectors(e,r);const l=of.dot(xM),c=sf.dot(xM);if(l<=0&&c<=0)return n.copy(r);bM.subVectors(e,i);const u=of.dot(bM),f=sf.dot(bM);if(u>=0&&f<=u)return n.copy(i);const h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(r).addScaledVector(of,s);_M.subVectors(e,o);const m=of.dot(_M),v=sf.dot(_M);if(v>=0&&m<=v)return n.copy(o);const x=m*c-l*v;if(x<=0&&c>=0&&v<=0)return a=c/(c-v),n.copy(r).addScaledVector(sf,a);const y=u*v-m*f;if(y<=0&&f-u>=0&&m-v>=0)return G4.subVectors(o,i),a=(f-u)/(f-u+(m-v)),n.copy(i).addScaledVector(G4,a);const g=1/(y+x+h);return s=x*g,a=h*g,n.copy(r).addScaledVector(of,s).addScaledVector(sf,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const FU={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},il={h:0,s:0,l:0},pv={h:0,s:0,l:0};function EM(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let ot=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Eo){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,an.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=an.workingColorSpace){return this.r=e,this.g=n,this.b=r,an.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=an.workingColorSpace){if(e=ZR(e,1),n=$n(n,0,1),r=$n(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=EM(s,o,e+1/3),this.g=EM(s,o,e),this.b=EM(s,o,e-1/3)}return an.toWorkingColorSpace(this,i),this}setStyle(e,n=Eo){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],s=o.length;if(s===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Eo){const r=FU[e.toLowerCase()];return r!==void 0?this.setHex(r,n):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=od(e.r),this.g=od(e.g),this.b=od(e.b),this}copyLinearToSRGB(e){return this.r=cM(e.r),this.g=cM(e.g),this.b=cM(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Eo){return an.fromWorkingColorSpace(Vr.copy(this),e),Math.round($n(Vr.r*255,0,255))*65536+Math.round($n(Vr.g*255,0,255))*256+Math.round($n(Vr.b*255,0,255))}getHexString(e=Eo){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=an.workingColorSpace){an.fromWorkingColorSpace(Vr.copy(this),n);const r=Vr.r,i=Vr.g,o=Vr.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,c;const u=(a+s)/2;if(a===s)l=0,c=0;else{const f=s-a;switch(c=u<=.5?f/(s+a):f/(2-s-a),s){case r:l=(i-o)/f+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==jc&&(r.blending=this.blending),this.side!==Pa&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==P1&&(r.blendSrc=this.blendSrc),this.blendDst!==N1&&(r.blendDst=this.blendDst),this.blendEquation!==hl&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==su&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==oC&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==xc&&(r.stencilFail=this.stencilFail),this.stencilZFail!==xc&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==xc&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(e.textures),s=i(e.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Vl extends Ir{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ot(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.combine=cg,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const pa=Wie();function Wie(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):c<-14?(r[l]=1024>>-c-14,r[l|256]=1024>>-c-14|32768,i[l]=-c-1,i[l|256]=-c-1):c<=15?(r[l]=c+15<<10,r[l|256]=c+15<<10|32768,i[l]=13,i[l|256]=13):c<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,o[l]=c|u}for(let l=1024;l<2048;++l)o[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:o,exponentTable:s,offsetTable:a}}function xi(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=$n(t,-65504,65504),pa.floatView[0]=t;const e=pa.uint32View[0],n=e>>23&511;return pa.baseTable[n]+((e&8388607)>>pa.shiftTable[n])}function hp(t){const e=t>>10;return pa.uint32View[0]=pa.mantissaTable[pa.offsetTable[e]+(t&1023)]+pa.exponentTable[e],pa.floatView[0]}const Hie={toHalfFloat:xi,fromHalfFloat:hp},Jn=new G,mv=new Ie;class hn{constructor(e,n,r=!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=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=Tm,this.updateRanges=[],this.gpuType=ai,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));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 n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],f=o[c];for(let h=0,m=f.length;h0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o(e.far-e.near)**2))&&(X4.copy(o).invert(),oc.copy(e.ray).applyMatrix4(X4),!(r.boundingBox!==null&&oc.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,oc)))}_computeIntersections(e,n,r){let i;const o=this.geometry,s=this.material,a=o.index,l=o.attributes.position,c=o.attributes.uv,u=o.attributes.uv1,f=o.attributes.normal,h=o.groups,m=o.drawRange;if(a!==null)if(Array.isArray(s))for(let v=0,x=h.length;vn.far?null:{distance:c,point:_v.clone(),object:t}}function wv(t,e,n,r,i,o,s,a,l,c){t.getVertexPosition(a,vv),t.getVertexPosition(l,yv),t.getVertexPosition(c,xv);const u=Qie(t,e,n,r,vv,yv,xv,Y4);if(u){const f=new G;Mi.getBarycoord(Y4,vv,yv,xv,f),i&&(u.uv=Mi.getInterpolatedAttribute(i,a,l,c,f,new Ie)),o&&(u.uv1=Mi.getInterpolatedAttribute(o,a,l,c,f,new Ie)),s&&(u.normal=Mi.getInterpolatedAttribute(s,a,l,c,f,new G),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new G,materialIndex:0};Mi.getNormal(vv,yv,xv,h.normal),u.face=h,u.barycoord=f}return u}class bu extends zt{constructor(e=1,n=1,r=1,i=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:s};const a=this;i=Math.floor(i),o=Math.floor(o),s=Math.floor(s);const l=[],c=[],u=[],f=[];let h=0,m=0;v("z","y","x",-1,-1,r,n,e,s,o,0),v("z","y","x",1,-1,r,n,-e,s,o,1),v("x","z","y",1,1,e,r,n,i,s,2),v("x","z","y",1,-1,e,r,-n,i,s,3),v("x","y","z",1,-1,e,n,r,i,o,4),v("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new pt(c,3)),this.setAttribute("normal",new pt(u,3)),this.setAttribute("uv",new pt(f,2));function v(x,y,g,b,_,S,P,N,T,L,U){const M=S/T,R=P/L,D=S/2,O=P/2,B=N/2,X=T+1,H=L+1;let Z=0,F=0;const Y=new G;for(let K=0;K0?1:-1,u.push(Y.x,Y.y,Y.z),f.push(me/T),f.push(1-K/L),Z+=1}}for(let K=0;K0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class pg extends tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new wt,this.projectionMatrix=new wt,this.projectionMatrixInverse=new wt,this.coordinateSystem=As}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const ol=new G,K4=new Ie,Z4=new Ie;class vr extends pg{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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 n=.5*this.getFilmHeight()/e;this.fov=Md*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan($c*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Md*2*Math.atan(Math.tan($c*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){ol.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ol.x,ol.y).multiplyScalar(-e/ol.z),ol.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(ol.x,ol.y).multiplyScalar(-e/ol.z)}getViewSize(e,n){return this.getViewBounds(e,K4,Z4),n.subVectors(Z4,K4)}setViewOffset(e,n,r,i,o,s){this.aspect=e/n,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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan($c*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,c=s.fullHeight;o+=s.offsetX*i/l,n-=s.offsetY*r/c,i*=s.width/l,r*=s.height/c}const a=this.filmOffset;a!==0&&(o+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const lf=-90,cf=1;class BU extends tn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new vr(lf,cf,e,n);i.layers=this.layers,this.add(i);const o=new vr(lf,cf,e,n);o.layers=this.layers,this.add(o);const s=new vr(lf,cf,e,n);s.layers=this.layers,this.add(s);const a=new vr(lf,cf,e,n);a.layers=this.layers,this.add(a);const l=new vr(lf,cf,e,n);l.layers=this.layers,this.add(l);const c=new vr(lf,cf,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,s,a,l]=n;for(const c of n)this.remove(c);if(e===As)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),s.up.set(0,0,1),s.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===Rm)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),s.up.set(0,0,-1),s.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 c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,s,a,l,c,u]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const x=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,s),e.setRenderTarget(r,2,i),e.render(n,a),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,c),r.texture.generateMipmaps=x,e.setRenderTarget(r,5,i),e.render(n,u),e.setRenderTarget(f,h,m),e.xr.enabled=v,r.texture.needsPMREMUpdate=!0}}class mg extends kn{constructor(e,n,r,i,o,s,a,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:Na,super(e,n,r,i,o,s,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class jU extends os{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new mg(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:tr}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},i=new bu(5,5,5),o=new ss({name:"CubemapFromEquirect",uniforms:Ed(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:fi,blending:wa});o.uniforms.tEquirect.value=n;const s=new nr(i,o),a=n.minFilter;return n.minFilter===Rs&&(n.minFilter=tr),new BU(1,10,this).update(e,s),n.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,n,r,i){const o=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(n,r,i);e.setRenderTarget(o)}}const RM=new G,roe=new G,ioe=new Ot;class ul{constructor(e=new G(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=RM.subVectors(r,n).cross(roe.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const r=e.delta(RM),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:n.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>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,n){const r=n||ioe.getNormalMatrix(e),i=this.coplanarPoint(RM).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const sc=new qr,Sv=new G;class gg{constructor(e=new ul,n=new ul,r=new ul,i=new ul,o=new ul,s=new ul){this.planes=[e,n,r,i,o,s]}set(e,n,r,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=As){const r=this.planes,i=e.elements,o=i[0],s=i[1],a=i[2],l=i[3],c=i[4],u=i[5],f=i[6],h=i[7],m=i[8],v=i[9],x=i[10],y=i[11],g=i[12],b=i[13],_=i[14],S=i[15];if(r[0].setComponents(l-o,h-c,y-m,S-g).normalize(),r[1].setComponents(l+o,h+c,y+m,S+g).normalize(),r[2].setComponents(l+s,h+u,y+v,S+b).normalize(),r[3].setComponents(l-s,h-u,y-v,S-b).normalize(),r[4].setComponents(l-a,h-f,y-x,S-_).normalize(),n===As)r[5].setComponents(l+a,h+f,y+x,S+_).normalize();else if(n===Rm)r[5].setComponents(a,f,x,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),sc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),sc.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(sc)}intersectsSprite(e){return sc.center.set(0,0,0),sc.radius=.7071067811865476,sc.applyMatrix4(e.matrixWorld),this.intersectsSphere(sc)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,Sv.y=i.normal.y>0?e.max.y:e.min.y,Sv.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Sv)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function VU(){let t=null,e=!1,n=null,r=null;function i(o,s){n(o,s),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function ooe(t){const e=new WeakMap;function n(a,l){const c=a.array,u=a.usage,f=c.byteLength,h=t.createBuffer();t.bindBuffer(l,h),t.bufferData(l,c,u),a.onUploadCallback();let m;if(c instanceof Float32Array)m=t.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?m=t.HALF_FLOAT:m=t.UNSIGNED_SHORT;else if(c instanceof Int16Array)m=t.SHORT;else if(c instanceof Uint32Array)m=t.UNSIGNED_INT;else if(c instanceof Int32Array)m=t.INT;else if(c instanceof Int8Array)m=t.BYTE;else if(c instanceof Uint8Array)m=t.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)m=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function r(a,l,c){const u=l.array,f=l.updateRanges;if(t.bindBuffer(c,a),f.length===0)t.bufferSubData(c,0,u);else{f.sort((m,v)=>m.start-v.start);let h=0;for(let m=1;m 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,woe=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Soe=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Moe=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Eoe=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,Coe=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Toe=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Roe=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,Aoe=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,Poe=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,Noe=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,Ioe=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Loe=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,koe=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,Ooe=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,Doe="gl_FragColor = linearToOutputTexel( gl_FragColor );",Foe=` +const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( + vec3( 0.8224621, 0.177538, 0.0 ), + vec3( 0.0331941, 0.9668058, 0.0 ), + vec3( 0.0170827, 0.0723974, 0.9105199 ) +); +const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( + vec3( 1.2249401, - 0.2249404, 0.0 ), + vec3( - 0.0420569, 1.0420571, 0.0 ), + vec3( - 0.0196376, - 0.0786361, 1.0982735 ) +); +vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { + return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); +} +vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { + return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); +} +vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,zoe=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,Uoe=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Boe=`#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`,joe=`#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`,Voe=`#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`,$oe=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Woe=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Hoe=`#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`,Goe=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,Xoe=`#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 +}`,qoe=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,Yoe=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,Koe=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Zoe=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,Joe=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,Qoe=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,ese=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,tse=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,nse=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,rse=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,ise=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,ose=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,sse=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,ase=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,lse=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,cse=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,use=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,fse=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,dse=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,hse=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,pse=`#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`,mse=`#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`,gse=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,vse=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,yse=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,xse=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,bse=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,_se=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,wse=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Sse=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Mse=`#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`,Ese=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Cse=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Tse=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Rse=`#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`,Ase=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,Pse=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,Nse=`#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`,Ise=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Lse=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,kse=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,Ose=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Dse=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Fse=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,zse=`#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`,Use=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Bse=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,jse=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,Vse=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,$se=`#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`,Wse=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Hse=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,Gse=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,Xse=`#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`,qse=`#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`,Yse=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,Kse=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,Zse=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,Jse=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,Qse=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,eae=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + + #else + + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,tae=`#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`,nae=`#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`,rae=`#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`,iae=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const oae=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,sae=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,aae=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,lae=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,cae=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,uae=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,fae=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,dae=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,hae=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,pae=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,mae=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,gae=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,vae=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,yae=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,xae=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,bae=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,_ae=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,wae=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Sae=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,Mae=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,Eae=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,Cae=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Tae=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Rae=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Aae=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,Pae=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,Nae=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Iae=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,Lae=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#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 + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,kae=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Oae=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Dae=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,Fae=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,zae=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Ut={alphahash_fragment:soe,alphahash_pars_fragment:aoe,alphamap_fragment:loe,alphamap_pars_fragment:coe,alphatest_fragment:uoe,alphatest_pars_fragment:foe,aomap_fragment:doe,aomap_pars_fragment:hoe,batching_pars_vertex:poe,batching_vertex:moe,begin_vertex:goe,beginnormal_vertex:voe,bsdfs:yoe,iridescence_fragment:xoe,bumpmap_pars_fragment:boe,clipping_planes_fragment:_oe,clipping_planes_pars_fragment:woe,clipping_planes_pars_vertex:Soe,clipping_planes_vertex:Moe,color_fragment:Eoe,color_pars_fragment:Coe,color_pars_vertex:Toe,color_vertex:Roe,common:Aoe,cube_uv_reflection_fragment:Poe,defaultnormal_vertex:Noe,displacementmap_pars_vertex:Ioe,displacementmap_vertex:Loe,emissivemap_fragment:koe,emissivemap_pars_fragment:Ooe,colorspace_fragment:Doe,colorspace_pars_fragment:Foe,envmap_fragment:zoe,envmap_common_pars_fragment:Uoe,envmap_pars_fragment:Boe,envmap_pars_vertex:joe,envmap_physical_pars_fragment:Joe,envmap_vertex:Voe,fog_vertex:$oe,fog_pars_vertex:Woe,fog_fragment:Hoe,fog_pars_fragment:Goe,gradientmap_pars_fragment:Xoe,lightmap_pars_fragment:qoe,lights_lambert_fragment:Yoe,lights_lambert_pars_fragment:Koe,lights_pars_begin:Zoe,lights_toon_fragment:Qoe,lights_toon_pars_fragment:ese,lights_phong_fragment:tse,lights_phong_pars_fragment:nse,lights_physical_fragment:rse,lights_physical_pars_fragment:ise,lights_fragment_begin:ose,lights_fragment_maps:sse,lights_fragment_end:ase,logdepthbuf_fragment:lse,logdepthbuf_pars_fragment:cse,logdepthbuf_pars_vertex:use,logdepthbuf_vertex:fse,map_fragment:dse,map_pars_fragment:hse,map_particle_fragment:pse,map_particle_pars_fragment:mse,metalnessmap_fragment:gse,metalnessmap_pars_fragment:vse,morphinstance_vertex:yse,morphcolor_vertex:xse,morphnormal_vertex:bse,morphtarget_pars_vertex:_se,morphtarget_vertex:wse,normal_fragment_begin:Sse,normal_fragment_maps:Mse,normal_pars_fragment:Ese,normal_pars_vertex:Cse,normal_vertex:Tse,normalmap_pars_fragment:Rse,clearcoat_normal_fragment_begin:Ase,clearcoat_normal_fragment_maps:Pse,clearcoat_pars_fragment:Nse,iridescence_pars_fragment:Ise,opaque_fragment:Lse,packing:kse,premultiplied_alpha_fragment:Ose,project_vertex:Dse,dithering_fragment:Fse,dithering_pars_fragment:zse,roughnessmap_fragment:Use,roughnessmap_pars_fragment:Bse,shadowmap_pars_fragment:jse,shadowmap_pars_vertex:Vse,shadowmap_vertex:$se,shadowmask_pars_fragment:Wse,skinbase_vertex:Hse,skinning_pars_vertex:Gse,skinning_vertex:Xse,skinnormal_vertex:qse,specularmap_fragment:Yse,specularmap_pars_fragment:Kse,tonemapping_fragment:Zse,tonemapping_pars_fragment:Jse,transmission_fragment:Qse,transmission_pars_fragment:eae,uv_pars_fragment:tae,uv_pars_vertex:nae,uv_vertex:rae,worldpos_vertex:iae,background_vert:oae,background_frag:sae,backgroundCube_vert:aae,backgroundCube_frag:lae,cube_vert:cae,cube_frag:uae,depth_vert:fae,depth_frag:dae,distanceRGBA_vert:hae,distanceRGBA_frag:pae,equirect_vert:mae,equirect_frag:gae,linedashed_vert:vae,linedashed_frag:yae,meshbasic_vert:xae,meshbasic_frag:bae,meshlambert_vert:_ae,meshlambert_frag:wae,meshmatcap_vert:Sae,meshmatcap_frag:Mae,meshnormal_vert:Eae,meshnormal_frag:Cae,meshphong_vert:Tae,meshphong_frag:Rae,meshphysical_vert:Aae,meshphysical_frag:Pae,meshtoon_vert:Nae,meshtoon_frag:Iae,points_vert:Lae,points_frag:kae,shadow_vert:Oae,shadow_frag:Dae,sprite_vert:Fae,sprite_frag:zae},Je={common:{diffuse:{value:new ot(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ot},alphaMap:{value:null},alphaMapTransform:{value:new Ot},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ot}},envmap:{envMap:{value:null},envMapRotation:{value:new Ot},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ot}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ot}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ot},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ot},normalScale:{value:new Ie(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ot},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ot}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ot}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ot}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ot(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ot(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ot},alphaTest:{value:0},uvTransform:{value:new Ot}},sprite:{diffuse:{value:new ot(16777215)},opacity:{value:1},center:{value:new Ie(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ot},alphaMap:{value:null},alphaMapTransform:{value:new Ot},alphaTest:{value:0}}},Jo={basic:{uniforms:ni([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.fog]),vertexShader:Ut.meshbasic_vert,fragmentShader:Ut.meshbasic_frag},lambert:{uniforms:ni([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new ot(0)}}]),vertexShader:Ut.meshlambert_vert,fragmentShader:Ut.meshlambert_frag},phong:{uniforms:ni([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new ot(0)},specular:{value:new ot(1118481)},shininess:{value:30}}]),vertexShader:Ut.meshphong_vert,fragmentShader:Ut.meshphong_frag},standard:{uniforms:ni([Je.common,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.roughnessmap,Je.metalnessmap,Je.fog,Je.lights,{emissive:{value:new ot(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ut.meshphysical_vert,fragmentShader:Ut.meshphysical_frag},toon:{uniforms:ni([Je.common,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.gradientmap,Je.fog,Je.lights,{emissive:{value:new ot(0)}}]),vertexShader:Ut.meshtoon_vert,fragmentShader:Ut.meshtoon_frag},matcap:{uniforms:ni([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,{matcap:{value:null}}]),vertexShader:Ut.meshmatcap_vert,fragmentShader:Ut.meshmatcap_frag},points:{uniforms:ni([Je.points,Je.fog]),vertexShader:Ut.points_vert,fragmentShader:Ut.points_frag},dashed:{uniforms:ni([Je.common,Je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ut.linedashed_vert,fragmentShader:Ut.linedashed_frag},depth:{uniforms:ni([Je.common,Je.displacementmap]),vertexShader:Ut.depth_vert,fragmentShader:Ut.depth_frag},normal:{uniforms:ni([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,{opacity:{value:1}}]),vertexShader:Ut.meshnormal_vert,fragmentShader:Ut.meshnormal_frag},sprite:{uniforms:ni([Je.sprite,Je.fog]),vertexShader:Ut.sprite_vert,fragmentShader:Ut.sprite_frag},background:{uniforms:{uvTransform:{value:new Ot},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ut.background_vert,fragmentShader:Ut.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ot}},vertexShader:Ut.backgroundCube_vert,fragmentShader:Ut.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ut.cube_vert,fragmentShader:Ut.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ut.equirect_vert,fragmentShader:Ut.equirect_frag},distanceRGBA:{uniforms:ni([Je.common,Je.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ut.distanceRGBA_vert,fragmentShader:Ut.distanceRGBA_frag},shadow:{uniforms:ni([Je.lights,Je.fog,{color:{value:new ot(0)},opacity:{value:1}}]),vertexShader:Ut.shadow_vert,fragmentShader:Ut.shadow_frag}};Jo.physical={uniforms:ni([Jo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ot},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ot},clearcoatNormalScale:{value:new Ie(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ot},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ot},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ot},sheen:{value:0},sheenColor:{value:new ot(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ot},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ot},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ot},transmissionSamplerSize:{value:new Ie},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ot},attenuationDistance:{value:0},attenuationColor:{value:new ot(0)},specularColor:{value:new ot(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ot},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ot},anisotropyVector:{value:new Ie},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ot}}]),vertexShader:Ut.meshphysical_vert,fragmentShader:Ut.meshphysical_frag};const Mv={r:0,b:0,g:0},ac=new ro,Uae=new wt;function Bae(t,e,n,r,i,o,s){const a=new ot(0);let l=o===!0?0:1,c,u,f=null,h=0,m=null;function v(b){let _=b.isScene===!0?b.background:null;return _&&_.isTexture&&(_=(b.backgroundBlurriness>0?n:e).get(_)),_}function x(b){let _=!1;const S=v(b);S===null?g(a,l):S&&S.isColor&&(g(S,1),_=!0);const P=t.xr.getEnvironmentBlendMode();P==="additive"?r.buffers.color.setClear(0,0,0,1,s):P==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(t.autoClear||_)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function y(b,_){const S=v(_);S&&(S.isCubeTexture||S.mapping===qd)?(u===void 0&&(u=new nr(new bu(1,1,1),new ss({name:"BackgroundCubeMaterial",uniforms:Ed(Jo.backgroundCube.uniforms),vertexShader:Jo.backgroundCube.vertexShader,fragmentShader:Jo.backgroundCube.fragmentShader,side:fi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(P,N,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),ac.copy(_.backgroundRotation),ac.x*=-1,ac.y*=-1,ac.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(ac.y*=-1,ac.z*=-1),u.material.uniforms.envMap.value=S,u.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Uae.makeRotationFromEuler(ac)),u.material.toneMapped=an.getTransfer(S.colorSpace)!==xn,(f!==S||h!==S.version||m!==t.toneMapping)&&(u.material.needsUpdate=!0,f=S,h=S.version,m=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new nr(new Kd(2,2),new ss({name:"BackgroundMaterial",uniforms:Ed(Jo.background.uniforms),vertexShader:Jo.background.vertexShader,fragmentShader:Jo.background.fragmentShader,side:Pa,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,c.material.toneMapped=an.getTransfer(S.colorSpace)!==xn,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(f!==S||h!==S.version||m!==t.toneMapping)&&(c.material.needsUpdate=!0,f=S,h=S.version,m=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function g(b,_){b.getRGB(Mv,zU(t)),r.buffers.color.setClear(Mv.r,Mv.g,Mv.b,_,s)}return{getClearColor:function(){return a},setClearColor:function(b,_=1){a.set(b),l=_,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,g(a,l)},render:x,addToRenderList:y}}function jae(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=h(null);let o=i,s=!1;function a(M,R,D,O,B){let X=!1;const H=f(O,D,R);o!==H&&(o=H,c(o.object)),X=m(M,O,D,B),X&&v(M,O,D,B),B!==null&&e.update(B,t.ELEMENT_ARRAY_BUFFER),(X||s)&&(s=!1,S(M,R,D,O),B!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(B).buffer))}function l(){return t.createVertexArray()}function c(M){return t.bindVertexArray(M)}function u(M){return t.deleteVertexArray(M)}function f(M,R,D){const O=D.wireframe===!0;let B=r[M.id];B===void 0&&(B={},r[M.id]=B);let X=B[R.id];X===void 0&&(X={},B[R.id]=X);let H=X[O];return H===void 0&&(H=h(l()),X[O]=H),H}function h(M){const R=[],D=[],O=[];for(let B=0;B=0){const K=B[F];let ee=X[F];if(ee===void 0&&(F==="instanceMatrix"&&M.instanceMatrix&&(ee=M.instanceMatrix),F==="instanceColor"&&M.instanceColor&&(ee=M.instanceColor)),K===void 0||K.attribute!==ee||ee&&K.data!==ee.data)return!0;H++}return o.attributesNum!==H||o.index!==O}function v(M,R,D,O){const B={},X=R.attributes;let H=0;const Z=D.getAttributes();for(const F in Z)if(Z[F].location>=0){let K=X[F];K===void 0&&(F==="instanceMatrix"&&M.instanceMatrix&&(K=M.instanceMatrix),F==="instanceColor"&&M.instanceColor&&(K=M.instanceColor));const ee={};ee.attribute=K,K&&K.data&&(ee.data=K.data),B[F]=ee,H++}o.attributes=B,o.attributesNum=H,o.index=O}function x(){const M=o.newAttributes;for(let R=0,D=M.length;R=0){let Y=B[Z];if(Y===void 0&&(Z==="instanceMatrix"&&M.instanceMatrix&&(Y=M.instanceMatrix),Z==="instanceColor"&&M.instanceColor&&(Y=M.instanceColor)),Y!==void 0){const K=Y.normalized,ee=Y.itemSize,me=e.get(Y);if(me===void 0)continue;const le=me.buffer,Q=me.type,ae=me.bytesPerElement,ge=Q===t.INT||Q===t.UNSIGNED_INT||Y.gpuType===Qb;if(Y.isInterleavedBufferAttribute){const Me=Y.data,tt=Me.stride,He=Y.offset;if(Me.isInstancedInterleavedBuffer){for(let rt=0;rt0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=n.logarithmicDepthBuffer===!0,h=n.reverseDepthBuffer===!0&&e.has("EXT_clip_control");if(h===!0){const T=e.get("EXT_clip_control");T.clipControlEXT(T.LOWER_LEFT_EXT,T.ZERO_TO_ONE_EXT)}const m=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),x=t.getParameter(t.MAX_TEXTURE_SIZE),y=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),g=t.getParameter(t.MAX_VERTEX_ATTRIBS),b=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),_=t.getParameter(t.MAX_VARYING_VECTORS),S=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),P=v>0,N=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:l,textureFormatReadable:s,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:h,maxTextures:m,maxVertexTextures:v,maxTextureSize:x,maxCubemapSize:y,maxAttributes:g,maxVertexUniforms:b,maxVaryings:_,maxFragmentUniforms:S,vertexTextures:P,maxSamples:N}}function Wae(t){const e=this;let n=null,r=0,i=!1,o=!1;const s=new ul,a=new Ot,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){const m=f.length!==0||h||r!==0||i;return i=h,r=f.length,m},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(f,h){n=u(f,h,0)},this.setState=function(f,h,m){const v=f.clippingPlanes,x=f.clipIntersection,y=f.clipShadows,g=t.get(f);if(!i||v===null||v.length===0||o&&!y)o?u(null):c();else{const b=o?0:r,_=b*4;let S=g.clippingState||null;l.value=S,S=u(v,h,_,m);for(let P=0;P!==_;++P)S[P]=n[P];g.clippingState=S,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(f,h,m,v){const x=f!==null?f.length:0;let y=null;if(x!==0){if(y=l.value,v!==!0||y===null){const g=m+x*4,b=h.matrixWorldInverse;a.getNormalMatrix(b),(y===null||y.length0){const c=new jU(l.height);return c.fromEquirectangularTexture(t,s),e.set(s,c),s.addEventListener("dispose",i),n(c.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class vg extends pg{constructor(e=-1,n=1,r=1,i=-1,o=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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,n,r,i,o,s){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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,s=r+e,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,s=o+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const $f=4,J4=[.125,.215,.35,.446,.526,.582],Sc=20,AM=new vg,Q4=new ot;let PM=null,NM=0,IM=0,LM=!1;const bc=(1+Math.sqrt(5))/2,uf=1/bc,eL=[new G(-bc,uf,0),new G(bc,uf,0),new G(-uf,0,bc),new G(uf,0,bc),new G(0,bc,-uf),new G(0,bc,uf),new G(-1,1,-1),new G(1,1,-1),new G(-1,1,1),new G(1,1,1)];class aC{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,n=0,r=.1,i=100){PM=this._renderer.getRenderTarget(),NM=this._renderer.getActiveCubeFace(),IM=this._renderer.getActiveMipmapLevel(),LM=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=rL(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=nL(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?_:0,_,_),u.setRenderTarget(i),x&&u.render(v,a),u.render(e,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=h,u.autoClear=f,e.background=y}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Na||e.mapping===Nl;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=rL()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=nL());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new nr(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=e;const l=this._cubeSize;Ev(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,AM)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let o=1;oSc&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Sc}`);const g=[];let b=0;for(let T=0;T_-$f?i-_+$f:0),N=4*(this._cubeSize-S);Ev(n,P,N,3*S,2*S),l.setRenderTarget(n),l.render(f,AM)}}function Gae(t){const e=[],n=[],r=[];let i=t;const o=t-$f+1+J4.length;for(let s=0;st-$f?l=J4[s-t+$f-1]:s===0&&(l=0),r.push(l);const c=1/(a-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],m=6,v=6,x=3,y=2,g=1,b=new Float32Array(x*v*m),_=new Float32Array(y*v*m),S=new Float32Array(g*v*m);for(let N=0;N2?0:-1,U=[T,L,0,T+2/3,L,0,T+2/3,L+1,0,T,L,0,T+2/3,L+1,0,T,L+1,0];b.set(U,x*v*N),_.set(h,y*v*N);const M=[N,N,N,N,N,N];S.set(M,g*v*N)}const P=new zt;P.setAttribute("position",new hn(b,x)),P.setAttribute("uv",new hn(_,y)),P.setAttribute("faceIndex",new hn(S,g)),e.push(P),i>$f&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function tL(t,e,n){const r=new os(t,e,n);return r.texture.mapping=qd,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Ev(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Xae(t,e,n){const r=new Float32Array(Sc),i=new G(0,1,0);return new ss({name:"SphericalGaussianBlur",defines:{n:Sc,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:tA(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:wa,depthTest:!1,depthWrite:!1})}function nL(){return new ss({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:tA(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:wa,depthTest:!1,depthWrite:!1})}function rL(){return new ss({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:tA(),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:wa,depthTest:!1,depthWrite:!1})}function tA(){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 qae(t){let e=new WeakMap,n=null;function r(a){if(a&&a.isTexture){const l=a.mapping,c=l===ym||l===xm,u=l===Na||l===Nl;if(c||u){let f=e.get(a);const h=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==h)return n===null&&(n=new aC(t)),f=c?n.fromEquirectangular(a,f):n.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const m=a.image;return c&&m&&m.height>0||u&&m&&i(m)?(n===null&&(n=new aC(t)),f=c?n.fromEquirectangular(a):n.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",o),f.texture):null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(N=Math.ceil(P/e.maxTextureSize),P=e.maxTextureSize);const T=new Float32Array(P*N*4*f),L=new s_(T,P,N,f);L.type=ai,L.needsUpdate=!0;const U=S*4;for(let R=0;R0)return t;const i=e*n;let o=oL[i];if(o===void 0&&(o=new Float32Array(i),oL[i]=o),e!==0){r.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=n,t[s].toArray(o,a)}return o}function cr(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${a}: ${n[s]}`)}return r.join(` +`)}function qle(t){const e=an.getPrimaries(an.workingColorSpace),n=an.getPrimaries(t);let r;switch(e===n?r="":e===Cm&&n===Em?r="LinearDisplayP3ToLinearSRGB":e===Em&&n===Cm&&(r="LinearSRGBToLinearDisplayP3"),t){case Fa:case hg:return[r,"LinearTransferOETF"];case Eo:case o_:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}function dL(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const s=parseInt(o[1]);return n.toUpperCase()+` + +`+i+` + +`+Xle(t.getShaderSource(e),s)}else return i}function Yle(t,e){const n=qle(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function Kle(t,e){let n;switch(e){case dU:n="Linear";break;case hU:n="Reinhard";break;case pU:n="Cineon";break;case zR:n="ACESFilmic";break;case gU:n="AgX";break;case vU:n="Neutral";break;case mU:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const Cv=new G;function Zle(){an.getLuminanceCoefficients(Cv);const t=Cv.x.toFixed(4),e=Cv.y.toFixed(4),n=Cv.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` +`)}function Jle(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(pp).join(` +`)}function Qle(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` +`)}function ece(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function lC(t){return t.replace(tce,rce)}const nce=new Map;function rce(t,e){let n=Ut[e];if(n===void 0){const r=nce.get(e);if(r!==void 0)n=Ut[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return lC(n)}const ice=/#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 mL(t){return t.replace(ice,oce)}function oce(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(y+=` +`),g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(pp).join(` +`),g.length>0&&(g+=` +`)):(y=[gL(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(pp).join(` +`),g=[gL(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Os?"#define TONE_MAPPING":"",n.toneMapping!==Os?Ut.tonemapping_pars_fragment:"",n.toneMapping!==Os?Kle("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Ut.colorspace_pars_fragment,Yle("linearToOutputTexel",n.outputColorSpace),Zle(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(pp).join(` +`)),s=lC(s),s=hL(s,n),s=pL(s,n),a=lC(a),a=hL(a,n),a=pL(a,n),s=mL(s),a=mL(a),n.isRawShaderMaterial!==!0&&(b=`#version 300 es +`,y=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+y,g=["#define varying in",n.glslVersion===sC?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===sC?"":"#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 _=b+y+s,S=b+g+a,P=fL(i,i.VERTEX_SHADER,_),N=fL(i,i.FRAGMENT_SHADER,S);i.attachShader(x,P),i.attachShader(x,N),n.index0AttributeName!==void 0?i.bindAttribLocation(x,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(x,0,"position"),i.linkProgram(x);function T(R){if(t.debug.checkShaderErrors){const D=i.getProgramInfoLog(x).trim(),O=i.getShaderInfoLog(P).trim(),B=i.getShaderInfoLog(N).trim();let X=!0,H=!0;if(i.getProgramParameter(x,i.LINK_STATUS)===!1)if(X=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,x,P,N);else{const Z=dL(i,P,"vertex"),F=dL(i,N,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(x,i.VALIDATE_STATUS)+` + +Material Name: `+R.name+` +Material Type: `+R.type+` + +Program Info Log: `+D+` +`+Z+` +`+F)}else D!==""?console.warn("THREE.WebGLProgram: Program Info Log:",D):(O===""||B==="")&&(H=!1);H&&(R.diagnostics={runnable:X,programLog:D,vertexShader:{log:O,prefix:y},fragmentShader:{log:B,prefix:g}})}i.deleteShader(P),i.deleteShader(N),L=new zy(i,x),U=ece(i,x)}let L;this.getUniforms=function(){return L===void 0&&T(this),L};let U;this.getAttributes=function(){return U===void 0&&T(this),U};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(x,Hle)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(x),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Gle++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=P,this.fragmentShader=N,this}let dce=0;class hce{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(o)===!1&&(s.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new pce(e),n.set(e,r)),r}}class pce{constructor(e){this.id=dce++,this.code=e,this.usedTimes=0}}function mce(t,e,n,r,i,o,s){const a=new Wc,l=new hce,c=new Set,u=[],f=i.logarithmicDepthBuffer,h=i.reverseDepthBuffer,m=i.vertexTextures;let v=i.precision;const x={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 y(M){return c.add(M),M===0?"uv":`uv${M}`}function g(M,R,D,O,B){const X=O.fog,H=B.geometry,Z=M.isMeshStandardMaterial?O.environment:null,F=(M.isMeshStandardMaterial?n:e).get(M.envMap||Z),Y=F&&F.mapping===qd?F.image.height:null,K=x[M.type];M.precision!==null&&(v=i.getMaxPrecision(M.precision),v!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",v,"instead."));const ee=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,me=ee!==void 0?ee.length:0;let le=0;H.morphAttributes.position!==void 0&&(le=1),H.morphAttributes.normal!==void 0&&(le=2),H.morphAttributes.color!==void 0&&(le=3);let Q,ae,ge,Me;if(K){const Mr=Jo[K];Q=Mr.vertexShader,ae=Mr.fragmentShader}else Q=M.vertexShader,ae=M.fragmentShader,l.update(M),ge=l.getVertexShaderID(M),Me=l.getFragmentShaderID(M);const tt=t.getRenderTarget(),He=B.isInstancedMesh===!0,rt=B.isBatchedMesh===!0,Ve=!!M.map,se=!!M.matcap,j=!!F,ye=!!M.aoMap,xe=!!M.lightMap,Re=!!M.bumpMap,Pe=!!M.normalMap,Ee=!!M.displacementMap,De=!!M.emissiveMap,$=!!M.metalnessMap,z=!!M.roughnessMap,re=M.anisotropy>0,he=M.clearcoat>0,pe=M.dispersion>0,be=M.iridescence>0,Ge=M.sheen>0,Fe=M.transmission>0,Ne=re&&!!M.anisotropyMap,ze=he&&!!M.clearcoatMap,Le=he&&!!M.clearcoatNormalMap,Xe=he&&!!M.clearcoatRoughnessMap,xt=be&&!!M.iridescenceMap,Oe=be&&!!M.iridescenceThicknessMap,Ue=Ge&&!!M.sheenColorMap,Ae=Ge&&!!M.sheenRoughnessMap,ke=!!M.specularMap,dt=!!M.specularColorMap,J=!!M.specularIntensityMap,je=Fe&&!!M.transmissionMap,fe=Fe&&!!M.thicknessMap,Te=!!M.gradientMap,Ke=!!M.alphaMap,Ye=M.alphaTest>0,Bt=!!M.alphaHash,An=!!M.extensions;let kr=Os;M.toneMapped&&(tt===null||tt.isXRRenderTarget===!0)&&(kr=t.toneMapping);const Yt={shaderID:K,shaderType:M.type,shaderName:M.name,vertexShader:Q,fragmentShader:ae,defines:M.defines,customVertexShaderID:ge,customFragmentShaderID:Me,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:v,batching:rt,batchingColor:rt&&B._colorsTexture!==null,instancing:He,instancingColor:He&&B.instanceColor!==null,instancingMorph:He&&B.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:tt===null?t.outputColorSpace:tt.isXRRenderTarget===!0?tt.texture.colorSpace:Fa,alphaToCoverage:!!M.alphaToCoverage,map:Ve,matcap:se,envMap:j,envMapMode:j&&F.mapping,envMapCubeUVHeight:Y,aoMap:ye,lightMap:xe,bumpMap:Re,normalMap:Pe,displacementMap:m&&Ee,emissiveMap:De,normalMapObjectSpace:Pe&&M.normalMapType===MU,normalMapTangentSpace:Pe&&M.normalMapType===jl,metalnessMap:$,roughnessMap:z,anisotropy:re,anisotropyMap:Ne,clearcoat:he,clearcoatMap:ze,clearcoatNormalMap:Le,clearcoatRoughnessMap:Xe,dispersion:pe,iridescence:be,iridescenceMap:xt,iridescenceThicknessMap:Oe,sheen:Ge,sheenColorMap:Ue,sheenRoughnessMap:Ae,specularMap:ke,specularColorMap:dt,specularIntensityMap:J,transmission:Fe,transmissionMap:je,thicknessMap:fe,gradientMap:Te,opaque:M.transparent===!1&&M.blending===jc&&M.alphaToCoverage===!1,alphaMap:Ke,alphaTest:Ye,alphaHash:Bt,combine:M.combine,mapUv:Ve&&y(M.map.channel),aoMapUv:ye&&y(M.aoMap.channel),lightMapUv:xe&&y(M.lightMap.channel),bumpMapUv:Re&&y(M.bumpMap.channel),normalMapUv:Pe&&y(M.normalMap.channel),displacementMapUv:Ee&&y(M.displacementMap.channel),emissiveMapUv:De&&y(M.emissiveMap.channel),metalnessMapUv:$&&y(M.metalnessMap.channel),roughnessMapUv:z&&y(M.roughnessMap.channel),anisotropyMapUv:Ne&&y(M.anisotropyMap.channel),clearcoatMapUv:ze&&y(M.clearcoatMap.channel),clearcoatNormalMapUv:Le&&y(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Xe&&y(M.clearcoatRoughnessMap.channel),iridescenceMapUv:xt&&y(M.iridescenceMap.channel),iridescenceThicknessMapUv:Oe&&y(M.iridescenceThicknessMap.channel),sheenColorMapUv:Ue&&y(M.sheenColorMap.channel),sheenRoughnessMapUv:Ae&&y(M.sheenRoughnessMap.channel),specularMapUv:ke&&y(M.specularMap.channel),specularColorMapUv:dt&&y(M.specularColorMap.channel),specularIntensityMapUv:J&&y(M.specularIntensityMap.channel),transmissionMapUv:je&&y(M.transmissionMap.channel),thicknessMapUv:fe&&y(M.thicknessMap.channel),alphaMapUv:Ke&&y(M.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(Pe||re),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,pointsUvs:B.isPoints===!0&&!!H.attributes.uv&&(Ve||Ke),fog:!!X,useFog:M.fog===!0,fogExp2:!!X&&X.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:h,skinning:B.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:me,morphTextureStride:le,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:M.dithering,shadowMapEnabled:t.shadowMap.enabled&&D.length>0,shadowMapType:t.shadowMap.type,toneMapping:kr,decodeVideoTexture:Ve&&M.map.isVideoTexture===!0&&an.getTransfer(M.map.colorSpace)===xn,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Qo,flipSided:M.side===fi,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:An&&M.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(An&&M.extensions.multiDraw===!0||rt)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return Yt.vertexUv1s=c.has(1),Yt.vertexUv2s=c.has(2),Yt.vertexUv3s=c.has(3),c.clear(),Yt}function b(M){const R=[];if(M.shaderID?R.push(M.shaderID):(R.push(M.customVertexShaderID),R.push(M.customFragmentShaderID)),M.defines!==void 0)for(const D in M.defines)R.push(D),R.push(M.defines[D]);return M.isRawShaderMaterial===!1&&(_(R,M),S(R,M),R.push(t.outputColorSpace)),R.push(M.customProgramCacheKey),R.join()}function _(M,R){M.push(R.precision),M.push(R.outputColorSpace),M.push(R.envMapMode),M.push(R.envMapCubeUVHeight),M.push(R.mapUv),M.push(R.alphaMapUv),M.push(R.lightMapUv),M.push(R.aoMapUv),M.push(R.bumpMapUv),M.push(R.normalMapUv),M.push(R.displacementMapUv),M.push(R.emissiveMapUv),M.push(R.metalnessMapUv),M.push(R.roughnessMapUv),M.push(R.anisotropyMapUv),M.push(R.clearcoatMapUv),M.push(R.clearcoatNormalMapUv),M.push(R.clearcoatRoughnessMapUv),M.push(R.iridescenceMapUv),M.push(R.iridescenceThicknessMapUv),M.push(R.sheenColorMapUv),M.push(R.sheenRoughnessMapUv),M.push(R.specularMapUv),M.push(R.specularColorMapUv),M.push(R.specularIntensityMapUv),M.push(R.transmissionMapUv),M.push(R.thicknessMapUv),M.push(R.combine),M.push(R.fogExp2),M.push(R.sizeAttenuation),M.push(R.morphTargetsCount),M.push(R.morphAttributeCount),M.push(R.numDirLights),M.push(R.numPointLights),M.push(R.numSpotLights),M.push(R.numSpotLightMaps),M.push(R.numHemiLights),M.push(R.numRectAreaLights),M.push(R.numDirLightShadows),M.push(R.numPointLightShadows),M.push(R.numSpotLightShadows),M.push(R.numSpotLightShadowsWithMaps),M.push(R.numLightProbes),M.push(R.shadowMapType),M.push(R.toneMapping),M.push(R.numClippingPlanes),M.push(R.numClipIntersection),M.push(R.depthPacking)}function S(M,R){a.disableAll(),R.supportsVertexTextures&&a.enable(0),R.instancing&&a.enable(1),R.instancingColor&&a.enable(2),R.instancingMorph&&a.enable(3),R.matcap&&a.enable(4),R.envMap&&a.enable(5),R.normalMapObjectSpace&&a.enable(6),R.normalMapTangentSpace&&a.enable(7),R.clearcoat&&a.enable(8),R.iridescence&&a.enable(9),R.alphaTest&&a.enable(10),R.vertexColors&&a.enable(11),R.vertexAlphas&&a.enable(12),R.vertexUv1s&&a.enable(13),R.vertexUv2s&&a.enable(14),R.vertexUv3s&&a.enable(15),R.vertexTangents&&a.enable(16),R.anisotropy&&a.enable(17),R.alphaHash&&a.enable(18),R.batching&&a.enable(19),R.dispersion&&a.enable(20),R.batchingColor&&a.enable(21),M.push(a.mask),a.disableAll(),R.fog&&a.enable(0),R.useFog&&a.enable(1),R.flatShading&&a.enable(2),R.logarithmicDepthBuffer&&a.enable(3),R.reverseDepthBuffer&&a.enable(4),R.skinning&&a.enable(5),R.morphTargets&&a.enable(6),R.morphNormals&&a.enable(7),R.morphColors&&a.enable(8),R.premultipliedAlpha&&a.enable(9),R.shadowMapEnabled&&a.enable(10),R.doubleSided&&a.enable(11),R.flipSided&&a.enable(12),R.useDepthPacking&&a.enable(13),R.dithering&&a.enable(14),R.transmission&&a.enable(15),R.sheen&&a.enable(16),R.opaque&&a.enable(17),R.pointsUvs&&a.enable(18),R.decodeVideoTexture&&a.enable(19),R.alphaToCoverage&&a.enable(20),M.push(a.mask)}function P(M){const R=x[M.type];let D;if(R){const O=Jo[R];D=UU.clone(O.uniforms)}else D=M.uniforms;return D}function N(M,R){let D;for(let O=0,B=u.length;O0?r.push(g):m.transparent===!0?i.push(g):n.push(g)}function l(f,h,m,v,x,y){const g=s(f,h,m,v,x,y);m.transmission>0?r.unshift(g):m.transparent===!0?i.unshift(g):n.unshift(g)}function c(f,h){n.length>1&&n.sort(f||vce),r.length>1&&r.sort(h||vL),i.length>1&&i.sort(h||vL)}function u(){for(let f=e,h=t.length;f=o.length?(s=new yL,o.push(s)):s=o[i],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function xce(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new G,color:new ot};break;case"SpotLight":n={position:new G,direction:new G,color:new ot,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new G,color:new ot,distance:0,decay:0};break;case"HemisphereLight":n={direction:new G,skyColor:new ot,groundColor:new ot};break;case"RectAreaLight":n={color:new ot,position:new G,halfWidth:new G,halfHeight:new G};break}return t[e.id]=n,n}}}function bce(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ie};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ie};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ie,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let _ce=0;function wce(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Sce(t){const e=new xce,n=bce(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new G);const i=new G,o=new wt,s=new wt;function a(c){let u=0,f=0,h=0;for(let U=0;U<9;U++)r.probe[U].set(0,0,0);let m=0,v=0,x=0,y=0,g=0,b=0,_=0,S=0,P=0,N=0,T=0;c.sort(wce);for(let U=0,M=c.length;U0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Je.LTC_FLOAT_1,r.rectAreaLTC2=Je.LTC_FLOAT_2):(r.rectAreaLTC1=Je.LTC_HALF_1,r.rectAreaLTC2=Je.LTC_HALF_2)),r.ambient[0]=u,r.ambient[1]=f,r.ambient[2]=h;const L=r.hash;(L.directionalLength!==m||L.pointLength!==v||L.spotLength!==x||L.rectAreaLength!==y||L.hemiLength!==g||L.numDirectionalShadows!==b||L.numPointShadows!==_||L.numSpotShadows!==S||L.numSpotMaps!==P||L.numLightProbes!==T)&&(r.directional.length=m,r.spot.length=x,r.rectArea.length=y,r.point.length=v,r.hemi.length=g,r.directionalShadow.length=b,r.directionalShadowMap.length=b,r.pointShadow.length=_,r.pointShadowMap.length=_,r.spotShadow.length=S,r.spotShadowMap.length=S,r.directionalShadowMatrix.length=b,r.pointShadowMatrix.length=_,r.spotLightMatrix.length=S+P-N,r.spotLightMap.length=P,r.numSpotLightShadowsWithMaps=N,r.numLightProbes=T,L.directionalLength=m,L.pointLength=v,L.spotLength=x,L.rectAreaLength=y,L.hemiLength=g,L.numDirectionalShadows=b,L.numPointShadows=_,L.numSpotShadows=S,L.numSpotMaps=P,L.numLightProbes=T,r.version=_ce++)}function l(c,u){let f=0,h=0,m=0,v=0,x=0;const y=u.matrixWorldInverse;for(let g=0,b=c.length;g=s.length?(a=new xL(t),s.push(a)):a=s[o],a}function r(){e=new WeakMap}return{get:n,dispose:r}}class rA extends Ir{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=wU,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 iA extends Ir{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 Ece=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Cce=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Tce(t,e,n){let r=new gg;const i=new Ie,o=new Ie,s=new Zt,a=new rA({depthPacking:SU}),l=new iA,c={},u=n.maxTextureSize,f={[Pa]:fi,[fi]:Pa,[Qo]:Qo},h=new ss({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ie},radius:{value:4}},vertexShader:Ece,fragmentShader:Cce}),m=h.clone();m.defines.HORIZONTAL_PASS=1;const v=new zt;v.setAttribute("position",new hn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new nr(v,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Jb;let g=this.type;this.render=function(N,T,L){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||N.length===0)return;const U=t.getRenderTarget(),M=t.getActiveCubeFace(),R=t.getActiveMipmapLevel(),D=t.state;D.setBlending(wa),D.buffers.color.setClear(1,1,1,1),D.buffers.depth.setTest(!0),D.setScissorTest(!1);const O=g!==Yo&&this.type===Yo,B=g===Yo&&this.type!==Yo;for(let X=0,H=N.length;Xu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/Y.x),i.x=o.x*Y.x,F.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/Y.y),i.y=o.y*Y.y,F.mapSize.y=o.y)),F.map===null||O===!0||B===!0){const ee=this.type!==Yo?{minFilter:lr,magFilter:lr}:{};F.map!==null&&F.map.dispose(),F.map=new os(i.x,i.y,ee),F.map.texture.name=Z.name+".shadowMap",F.camera.updateProjectionMatrix()}t.setRenderTarget(F.map),t.clear();const K=F.getViewportCount();for(let ee=0;ee0||T.map&&T.alphaTest>0){const D=M.uuid,O=T.uuid;let B=c[D];B===void 0&&(B={},c[D]=B);let X=B[O];X===void 0&&(X=M.clone(),B[O]=X,T.addEventListener("dispose",P)),M=X}if(M.visible=T.visible,M.wireframe=T.wireframe,U===Yo?M.side=T.shadowSide!==null?T.shadowSide:T.side:M.side=T.shadowSide!==null?T.shadowSide:f[T.side],M.alphaMap=T.alphaMap,M.alphaTest=T.alphaTest,M.map=T.map,M.clipShadows=T.clipShadows,M.clippingPlanes=T.clippingPlanes,M.clipIntersection=T.clipIntersection,M.displacementMap=T.displacementMap,M.displacementScale=T.displacementScale,M.displacementBias=T.displacementBias,M.wireframeLinewidth=T.wireframeLinewidth,M.linewidth=T.linewidth,L.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const D=t.properties.get(M);D.light=L}return M}function S(N,T,L,U,M){if(N.visible===!1)return;if(N.layers.test(T.layers)&&(N.isMesh||N.isLine||N.isPoints)&&(N.castShadow||N.receiveShadow&&M===Yo)&&(!N.frustumCulled||r.intersectsObject(N))){N.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,N.matrixWorld);const O=e.update(N),B=N.material;if(Array.isArray(B)){const X=O.groups;for(let H=0,Z=X.length;H=1):Z.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),X=H>=2);let F=null,Y={};const K=t.getParameter(t.SCISSOR_BOX),ee=t.getParameter(t.VIEWPORT),me=new Zt().fromArray(K),le=new Zt().fromArray(ee);function Q(J,je,fe,Te){const Ke=new Uint8Array(4),Ye=t.createTexture();t.bindTexture(J,Ye),t.texParameteri(J,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(J,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Bt=0;Bte?(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}function Nce(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}function Ice(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}function cC(t,e,n,r){const i=Lce(r);switch(n){case $R:return t*e;case HR:return t*e;case GR:return t*e*2;case fg:return t*e/i.components*i.byteLength;case dg:return t*e/i.components*i.byteLength;case XR:return t*e*2/i.components*i.byteLength;case n_:return t*e*2/i.components*i.byteLength;case WR:return t*e*3/i.components*i.byteLength;case Rr:return t*e*4/i.components*i.byteLength;case r_:return t*e*4/i.components*i.byteLength;case Np:case Ip:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case Lp:case kp:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case B1:case V1:return Math.max(t,16)*Math.max(e,8)/4;case U1:case j1:return Math.max(t,8)*Math.max(e,8)/2;case $1:case W1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case H1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case G1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case X1:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case q1:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case Y1:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case K1:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case Z1:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case J1:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case Q1:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case ex:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case tx:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case nx:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case rx:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case ix:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case ox:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case Op:case sx:case ax:return Math.ceil(t/4)*Math.ceil(e/4)*16;case qR:case lx:return Math.ceil(t/4)*Math.ceil(e/4)*8;case cx:case ux:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function Lce(t){switch(t){case Fi:case BR:return{byteLength:1,components:1};case Sd:case jR:case xu:return{byteLength:2,components:1};case e_:case t_:return{byteLength:2,components:4};case Ia:case Qb:case ai:return{byteLength:4,components:1};case VR:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}const kce={contain:Pce,cover:Nce,fill:Ice,getByteLength:cC};function Oce(t,e,n,r,i,o,s){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Ie,u=new WeakMap;let f;const h=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v($,z){return m?new OffscreenCanvas($,z):Am("canvas")}function x($,z,re){let he=1;const pe=De($);if((pe.width>re||pe.height>re)&&(he=re/Math.max(pe.width,pe.height)),he<1)if(typeof HTMLImageElement<"u"&&$ instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&$ instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&$ instanceof ImageBitmap||typeof VideoFrame<"u"&&$ instanceof VideoFrame){const be=Math.floor(he*pe.width),Ge=Math.floor(he*pe.height);f===void 0&&(f=v(be,Ge));const Fe=z?v(be,Ge):f;return Fe.width=be,Fe.height=Ge,Fe.getContext("2d").drawImage($,0,0,be,Ge),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+pe.width+"x"+pe.height+") to ("+be+"x"+Ge+")."),Fe}else return"data"in $&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+pe.width+"x"+pe.height+")."),$;return $}function y($){return $.generateMipmaps&&$.minFilter!==lr&&$.minFilter!==tr}function g($){t.generateMipmap($)}function b($,z,re,he,pe=!1){if($!==null){if(t[$]!==void 0)return t[$];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+$+"'")}let be=z;if(z===t.RED&&(re===t.FLOAT&&(be=t.R32F),re===t.HALF_FLOAT&&(be=t.R16F),re===t.UNSIGNED_BYTE&&(be=t.R8)),z===t.RED_INTEGER&&(re===t.UNSIGNED_BYTE&&(be=t.R8UI),re===t.UNSIGNED_SHORT&&(be=t.R16UI),re===t.UNSIGNED_INT&&(be=t.R32UI),re===t.BYTE&&(be=t.R8I),re===t.SHORT&&(be=t.R16I),re===t.INT&&(be=t.R32I)),z===t.RG&&(re===t.FLOAT&&(be=t.RG32F),re===t.HALF_FLOAT&&(be=t.RG16F),re===t.UNSIGNED_BYTE&&(be=t.RG8)),z===t.RG_INTEGER&&(re===t.UNSIGNED_BYTE&&(be=t.RG8UI),re===t.UNSIGNED_SHORT&&(be=t.RG16UI),re===t.UNSIGNED_INT&&(be=t.RG32UI),re===t.BYTE&&(be=t.RG8I),re===t.SHORT&&(be=t.RG16I),re===t.INT&&(be=t.RG32I)),z===t.RGB_INTEGER&&(re===t.UNSIGNED_BYTE&&(be=t.RGB8UI),re===t.UNSIGNED_SHORT&&(be=t.RGB16UI),re===t.UNSIGNED_INT&&(be=t.RGB32UI),re===t.BYTE&&(be=t.RGB8I),re===t.SHORT&&(be=t.RGB16I),re===t.INT&&(be=t.RGB32I)),z===t.RGBA_INTEGER&&(re===t.UNSIGNED_BYTE&&(be=t.RGBA8UI),re===t.UNSIGNED_SHORT&&(be=t.RGBA16UI),re===t.UNSIGNED_INT&&(be=t.RGBA32UI),re===t.BYTE&&(be=t.RGBA8I),re===t.SHORT&&(be=t.RGBA16I),re===t.INT&&(be=t.RGBA32I)),z===t.RGB&&re===t.UNSIGNED_INT_5_9_9_9_REV&&(be=t.RGB9_E5),z===t.RGBA){const Ge=pe?Mm:an.getTransfer(he);re===t.FLOAT&&(be=t.RGBA32F),re===t.HALF_FLOAT&&(be=t.RGBA16F),re===t.UNSIGNED_BYTE&&(be=Ge===xn?t.SRGB8_ALPHA8:t.RGBA8),re===t.UNSIGNED_SHORT_4_4_4_4&&(be=t.RGBA4),re===t.UNSIGNED_SHORT_5_5_5_1&&(be=t.RGB5_A1)}return(be===t.R16F||be===t.R32F||be===t.RG16F||be===t.RG32F||be===t.RGBA16F||be===t.RGBA32F)&&e.get("EXT_color_buffer_float"),be}function _($,z){let re;return $?z===null||z===Ia||z===au?re=t.DEPTH24_STENCIL8:z===ai?re=t.DEPTH32F_STENCIL8:z===Sd&&(re=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):z===null||z===Ia||z===au?re=t.DEPTH_COMPONENT24:z===ai?re=t.DEPTH_COMPONENT32F:z===Sd&&(re=t.DEPTH_COMPONENT16),re}function S($,z){return y($)===!0||$.isFramebufferTexture&&$.minFilter!==lr&&$.minFilter!==tr?Math.log2(Math.max(z.width,z.height))+1:$.mipmaps!==void 0&&$.mipmaps.length>0?$.mipmaps.length:$.isCompressedTexture&&Array.isArray($.image)?z.mipmaps.length:1}function P($){const z=$.target;z.removeEventListener("dispose",P),T(z),z.isVideoTexture&&u.delete(z)}function N($){const z=$.target;z.removeEventListener("dispose",N),U(z)}function T($){const z=r.get($);if(z.__webglInit===void 0)return;const re=$.source,he=h.get(re);if(he){const pe=he[z.__cacheKey];pe.usedTimes--,pe.usedTimes===0&&L($),Object.keys(he).length===0&&h.delete(re)}r.remove($)}function L($){const z=r.get($);t.deleteTexture(z.__webglTexture);const re=$.source,he=h.get(re);delete he[z.__cacheKey],s.memory.textures--}function U($){const z=r.get($);if($.depthTexture&&$.depthTexture.dispose(),$.isWebGLCubeRenderTarget)for(let he=0;he<6;he++){if(Array.isArray(z.__webglFramebuffer[he]))for(let pe=0;pe=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+$+" texture units while this GPU supports only "+i.maxTextures),M+=1,$}function O($){const z=[];return z.push($.wrapS),z.push($.wrapT),z.push($.wrapR||0),z.push($.magFilter),z.push($.minFilter),z.push($.anisotropy),z.push($.internalFormat),z.push($.format),z.push($.type),z.push($.generateMipmaps),z.push($.premultiplyAlpha),z.push($.flipY),z.push($.unpackAlignment),z.push($.colorSpace),z.join()}function B($,z){const re=r.get($);if($.isVideoTexture&&Pe($),$.isRenderTargetTexture===!1&&$.version>0&&re.__version!==$.version){const he=$.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{le(re,$,z);return}}n.bindTexture(t.TEXTURE_2D,re.__webglTexture,t.TEXTURE0+z)}function X($,z){const re=r.get($);if($.version>0&&re.__version!==$.version){le(re,$,z);return}n.bindTexture(t.TEXTURE_2D_ARRAY,re.__webglTexture,t.TEXTURE0+z)}function H($,z){const re=r.get($);if($.version>0&&re.__version!==$.version){le(re,$,z);return}n.bindTexture(t.TEXTURE_3D,re.__webglTexture,t.TEXTURE0+z)}function Z($,z){const re=r.get($);if($.version>0&&re.__version!==$.version){Q(re,$,z);return}n.bindTexture(t.TEXTURE_CUBE_MAP,re.__webglTexture,t.TEXTURE0+z)}const F={[bm]:t.REPEAT,[Ti]:t.CLAMP_TO_EDGE,[_m]:t.MIRRORED_REPEAT},Y={[lr]:t.NEAREST,[UR]:t.NEAREST_MIPMAP_NEAREST,[jf]:t.NEAREST_MIPMAP_LINEAR,[tr]:t.LINEAR,[Pp]:t.LINEAR_MIPMAP_NEAREST,[Rs]:t.LINEAR_MIPMAP_LINEAR},K={[EU]:t.NEVER,[NU]:t.ALWAYS,[CU]:t.LESS,[KR]:t.LEQUAL,[TU]:t.EQUAL,[PU]:t.GEQUAL,[RU]:t.GREATER,[AU]:t.NOTEQUAL};function ee($,z){if(z.type===ai&&e.has("OES_texture_float_linear")===!1&&(z.magFilter===tr||z.magFilter===Pp||z.magFilter===jf||z.magFilter===Rs||z.minFilter===tr||z.minFilter===Pp||z.minFilter===jf||z.minFilter===Rs)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri($,t.TEXTURE_WRAP_S,F[z.wrapS]),t.texParameteri($,t.TEXTURE_WRAP_T,F[z.wrapT]),($===t.TEXTURE_3D||$===t.TEXTURE_2D_ARRAY)&&t.texParameteri($,t.TEXTURE_WRAP_R,F[z.wrapR]),t.texParameteri($,t.TEXTURE_MAG_FILTER,Y[z.magFilter]),t.texParameteri($,t.TEXTURE_MIN_FILTER,Y[z.minFilter]),z.compareFunction&&(t.texParameteri($,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri($,t.TEXTURE_COMPARE_FUNC,K[z.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(z.magFilter===lr||z.minFilter!==jf&&z.minFilter!==Rs||z.type===ai&&e.has("OES_texture_float_linear")===!1)return;if(z.anisotropy>1||r.get(z).__currentAnisotropy){const re=e.get("EXT_texture_filter_anisotropic");t.texParameterf($,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(z.anisotropy,i.getMaxAnisotropy())),r.get(z).__currentAnisotropy=z.anisotropy}}}function me($,z){let re=!1;$.__webglInit===void 0&&($.__webglInit=!0,z.addEventListener("dispose",P));const he=z.source;let pe=h.get(he);pe===void 0&&(pe={},h.set(he,pe));const be=O(z);if(be!==$.__cacheKey){pe[be]===void 0&&(pe[be]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,re=!0),pe[be].usedTimes++;const Ge=pe[$.__cacheKey];Ge!==void 0&&(pe[$.__cacheKey].usedTimes--,Ge.usedTimes===0&&L(z)),$.__cacheKey=be,$.__webglTexture=pe[be].texture}return re}function le($,z,re){let he=t.TEXTURE_2D;(z.isDataArrayTexture||z.isCompressedArrayTexture)&&(he=t.TEXTURE_2D_ARRAY),z.isData3DTexture&&(he=t.TEXTURE_3D);const pe=me($,z),be=z.source;n.bindTexture(he,$.__webglTexture,t.TEXTURE0+re);const Ge=r.get(be);if(be.version!==Ge.__version||pe===!0){n.activeTexture(t.TEXTURE0+re);const Fe=an.getPrimaries(an.workingColorSpace),Ne=z.colorSpace===ha?null:an.getPrimaries(z.colorSpace),ze=z.colorSpace===ha||Fe===Ne?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,z.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,z.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,z.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,ze);let Le=x(z.image,!1,i.maxTextureSize);Le=Ee(z,Le);const Xe=o.convert(z.format,z.colorSpace),xt=o.convert(z.type);let Oe=b(z.internalFormat,Xe,xt,z.colorSpace,z.isVideoTexture);ee(he,z);let Ue;const Ae=z.mipmaps,ke=z.isVideoTexture!==!0,dt=Ge.__version===void 0||pe===!0,J=be.dataReady,je=S(z,Le);if(z.isDepthTexture)Oe=_(z.format===lu,z.type),dt&&(ke?n.texStorage2D(t.TEXTURE_2D,1,Oe,Le.width,Le.height):n.texImage2D(t.TEXTURE_2D,0,Oe,Le.width,Le.height,0,Xe,xt,null));else if(z.isDataTexture)if(Ae.length>0){ke&&dt&&n.texStorage2D(t.TEXTURE_2D,je,Oe,Ae[0].width,Ae[0].height);for(let fe=0,Te=Ae.length;fe0){const Ke=cC(Ue.width,Ue.height,z.format,z.type);for(const Ye of z.layerUpdates){const Bt=Ue.data.subarray(Ye*Ke/Ue.data.BYTES_PER_ELEMENT,(Ye+1)*Ke/Ue.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,fe,0,0,Ye,Ue.width,Ue.height,1,Xe,Bt,0,0)}z.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,fe,0,0,0,Ue.width,Ue.height,Le.depth,Xe,Ue.data,0,0)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,fe,Oe,Ue.width,Ue.height,Le.depth,0,Ue.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ke?J&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,fe,0,0,0,Ue.width,Ue.height,Le.depth,Xe,xt,Ue.data):n.texImage3D(t.TEXTURE_2D_ARRAY,fe,Oe,Ue.width,Ue.height,Le.depth,0,Xe,xt,Ue.data)}else{ke&&dt&&n.texStorage2D(t.TEXTURE_2D,je,Oe,Ae[0].width,Ae[0].height);for(let fe=0,Te=Ae.length;fe0){const fe=cC(Le.width,Le.height,z.format,z.type);for(const Te of z.layerUpdates){const Ke=Le.data.subarray(Te*fe/Le.data.BYTES_PER_ELEMENT,(Te+1)*fe/Le.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,Te,Le.width,Le.height,1,Xe,xt,Ke)}z.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Le.width,Le.height,Le.depth,Xe,xt,Le.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Oe,Le.width,Le.height,Le.depth,0,Xe,xt,Le.data);else if(z.isData3DTexture)ke?(dt&&n.texStorage3D(t.TEXTURE_3D,je,Oe,Le.width,Le.height,Le.depth),J&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Le.width,Le.height,Le.depth,Xe,xt,Le.data)):n.texImage3D(t.TEXTURE_3D,0,Oe,Le.width,Le.height,Le.depth,0,Xe,xt,Le.data);else if(z.isFramebufferTexture){if(dt)if(ke)n.texStorage2D(t.TEXTURE_2D,je,Oe,Le.width,Le.height);else{let fe=Le.width,Te=Le.height;for(let Ke=0;Ke>=1,Te>>=1}}else if(Ae.length>0){if(ke&&dt){const fe=De(Ae[0]);n.texStorage2D(t.TEXTURE_2D,je,Oe,fe.width,fe.height)}for(let fe=0,Te=Ae.length;fe0&&je++;const Te=De(Xe[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,je,Ae,Te.width,Te.height)}for(let Te=0;Te<6;Te++)if(Le){ke?J&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,0,0,Xe[Te].width,Xe[Te].height,Oe,Ue,Xe[Te].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,Ae,Xe[Te].width,Xe[Te].height,0,Oe,Ue,Xe[Te].data);for(let Ke=0;Ke>be),Xe=Math.max(1,z.height>>be);pe===t.TEXTURE_3D||pe===t.TEXTURE_2D_ARRAY?n.texImage3D(pe,be,Ne,Le,Xe,z.depth,0,Ge,Fe,null):n.texImage2D(pe,be,Ne,Le,Xe,0,Ge,Fe,null)}n.bindFramebuffer(t.FRAMEBUFFER,$),Re(z)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,he,pe,r.get(re).__webglTexture,0,xe(z)):(pe===t.TEXTURE_2D||pe>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&pe<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,he,pe,r.get(re).__webglTexture,be),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ge($,z,re){if(t.bindRenderbuffer(t.RENDERBUFFER,$),z.depthBuffer){const he=z.depthTexture,pe=he&&he.isDepthTexture?he.type:null,be=_(z.stencilBuffer,pe),Ge=z.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Fe=xe(z);Re(z)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Fe,be,z.width,z.height):re?t.renderbufferStorageMultisample(t.RENDERBUFFER,Fe,be,z.width,z.height):t.renderbufferStorage(t.RENDERBUFFER,be,z.width,z.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ge,t.RENDERBUFFER,$)}else{const he=z.textures;for(let pe=0;pe{delete z.__boundDepthTexture,delete z.__depthDisposeCallback,he.removeEventListener("dispose",pe)};he.addEventListener("dispose",pe),z.__depthDisposeCallback=pe}z.__boundDepthTexture=he}if($.depthTexture&&!z.__autoAllocateDepthBuffer){if(re)throw new Error("target.depthTexture not supported in Cube render targets");Me(z.__webglFramebuffer,$)}else if(re){z.__webglDepthbuffer=[];for(let he=0;he<6;he++)if(n.bindFramebuffer(t.FRAMEBUFFER,z.__webglFramebuffer[he]),z.__webglDepthbuffer[he]===void 0)z.__webglDepthbuffer[he]=t.createRenderbuffer(),ge(z.__webglDepthbuffer[he],$,!1);else{const pe=$.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,be=z.__webglDepthbuffer[he];t.bindRenderbuffer(t.RENDERBUFFER,be),t.framebufferRenderbuffer(t.FRAMEBUFFER,pe,t.RENDERBUFFER,be)}}else if(n.bindFramebuffer(t.FRAMEBUFFER,z.__webglFramebuffer),z.__webglDepthbuffer===void 0)z.__webglDepthbuffer=t.createRenderbuffer(),ge(z.__webglDepthbuffer,$,!1);else{const he=$.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,pe=z.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,pe),t.framebufferRenderbuffer(t.FRAMEBUFFER,he,t.RENDERBUFFER,pe)}n.bindFramebuffer(t.FRAMEBUFFER,null)}function He($,z,re){const he=r.get($);z!==void 0&&ae(he.__webglFramebuffer,$,$.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),re!==void 0&&tt($)}function rt($){const z=$.texture,re=r.get($),he=r.get(z);$.addEventListener("dispose",N);const pe=$.textures,be=$.isWebGLCubeRenderTarget===!0,Ge=pe.length>1;if(Ge||(he.__webglTexture===void 0&&(he.__webglTexture=t.createTexture()),he.__version=z.version,s.memory.textures++),be){re.__webglFramebuffer=[];for(let Fe=0;Fe<6;Fe++)if(z.mipmaps&&z.mipmaps.length>0){re.__webglFramebuffer[Fe]=[];for(let Ne=0;Ne0){re.__webglFramebuffer=[];for(let Fe=0;Fe0&&Re($)===!1){re.__webglMultisampledFramebuffer=t.createFramebuffer(),re.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,re.__webglMultisampledFramebuffer);for(let Fe=0;Fe0)for(let Ne=0;Ne0)for(let Ne=0;Ne0){if(Re($)===!1){const z=$.textures,re=$.width,he=$.height;let pe=t.COLOR_BUFFER_BIT;const be=$.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ge=r.get($),Fe=z.length>1;if(Fe)for(let Ne=0;Ne0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&z.__useRenderToTexture!==!1}function Pe($){const z=s.render.frame;u.get($)!==z&&(u.set($,z),$.update())}function Ee($,z){const re=$.colorSpace,he=$.format,pe=$.type;return $.isCompressedTexture===!0||$.isVideoTexture===!0||re!==Fa&&re!==ha&&(an.getTransfer(re)===xn?(he!==Rr||pe!==Fi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",re)),z}function De($){return typeof HTMLImageElement<"u"&&$ instanceof HTMLImageElement?(c.width=$.naturalWidth||$.width,c.height=$.naturalHeight||$.height):typeof VideoFrame<"u"&&$ instanceof VideoFrame?(c.width=$.displayWidth,c.height=$.displayHeight):(c.width=$.width,c.height=$.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=R,this.setTexture2D=B,this.setTexture2DArray=X,this.setTexture3D=H,this.setTextureCube=Z,this.rebindTextures=He,this.setupRenderTarget=rt,this.updateRenderTargetMipmap=Ve,this.updateMultisampleRenderTarget=ye,this.setupDepthRenderbuffer=tt,this.setupFrameBufferTexture=ae,this.useMultisampledRTT=Re}function XU(t,e){function n(r,i=ha){let o;const s=an.getTransfer(i);if(r===Fi)return t.UNSIGNED_BYTE;if(r===e_)return t.UNSIGNED_SHORT_4_4_4_4;if(r===t_)return t.UNSIGNED_SHORT_5_5_5_1;if(r===VR)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===BR)return t.BYTE;if(r===jR)return t.SHORT;if(r===Sd)return t.UNSIGNED_SHORT;if(r===Qb)return t.INT;if(r===Ia)return t.UNSIGNED_INT;if(r===ai)return t.FLOAT;if(r===xu)return t.HALF_FLOAT;if(r===$R)return t.ALPHA;if(r===WR)return t.RGB;if(r===Rr)return t.RGBA;if(r===HR)return t.LUMINANCE;if(r===GR)return t.LUMINANCE_ALPHA;if(r===Vc)return t.DEPTH_COMPONENT;if(r===lu)return t.DEPTH_STENCIL;if(r===fg)return t.RED;if(r===dg)return t.RED_INTEGER;if(r===XR)return t.RG;if(r===n_)return t.RG_INTEGER;if(r===r_)return t.RGBA_INTEGER;if(r===Np||r===Ip||r===Lp||r===kp)if(s===xn)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(r===Np)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Ip)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Lp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===kp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===Np)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Ip)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Lp)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===kp)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===U1||r===B1||r===j1||r===V1)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===U1)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===B1)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===j1)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===V1)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===$1||r===W1||r===H1)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(r===$1||r===W1)return s===xn?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===H1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===G1||r===X1||r===q1||r===Y1||r===K1||r===Z1||r===J1||r===Q1||r===ex||r===tx||r===nx||r===rx||r===ix||r===ox)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(r===G1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===X1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===q1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===Y1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===K1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Z1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===J1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===Q1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===ex)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===tx)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===nx)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===rx)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===ix)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===ox)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Op||r===sx||r===ax)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(r===Op)return s===xn?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===sx)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===ax)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===qR||r===lx||r===cx||r===ux)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(r===Op)return o.COMPRESSED_RED_RGTC1_EXT;if(r===lx)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===cx)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===ux)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===au?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}class qU extends vr{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let Wf=class extends tn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const Dce={type:"move"};class OM{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Wf,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 Wf,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Wf,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),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 n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){s=!0;for(const x of e.hand.values()){const y=n.getJointPose(x,r),g=this._getHandJoint(c,x);y!==null&&(g.matrix.fromArray(y.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=y.radius),g.visible=y!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),m=.02,v=.005;c.inputState.pinching&&h>m+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=m-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Dce)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new Wf;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}const Fce=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,zce=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class Uce{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,r){if(this.texture===null){const i=new kn,o=e.properties.get(i);o.__webglTexture=n.texture,(n.depthNear!=r.depthNear||n.depthFar!=r.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new ss({vertexShader:Fce,fragmentShader:zce,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new nr(new Kd(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Bce extends Xs{constructor(e,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=1,c=null,u=null,f=null,h=null,m=null,v=null;const x=new Uce,y=n.getContextAttributes();let g=null,b=null;const _=[],S=[],P=new Ie;let N=null;const T=new vr;T.layers.enable(1),T.viewport=new Zt;const L=new vr;L.layers.enable(2),L.viewport=new Zt;const U=[T,L],M=new qU;M.layers.enable(1),M.layers.enable(2);let R=null,D=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Q){let ae=_[Q];return ae===void 0&&(ae=new OM,_[Q]=ae),ae.getTargetRaySpace()},this.getControllerGrip=function(Q){let ae=_[Q];return ae===void 0&&(ae=new OM,_[Q]=ae),ae.getGripSpace()},this.getHand=function(Q){let ae=_[Q];return ae===void 0&&(ae=new OM,_[Q]=ae),ae.getHandSpace()};function O(Q){const ae=S.indexOf(Q.inputSource);if(ae===-1)return;const ge=_[ae];ge!==void 0&&(ge.update(Q.inputSource,Q.frame,c||s),ge.dispatchEvent({type:Q.type,data:Q.inputSource}))}function B(){i.removeEventListener("select",O),i.removeEventListener("selectstart",O),i.removeEventListener("selectend",O),i.removeEventListener("squeeze",O),i.removeEventListener("squeezestart",O),i.removeEventListener("squeezeend",O),i.removeEventListener("end",B),i.removeEventListener("inputsourceschange",X);for(let Q=0;Q<_.length;Q++){const ae=S[Q];ae!==null&&(S[Q]=null,_[Q].disconnect(ae))}R=null,D=null,x.reset(),e.setRenderTarget(g),m=null,h=null,f=null,i=null,b=null,le.stop(),r.isPresenting=!1,e.setPixelRatio(N),e.setSize(P.width,P.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Q){o=Q,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Q){a=Q,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||s},this.setReferenceSpace=function(Q){c=Q},this.getBaseLayer=function(){return h!==null?h:m},this.getBinding=function(){return f},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(Q){if(i=Q,i!==null){if(g=e.getRenderTarget(),i.addEventListener("select",O),i.addEventListener("selectstart",O),i.addEventListener("selectend",O),i.addEventListener("squeeze",O),i.addEventListener("squeezestart",O),i.addEventListener("squeezeend",O),i.addEventListener("end",B),i.addEventListener("inputsourceschange",X),y.xrCompatible!==!0&&await n.makeXRCompatible(),N=e.getPixelRatio(),e.getSize(P),i.renderState.layers===void 0){const ae={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:o};m=new XRWebGLLayer(i,n,ae),i.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),b=new os(m.framebufferWidth,m.framebufferHeight,{format:Rr,type:Fi,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil})}else{let ae=null,ge=null,Me=null;y.depth&&(Me=y.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,ae=y.stencil?lu:Vc,ge=y.stencil?au:Ia);const tt={colorFormat:n.RGBA8,depthFormat:Me,scaleFactor:o};f=new XRWebGLBinding(i,n),h=f.createProjectionLayer(tt),i.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),b=new os(h.textureWidth,h.textureHeight,{format:Rr,type:Fi,depthTexture:new nA(h.textureWidth,h.textureHeight,ge,void 0,void 0,void 0,void 0,void 0,void 0,ae),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:h.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(l),c=null,s=await i.requestReferenceSpace(a),le.setContext(i),le.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return x.getDepthTexture()};function X(Q){for(let ae=0;ae=0&&(S[Me]=null,_[Me].disconnect(ge))}for(let ae=0;ae=S.length){S.push(ge),Me=He;break}else if(S[He]===null){S[He]=ge,Me=He;break}if(Me===-1)break}const tt=_[Me];tt&&tt.connect(ge)}}const H=new G,Z=new G;function F(Q,ae,ge){H.setFromMatrixPosition(ae.matrixWorld),Z.setFromMatrixPosition(ge.matrixWorld);const Me=H.distanceTo(Z),tt=ae.projectionMatrix.elements,He=ge.projectionMatrix.elements,rt=tt[14]/(tt[10]-1),Ve=tt[14]/(tt[10]+1),se=(tt[9]+1)/tt[5],j=(tt[9]-1)/tt[5],ye=(tt[8]-1)/tt[0],xe=(He[8]+1)/He[0],Re=rt*ye,Pe=rt*xe,Ee=Me/(-ye+xe),De=Ee*-ye;if(ae.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Q.translateX(De),Q.translateZ(Ee),Q.matrixWorld.compose(Q.position,Q.quaternion,Q.scale),Q.matrixWorldInverse.copy(Q.matrixWorld).invert(),tt[10]===-1)Q.projectionMatrix.copy(ae.projectionMatrix),Q.projectionMatrixInverse.copy(ae.projectionMatrixInverse);else{const $=rt+Ee,z=Ve+Ee,re=Re-De,he=Pe+(Me-De),pe=se*Ve/z*$,be=j*Ve/z*$;Q.projectionMatrix.makePerspective(re,he,pe,be,$,z),Q.projectionMatrixInverse.copy(Q.projectionMatrix).invert()}}function Y(Q,ae){ae===null?Q.matrixWorld.copy(Q.matrix):Q.matrixWorld.multiplyMatrices(ae.matrixWorld,Q.matrix),Q.matrixWorldInverse.copy(Q.matrixWorld).invert()}this.updateCamera=function(Q){if(i===null)return;let ae=Q.near,ge=Q.far;x.texture!==null&&(x.depthNear>0&&(ae=x.depthNear),x.depthFar>0&&(ge=x.depthFar)),M.near=L.near=T.near=ae,M.far=L.far=T.far=ge,(R!==M.near||D!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),R=M.near,D=M.far);const Me=Q.parent,tt=M.cameras;Y(M,Me);for(let He=0;He0&&(y.alphaTest.value=g.alphaTest);const b=e.get(g),_=b.envMap,S=b.envMapRotation;_&&(y.envMap.value=_,lc.copy(S),lc.x*=-1,lc.y*=-1,lc.z*=-1,_.isCubeTexture&&_.isRenderTargetTexture===!1&&(lc.y*=-1,lc.z*=-1),y.envMapRotation.value.setFromMatrix4(jce.makeRotationFromEuler(lc)),y.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=g.reflectivity,y.ior.value=g.ior,y.refractionRatio.value=g.refractionRatio),g.lightMap&&(y.lightMap.value=g.lightMap,y.lightMapIntensity.value=g.lightMapIntensity,n(g.lightMap,y.lightMapTransform)),g.aoMap&&(y.aoMap.value=g.aoMap,y.aoMapIntensity.value=g.aoMapIntensity,n(g.aoMap,y.aoMapTransform))}function s(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,g.map&&(y.map.value=g.map,n(g.map,y.mapTransform))}function a(y,g){y.dashSize.value=g.dashSize,y.totalSize.value=g.dashSize+g.gapSize,y.scale.value=g.scale}function l(y,g,b,_){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.size.value=g.size*b,y.scale.value=_*.5,g.map&&(y.map.value=g.map,n(g.map,y.uvTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,n(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function c(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.rotation.value=g.rotation,g.map&&(y.map.value=g.map,n(g.map,y.mapTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,n(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function u(y,g){y.specular.value.copy(g.specular),y.shininess.value=Math.max(g.shininess,1e-4)}function f(y,g){g.gradientMap&&(y.gradientMap.value=g.gradientMap)}function h(y,g){y.metalness.value=g.metalness,g.metalnessMap&&(y.metalnessMap.value=g.metalnessMap,n(g.metalnessMap,y.metalnessMapTransform)),y.roughness.value=g.roughness,g.roughnessMap&&(y.roughnessMap.value=g.roughnessMap,n(g.roughnessMap,y.roughnessMapTransform)),g.envMap&&(y.envMapIntensity.value=g.envMapIntensity)}function m(y,g,b){y.ior.value=g.ior,g.sheen>0&&(y.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),y.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(y.sheenColorMap.value=g.sheenColorMap,n(g.sheenColorMap,y.sheenColorMapTransform)),g.sheenRoughnessMap&&(y.sheenRoughnessMap.value=g.sheenRoughnessMap,n(g.sheenRoughnessMap,y.sheenRoughnessMapTransform))),g.clearcoat>0&&(y.clearcoat.value=g.clearcoat,y.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(y.clearcoatMap.value=g.clearcoatMap,n(g.clearcoatMap,y.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,n(g.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(y.clearcoatNormalMap.value=g.clearcoatNormalMap,n(g.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===fi&&y.clearcoatNormalScale.value.negate())),g.dispersion>0&&(y.dispersion.value=g.dispersion),g.iridescence>0&&(y.iridescence.value=g.iridescence,y.iridescenceIOR.value=g.iridescenceIOR,y.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(y.iridescenceMap.value=g.iridescenceMap,n(g.iridescenceMap,y.iridescenceMapTransform)),g.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=g.iridescenceThicknessMap,n(g.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),g.transmission>0&&(y.transmission.value=g.transmission,y.transmissionSamplerMap.value=b.texture,y.transmissionSamplerSize.value.set(b.width,b.height),g.transmissionMap&&(y.transmissionMap.value=g.transmissionMap,n(g.transmissionMap,y.transmissionMapTransform)),y.thickness.value=g.thickness,g.thicknessMap&&(y.thicknessMap.value=g.thicknessMap,n(g.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=g.attenuationDistance,y.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(y.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(y.anisotropyMap.value=g.anisotropyMap,n(g.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=g.specularIntensity,y.specularColor.value.copy(g.specularColor),g.specularColorMap&&(y.specularColorMap.value=g.specularColorMap,n(g.specularColorMap,y.specularColorMapTransform)),g.specularIntensityMap&&(y.specularIntensityMap.value=g.specularIntensityMap,n(g.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,g){g.matcap&&(y.matcap.value=g.matcap)}function x(y,g){const b=e.get(g).light;y.referencePosition.value.setFromMatrixPosition(b.matrixWorld),y.nearDistance.value=b.shadow.camera.near,y.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function $ce(t,e,n,r){let i={},o={},s=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,_){const S=_.program;r.uniformBlockBinding(b,S)}function c(b,_){let S=i[b.id];S===void 0&&(v(b),S=u(b),i[b.id]=S,b.addEventListener("dispose",y));const P=_.program;r.updateUBOMapping(b,P);const N=e.render.frame;o[b.id]!==N&&(h(b),o[b.id]=N)}function u(b){const _=f();b.__bindingPointIndex=_;const S=t.createBuffer(),P=b.__size,N=b.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,P,N),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,_,S),S}function f(){for(let b=0;b0&&(S+=P-N),b.__size=S,b.__cache={},this}function x(b){const _={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(_.boundary=4,_.storage=4):b.isVector2?(_.boundary=8,_.storage=8):b.isVector3||b.isColor?(_.boundary=16,_.storage=12):b.isVector4?(_.boundary=16,_.storage=16):b.isMatrix3?(_.boundary=48,_.storage=48):b.isMatrix4?(_.boundary=64,_.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),_}function y(b){const _=b.target;_.removeEventListener("dispose",y);const S=s.indexOf(_.__bindingPointIndex);s.splice(S,1),t.deleteBuffer(i[_.id]),delete i[_.id],delete o[_.id]}function g(){for(const b in i)t.deleteBuffer(i[b]);s=[],i={},o={}}return{bind:l,update:c,dispose:g}}class YU{constructor(e={}){const{canvas:n=kU(),context:r=null,depth:i=!0,stencil:o=!1,alpha:s=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let h;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=r.getContextAttributes().alpha}else h=s;const m=new Uint32Array(4),v=new Int32Array(4);let x=null,y=null;const g=[],b=[];this.domElement=n,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=Eo,this.toneMapping=Os,this.toneMappingExposure=1;const _=this;let S=!1,P=0,N=0,T=null,L=-1,U=null;const M=new Zt,R=new Zt;let D=null;const O=new ot(0);let B=0,X=n.width,H=n.height,Z=1,F=null,Y=null;const K=new Zt(0,0,X,H),ee=new Zt(0,0,X,H);let me=!1;const le=new gg;let Q=!1,ae=!1;const ge=new wt,Me=new wt,tt=new G,He=new Zt,rt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ve=!1;function se(){return T===null?Z:1}let j=r;function ye(V,ne){return n.getContext(V,ne)}try{const V={alpha:!0,depth:i,stencil:o,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Zb}`),n.addEventListener("webglcontextlost",Te,!1),n.addEventListener("webglcontextrestored",Ke,!1),n.addEventListener("webglcontextcreationerror",Ye,!1),j===null){const ne="webgl2";if(j=ye(ne,V),j===null)throw ye(ne)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(V){throw console.error("THREE.WebGLRenderer: "+V.message),V}let xe,Re,Pe,Ee,De,$,z,re,he,pe,be,Ge,Fe,Ne,ze,Le,Xe,xt,Oe,Ue,Ae,ke,dt,J;function je(){xe=new Yae(j),xe.init(),ke=new XU(j,xe),Re=new $ae(j,xe,e,ke),Pe=new Ace(j),Re.reverseDepthBuffer&&Pe.buffers.depth.setReversed(!0),Ee=new Jae(j),De=new gce,$=new Oce(j,xe,Pe,De,Re,ke,Ee),z=new Hae(_),re=new qae(_),he=new ooe(j),dt=new jae(j,he),pe=new Kae(j,he,Ee,dt),be=new ele(j,pe,he,Ee),Oe=new Qae(j,Re,$),Le=new Wae(De),Ge=new mce(_,z,re,xe,Re,dt,Le),Fe=new Vce(_,De),Ne=new yce,ze=new Mce(xe),xt=new Bae(_,z,re,Pe,be,h,l),Xe=new Tce(_,be,Re),J=new $ce(j,Ee,Re,Pe),Ue=new Vae(j,xe,Ee),Ae=new Zae(j,xe,Ee),Ee.programs=Ge.programs,_.capabilities=Re,_.extensions=xe,_.properties=De,_.renderLists=Ne,_.shadowMap=Xe,_.state=Pe,_.info=Ee}je();const fe=new Bce(_,j);this.xr=fe,this.getContext=function(){return j},this.getContextAttributes=function(){return j.getContextAttributes()},this.forceContextLoss=function(){const V=xe.get("WEBGL_lose_context");V&&V.loseContext()},this.forceContextRestore=function(){const V=xe.get("WEBGL_lose_context");V&&V.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(V){V!==void 0&&(Z=V,this.setSize(X,H,!1))},this.getSize=function(V){return V.set(X,H)},this.setSize=function(V,ne,ue=!0){if(fe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=V,H=ne,n.width=Math.floor(V*Z),n.height=Math.floor(ne*Z),ue===!0&&(n.style.width=V+"px",n.style.height=ne+"px"),this.setViewport(0,0,V,ne)},this.getDrawingBufferSize=function(V){return V.set(X*Z,H*Z).floor()},this.setDrawingBufferSize=function(V,ne,ue){X=V,H=ne,Z=ue,n.width=Math.floor(V*ue),n.height=Math.floor(ne*ue),this.setViewport(0,0,V,ne)},this.getCurrentViewport=function(V){return V.copy(M)},this.getViewport=function(V){return V.copy(K)},this.setViewport=function(V,ne,ue,de){V.isVector4?K.set(V.x,V.y,V.z,V.w):K.set(V,ne,ue,de),Pe.viewport(M.copy(K).multiplyScalar(Z).round())},this.getScissor=function(V){return V.copy(ee)},this.setScissor=function(V,ne,ue,de){V.isVector4?ee.set(V.x,V.y,V.z,V.w):ee.set(V,ne,ue,de),Pe.scissor(R.copy(ee).multiplyScalar(Z).round())},this.getScissorTest=function(){return me},this.setScissorTest=function(V){Pe.setScissorTest(me=V)},this.setOpaqueSort=function(V){F=V},this.setTransparentSort=function(V){Y=V},this.getClearColor=function(V){return V.copy(xt.getClearColor())},this.setClearColor=function(){xt.setClearColor.apply(xt,arguments)},this.getClearAlpha=function(){return xt.getClearAlpha()},this.setClearAlpha=function(){xt.setClearAlpha.apply(xt,arguments)},this.clear=function(V=!0,ne=!0,ue=!0){let de=0;if(V){let oe=!1;if(T!==null){const We=T.texture.format;oe=We===r_||We===n_||We===dg}if(oe){const We=T.texture.type,it=We===Fi||We===Ia||We===Sd||We===au||We===e_||We===t_,lt=xt.getClearColor(),ct=xt.getClearAlpha(),St=lt.r,Et=lt.g,mt=lt.b;it?(m[0]=St,m[1]=Et,m[2]=mt,m[3]=ct,j.clearBufferuiv(j.COLOR,0,m)):(v[0]=St,v[1]=Et,v[2]=mt,v[3]=ct,j.clearBufferiv(j.COLOR,0,v))}else de|=j.COLOR_BUFFER_BIT}ne&&(de|=j.DEPTH_BUFFER_BIT,j.clearDepth(this.capabilities.reverseDepthBuffer?0:1)),ue&&(de|=j.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),j.clear(de)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Te,!1),n.removeEventListener("webglcontextrestored",Ke,!1),n.removeEventListener("webglcontextcreationerror",Ye,!1),Ne.dispose(),ze.dispose(),De.dispose(),z.dispose(),re.dispose(),be.dispose(),dt.dispose(),J.dispose(),Ge.dispose(),fe.dispose(),fe.removeEventListener("sessionstart",kg),fe.removeEventListener("sessionend",Og),Ks.stop()};function Te(V){V.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function Ke(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;const V=Ee.autoReset,ne=Xe.enabled,ue=Xe.autoUpdate,de=Xe.needsUpdate,oe=Xe.type;je(),Ee.autoReset=V,Xe.enabled=ne,Xe.autoUpdate=ue,Xe.needsUpdate=de,Xe.type=oe}function Ye(V){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",V.statusMessage)}function Bt(V){const ne=V.target;ne.removeEventListener("dispose",Bt),An(ne)}function An(V){kr(V),De.remove(V)}function kr(V){const ne=De.get(V).programs;ne!==void 0&&(ne.forEach(function(ue){Ge.releaseProgram(ue)}),V.isShaderMaterial&&Ge.releaseShaderCache(V))}this.renderBufferDirect=function(V,ne,ue,de,oe,We){ne===null&&(ne=rt);const it=oe.isMesh&&oe.matrixWorld.determinant()<0,lt=tw(V,ne,ue,de,oe);Pe.setMaterial(de,it);let ct=ue.index,St=1;if(de.wireframe===!0){if(ct=pe.getWireframeAttribute(ue),ct===void 0)return;St=2}const Et=ue.drawRange,mt=ue.attributes.position;let Jt=Et.start*St,nn=(Et.start+Et.count)*St;We!==null&&(Jt=Math.max(Jt,We.start*St),nn=Math.min(nn,(We.start+We.count)*St)),ct!==null?(Jt=Math.max(Jt,0),nn=Math.min(nn,ct.count)):mt!=null&&(Jt=Math.max(Jt,0),nn=Math.min(nn,mt.count));const ln=nn-Jt;if(ln<0||ln===1/0)return;dt.setup(oe,de,lt,ue,ct);let $t,vt=Ue;if(ct!==null&&($t=he.get(ct),vt=Ae,vt.setIndex($t)),oe.isMesh)de.wireframe===!0?(Pe.setLineWidth(de.wireframeLinewidth*se()),vt.setMode(j.LINES)):vt.setMode(j.TRIANGLES);else if(oe.isLine){let ft=de.linewidth;ft===void 0&&(ft=1),Pe.setLineWidth(ft*se()),oe.isLineSegments?vt.setMode(j.LINES):oe.isLineLoop?vt.setMode(j.LINE_LOOP):vt.setMode(j.LINE_STRIP)}else oe.isPoints?vt.setMode(j.POINTS):oe.isSprite&&vt.setMode(j.TRIANGLES);if(oe.isBatchedMesh)if(oe._multiDrawInstances!==null)vt.renderMultiDrawInstances(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount,oe._multiDrawInstances);else if(xe.get("WEBGL_multi_draw"))vt.renderMultiDraw(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount);else{const ft=oe._multiDrawStarts,Kt=oe._multiDrawCounts,Pt=oe._multiDrawCount,rr=ct?he.get(ct).bytesPerElement:1,Ui=De.get(de).currentProgram.getUniforms();for(let gn=0;gn{function We(){if(de.forEach(function(it){De.get(it).currentProgram.isReady()&&de.delete(it)}),de.size===0){oe(V);return}setTimeout(We,10)}xe.get("KHR_parallel_shader_compile")!==null?We():setTimeout(We,10)})};let Mr=null;function co(V){Mr&&Mr(V)}function kg(){Ks.stop()}function Og(){Ks.start()}const Ks=new VU;Ks.setAnimationLoop(co),typeof self<"u"&&Ks.setContext(self),this.setAnimationLoop=function(V){Mr=V,fe.setAnimationLoop(V),V===null?Ks.stop():Ks.start()},fe.addEventListener("sessionstart",kg),fe.addEventListener("sessionend",Og),this.render=function(V,ne){if(ne!==void 0&&ne.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;if(V.matrixWorldAutoUpdate===!0&&V.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),fe.enabled===!0&&fe.isPresenting===!0&&(fe.cameraAutoUpdate===!0&&fe.updateCamera(ne),ne=fe.getCamera()),V.isScene===!0&&V.onBeforeRender(_,V,ne,T),y=ze.get(V,b.length),y.init(ne),b.push(y),Me.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),le.setFromProjectionMatrix(Me),ae=this.localClippingEnabled,Q=Le.init(this.clippingPlanes,ae),x=Ne.get(V,g.length),x.init(),g.push(x),fe.enabled===!0&&fe.isPresenting===!0){const We=_.xr.getDepthSensingMesh();We!==null&&Ru(We,ne,-1/0,_.sortObjects)}Ru(V,ne,0,_.sortObjects),x.finish(),_.sortObjects===!0&&x.sort(F,Y),Ve=fe.enabled===!1||fe.isPresenting===!1||fe.hasDepthSensing()===!1,Ve&&xt.addToRenderList(x,V),this.info.render.frame++,Q===!0&&Le.beginShadows();const ue=y.state.shadowsArray;Xe.render(ue,V,ne),Q===!0&&Le.endShadows(),this.info.autoReset===!0&&this.info.reset();const de=x.opaque,oe=x.transmissive;if(y.setupLights(),ne.isArrayCamera){const We=ne.cameras;if(oe.length>0)for(let it=0,lt=We.length;it0&&Dg(de,oe,V,ne),Ve&&xt.render(V),Au(x,V,ne);T!==null&&($.updateMultisampleRenderTarget(T),$.updateRenderTargetMipmap(T)),V.isScene===!0&&V.onAfterRender(_,V,ne),dt.resetDefaultState(),L=-1,U=null,b.pop(),b.length>0?(y=b[b.length-1],Q===!0&&Le.setGlobalState(_.clippingPlanes,y.state.camera)):y=null,g.pop(),g.length>0?x=g[g.length-1]:x=null};function Ru(V,ne,ue,de){if(V.visible===!1)return;if(V.layers.test(ne.layers)){if(V.isGroup)ue=V.renderOrder;else if(V.isLOD)V.autoUpdate===!0&&V.update(ne);else if(V.isLight)y.pushLight(V),V.castShadow&&y.pushShadow(V);else if(V.isSprite){if(!V.frustumCulled||le.intersectsSprite(V)){de&&He.setFromMatrixPosition(V.matrixWorld).applyMatrix4(Me);const it=be.update(V),lt=V.material;lt.visible&&x.push(V,it,lt,ue,He.z,null)}}else if((V.isMesh||V.isLine||V.isPoints)&&(!V.frustumCulled||le.intersectsObject(V))){const it=be.update(V),lt=V.material;if(de&&(V.boundingSphere!==void 0?(V.boundingSphere===null&&V.computeBoundingSphere(),He.copy(V.boundingSphere.center)):(it.boundingSphere===null&&it.computeBoundingSphere(),He.copy(it.boundingSphere.center)),He.applyMatrix4(V.matrixWorld).applyMatrix4(Me)),Array.isArray(lt)){const ct=it.groups;for(let St=0,Et=ct.length;St0&&hs(oe,ne,ue),We.length>0&&hs(We,ne,ue),it.length>0&&hs(it,ne,ue),Pe.buffers.depth.setTest(!0),Pe.buffers.depth.setMask(!0),Pe.buffers.color.setMask(!0),Pe.setPolygonOffset(!1)}function Dg(V,ne,ue,de){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;y.state.transmissionRenderTarget[de.id]===void 0&&(y.state.transmissionRenderTarget[de.id]=new os(1,1,{generateMipmaps:!0,type:xe.has("EXT_color_buffer_half_float")||xe.has("EXT_color_buffer_float")?xu:Fi,minFilter:Rs,samples:4,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:an.workingColorSpace}));const We=y.state.transmissionRenderTarget[de.id],it=de.viewport||M;We.setSize(it.z,it.w);const lt=_.getRenderTarget();_.setRenderTarget(We),_.getClearColor(O),B=_.getClearAlpha(),B<1&&_.setClearColor(16777215,.5),_.clear(),Ve&&xt.render(ue);const ct=_.toneMapping;_.toneMapping=Os;const St=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),y.setupLightsView(de),Q===!0&&Le.setGlobalState(_.clippingPlanes,de),hs(V,ue,de),$.updateMultisampleRenderTarget(We),$.updateRenderTargetMipmap(We),xe.has("WEBGL_multisampled_render_to_texture")===!1){let Et=!1;for(let mt=0,Jt=ne.length;mt0),mt=!!ue.morphAttributes.position,Jt=!!ue.morphAttributes.normal,nn=!!ue.morphAttributes.color;let ln=Os;de.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(ln=_.toneMapping);const $t=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,vt=$t!==void 0?$t.length:0,ft=De.get(de),Kt=y.state.lights;if(Q===!0&&(ae===!0||V!==U)){const Kr=V===U&&de.id===L;Le.setState(de,V,Kr)}let Pt=!1;de.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==Kt.state.version||ft.outputColorSpace!==lt||oe.isBatchedMesh&&ft.batching===!1||!oe.isBatchedMesh&&ft.batching===!0||oe.isBatchedMesh&&ft.batchingColor===!0&&oe.colorTexture===null||oe.isBatchedMesh&&ft.batchingColor===!1&&oe.colorTexture!==null||oe.isInstancedMesh&&ft.instancing===!1||!oe.isInstancedMesh&&ft.instancing===!0||oe.isSkinnedMesh&&ft.skinning===!1||!oe.isSkinnedMesh&&ft.skinning===!0||oe.isInstancedMesh&&ft.instancingColor===!0&&oe.instanceColor===null||oe.isInstancedMesh&&ft.instancingColor===!1&&oe.instanceColor!==null||oe.isInstancedMesh&&ft.instancingMorph===!0&&oe.morphTexture===null||oe.isInstancedMesh&&ft.instancingMorph===!1&&oe.morphTexture!==null||ft.envMap!==ct||de.fog===!0&&ft.fog!==We||ft.numClippingPlanes!==void 0&&(ft.numClippingPlanes!==Le.numPlanes||ft.numIntersection!==Le.numIntersection)||ft.vertexAlphas!==St||ft.vertexTangents!==Et||ft.morphTargets!==mt||ft.morphNormals!==Jt||ft.morphColors!==nn||ft.toneMapping!==ln||ft.morphTargetsCount!==vt)&&(Pt=!0):(Pt=!0,ft.__version=de.version);let rr=ft.currentProgram;Pt===!0&&(rr=Pu(de,ne,oe));let Ui=!1,gn=!1,Ua=!1;const Mn=rr.getUniforms(),Uo=ft.uniforms;if(Pe.useProgram(rr.program)&&(Ui=!0,gn=!0,Ua=!0),de.id!==L&&(L=de.id,gn=!0),Ui||U!==V){Re.reverseDepthBuffer?(ge.copy(V.projectionMatrix),Aie(ge),Pie(ge),Mn.setValue(j,"projectionMatrix",ge)):Mn.setValue(j,"projectionMatrix",V.projectionMatrix),Mn.setValue(j,"viewMatrix",V.matrixWorldInverse);const Kr=Mn.map.cameraPosition;Kr!==void 0&&Kr.setValue(j,tt.setFromMatrixPosition(V.matrixWorld)),Re.logarithmicDepthBuffer&&Mn.setValue(j,"logDepthBufFC",2/(Math.log(V.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&Mn.setValue(j,"isOrthographic",V.isOrthographicCamera===!0),U!==V&&(U=V,gn=!0,Ua=!0)}if(oe.isSkinnedMesh){Mn.setOptional(j,oe,"bindMatrix"),Mn.setOptional(j,oe,"bindMatrixInverse");const Kr=oe.skeleton;Kr&&(Kr.boneTexture===null&&Kr.computeBoneTexture(),Mn.setValue(j,"boneTexture",Kr.boneTexture,$))}oe.isBatchedMesh&&(Mn.setOptional(j,oe,"batchingTexture"),Mn.setValue(j,"batchingTexture",oe._matricesTexture,$),Mn.setOptional(j,oe,"batchingIdTexture"),Mn.setValue(j,"batchingIdTexture",oe._indirectTexture,$),Mn.setOptional(j,oe,"batchingColorTexture"),oe._colorsTexture!==null&&Mn.setValue(j,"batchingColorTexture",oe._colorsTexture,$));const Ba=ue.morphAttributes;if((Ba.position!==void 0||Ba.normal!==void 0||Ba.color!==void 0)&&Oe.update(oe,ue,rr),(gn||ft.receiveShadow!==oe.receiveShadow)&&(ft.receiveShadow=oe.receiveShadow,Mn.setValue(j,"receiveShadow",oe.receiveShadow)),de.isMeshGouraudMaterial&&de.envMap!==null&&(Uo.envMap.value=ct,Uo.flipEnvMap.value=ct.isCubeTexture&&ct.isRenderTargetTexture===!1?-1:1),de.isMeshStandardMaterial&&de.envMap===null&&ne.environment!==null&&(Uo.envMapIntensity.value=ne.environmentIntensity),gn&&(Mn.setValue(j,"toneMappingExposure",_.toneMappingExposure),ft.needsLights&&nw(Uo,Ua),We&&de.fog===!0&&Fe.refreshFogUniforms(Uo,We),Fe.refreshMaterialUniforms(Uo,de,Z,H,y.state.transmissionRenderTarget[V.id]),zy.upload(j,zg(ft),Uo,$)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(zy.upload(j,zg(ft),Uo,$),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&Mn.setValue(j,"center",oe.center),Mn.setValue(j,"modelViewMatrix",oe.modelViewMatrix),Mn.setValue(j,"normalMatrix",oe.normalMatrix),Mn.setValue(j,"modelMatrix",oe.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const Kr=de.uniformsGroups;for(let Zr=0,iw=Kr.length;Zr0&&$.useMultisampledRTT(V)===!1?oe=De.get(V).__webglMultisampledFramebuffer:Array.isArray(Et)?oe=Et[ue]:oe=Et,M.copy(V.viewport),R.copy(V.scissor),D=V.scissorTest}else M.copy(K).multiplyScalar(Z).floor(),R.copy(ee).multiplyScalar(Z).floor(),D=me;if(Pe.bindFramebuffer(j.FRAMEBUFFER,oe)&&de&&Pe.drawBuffers(V,oe),Pe.viewport(M),Pe.scissor(R),Pe.setScissorTest(D),We){const ct=De.get(V.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+ne,ct.__webglTexture,ue)}else if(it){const ct=De.get(V.texture),St=ne||0;j.framebufferTextureLayer(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,ct.__webglTexture,ue||0,St)}L=-1},this.readRenderTargetPixels=function(V,ne,ue,de,oe,We,it){if(!(V&&V.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let lt=De.get(V).__webglFramebuffer;if(V.isWebGLCubeRenderTarget&&it!==void 0&&(lt=lt[it]),lt){Pe.bindFramebuffer(j.FRAMEBUFFER,lt);try{const ct=V.texture,St=ct.format,Et=ct.type;if(!Re.textureFormatReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Re.textureTypeReadable(Et)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=V.width-de&&ue>=0&&ue<=V.height-oe&&j.readPixels(ne,ue,de,oe,ke.convert(St),ke.convert(Et),We)}finally{const ct=T!==null?De.get(T).__webglFramebuffer:null;Pe.bindFramebuffer(j.FRAMEBUFFER,ct)}}},this.readRenderTargetPixelsAsync=async function(V,ne,ue,de,oe,We,it){if(!(V&&V.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let lt=De.get(V).__webglFramebuffer;if(V.isWebGLCubeRenderTarget&&it!==void 0&&(lt=lt[it]),lt){const ct=V.texture,St=ct.format,Et=ct.type;if(!Re.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Re.textureTypeReadable(Et))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(ne>=0&&ne<=V.width-de&&ue>=0&&ue<=V.height-oe){Pe.bindFramebuffer(j.FRAMEBUFFER,lt);const mt=j.createBuffer();j.bindBuffer(j.PIXEL_PACK_BUFFER,mt),j.bufferData(j.PIXEL_PACK_BUFFER,We.byteLength,j.STREAM_READ),j.readPixels(ne,ue,de,oe,ke.convert(St),ke.convert(Et),0);const Jt=T!==null?De.get(T).__webglFramebuffer:null;Pe.bindFramebuffer(j.FRAMEBUFFER,Jt);const nn=j.fenceSync(j.SYNC_GPU_COMMANDS_COMPLETE,0);return j.flush(),await Rie(j,nn,4),j.bindBuffer(j.PIXEL_PACK_BUFFER,mt),j.getBufferSubData(j.PIXEL_PACK_BUFFER,0,We),j.deleteBuffer(mt),j.deleteSync(nn),We}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(V,ne=null,ue=0){V.isTexture!==!0&&(Fy("WebGLRenderer: copyFramebufferToTexture function signature has changed."),ne=arguments[0]||null,V=arguments[1]);const de=Math.pow(2,-ue),oe=Math.floor(V.image.width*de),We=Math.floor(V.image.height*de),it=ne!==null?ne.x:0,lt=ne!==null?ne.y:0;$.setTexture2D(V,0),j.copyTexSubImage2D(j.TEXTURE_2D,ue,0,0,it,lt,oe,We),Pe.unbindTexture()},this.copyTextureToTexture=function(V,ne,ue=null,de=null,oe=0){V.isTexture!==!0&&(Fy("WebGLRenderer: copyTextureToTexture function signature has changed."),de=arguments[0]||null,V=arguments[1],ne=arguments[2],oe=arguments[3]||0,ue=null);let We,it,lt,ct,St,Et;ue!==null?(We=ue.max.x-ue.min.x,it=ue.max.y-ue.min.y,lt=ue.min.x,ct=ue.min.y):(We=V.image.width,it=V.image.height,lt=0,ct=0),de!==null?(St=de.x,Et=de.y):(St=0,Et=0);const mt=ke.convert(ne.format),Jt=ke.convert(ne.type);$.setTexture2D(ne,0),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,ne.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ne.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,ne.unpackAlignment);const nn=j.getParameter(j.UNPACK_ROW_LENGTH),ln=j.getParameter(j.UNPACK_IMAGE_HEIGHT),$t=j.getParameter(j.UNPACK_SKIP_PIXELS),vt=j.getParameter(j.UNPACK_SKIP_ROWS),ft=j.getParameter(j.UNPACK_SKIP_IMAGES),Kt=V.isCompressedTexture?V.mipmaps[oe]:V.image;j.pixelStorei(j.UNPACK_ROW_LENGTH,Kt.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,Kt.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,lt),j.pixelStorei(j.UNPACK_SKIP_ROWS,ct),V.isDataTexture?j.texSubImage2D(j.TEXTURE_2D,oe,St,Et,We,it,mt,Jt,Kt.data):V.isCompressedTexture?j.compressedTexSubImage2D(j.TEXTURE_2D,oe,St,Et,Kt.width,Kt.height,mt,Kt.data):j.texSubImage2D(j.TEXTURE_2D,oe,St,Et,We,it,mt,Jt,Kt),j.pixelStorei(j.UNPACK_ROW_LENGTH,nn),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,ln),j.pixelStorei(j.UNPACK_SKIP_PIXELS,$t),j.pixelStorei(j.UNPACK_SKIP_ROWS,vt),j.pixelStorei(j.UNPACK_SKIP_IMAGES,ft),oe===0&&ne.generateMipmaps&&j.generateMipmap(j.TEXTURE_2D),Pe.unbindTexture()},this.copyTextureToTexture3D=function(V,ne,ue=null,de=null,oe=0){V.isTexture!==!0&&(Fy("WebGLRenderer: copyTextureToTexture3D function signature has changed."),ue=arguments[0]||null,de=arguments[1]||null,V=arguments[2],ne=arguments[3],oe=arguments[4]||0);let We,it,lt,ct,St,Et,mt,Jt,nn;const ln=V.isCompressedTexture?V.mipmaps[oe]:V.image;ue!==null?(We=ue.max.x-ue.min.x,it=ue.max.y-ue.min.y,lt=ue.max.z-ue.min.z,ct=ue.min.x,St=ue.min.y,Et=ue.min.z):(We=ln.width,it=ln.height,lt=ln.depth,ct=0,St=0,Et=0),de!==null?(mt=de.x,Jt=de.y,nn=de.z):(mt=0,Jt=0,nn=0);const $t=ke.convert(ne.format),vt=ke.convert(ne.type);let ft;if(ne.isData3DTexture)$.setTexture3D(ne,0),ft=j.TEXTURE_3D;else if(ne.isDataArrayTexture||ne.isCompressedArrayTexture)$.setTexture2DArray(ne,0),ft=j.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,ne.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ne.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,ne.unpackAlignment);const Kt=j.getParameter(j.UNPACK_ROW_LENGTH),Pt=j.getParameter(j.UNPACK_IMAGE_HEIGHT),rr=j.getParameter(j.UNPACK_SKIP_PIXELS),Ui=j.getParameter(j.UNPACK_SKIP_ROWS),gn=j.getParameter(j.UNPACK_SKIP_IMAGES);j.pixelStorei(j.UNPACK_ROW_LENGTH,ln.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,ln.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,ct),j.pixelStorei(j.UNPACK_SKIP_ROWS,St),j.pixelStorei(j.UNPACK_SKIP_IMAGES,Et),V.isDataTexture||V.isData3DTexture?j.texSubImage3D(ft,oe,mt,Jt,nn,We,it,lt,$t,vt,ln.data):ne.isCompressedArrayTexture?j.compressedTexSubImage3D(ft,oe,mt,Jt,nn,We,it,lt,$t,ln.data):j.texSubImage3D(ft,oe,mt,Jt,nn,We,it,lt,$t,vt,ln),j.pixelStorei(j.UNPACK_ROW_LENGTH,Kt),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,Pt),j.pixelStorei(j.UNPACK_SKIP_PIXELS,rr),j.pixelStorei(j.UNPACK_SKIP_ROWS,Ui),j.pixelStorei(j.UNPACK_SKIP_IMAGES,gn),oe===0&&ne.generateMipmaps&&j.generateMipmap(ft),Pe.unbindTexture()},this.initRenderTarget=function(V){De.get(V).__webglFramebuffer===void 0&&$.setupRenderTarget(V)},this.initTexture=function(V){V.isCubeTexture?$.setTextureCube(V,0):V.isData3DTexture?$.setTexture3D(V,0):V.isDataArrayTexture||V.isCompressedArrayTexture?$.setTexture2DArray(V,0):$.setTexture2D(V,0),Pe.unbindTexture()},this.resetState=function(){P=0,N=0,T=null,Pe.reset(),dt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return As}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===o_?"display-p3":"srgb",n.unpackColorSpace=an.workingColorSpace===hg?"display-p3":"srgb"}}class l_{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new ot(e),this.density=n}clone(){return new l_(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class c_{constructor(e,n=1,r=1e3){this.isFog=!0,this.name="",this.color=new ot(e),this.near=n,this.far=r}clone(){return new c_(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class dx extends tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ro,this.environmentIntensity=1,this.environmentRotation=new ro,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class u_{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=Tm,this.updateRanges=[],this.version=0,this.uuid=eo()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;ie.far||n.push({distance:l,point:qh.clone(),uv:Mi.getInterpolation(qh,Tv,Kh,Rv,bL,DM,_L,new Ie),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Av(t,e,n,r,i,o){pf.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(Yh.x=o*pf.x-i*pf.y,Yh.y=i*pf.x+o*pf.y):Yh.copy(pf),t.copy(e),t.x+=Yh.x,t.y+=Yh.y,t.applyMatrix4(KU)}const Pv=new G,wL=new G;class JU extends tn{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 n=e.levels;for(let r=0,i=n.length;r0){let r,i;for(r=1,i=n.length;r0){Pv.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Pv);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){Pv.setFromMatrixPosition(e.matrixWorld),wL.setFromMatrixPosition(this.matrixWorld);const r=Pv.distanceTo(wL)/e.zoom;n[0].object.visible=!0;let i,o;for(i=1,o=n.length;i=s)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;i=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});const s=i[this.index];o.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=n,s.index=r}reset(){this.list.length=0,this.index=0}}const sl=new wt,UM=new wt,Kce=new wt,Zce=new ot(1,1,1),NL=new wt,BM=new gg,Lv=new Pr,cc=new qr,Qh=new G,IL=new G,Jce=new G,jM=new Yce,$r=new nr,kv=[];function Qce(t,e,n=0){const r=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const i=t.count;for(let o=0;o65535?new Uint32Array(i):new Uint16Array(i);n.setIndex(new hn(o,1))}this._geometryInitialized=!0}}_validateGeometry(e){const n=this.geometry;if(!!e.getIndex()!=!!n.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in n.attributes){if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),o=n.getAttribute(r);if(i.itemSize!==o.itemSize||i.normalized!==o.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Pr);const e=this.boundingBox,n=this._drawInfo;e.makeEmpty();for(let r=0,i=n.length;r=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("BatchedMesh: Maximum item count reached.");const r={visible:!0,active:!0,geometryIndex:e};let i=null;this._availableInstanceIds.length>0?(i=this._availableInstanceIds.pop(),this._drawInfo[i]=r):(i=this._drawInfo.length,this._drawInfo.push(r));const o=this._matricesTexture,s=o.image.data;Kce.toArray(s,i*16),o.needsUpdate=!0;const a=this._colorsTexture;return a&&(Zce.toArray(a.image.data,i*4),a.needsUpdate=!0),i}addGeometry(e,n=-1,r=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let o=null;const s=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(o=s[s.length-1]),n===-1?i.vertexCount=e.getAttribute("position").count:i.vertexCount=n,o===null?i.vertexStart=0:i.vertexStart=o.vertexStart+o.vertexCount;const c=e.getIndex(),u=c!==null;if(u&&(r===-1?i.indexCount=c.count:i.indexCount=r,o===null?i.indexStart=0:i.indexStart=o.indexStart+o.indexCount),i.indexStart!==-1&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const f=this._geometryCount;return this._geometryCount++,s.push(i),a.push({start:u?i.indexStart:i.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Pr,sphereInitialized:!1,sphere:new qr}),this.setGeometryAt(f,e),f}setGeometryAt(e,n){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(n);const r=this.geometry,i=r.getIndex()!==null,o=r.getIndex(),s=n.getIndex(),a=this._reservedRanges[e];if(i&&s.count>a.indexCount||n.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const m in r.attributes){const v=n.getAttribute(m),x=r.getAttribute(m);Qce(v,x,l);const y=v.itemSize;for(let g=v.count,b=c;g=n.length||n[e].active===!1?this:(n[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this)}getBoundingBoxAt(e,n){if(e>=this._geometryCount)return null;const r=this._bounds[e],i=r.box,o=this.geometry;if(r.boxInitialized===!1){i.makeEmpty();const s=o.index,a=o.attributes.position,l=this._drawRanges[e];for(let c=l.start,u=l.start+l.count;c=this._geometryCount)return null;const r=this._bounds[e],i=r.sphere,o=this.geometry;if(r.sphereInitialized===!1){i.makeEmpty(),this.getBoundingBoxAt(e,Lv),Lv.getCenter(i.center);const s=o.index,a=o.attributes.position,l=this._drawRanges[e];let c=0;for(let u=l.start,f=l.start+l.count;u=r.length||r[e].active===!1?this:(n.toArray(o,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,n){const r=this._drawInfo,i=this._matricesTexture.image.data;return e>=r.length||r[e].active===!1?null:n.fromArray(i,e*16)}setColorAt(e,n){this._colorsTexture===null&&this._initColorsTexture();const r=this._colorsTexture,i=this._colorsTexture.image.data,o=this._drawInfo;return e>=o.length||o[e].active===!1?this:(n.toArray(i,e*4),r.needsUpdate=!0,this)}getColorAt(e,n){const r=this._colorsTexture.image.data,i=this._drawInfo;return e>=i.length||i[e].active===!1?null:n.fromArray(r,e*4)}setVisibleAt(e,n){const r=this._drawInfo;return e>=r.length||r[e].active===!1||r[e].visible===n?this:(r[e].visible=n,this._visibilityChanged=!0,this)}getVisibleAt(e){const n=this._drawInfo;return e>=n.length||n[e].active===!1?!1:n[e].visible}setGeometryIdAt(e,n){const r=this._drawInfo;return e>=r.length||r[e].active===!1||n<0||n>=this._geometryCount?null:(r[e].geometryIndex=n,this)}getGeometryIdAt(e){const n=this._drawInfo;return e>=n.length||n[e].active===!1?-1:n[e].geometryIndex}getGeometryRangeAt(e,n={}){if(e<0||e>=this._geometryCount)return null;const r=this._drawRanges[e];return n.start=r.start,n.count=r.count,n}raycast(e,n){const r=this._drawInfo,i=this._drawRanges,o=this.matrixWorld,s=this.geometry;$r.material=this.material,$r.geometry.index=s.index,$r.geometry.attributes=s.attributes,$r.geometry.boundingBox===null&&($r.geometry.boundingBox=new Pr),$r.geometry.boundingSphere===null&&($r.geometry.boundingSphere=new qr);for(let a=0,l=r.length;a({...n})),this._reservedRanges=e._reservedRanges.map(n=>({...n})),this._drawInfo=e._drawInfo.map(n=>({...n})),this._bounds=e._bounds.map(n=>({boxInitialized:n.boxInitialized,box:n.box.clone(),sphereInitialized:n.sphereInitialized,sphere:n.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,n,r,i,o){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=i.getIndex(),a=s===null?1:s.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._drawRanges,h=this.perObjectFrustumCulled,m=this._indirectTexture,v=m.image.data;h&&(NL.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),BM.setFromProjectionMatrix(NL,e.coordinateSystem));let x=0;if(this.sortObjects){UM.copy(this.matrixWorld).invert(),Qh.setFromMatrixPosition(r.matrixWorld).applyMatrix4(UM),IL.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(UM);for(let b=0,_=l.length;b<_;b++)if(l[b].visible&&l[b].active){const S=l[b].geometryIndex;this.getMatrixAt(b,sl),this.getBoundingSphereAt(S,cc).applyMatrix4(sl);let P=!1;if(h&&(P=!BM.intersectsSphere(cc)),!P){const N=Jce.subVectors(cc.center,Qh).dot(IL);jM.push(f[S],N,b)}}const y=jM.list,g=this.customSort;g===null?y.sort(o.transparent?qce:Xce):g.call(this,y,r);for(let b=0,_=y.length;b<_;b++){const S=y[b];c[x]=S.start*a,u[x]=S.count,v[x]=S.index,x++}jM.reset()}else for(let y=0,g=l.length;y0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;or)return;VM.applyMatrix4(t.matrixWorld);const l=e.ray.origin.distanceTo(VM);if(!(le.far))return{distance:l,point:kL.clone().applyMatrix4(t.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:t}}const OL=new G,DL=new G;class qs extends La{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;oi.far)return;o.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class eue extends kn{constructor(e,n,r,i,o,s,a,l,c){super(e,n,r,i,o,s,a,l,c),this.isVideoTexture=!0,this.minFilter=s!==void 0?s:tr,this.magFilter=o!==void 0?o:tr,this.generateMipmaps=!1;const u=this;function f(){u.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class tue extends kn{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=lr,this.minFilter=lr,this.generateMipmaps=!1,this.needsUpdate=!0}}class d_ extends kn{constructor(e,n,r,i,o,s,a,l,c,u,f,h){super(null,s,a,l,c,u,i,o,f,h),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class nue extends d_{constructor(e,n,r,i,o,s){super(e,n,r,o,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ti,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class rue extends d_{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,Na),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class iue extends kn{constructor(e,n,r,i,o,s,a,l,c){super(e,n,r,i,o,s,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class us{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,n){const r=this.getUtoTmapping(e);return this.getPoint(r,n)}getPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return n}getSpacedPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n}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 n=[];let r,i=this.getPoint(0),o=0;n.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),o+=r.distanceTo(i),n.push(o),i=r;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n){const r=this.getLengths();let i=0;const o=r.length;let s;n?s=n:s=e*r[o-1];let a=0,l=o-1,c;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),c=r[i]-s,c<0)a=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,r[i]===s)return i/(o-1);const u=r[i],h=r[i+1]-u,m=(s-u)/h;return(i+m)/(o-1)}getTangent(e,n){let i=e-1e-4,o=e+1e-4;i<0&&(i=0),o>1&&(o=1);const s=this.getPoint(i),a=this.getPoint(o),l=n||(s.isVector2?new Ie:new G);return l.copy(a).sub(s).normalize(),l}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n){const r=new G,i=[],o=[],s=[],a=new G,l=new wt;for(let m=0;m<=e;m++){const v=m/e;i[m]=this.getTangentAt(v,new G)}o[0]=new G,s[0]=new G;let c=Number.MAX_VALUE;const u=Math.abs(i[0].x),f=Math.abs(i[0].y),h=Math.abs(i[0].z);u<=c&&(c=u,r.set(1,0,0)),f<=c&&(c=f,r.set(0,1,0)),h<=c&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),o[0].crossVectors(i[0],a),s[0].crossVectors(i[0],o[0]);for(let m=1;m<=e;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(i[m-1],i[m]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos($n(i[m-1].dot(i[m]),-1,1));o[m].applyMatrix4(l.makeRotationAxis(a,v))}s[m].crossVectors(i[m],o[m])}if(n===!0){let m=Math.acos($n(o[0].dot(o[e]),-1,1));m/=e,i[0].dot(a.crossVectors(o[0],o[e]))>0&&(m=-m);for(let v=1;v<=e;v++)o[v].applyMatrix4(l.makeRotationAxis(i[v],m*v)),s[v].crossVectors(i[v],o[v])}return{tangents:i,normals:o,binormals:s}}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 h_ extends us{constructor(e=0,n=0,r=1,i=1,o=0,s=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=r,this.yRadius=i,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(e,n=new Ie){const r=n,i=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)i;)o-=i;o0?0:(Math.floor(Math.abs(a)/o)+1)*o:l===0&&a===o-1&&(a=o-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%o]:(Uv.subVectors(i[0],i[1]).add(i[0]),c=Uv);const f=i[a%o],h=i[(a+1)%o];if(this.closed||a+2i.length-2?i.length-1:s+1],f=i[s>i.length-3?i.length-1:s+2];return r.set(UL(a,l.x,c.x,u.x,f.x),UL(a,l.y,c.y,u.y,f.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n=r){const s=i[o]-r,a=this.curves[o],l=a.getLength(),c=l===0?0:1-s/l;return a.getPointAt(c,n)}o++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let r=0,i=this.curves.length;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,r=e.curves.length;n0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),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 yg extends zt{constructor(e=[new Ie(0,-.5),new Ie(.5,0),new Ie(0,.5)],n=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:r,phiLength:i},n=Math.floor(n),i=$n(i,0,Math.PI*2);const o=[],s=[],a=[],l=[],c=[],u=1/n,f=new G,h=new Ie,m=new G,v=new G,x=new G;let y=0,g=0;for(let b=0;b<=e.length-1;b++)switch(b){case 0:y=e[b+1].x-e[b].x,g=e[b+1].y-e[b].y,m.x=g*1,m.y=-y,m.z=g*0,x.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(x.x,x.y,x.z);break;default:y=e[b+1].x-e[b].x,g=e[b+1].y-e[b].y,m.x=g*1,m.y=-y,m.z=g*0,v.copy(m),m.x+=x.x,m.y+=x.y,m.z+=x.z,m.normalize(),l.push(m.x,m.y,m.z),x.copy(v)}for(let b=0;b<=n;b++){const _=r+b*u*i,S=Math.sin(_),P=Math.cos(_);for(let N=0;N<=e.length-1;N++){f.x=e[N].x*S,f.y=e[N].y,f.z=e[N].x*P,s.push(f.x,f.y,f.z),h.x=b/n,h.y=N/(e.length-1),a.push(h.x,h.y);const T=l[3*N+0]*S,L=l[3*N+1],U=l[3*N+0]*P;c.push(T,L,U)}}for(let b=0;b0&&_(!0),n>0&&_(!1)),this.setIndex(u),this.setAttribute("position",new pt(f,3)),this.setAttribute("normal",new pt(h,3)),this.setAttribute("uv",new pt(m,2));function b(){const S=new G,P=new G;let N=0;const T=(n-e)/r;for(let L=0;L<=o;L++){const U=[],M=L/o,R=M*(n-e)+e;for(let D=0;D<=i;D++){const O=D/i,B=O*l+a,X=Math.sin(B),H=Math.cos(B);P.x=R*X,P.y=-M*r+y,P.z=R*H,f.push(P.x,P.y,P.z),S.set(X,T,H).normalize(),h.push(S.x,S.y,S.z),m.push(O,1-M),U.push(v++)}x.push(U)}for(let L=0;L0&&(u.push(M,R,O),N+=3),n>0&&(u.push(R,D,O),N+=3)}c.addGroup(g,N,0),g+=N}function _(S){const P=v,N=new Ie,T=new G;let L=0;const U=S===!0?e:n,M=S===!0?1:-1;for(let D=1;D<=i;D++)f.push(0,y*M,0),h.push(0,M,0),m.push(.5,.5),v++;const R=v;for(let D=0;D<=i;D++){const B=D/i*l+a,X=Math.cos(B),H=Math.sin(B);T.x=U*H,T.y=y*M,T.z=U*X,f.push(T.x,T.y,T.z),h.push(0,M,0),N.x=X*.5+.5,N.y=H*.5*M+.5,m.push(N.x,N.y),v++}for(let D=0;D.9&&T<.1&&(_<.2&&(s[b+0]+=1),S<.2&&(s[b+2]+=1),P<.2&&(s[b+4]+=1))}}function h(b){o.push(b.x,b.y,b.z)}function m(b,_){const S=b*3;_.x=e[S+0],_.y=e[S+1],_.z=e[S+2]}function v(){const b=new G,_=new G,S=new G,P=new G,N=new Ie,T=new Ie,L=new Ie;for(let U=0,M=0;U80*n){a=c=t[0],l=u=t[1];for(let v=n;vc&&(c=f),h>u&&(u=h);m=Math.max(c-a,u-l),m=m!==0?32767/m:0}return Nm(o,s,n,a,l,m,0),s}};function uB(t,e,n,r,i){let o,s;if(i===Rue(t,e,n,r)>0)for(o=e;o=e;o-=r)s=BL(o,t[o],t[o+1],s);return s&&y_(s,s.next)&&(Lm(s),s=s.next),s}function uu(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(y_(n,n.next)||In(n.prev,n,n.next)===0)){if(Lm(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function Nm(t,e,n,r,i,o,s){if(!t)return;!s&&o&&wue(t,r,i,o);let a=t,l,c;for(;t.prev!==t.next;){if(l=t.prev,c=t.next,o?pue(t,r,i,o):hue(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(c.i/n|0),Lm(t),t=c.next,a=c.next;continue}if(t=c,t===a){s?s===1?(t=mue(uu(t),e,n),Nm(t,e,n,r,i,o,2)):s===2&&gue(t,e,n,r,i,o):Nm(uu(t),e,n,r,i,o,1);break}}}function hue(t){const e=t.prev,n=t,r=t.next;if(In(e,n,r)>=0)return!1;const i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,c=r.y,u=io?i>s?i:s:o>s?o:s,m=a>l?a>c?a:c:l>c?l:c;let v=r.next;for(;v!==e;){if(v.x>=u&&v.x<=h&&v.y>=f&&v.y<=m&&Hf(i,a,o,l,s,c,v.x,v.y)&&In(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function pue(t,e,n,r){const i=t.prev,o=t,s=t.next;if(In(i,o,s)>=0)return!1;const a=i.x,l=o.x,c=s.x,u=i.y,f=o.y,h=s.y,m=al?a>c?a:c:l>c?l:c,y=u>f?u>h?u:h:f>h?f:h,g=fC(m,v,e,n,r),b=fC(x,y,e,n,r);let _=t.prevZ,S=t.nextZ;for(;_&&_.z>=g&&S&&S.z<=b;){if(_.x>=m&&_.x<=x&&_.y>=v&&_.y<=y&&_!==i&&_!==s&&Hf(a,u,l,f,c,h,_.x,_.y)&&In(_.prev,_,_.next)>=0||(_=_.prevZ,S.x>=m&&S.x<=x&&S.y>=v&&S.y<=y&&S!==i&&S!==s&&Hf(a,u,l,f,c,h,S.x,S.y)&&In(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;_&&_.z>=g;){if(_.x>=m&&_.x<=x&&_.y>=v&&_.y<=y&&_!==i&&_!==s&&Hf(a,u,l,f,c,h,_.x,_.y)&&In(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;S&&S.z<=b;){if(S.x>=m&&S.x<=x&&S.y>=v&&S.y<=y&&S!==i&&S!==s&&Hf(a,u,l,f,c,h,S.x,S.y)&&In(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function mue(t,e,n){let r=t;do{const i=r.prev,o=r.next.next;!y_(i,o)&&fB(i,r,r.next,o)&&Im(i,o)&&Im(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),Lm(r),Lm(r.next),r=t=o),r=r.next}while(r!==t);return uu(r)}function gue(t,e,n,r,i,o){let s=t;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&Eue(s,a)){let l=dB(s,a);s=uu(s,s.next),l=uu(l,l.next),Nm(s,e,n,r,i,o,0),Nm(l,e,n,r,i,o,0);return}a=a.next}s=s.next}while(s!==t)}function vue(t,e,n,r){const i=[];let o,s,a,l,c;for(o=0,s=e.length;o=n.next.y&&n.next.y!==n.y){const h=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=o&&h>r&&(r=h,i=n.x=n.x&&n.x>=l&&o!==n.x&&Hf(si.x||n.x===i.x&&_ue(i,n)))&&(i=n,u=f)),n=n.next;while(n!==a);return i}function _ue(t,e){return In(t.prev,t,e.prev)<0&&In(e.next,t,t.next)<0}function wue(t,e,n,r){let i=t;do i.z===0&&(i.z=fC(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,Sue(i)}function Sue(t){let e,n,r,i,o,s,a,l,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||l>0&&r;)a!==0&&(l===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1);return t}function fC(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Mue(t){let e=t,n=t;do(e.x=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function Eue(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Cue(t,e)&&(Im(t,e)&&Im(e,t)&&Tue(t,e)&&(In(t.prev,t,e.prev)||In(t,e.prev,e))||y_(t,e)&&In(t.prev,t,t.next)>0&&In(e.prev,e,e.next)>0)}function In(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function y_(t,e){return t.x===e.x&&t.y===e.y}function fB(t,e,n,r){const i=Wv(In(t,e,n)),o=Wv(In(t,e,r)),s=Wv(In(n,r,t)),a=Wv(In(n,r,e));return!!(i!==o&&s!==a||i===0&&$v(t,n,e)||o===0&&$v(t,r,e)||s===0&&$v(n,t,r)||a===0&&$v(n,e,r))}function $v(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Wv(t){return t>0?1:t<0?-1:0}function Cue(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&fB(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Im(t,e){return In(t.prev,t,t.next)<0?In(t,e,t.next)>=0&&In(t,t.prev,e)>=0:In(t,e,t.prev)<0||In(t,t.next,e)<0}function Tue(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}function dB(t,e){const n=new dC(t.i,t.x,t.y),r=new dC(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function BL(t,e,n,r){const i=new dC(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Lm(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function dC(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Rue(t,e,n,r){let i=0;for(let o=e,s=n-r;o2&&t[e-1].equals(t[0])&&t.pop()}function VL(t,e){for(let n=0;nNumber.EPSILON){const pe=Math.sqrt(re),be=Math.sqrt($*$+z*z),Ge=j.x-De/pe,Fe=j.y+Ee/pe,Ne=ye.x-z/be,ze=ye.y+$/be,Le=((Ne-Ge)*z-(ze-Fe)*$)/(Ee*z-De*$);xe=Ge+Ee*Le-se.x,Re=Fe+De*Le-se.y;const Xe=xe*xe+Re*Re;if(Xe<=2)return new Ie(xe,Re);Pe=Math.sqrt(Xe/2)}else{let pe=!1;Ee>Number.EPSILON?$>Number.EPSILON&&(pe=!0):Ee<-Number.EPSILON?$<-Number.EPSILON&&(pe=!0):Math.sign(De)===Math.sign(z)&&(pe=!0),pe?(xe=-De,Re=Ee,Pe=Math.sqrt(re)):(xe=Ee,Re=De,Pe=Math.sqrt(re/2))}return new Ie(xe/Pe,Re/Pe)}const Y=[];for(let se=0,j=B.length,ye=j-1,xe=se+1;se=0;se--){const j=se/y,ye=m*Math.cos(j*Math.PI/2),xe=v*Math.sin(j*Math.PI/2)+x;for(let Re=0,Pe=B.length;Re=0;){const xe=ye;let Re=ye-1;Re<0&&(Re=se.length-1);for(let Pe=0,Ee=u+y*2;Pe0)&&m.push(_,S,N),(g!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class vB extends Ir{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ot(16777215),this.specular=new ot(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ot(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=jl,this.normalScale=new Ie(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.combine=cg,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class yB extends Ir{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ot(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ot(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=jl,this.normalScale=new Ie(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 xB extends Ir{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=jl,this.normalScale=new Ie(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 bB extends Ir{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ot(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ot(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=jl,this.normalScale=new Ie(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.combine=cg,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class _B extends Ir{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ot(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=jl,this.normalScale=new Ie(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 wB extends mi{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 kc(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function SB(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function MB(t){function e(i,o){return t[i]-t[o]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function hC(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,s=0;s!==r;++o){const a=n[o]*e;for(let l=0;l!==e;++l)i[s++]=t[a+l]}return i}function mA(t,e,n,r){let i=1,o=t[0];for(;o!==void 0&&o[r]===void 0;)o=t[i++];if(o===void 0)return;let s=o[r];if(s!==void 0)if(Array.isArray(s))do s=o[r],s!==void 0&&(e.push(o.time),n.push.apply(n,s)),o=t[i++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[r],s!==void 0&&(e.push(o.time),s.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do s=o[r],s!==void 0&&(e.push(o.time),n.push(s)),o=t[i++];while(o!==void 0)}function Iue(t,e,n,r,i=30){const o=t.clone();o.name=e;const s=[];for(let l=0;l=r)){f.push(c.times[m]);for(let x=0;xo.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l=a.times[v]){const g=v*f+u,b=g+f-u;x=a.values.slice(g,b)}else{const g=a.createInterpolant(),b=u,_=f-u;g.evaluate(o),x=g.resultBuffer.slice(b,_)}l==="quaternion"&&new ki().fromArray(x).normalize().conjugate().toArray(x);const y=c.times.length;for(let g=0;g=o)){const a=n[1];e=o)break t}s=r,r=0;break n}break e}for(;r>>1;en;)--s;if(++s,o!==0||s!==i){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=r.slice(o,s),this.values=this.values.slice(o*a,s*a)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let a=0;a!==o;a++){const l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,s),e=!1;break}s=l}if(i!==void 0&&SB(i))for(let a=0,l=i.length;a!==l;++a){const c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Dy,o=e.length-1;let s=1;for(let a=1;a0){e[s]=e[o];for(let a=o*r,l=s*r,c=0;c!==r;++c)n[l+c]=n[a+c];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=n.slice(0,s*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}fs.prototype.TimeBufferType=Float32Array;fs.prototype.ValueBufferType=Float32Array;fs.prototype.DefaultInterpolation=fx;class _u extends fs{constructor(e,n,r){super(e,n,r)}}_u.prototype.ValueTypeName="bool";_u.prototype.ValueBufferType=Array;_u.prototype.DefaultInterpolation=wm;_u.prototype.InterpolantFactoryMethodLinear=void 0;_u.prototype.InterpolantFactoryMethodSmooth=void 0;class vA extends fs{}vA.prototype.ValueTypeName="color";class km extends fs{}km.prototype.ValueTypeName="number";class TB extends _g{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(r-n)/(i-n);let c=e*a;for(let u=c+a;c!==u;c+=4)ki.slerpFlat(o,0,s,c-a,s,c,l);return o}}class wg extends fs{InterpolantFactoryMethodLinear(e){return new TB(this.times,this.values,this.getValueSize(),e)}}wg.prototype.ValueTypeName="quaternion";wg.prototype.InterpolantFactoryMethodSmooth=void 0;class wu extends fs{constructor(e,n,r){super(e,n,r)}}wu.prototype.ValueTypeName="string";wu.prototype.ValueBufferType=Array;wu.prototype.DefaultInterpolation=wm;wu.prototype.InterpolantFactoryMethodLinear=void 0;wu.prototype.InterpolantFactoryMethodSmooth=void 0;class Om extends fs{}Om.prototype.ValueTypeName="vector";class Dm{constructor(e="",n=-1,r=[],i=i_){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=eo(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let s=0,a=r.length;s!==a;++s)n.push(Due(r[s]).scale(i));const o=new this(e.name,e.duration,n,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,s=r.length;o!==s;++o)n.push(fs.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,s=[];for(let a=0;a1){const f=u[1];let h=i[f];h||(i[f]=h=[]),h.push(c)}}const s=[];for(const a in i)s.push(this.CreateFromMorphTargetSequence(a,i[a],n,r));return s}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(f,h,m,v,x){if(m.length!==0){const y=[],g=[];mA(m,y,g,v),y.length!==0&&x.push(new f(h,y,g))}},i=[],o=e.name||"default",s=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{n&&n(o),this.manager.itemEnd(e)},0),o;if(la[e]!==void 0){la[e].push({onLoad:n,onProgress:r,onError:i});return}la[e]=[],la[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=la[e],f=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),m=h?parseInt(h):0,v=m!==0;let x=0;const y=new ReadableStream({start(g){b();function b(){f.read().then(({done:_,value:S})=>{if(_)g.close();else{x+=S.byteLength;const P=new ProgressEvent("progress",{lengthComputable:v,loaded:x,total:m});for(let N=0,T=u.length;N{g.error(_)})}}});return new Response(y)}else throw new Fue(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),h=f&&f[1]?f[1].toLowerCase():void 0,m=new TextDecoder(h);return c.arrayBuffer().then(v=>m.decode(v))}}}).then(c=>{ya.add(e,c);const u=la[e];delete la[e];for(let f=0,h=u.length;f{const u=la[e];if(u===void 0)throw this.manager.itemError(e),c;delete la[e];for(let f=0,h=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class zue extends zi{constructor(e){super(e)}load(e,n,r,i){const o=this,s=new ka(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{n(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},r,i)}parse(e){const n=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const s=e.uniforms[o];switch(i.uniforms[o]={},s.type){case"t":i.uniforms[o].value=r(s.value);break;case"c":i.uniforms[o].value=new ot().setHex(s.value);break;case"v2":i.uniforms[o].value=new Ie().fromArray(s.value);break;case"v3":i.uniforms[o].value=new G().fromArray(s.value);break;case"v4":i.uniforms[o].value=new Zt().fromArray(s.value);break;case"m3":i.uniforms[o].value=new Ot().fromArray(s.value);break;case"m4":i.uniforms[o].value=new wt().fromArray(s.value);break;default:i.uniforms[o].value=s.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const o in e.extensions)i.extensions[o]=e.extensions[o];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),i.normalScale=new Ie().fromArray(o)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Ie().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return T_.createMaterialFromType(e)}static createMaterialFromType(e){const n={ShadowMaterial:pB,SpriteMaterial:oA,RawShaderMaterial:mB,ShaderMaterial:ss,PointsMaterial:aA,MeshPhysicalMaterial:gB,MeshStandardMaterial:pA,MeshPhongMaterial:vB,MeshToonMaterial:yB,MeshNormalMaterial:xB,MeshLambertMaterial:bB,MeshDepthMaterial:rA,MeshDistanceMaterial:iA,MeshBasicMaterial:Vl,MeshMatcapMaterial:_B,LineDashedMaterial:wB,LineBasicMaterial:mi,Material:Ir};return new n[e]}}class pC{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let r=0,i=e.length;r0){const l=new yA(n);o=new Fm(l),o.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new Fm(this.manager),i.setCrossOrigin(this.crossOrigin);for(let s=0,a=e.length;s{const y=new Pr;y.min.fromArray(x.boxMin),y.max.fromArray(x.boxMax);const g=new qr;return g.radius=x.sphereRadius,g.center.fromArray(x.sphereCenter),{boxInitialized:x.boxInitialized,box:y,sphereInitialized:x.sphereInitialized,sphere:g}}),s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._geometryCount=e.geometryCount,s._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(s._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":s=new JU;break;case"Line":s=new La(a(e.geometry),l(e.material));break;case"LineLoop":s=new nB(a(e.geometry),l(e.material));break;case"LineSegments":s=new qs(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":s=new rB(a(e.geometry),l(e.material));break;case"Sprite":s=new ZU(l(e.material));break;case"Group":s=new Wf;break;case"Bone":s=new sA;break;default:s=new tn}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.up!==void 0&&s.up.fromArray(e.up),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(s.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const h=e.children;for(let m=0;m"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,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=ya.get(e);if(s!==void 0){if(o.manager.itemStart(e),s.then){s.then(c=>{n&&n(c),o.manager.itemEnd(e)}).catch(c=>{i&&i(c)});return}return setTimeout(function(){n&&n(s),o.manager.itemEnd(e)},0),s}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(c){return ya.add(e,c),n&&n(c),o.manager.itemEnd(e),c}).catch(function(c){i&&i(c),ya.remove(e),o.manager.itemError(e),o.manager.itemEnd(e)});ya.add(e,l),o.manager.itemStart(e)}}let Hv;class bA{static getContext(){return Hv===void 0&&(Hv=new(window.AudioContext||window.webkitAudioContext)),Hv}static setContext(e){Hv=e}}class Yue extends zi{constructor(e){super(e)}load(e,n,r,i){const o=this,s=new ka(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(l){try{const c=l.slice(0);bA.getContext().decodeAudioData(c,function(f){n(f)}).catch(a)}catch(c){a(c)}},r,i);function a(l){i?i(l):console.error(l),o.manager.itemError(e)}}}const KL=new wt,ZL=new wt,uc=new wt;class Kue{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new vr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new vr,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 n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,uc.copy(e.projectionMatrix);const i=n.eyeSep/2,o=i*n.near/n.focus,s=n.near*Math.tan($c*n.fov*.5)/n.zoom;let a,l;ZL.elements[12]=-i,KL.elements[12]=i,a=-s*n.aspect+o,l=s*n.aspect+o,uc.elements[0]=2*n.near/(l-a),uc.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(uc),a=-s*n.aspect-o,l=s*n.aspect-o,uc.elements[0]=2*n.near/(l-a),uc.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(uc)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(ZL),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(KL)}}class _A{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=JL(),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 n=JL();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function JL(){return performance.now()}const fc=new G,QL=new ki,Zue=new G,dc=new G;class Jue extends tn{constructor(){super(),this.type="AudioListener",this.context=bA.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new _A}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 n=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(fc,QL,Zue),dc.set(0,0,-1).applyQuaternion(QL),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(fc.x,i),n.positionY.linearRampToValueAtTime(fc.y,i),n.positionZ.linearRampToValueAtTime(fc.z,i),n.forwardX.linearRampToValueAtTime(dc.x,i),n.forwardY.linearRampToValueAtTime(dc.y,i),n.forwardZ.linearRampToValueAtTime(dc.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(fc.x,fc.y,fc.z),n.setOrientation(dc.x,dc.y,dc.z,r.x,r.y,r.z)}}class UB extends tn{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 n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*n,1,n);for(let l=n,c=n+n;l!==c;++l)if(r[l]!==r[l+n]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,n=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(n,i);for(let o=r,s=i;o!==s;++o)n[o]=n[i+o%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,n=e+this.valueSize;for(let r=e;r=.5)for(let s=0;s!==o;++s)e[n+s]=e[r+s]}_slerp(e,n,r,i){ki.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,o){const s=this._workIndex*o;ki.multiplyQuaternionsFlat(e,s,e,n,e,r),ki.slerpFlat(e,n,e,n,e,s,i)}_lerp(e,n,r,i,o){const s=1-i;for(let a=0;a!==o;++a){const l=n+a;e[l]=e[l]*s+e[r+a]*i}}_lerpAdditive(e,n,r,i,o){for(let s=0;s!==o;++s){const a=n+s;e[a]=e[a]+e[r+s]*i}}}const wA="\\[\\]\\.:\\/",nfe=new RegExp("["+wA+"]","g"),SA="[^"+wA+"]",rfe="[^"+wA.replace("\\.","")+"]",ife=/((?:WC+[\/:])*)/.source.replace("WC",SA),ofe=/(WCOD+)?/.source.replace("WCOD",rfe),sfe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",SA),afe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",SA),lfe=new RegExp("^"+ife+ofe+sfe+afe+"$"),cfe=["material","materials","bones","map"];class ufe{constructor(e,n,r){const i=r||Qt.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class Qt{constructor(e,n,r){this.path=n,this.parsedPath=r||Qt.parseTrackName(n),this.node=Qt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new Qt.Composite(e,n,r):new Qt(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(nfe,"")}static parseTrackName(e){const n=lfe.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=r.nodeName.substring(i+1);cfe.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(o){for(let s=0;s=o){const f=o++,h=e[f];n[h.uuid]=u,e[u]=h,n[c]=f,e[f]=l;for(let m=0,v=i;m!==v;++m){const x=r[m],y=x[f],g=x[u];x[u]=y,x[f]=g}}}this.nCachedObjects_=o}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let o=this.nCachedObjects_,s=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,f=n[u];if(f!==void 0)if(delete n[u],f0&&(n[m.uuid]=f),e[f]=m,e.pop();for(let v=0,x=i;v!==x;++v){const y=r[v];y[f]=y[h],y.pop()}}}this.nCachedObjects_=o}subscribe_(e,n){const r=this._bindingsIndicesByPath;let i=r[e];const o=this._bindings;if(i!==void 0)return o[i];const s=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);i=o.length,r[e]=i,s.push(e),a.push(n),o.push(f);for(let h=u,m=l.length;h!==m;++h){const v=l[h];f[h]=new Qt(v,e,n)}return f}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,o=this._parsedPaths,s=this._bindings,a=s.length-1,l=s[a],c=e[a];n[c]=r,s[r]=l,s.pop(),o[r]=o[a],o.pop(),i[r]=i[a],i.pop()}}}class jB{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const o=n.tracks,s=o.length,a=new Array(s),l={endingStart:Nc,endingEnd:Nc};for(let c=0;c!==s;++c){const u=o[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=bU,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,n){return this.loop=e,this.repetitions=n,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,n,r){if(e.fadeOut(n),this.fadeIn(n),r){const i=this._clip.duration,o=e._clip.duration,s=o/i,a=i/o;e.warp(1,s,n),this.warp(a,1,n)}return this}crossFadeTo(e,n,r){return e.crossFadeFrom(this,n,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,n,r){const i=this._mixer,o=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=o,l[1]=o+r,c[0]=e/s,c[1]=n/s,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,n,r,i){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const l=(e-o)*r;l<0||r===0?n=0:(this._startTime=null,n=r*l)}n*=this._updateTimeScale(e);const s=this._updateTime(n),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case YR:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(s),c[u].accumulateAdditive(a);break;case i_:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(s),c[u].accumulate(i,a)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,r=this.loop;let i=this.time+e,o=this._loopCount;const s=r===_U;if(e===0)return o===-1?i:s&&(o&1)===1?n-i:i;if(r===xU){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=n)i=n;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),i>=n||i<0){const a=Math.floor(i/n);i-=n*a,o+=Math.abs(a);const l=this.repetitions-o;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?n:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(s&&(o&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=Ic,i.endingEnd=Ic):(e?i.endingStart=this.zeroSlopeAtStart?Ic:Nc:i.endingStart=Sm,n?i.endingEnd=this.zeroSlopeAtEnd?Ic:Nc:i.endingEnd=Sm)}_scheduleFading(e,n,r){const i=this._mixer,o=i.time;let s=this._weightInterpolant;s===null&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=o,l[0]=n,a[1]=o+e,l[1]=r,this}}const dfe=new Float32Array(1);class hfe extends Xs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const r=e._localRoot||this._root,i=e._clip.tracks,o=i.length,s=e._propertyBindings,a=e._interpolants,l=r.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==o;++f){const h=i[f],m=h.name;let v=u[m];if(v!==void 0)++v.referenceCount,s[f]=v;else{if(v=s[f],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,m));continue}const x=n&&n._propertyBindings[f].binding.parsedPath;v=new BB(Qt.create(r,m,x),h.ValueTypeName,h.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,m),s[f]=v}a[f].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,o=this._actionsByClip[i];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,i,r)}const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const o=n[r];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const o=n[r];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const n=e._cacheIndex;return n!==null&&n=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const n=this._actions,r=this._nActiveActions,i=this.time+=e,o=Math.sign(e),s=this._accuIndex^=1;for(let c=0;c!==r;++c)n[c]._update(i,e,o,s);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(s);return this}setTime(e){this.time=0;for(let n=0;n=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,n){return n.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,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,rk).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 ik=new G,Gv=new G;class _fe{constructor(e=new G,n=new G){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),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,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){ik.subVectors(e,this.start),Gv.subVectors(this.end,this.start);const r=Gv.dot(Gv);let o=Gv.dot(ik)/r;return n&&(o=$n(o,0,1)),o}closestPointToPoint(e,n,r){const i=this.closestPointToPointParameter(e,n);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const ok=new G;class wfe extends tn{constructor(e,n){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new zt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,l=32;s1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{uk.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(uk,n)}}setLength(e,n=e*.2,r=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(r,n,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Ofe extends qs{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new zt;i.setAttribute("position",new pt(n,3)),i.setAttribute("color",new pt(r,3));const o=new mi({vertexColors:!0,toneMapped:!1});super(i,o),this.type="AxesHelper"}setColors(e,n,r){const i=new ot,o=this.geometry.attributes.color.array;return i.set(e),i.toArray(o,0),i.toArray(o,3),i.set(n),i.toArray(o,6),i.toArray(o,9),i.set(r),i.toArray(o,12),i.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Dfe{constructor(){this.type="ShapePath",this.color=new ot,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new Pm,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,r,i){return this.currentPath.quadraticCurveTo(e,n,r,i),this}bezierCurveTo(e,n,r,i,o,s){return this.currentPath.bezierCurveTo(e,n,r,i,o,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(g){const b=[];for(let _=0,S=g.length;_Number.EPSILON){if(M<0&&(T=b[N],U=-U,L=b[P],M=-M),g.yL.y)continue;if(g.y===T.y){if(g.x===T.x)return!0}else{const R=M*(g.x-T.x)-U*(g.y-T.y);if(R===0)return!0;if(R<0)continue;S=!S}}else{if(g.y!==T.y)continue;if(L.x<=g.x&&g.x<=T.x||T.x<=g.x&&g.x<=L.x)return!0}}return S}const i=Ds.isClockWise,o=this.subPaths;if(o.length===0)return[];let s,a,l;const c=[];if(o.length===1)return a=o[0],l=new Hc,l.curves=a.curves,c.push(l),c;let u=!i(o[0].getPoints());u=e?!u:u;const f=[],h=[];let m=[],v=0,x;h[v]=void 0,m[v]=[];for(let g=0,b=o.length;g1){let g=!1,b=0;for(let _=0,S=h.length;_0&&g===!1&&(m=f)}let y;for(let g=0,b=h.length;g{const f=typeof c=="function"?c(e):c;if(f!==e){const h=e;e=u?f:Object.assign({},e,f),n.forEach(m=>m(e,h))}},i=()=>e,o=(c,u=i,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let h=u(e);function m(){const v=u(e);if(!f(h,v)){const x=h;c(h=v,x)}}return n.add(m),()=>n.delete(m)},l={setState:r,getState:i,subscribe:(c,u,f)=>u||f?o(c,u,f):(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return e=t(r,i,l),l}const jfe=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),fk=jfe?A.useEffect:A.useLayoutEffect;function Vfe(t){const e=typeof t=="function"?Bfe(t):t,n=(r=e.getState,i=Object.is)=>{const[,o]=A.useReducer(y=>y+1,0),s=e.getState(),a=A.useRef(s),l=A.useRef(r),c=A.useRef(i),u=A.useRef(!1),f=A.useRef();f.current===void 0&&(f.current=r(s));let h,m=!1;(a.current!==s||l.current!==r||c.current!==i||u.current)&&(h=r(s),m=!i(f.current,h)),fk(()=>{m&&(f.current=h),a.current=s,l.current=r,c.current=i,u.current=!1});const v=A.useRef(s);fk(()=>{const y=()=>{try{const b=e.getState(),_=l.current(b);c.current(f.current,_)||(a.current=b,f.current=_,o())}catch{u.current=!0,o()}},g=e.subscribe(y);return e.getState()!==v.current&&y(),g},[]);const x=m?h:f.current;return A.useDebugValue(x),x};return Object.assign(n,e),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[n,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},n}var HB={exports:{}},GB={exports:{}},XB={};/** + * @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(t){function e(F,Y){var K=F.length;F.push(Y);e:for(;0>>1,me=F[ee];if(0>>1;eei(ae,K))gei(Me,ae)?(F[ee]=Me,F[ge]=K,ee=ge):(F[ee]=ae,F[Q]=K,ee=Q);else if(gei(Me,K))F[ee]=Me,F[ge]=K,ee=ge;else break e}}return Y}function i(F,Y){var K=F.sortIndex-Y.sortIndex;return K!==0?K:F.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,h=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(F){for(var Y=n(c);Y!==null;){if(Y.callback===null)r(c);else if(Y.startTime<=F)r(c),Y.sortIndex=Y.expirationTime,e(l,Y);else break;Y=n(c)}}function S(F){if(x=!1,_(F),!v)if(n(l)!==null)v=!0,H(P);else{var Y=n(c);Y!==null&&Z(S,Y.startTime-F)}}function P(F,Y){v=!1,x&&(x=!1,g(L),L=-1),m=!0;var K=h;try{for(_(Y),f=n(l);f!==null&&(!(f.expirationTime>Y)||F&&!R());){var ee=f.callback;if(typeof ee=="function"){f.callback=null,h=f.priorityLevel;var me=ee(f.expirationTime<=Y);Y=t.unstable_now(),typeof me=="function"?f.callback=me:f===n(l)&&r(l),_(Y)}else r(l);f=n(l)}if(f!==null)var le=!0;else{var Q=n(c);Q!==null&&Z(S,Q.startTime-Y),le=!1}return le}finally{f=null,h=K,m=!1}}var N=!1,T=null,L=-1,U=5,M=-1;function R(){return!(t.unstable_now()-MF||125ee?(F.sortIndex=K,e(c,F),n(l)===null&&F===n(c)&&(x?(g(L),L=-1):x=!0,Z(S,K-ee))):(F.sortIndex=me,e(l,F),v||m||(v=!0,H(P))),F},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(F){var Y=h;return function(){var K=h;h=Y;try{return F.apply(this,arguments)}finally{h=K}}}})(XB);GB.exports=XB;var gC=GB.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 $fe=function(e){var n={},r=A,i=gC,o=Object.assign;function s(d){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+d,w=1;wte||I[q]!==k[te]){var Se=` +`+I[q].replace(" at new "," at ");return d.displayName&&Se.includes("")&&(Se=Se.replace("",d.displayName)),Se}while(1<=q&&0<=te);break}}}finally{St=!1,Error.prepareStackTrace=w}return(d=d?d.displayName||d.name:"")?ct(d):""}var mt=Object.prototype.hasOwnProperty,Jt=[],nn=-1;function ln(d){return{current:d}}function $t(d){0>nn||(d.current=Jt[nn],Jt[nn]=null,nn--)}function vt(d,p){nn++,Jt[nn]=d.current,d.current=p}var ft={},Kt=ln(ft),Pt=ln(!1),rr=ft;function Ui(d,p){var w=d.type.contextTypes;if(!w)return ft;var E=d.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===p)return E.__reactInternalMemoizedMaskedChildContext;var I={},k;for(k in w)I[k]=p[k];return E&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=p,d.__reactInternalMemoizedMaskedChildContext=I),I}function gn(d){return d=d.childContextTypes,d!=null}function Ua(){$t(Pt),$t(Kt)}function Mn(d,p,w){if(Kt.current!==ft)throw Error(s(168));vt(Kt,p),vt(Pt,w)}function Uo(d,p,w){var E=d.stateNode;if(p=p.childContextTypes,typeof E.getChildContext!="function")return w;E=E.getChildContext();for(var I in E)if(!(I in p))throw Error(s(108,L(d)||"Unknown",I));return o({},w,E)}function Ba(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||ft,rr=Kt.current,vt(Kt,d),vt(Pt,Pt.current),!0}function Kr(d,p,w){var E=d.stateNode;if(!E)throw Error(s(169));w?(d=Uo(d,p,rr),E.__reactInternalMemoizedMergedChildContext=d,$t(Pt),$t(Kt),vt(Kt,d)):$t(Pt),vt(Pt,w)}var Zr=Math.clz32?Math.clz32:M7,iw=Math.log,Bg=Math.LN2;function M7(d){return d>>>=0,d===0?32:31-(iw(d)/Bg|0)|0}var jg=64,Vg=4194304;function ah(d){switch(d&-d){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 d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function $g(d,p){var w=d.pendingLanes;if(w===0)return 0;var E=0,I=d.suspendedLanes,k=d.pingedLanes,q=w&268435455;if(q!==0){var te=q&~I;te!==0?E=ah(te):(k&=q,k!==0&&(E=ah(k)))}else q=w&~I,q!==0?E=ah(q):k!==0&&(E=ah(k));if(E===0)return 0;if(p!==0&&p!==E&&!(p&I)&&(I=E&-E,k=p&-p,I>=k||I===16&&(k&4194240)!==0))return p;if(E&4&&(E|=w&16),p=d.entangledLanes,p!==0)for(d=d.entanglements,p&=E;0w;w++)p.push(d);return p}function lh(d,p,w){d.pendingLanes|=p,p!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,p=31-Zr(p),d[p]=w}function T7(d,p){var w=d.pendingLanes&~p;d.pendingLanes=p,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=p,d.mutableReadLanes&=p,d.entangledLanes&=p,p=d.entanglements;var E=d.eventTimes;for(d=d.expirationTimes;0>=q,I-=q,Qs=1<<32-Zr(p)+I|w<on?(hr=It,It=null):hr=It.sibling;var sn=_t(ce,It,ve[on],nt);if(sn===null){It===null&&(It=hr);break}d&&It&&sn.alternate===null&&p(ce,It),ie=k(sn,ie,on),jt===null?gt=sn:jt.sibling=sn,jt=sn,It=hr}if(on===ve.length)return w(ce,It),En&&ql(ce,on),gt;if(It===null){for(;onon?(hr=It,It=null):hr=It.sibling;var qa=_t(ce,It,sn.value,nt);if(qa===null){It===null&&(It=hr);break}d&&It&&qa.alternate===null&&p(ce,It),ie=k(qa,ie,on),jt===null?gt=qa:jt.sibling=qa,jt=qa,It=hr}if(sn.done)return w(ce,It),En&&ql(ce,on),gt;if(It===null){for(;!sn.done;on++,sn=ve.next())sn=Nt(ce,sn.value,nt),sn!==null&&(ie=k(sn,ie,on),jt===null?gt=sn:jt.sibling=sn,jt=sn);return En&&ql(ce,on),gt}for(It=E(ce,It);!sn.done;on++,sn=ve.next())sn=vn(It,ce,on,sn.value,nt),sn!==null&&(d&&sn.alternate!==null&&It.delete(sn.key===null?on:sn.key),ie=k(sn,ie,on),jt===null?gt=sn:jt.sibling=sn,jt=sn);return d&&It.forEach(function(dj){return p(ce,dj)}),En&&ql(ce,on),gt}function yo(ce,ie,ve,nt){if(typeof ve=="object"&&ve!==null&&ve.type===u&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case l:e:{for(var gt=ve.key,jt=ie;jt!==null;){if(jt.key===gt){if(gt=ve.type,gt===u){if(jt.tag===7){w(ce,jt.sibling),ie=I(jt,ve.props.children),ie.return=ce,ce=ie;break e}}else if(jt.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===_&&OP(gt)===jt.type){w(ce,jt.sibling),ie=I(jt,ve.props),ie.ref=fh(ce,jt,ve),ie.return=ce,ce=ie;break e}w(ce,jt);break}else p(ce,jt);jt=jt.sibling}ve.type===u?(ie=tc(ve.props.children,ce.mode,nt,ve.key),ie.return=ce,ce=ie):(nt=N0(ve.type,ve.key,ve.props,null,ce.mode,nt),nt.ref=fh(ce,ie,ve),nt.return=ce,ce=nt)}return q(ce);case c:e:{for(jt=ve.key;ie!==null;){if(ie.key===jt)if(ie.tag===4&&ie.stateNode.containerInfo===ve.containerInfo&&ie.stateNode.implementation===ve.implementation){w(ce,ie.sibling),ie=I(ie,ve.children||[]),ie.return=ce,ce=ie;break e}else{w(ce,ie);break}else p(ce,ie);ie=ie.sibling}ie=aS(ve,ce.mode,nt),ie.return=ce,ce=ie}return q(ce);case _:return jt=ve._init,yo(ce,ie,jt(ve._payload),nt)}if(X(ve))return yt(ce,ie,ve,nt);if(N(ve))return zr(ce,ie,ve,nt);e0(ce,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,ie!==null&&ie.tag===6?(w(ce,ie.sibling),ie=I(ie,ve),ie.return=ce,ce=ie):(w(ce,ie),ie=sS(ve,ce.mode,nt),ie.return=ce,ce=ie),q(ce)):w(ce,ie)}return yo}var Du=DP(!0),FP=DP(!1),dh={},po=ln(dh),hh=ln(dh),Fu=ln(dh);function ys(d){if(d===dh)throw Error(s(174));return d}function Mw(d,p){vt(Fu,p),vt(hh,d),vt(po,dh),d=Z(p),$t(po),vt(po,d)}function zu(){$t(po),$t(hh),$t(Fu)}function zP(d){var p=ys(Fu.current),w=ys(po.current);p=F(w,d.type,p),w!==p&&(vt(hh,d),vt(po,p))}function Ew(d){hh.current===d&&($t(po),$t(hh))}var Pn=ln(0);function t0(d){for(var p=d;p!==null;){if(p.tag===13){var w=p.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||Ru(w)||Au(w)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if(p.flags&128)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var Cw=[];function Tw(){for(var d=0;dw?w:4,d(!0);var E=mo.transition;mo.transition={};try{d(!1),p()}finally{rn=w,mo.transition=E}}function JP(){return xs().memoizedState}function U7(d,p,w){var E=Ha(d);w={lane:E,action:w,hasEagerState:!1,eagerState:null,next:null},QP(d)?e3(p,w):(t3(d,p,w),w=Qr(),d=go(d,E,w),d!==null&&n3(d,p,E))}function B7(d,p,w){var E=Ha(d),I={lane:E,action:w,hasEagerState:!1,eagerState:null,next:null};if(QP(d))e3(p,I);else{t3(d,p,I);var k=d.alternate;if(d.lanes===0&&(k===null||k.lanes===0)&&(k=p.lastRenderedReducer,k!==null))try{var q=p.lastRenderedState,te=k(q,w);if(I.hasEagerState=!0,I.eagerState=te,ms(te,q))return}catch{}finally{}w=Qr(),d=go(d,E,w),d!==null&&n3(d,p,E)}}function QP(d){var p=d.alternate;return d===zn||p!==null&&p===zn}function e3(d,p){ph=r0=!0;var w=d.pending;w===null?p.next=p:(p.next=w.next,w.next=p),d.pending=p}function t3(d,p,w){Kn!==null&&d.mode&1&&!(Wt&2)?(d=p.interleaved,d===null?(w.next=w,vs===null?vs=[p]:vs.push(p)):(w.next=d.next,d.next=w),p.interleaved=w):(d=p.pending,d===null?w.next=w:(w.next=d.next,d.next=w),p.pending=w)}function n3(d,p,w){if(w&4194240){var E=p.lanes;E&=d.pendingLanes,w|=E,p.lanes=w,aw(d,w)}}var l0={readContext:uo,useCallback:Dr,useContext:Dr,useEffect:Dr,useImperativeHandle:Dr,useInsertionEffect:Dr,useLayoutEffect:Dr,useMemo:Dr,useReducer:Dr,useRef:Dr,useState:Dr,useDebugValue:Dr,useDeferredValue:Dr,useTransition:Dr,useMutableSource:Dr,useSyncExternalStore:Dr,useId:Dr,unstable_isNewReconciler:!1},j7={readContext:uo,useCallback:function(d,p){return ta().memoizedState=[d,p===void 0?null:p],d},useContext:uo,useEffect:Iw,useImperativeHandle:function(d,p,w){return w=w!=null?w.concat([d]):null,s0(4194308,4,qP.bind(null,p,d),w)},useLayoutEffect:function(d,p){return s0(4194308,4,d,p)},useInsertionEffect:function(d,p){return s0(4,2,d,p)},useMemo:function(d,p){var w=ta();return p=p===void 0?null:p,d=d(),w.memoizedState=[d,p],d},useReducer:function(d,p,w){var E=ta();return p=w!==void 0?w(p):p,E.memoizedState=E.baseState=p,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:p},E.queue=d,d=d.dispatch=U7.bind(null,zn,d),[E.memoizedState,d]},useRef:function(d){var p=ta();return d={current:d},p.memoizedState=d},useState:Nw,useDebugValue:Lw,useDeferredValue:function(d){var p=Nw(d),w=p[0],E=p[1];return Iw(function(){var I=mo.transition;mo.transition={};try{E(d)}finally{mo.transition=I}},[d]),w},useTransition:function(){var d=Nw(!1),p=d[0];return d=z7.bind(null,d[1]),ta().memoizedState=d,[p,d]},useMutableSource:function(){},useSyncExternalStore:function(d,p,w){var E=zn,I=ta();if(En){if(w===void 0)throw Error(s(407));w=w()}else{if(w=p(),Kn===null)throw Error(s(349));Uu&30||jP(E,p,w)}I.memoizedState=w;var k={value:w,getSnapshot:p};return I.queue=k,Iw($P.bind(null,E,k,d),[d]),E.flags|=2048,gh(9,VP.bind(null,E,k,w,p),void 0,null),w},useId:function(){var d=ta(),p=Kn.identifierPrefix;if(En){var w=ea,E=Qs;w=(E&~(1<<32-Zr(E)-1)).toString(32)+w,p=":"+p+"R"+w,w=mh++,0Jw&&(p.flags|=128,E=!0,bh(I,!1),p.lanes=4194304)}else{if(!E)if(d=t0(k),d!==null){if(p.flags|=128,E=!0,d=d.updateQueue,d!==null&&(p.updateQueue=d,p.flags|=4),bh(I,!0),I.tail===null&&I.tailMode==="hidden"&&!k.alternate&&!En)return Fr(p),null}else 2*fr()-I.renderingStartTime>Jw&&w!==1073741824&&(p.flags|=128,E=!0,bh(I,!1),p.lanes=4194304);I.isBackwards?(k.sibling=p.child,p.child=k):(d=I.last,d!==null?d.sibling=k:p.child=k,I.last=k)}return I.tail!==null?(p=I.tail,I.rendering=p,I.tail=p.sibling,I.renderingStartTime=fr(),p.sibling=null,d=Pn.current,vt(Pn,E?d&1|2:d&1),p):(Fr(p),null);case 22:case 23:return rS(),E=p.memoizedState!==null,d!==null&&d.memoizedState!==null!==E&&(p.flags|=8192),E&&p.mode&1?$i&1073741824&&(Fr(p),Ve&&p.subtreeFlags&6&&(p.flags|=8192)):Fr(p),null;case 24:return null;case 25:return null}throw Error(s(156,p.tag))}var G7=a.ReactCurrentOwner,Vi=!1;function Jr(d,p,w,E){p.child=d===null?FP(p,null,w,E):Du(p,d.child,w,E)}function u3(d,p,w,E,I){w=w.render;var k=p.ref;return Iu(p,I),E=Aw(d,p,w,E,k,I),w=Pw(),d!==null&&!Vi?(p.updateQueue=d.updateQueue,p.flags&=-2053,d.lanes&=~I,na(d,p,I)):(En&&w&&xw(p),p.flags|=1,Jr(d,p,E,I),p.child)}function f3(d,p,w,E,I){if(d===null){var k=w.type;return typeof k=="function"&&!oS(k)&&k.defaultProps===void 0&&w.compare===null&&w.defaultProps===void 0?(p.tag=15,p.type=k,d3(d,p,k,E,I)):(d=N0(w.type,null,E,p,p.mode,I),d.ref=p.ref,d.return=p,p.child=d)}if(k=d.child,!(d.lanes&I)){var q=k.memoizedProps;if(w=w.compare,w=w!==null?w:Gg,w(q,E)&&d.ref===p.ref)return na(d,p,I)}return p.flags|=1,d=Xa(k,E),d.ref=p.ref,d.return=p,p.child=d}function d3(d,p,w,E,I){if(d!==null&&Gg(d.memoizedProps,E)&&d.ref===p.ref)if(Vi=!1,(d.lanes&I)!==0)d.flags&131072&&(Vi=!0);else return p.lanes=d.lanes,na(d,p,I);return Dw(d,p,w,E,I)}function h3(d,p,w){var E=p.pendingProps,I=E.children,k=d!==null?d.memoizedState:null;if(E.mode==="hidden")if(!(p.mode&1))p.memoizedState={baseLanes:0,cachePool:null},vt(Bu,$i),$i|=w;else if(w&1073741824)p.memoizedState={baseLanes:0,cachePool:null},E=k!==null?k.baseLanes:w,vt(Bu,$i),$i|=E;else return d=k!==null?k.baseLanes|w:w,p.lanes=p.childLanes=1073741824,p.memoizedState={baseLanes:d,cachePool:null},p.updateQueue=null,vt(Bu,$i),$i|=d,null;else k!==null?(E=k.baseLanes|w,p.memoizedState=null):E=w,vt(Bu,$i),$i|=E;return Jr(d,p,I,w),p.child}function p3(d,p){var w=p.ref;(d===null&&w!==null||d!==null&&d.ref!==w)&&(p.flags|=512,p.flags|=2097152)}function Dw(d,p,w,E,I){var k=gn(w)?rr:Kt.current;return k=Ui(p,k),Iu(p,I),w=Aw(d,p,w,E,k,I),E=Pw(),d!==null&&!Vi?(p.updateQueue=d.updateQueue,p.flags&=-2053,d.lanes&=~I,na(d,p,I)):(En&&E&&xw(p),p.flags|=1,Jr(d,p,w,I),p.child)}function m3(d,p,w,E,I){if(gn(w)){var k=!0;Ba(p)}else k=!1;if(Iu(p,I),p.stateNode===null)d!==null&&(d.alternate=null,p.alternate=null,p.flags|=2),AP(p,w,E),yw(p,w,E,I),E=!0;else if(d===null){var q=p.stateNode,te=p.memoizedProps;q.props=te;var Se=q.context,$e=w.contextType;typeof $e=="object"&&$e!==null?$e=uo($e):($e=gn(w)?rr:Kt.current,$e=Ui(p,$e));var ut=w.getDerivedStateFromProps,Nt=typeof ut=="function"||typeof q.getSnapshotBeforeUpdate=="function";Nt||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(te!==E||Se!==$e)&&PP(p,q,E,$e),ja=!1;var _t=p.memoizedState;q.state=_t,Kg(p,E,q,I),Se=p.memoizedState,te!==E||_t!==Se||Pt.current||ja?(typeof ut=="function"&&(vw(p,w,ut,E),Se=p.memoizedState),(te=ja||RP(p,w,te,E,_t,Se,$e))?(Nt||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount()),typeof q.componentDidMount=="function"&&(p.flags|=4194308)):(typeof q.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=E,p.memoizedState=Se),q.props=E,q.state=Se,q.context=$e,E=te):(typeof q.componentDidMount=="function"&&(p.flags|=4194308),E=!1)}else{q=p.stateNode,MP(d,p),te=p.memoizedProps,$e=p.type===p.elementType?te:Bo(p.type,te),q.props=$e,Nt=p.pendingProps,_t=q.context,Se=w.contextType,typeof Se=="object"&&Se!==null?Se=uo(Se):(Se=gn(w)?rr:Kt.current,Se=Ui(p,Se));var vn=w.getDerivedStateFromProps;(ut=typeof vn=="function"||typeof q.getSnapshotBeforeUpdate=="function")||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(te!==Nt||_t!==Se)&&PP(p,q,E,Se),ja=!1,_t=p.memoizedState,q.state=_t,Kg(p,E,q,I);var yt=p.memoizedState;te!==Nt||_t!==yt||Pt.current||ja?(typeof vn=="function"&&(vw(p,w,vn,E),yt=p.memoizedState),($e=ja||RP(p,w,$e,E,_t,yt,Se)||!1)?(ut||typeof q.UNSAFE_componentWillUpdate!="function"&&typeof q.componentWillUpdate!="function"||(typeof q.componentWillUpdate=="function"&&q.componentWillUpdate(E,yt,Se),typeof q.UNSAFE_componentWillUpdate=="function"&&q.UNSAFE_componentWillUpdate(E,yt,Se)),typeof q.componentDidUpdate=="function"&&(p.flags|=4),typeof q.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof q.componentDidUpdate!="function"||te===d.memoizedProps&&_t===d.memoizedState||(p.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||te===d.memoizedProps&&_t===d.memoizedState||(p.flags|=1024),p.memoizedProps=E,p.memoizedState=yt),q.props=E,q.state=yt,q.context=Se,E=$e):(typeof q.componentDidUpdate!="function"||te===d.memoizedProps&&_t===d.memoizedState||(p.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||te===d.memoizedProps&&_t===d.memoizedState||(p.flags|=1024),E=!1)}return Fw(d,p,w,E,k,I)}function Fw(d,p,w,E,I,k){p3(d,p);var q=(p.flags&128)!==0;if(!E&&!q)return I&&Kr(p,w,!1),na(d,p,k);E=p.stateNode,G7.current=p;var te=q&&typeof w.getDerivedStateFromError!="function"?null:E.render();return p.flags|=1,d!==null&&q?(p.child=Du(p,d.child,null,k),p.child=Du(p,null,te,k)):Jr(d,p,te,k),p.memoizedState=E.state,I&&Kr(p,w,!0),p.child}function g3(d){var p=d.stateNode;p.pendingContext?Mn(d,p.pendingContext,p.pendingContext!==p.context):p.context&&Mn(d,p.context,!1),Mw(d,p.containerInfo)}function v3(d,p,w,E,I){return Ou(),Sw(I),p.flags|=256,Jr(d,p,w,E),p.child}var f0={dehydrated:null,treeContext:null,retryLane:0};function d0(d){return{baseLanes:d,cachePool:null}}function y3(d,p,w){var E=p.pendingProps,I=Pn.current,k=!1,q=(p.flags&128)!==0,te;if((te=q)||(te=d!==null&&d.memoizedState===null?!1:(I&2)!==0),te?(k=!0,p.flags&=-129):(d===null||d.memoizedState!==null)&&(I|=1),vt(Pn,I&1),d===null)return ww(p),d=p.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?(p.mode&1?Au(d)?p.lanes=8:p.lanes=1073741824:p.lanes=1,null):(I=E.children,d=E.fallback,k?(E=p.mode,k=p.child,I={mode:"hidden",children:I},!(E&1)&&k!==null?(k.childLanes=0,k.pendingProps=I):k=I0(I,E,0,null),d=tc(d,E,w,null),k.return=p,d.return=p,k.sibling=d,p.child=k,p.child.memoizedState=d0(w),p.memoizedState=f0,d):zw(p,I));if(I=d.memoizedState,I!==null){if(te=I.dehydrated,te!==null){if(q)return p.flags&256?(p.flags&=-257,h0(d,p,w,Error(s(422)))):p.memoizedState!==null?(p.child=d.child,p.flags|=128,null):(k=E.fallback,I=p.mode,E=I0({mode:"visible",children:E.children},I,0,null),k=tc(k,I,w,null),k.flags|=2,E.return=p,k.return=p,E.sibling=k,p.child=E,p.mode&1&&Du(p,d.child,null,w),p.child.memoizedState=d0(w),p.memoizedState=f0,k);if(!(p.mode&1))p=h0(d,p,w,null);else if(Au(te))p=h0(d,p,w,Error(s(419)));else if(E=(w&d.childLanes)!==0,Vi||E){if(E=Kn,E!==null){switch(w&-w){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}E=k&(E.suspendedLanes|w)?0:k,E!==0&&E!==I.retryLane&&(I.retryLane=E,go(d,E,-1))}iS(),p=h0(d,p,w,Error(s(421)))}else Ru(te)?(p.flags|=128,p.child=d.child,p=oj.bind(null,d),Dg(te,p),p=null):(w=I.treeContext,j&&(ji=zg(te),Bi=p,En=!0,jo=null,ch=!1,w!==null&&(fo[ho++]=Qs,fo[ho++]=ea,fo[ho++]=Xl,Qs=w.id,ea=w.overflow,Xl=p)),p=zw(p,p.pendingProps.children),p.flags|=4096);return p}return k?(E=b3(d,p,E.children,E.fallback,w),k=p.child,I=d.child.memoizedState,k.memoizedState=I===null?d0(w):{baseLanes:I.baseLanes|w,cachePool:null},k.childLanes=d.childLanes&~w,p.memoizedState=f0,E):(w=x3(d,p,E.children,w),p.memoizedState=null,w)}return k?(E=b3(d,p,E.children,E.fallback,w),k=p.child,I=d.child.memoizedState,k.memoizedState=I===null?d0(w):{baseLanes:I.baseLanes|w,cachePool:null},k.childLanes=d.childLanes&~w,p.memoizedState=f0,E):(w=x3(d,p,E.children,w),p.memoizedState=null,w)}function zw(d,p){return p=I0({mode:"visible",children:p},d.mode,0,null),p.return=d,d.child=p}function x3(d,p,w,E){var I=d.child;return d=I.sibling,w=Xa(I,{mode:"visible",children:w}),!(p.mode&1)&&(w.lanes=E),w.return=p,w.sibling=null,d!==null&&(E=p.deletions,E===null?(p.deletions=[d],p.flags|=16):E.push(d)),p.child=w}function b3(d,p,w,E,I){var k=p.mode;d=d.child;var q=d.sibling,te={mode:"hidden",children:w};return!(k&1)&&p.child!==d?(w=p.child,w.childLanes=0,w.pendingProps=te,p.deletions=null):(w=Xa(d,te),w.subtreeFlags=d.subtreeFlags&14680064),q!==null?E=Xa(q,E):(E=tc(E,k,I,null),E.flags|=2),E.return=p,w.return=p,w.sibling=E,p.child=w,E}function h0(d,p,w,E){return E!==null&&Sw(E),Du(p,d.child,null,w),d=zw(p,p.pendingProps.children),d.flags|=2,p.memoizedState=null,d}function _3(d,p,w){d.lanes|=p;var E=d.alternate;E!==null&&(E.lanes|=p),mw(d.return,p,w)}function Uw(d,p,w,E,I){var k=d.memoizedState;k===null?d.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:E,tail:w,tailMode:I}:(k.isBackwards=p,k.rendering=null,k.renderingStartTime=0,k.last=E,k.tail=w,k.tailMode=I)}function w3(d,p,w){var E=p.pendingProps,I=E.revealOrder,k=E.tail;if(Jr(d,p,E.children,w),E=Pn.current,E&2)E=E&1|2,p.flags|=128;else{if(d!==null&&d.flags&128)e:for(d=p.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&_3(d,w,p);else if(d.tag===19)_3(d,w,p);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===p)break e;for(;d.sibling===null;){if(d.return===null||d.return===p)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}E&=1}if(vt(Pn,E),!(p.mode&1))p.memoizedState=null;else switch(I){case"forwards":for(w=p.child,I=null;w!==null;)d=w.alternate,d!==null&&t0(d)===null&&(I=w),w=w.sibling;w=I,w===null?(I=p.child,p.child=null):(I=w.sibling,w.sibling=null),Uw(p,!1,I,w,k);break;case"backwards":for(w=null,I=p.child,p.child=null;I!==null;){if(d=I.alternate,d!==null&&t0(d)===null){p.child=I;break}d=I.sibling,I.sibling=w,w=I,I=d}Uw(p,!0,w,null,k);break;case"together":Uw(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function na(d,p,w){if(d!==null&&(p.dependencies=d.dependencies),ju|=p.lanes,!(w&p.childLanes))return null;if(d!==null&&p.child!==d.child)throw Error(s(153));if(p.child!==null){for(d=p.child,w=Xa(d,d.pendingProps),p.child=w,w.return=p;d.sibling!==null;)d=d.sibling,w=w.sibling=Xa(d,d.pendingProps),w.return=p;w.sibling=null}return p.child}function X7(d,p,w){switch(p.tag){case 3:g3(p),Ou();break;case 5:zP(p);break;case 1:gn(p.type)&&Ba(p);break;case 4:Mw(p,p.stateNode.containerInfo);break;case 10:SP(p,p.type._context,p.memoizedProps.value);break;case 13:var E=p.memoizedState;if(E!==null)return E.dehydrated!==null?(vt(Pn,Pn.current&1),p.flags|=128,null):w&p.child.childLanes?y3(d,p,w):(vt(Pn,Pn.current&1),d=na(d,p,w),d!==null?d.sibling:null);vt(Pn,Pn.current&1);break;case 19:if(E=(w&p.childLanes)!==0,d.flags&128){if(E)return w3(d,p,w);p.flags|=128}var I=p.memoizedState;if(I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),vt(Pn,Pn.current),E)break;return null;case 22:case 23:return p.lanes=0,h3(d,p,w)}return na(d,p,w)}function q7(d,p){switch(bw(p),p.tag){case 1:return gn(p.type)&&Ua(),d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 3:return zu(),$t(Pt),$t(Kt),Tw(),d=p.flags,d&65536&&!(d&128)?(p.flags=d&-65537|128,p):null;case 5:return Ew(p),null;case 13:if($t(Pn),d=p.memoizedState,d!==null&&d.dehydrated!==null){if(p.alternate===null)throw Error(s(340));Ou()}return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 19:return $t(Pn),null;case 4:return zu(),null;case 10:return pw(p.type._context),null;case 22:case 23:return rS(),null;case 24:return null;default:return null}}var p0=!1,Kl=!1,Y7=typeof WeakSet=="function"?WeakSet:Set,et=null;function m0(d,p){var w=d.ref;if(w!==null)if(typeof w=="function")try{w(null)}catch(E){yi(d,p,E)}else w.current=null}function Bw(d,p,w){try{w()}catch(E){yi(d,p,E)}}var S3=!1;function K7(d,p){for(Y(d.containerInfo),et=p;et!==null;)if(d=et,p=d.child,(d.subtreeFlags&1028)!==0&&p!==null)p.return=d,et=p;else for(;et!==null;){d=et;try{var w=d.alternate;if(d.flags&1024)switch(d.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var E=w.memoizedProps,I=w.memoizedState,k=d.stateNode,q=k.getSnapshotBeforeUpdate(d.elementType===d.type?E:Bo(d.type,E),I);k.__reactInternalSnapshotBeforeUpdate=q}break;case 3:Ve&&Ke(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(te){yi(d,d.return,te)}if(p=d.sibling,p!==null){p.return=d.return,et=p;break}et=d.return}return w=S3,S3=!1,w}function Zl(d,p,w){var E=p.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var I=E=E.next;do{if((I.tag&d)===d){var k=I.destroy;I.destroy=void 0,k!==void 0&&Bw(p,w,k)}I=I.next}while(I!==E)}}function _h(d,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var w=p=p.next;do{if((w.tag&d)===d){var E=w.create;w.destroy=E()}w=w.next}while(w!==p)}}function jw(d){var p=d.ref;if(p!==null){var w=d.stateNode;switch(d.tag){case 5:d=H(w);break;default:d=w}typeof p=="function"?p(d):p.current=d}}function M3(d,p,w){if(ps&&typeof ps.onCommitFiberUnmount=="function")try{ps.onCommitFiberUnmount(Wg,p)}catch{}switch(p.tag){case 0:case 11:case 14:case 15:if(d=p.updateQueue,d!==null&&(d=d.lastEffect,d!==null)){var E=d=d.next;do{var I=E,k=I.destroy;I=I.tag,k!==void 0&&(I&2||I&4)&&Bw(p,w,k),E=E.next}while(E!==d)}break;case 1:if(m0(p,w),d=p.stateNode,typeof d.componentWillUnmount=="function")try{d.props=p.memoizedProps,d.state=p.memoizedState,d.componentWillUnmount()}catch(q){yi(p,w,q)}break;case 5:m0(p,w);break;case 4:Ve?P3(d,p,w):se&&se&&(p=p.stateNode.containerInfo,w=Bt(p),Yt(p,w))}}function E3(d,p,w){for(var E=p;;)if(M3(d,E,w),E.child===null||Ve&&E.tag===4){if(E===p)break;for(;E.sibling===null;){if(E.return===null||E.return===p)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else E.child.return=E,E=E.child}function C3(d){var p=d.alternate;p!==null&&(d.alternate=null,C3(p)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(p=d.stateNode,p!==null&&Pe(p)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function T3(d){return d.tag===5||d.tag===3||d.tag===4}function R3(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||T3(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function A3(d){if(Ve){e:{for(var p=d.return;p!==null;){if(T3(p))break e;p=p.return}throw Error(s(160))}var w=p;switch(w.tag){case 5:p=w.stateNode,w.flags&32&&(dt(p),w.flags&=-33),w=R3(d),$w(d,w,p);break;case 3:case 4:p=w.stateNode.containerInfo,w=R3(d),Vw(d,w,p);break;default:throw Error(s(161))}}}function Vw(d,p,w){var E=d.tag;if(E===5||E===6)d=d.stateNode,p?Ue(w,d,p):ze(w,d);else if(E!==4&&(d=d.child,d!==null))for(Vw(d,p,w),d=d.sibling;d!==null;)Vw(d,p,w),d=d.sibling}function $w(d,p,w){var E=d.tag;if(E===5||E===6)d=d.stateNode,p?Oe(w,d,p):Ne(w,d);else if(E!==4&&(d=d.child,d!==null))for($w(d,p,w),d=d.sibling;d!==null;)$w(d,p,w),d=d.sibling}function P3(d,p,w){for(var E=p,I=!1,k,q;;){if(!I){I=E.return;e:for(;;){if(I===null)throw Error(s(160));switch(k=I.stateNode,I.tag){case 5:q=!1;break e;case 3:k=k.containerInfo,q=!0;break e;case 4:k=k.containerInfo,q=!0;break e}I=I.return}I=!0}if(E.tag===5||E.tag===6)E3(d,E,w),q?ke(k,E.stateNode):Ae(k,E.stateNode);else if(E.tag===18)q?de(k,E.stateNode):ue(k,E.stateNode);else if(E.tag===4){if(E.child!==null){k=E.stateNode.containerInfo,q=!0,E.child.return=E,E=E.child;continue}}else if(M3(d,E,w),E.child!==null){E.child.return=E,E=E.child;continue}if(E===p)break;for(;E.sibling===null;){if(E.return===null||E.return===p)return;E=E.return,E.tag===4&&(I=!1)}E.sibling.return=E.return,E=E.sibling}}function Ww(d,p){if(Ve){switch(p.tag){case 0:case 11:case 14:case 15:Zl(3,p,p.return),_h(3,p),Zl(5,p,p.return);return;case 1:return;case 5:var w=p.stateNode;if(w!=null){var E=p.memoizedProps;d=d!==null?d.memoizedProps:E;var I=p.type,k=p.updateQueue;p.updateQueue=null,k!==null&&xt(w,k,I,d,E,p)}return;case 6:if(p.stateNode===null)throw Error(s(162));w=p.memoizedProps,Le(p.stateNode,d!==null?d.memoizedProps:w,w);return;case 3:j&&d!==null&&d.memoizedState.isDehydrated&&V(p.stateNode.containerInfo);return;case 12:return;case 13:g0(p);return;case 19:g0(p);return;case 17:return}throw Error(s(163))}switch(p.tag){case 0:case 11:case 14:case 15:Zl(3,p,p.return),_h(3,p),Zl(5,p,p.return);return;case 12:return;case 13:g0(p);return;case 19:g0(p);return;case 3:j&&d!==null&&d.memoizedState.isDehydrated&&V(p.stateNode.containerInfo);break;case 22:case 23:return}e:if(se){switch(p.tag){case 1:case 5:case 6:break e;case 3:case 4:p=p.stateNode,Yt(p.containerInfo,p.pendingChildren);break e}throw Error(s(163))}}function g0(d){var p=d.updateQueue;if(p!==null){d.updateQueue=null;var w=d.stateNode;w===null&&(w=d.stateNode=new Y7),p.forEach(function(E){var I=sj.bind(null,d,E);w.has(E)||(w.add(E),E.then(I,I))})}}function Z7(d,p){for(et=p;et!==null;){p=et;var w=p.deletions;if(w!==null)for(var E=0;E";case y0:return":has("+(Xw(d)||"")+")";case x0:return'[role="'+d.value+'"]';case _0:return'"'+d.value+'"';case b0:return'[data-testname="'+d.value+'"]';default:throw Error(s(365))}}function O3(d,p){var w=[];d=[d,0];for(var E=0;EI&&(I=q),E&=~k}if(E=I,E=fr()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*Q7(E/1960))-E,10d?16:d,Wa===null)var E=!1;else{if(d=Wa,Wa=null,C0=0,Wt&6)throw Error(s(331));var I=Wt;for(Wt|=4,et=d.current;et!==null;){var k=et,q=k.child;if(et.flags&16){var te=k.deletions;if(te!==null){for(var Se=0;Sefr()-Zw?Jl(d,0):Kw|=w),vi(d,p)}function W3(d,p){p===0&&(d.mode&1?(p=Vg,Vg<<=1,!(Vg&130023424)&&(Vg=4194304)):p=1);var w=Qr();d=A0(d,p),d!==null&&(lh(d,p,w),vi(d,w))}function oj(d){var p=d.memoizedState,w=0;p!==null&&(w=p.retryLane),W3(d,w)}function sj(d,p){var w=0;switch(d.tag){case 13:var E=d.stateNode,I=d.memoizedState;I!==null&&(w=I.retryLane);break;case 19:E=d.stateNode;break;default:throw Error(s(314))}E!==null&&E.delete(p),W3(d,w)}var H3;H3=function(d,p,w){if(d!==null)if(d.memoizedProps!==p.pendingProps||Pt.current)Vi=!0;else{if(!(d.lanes&w)&&!(p.flags&128))return Vi=!1,X7(d,p,w);Vi=!!(d.flags&131072)}else Vi=!1,En&&p.flags&1048576&&NP(p,Qg,p.index);switch(p.lanes=0,p.tag){case 2:var E=p.type;d!==null&&(d.alternate=null,p.alternate=null,p.flags|=2),d=p.pendingProps;var I=Ui(p,Kt.current);Iu(p,w),I=Aw(null,p,E,d,I,w);var k=Pw();return p.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,gn(E)?(k=!0,Ba(p)):k=!1,p.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,gw(p),I.updater=Zg,p.stateNode=I,I._reactInternals=p,yw(p,E,d,w),p=Fw(null,p,E,!0,k,w)):(p.tag=0,En&&k&&xw(p),Jr(null,p,I,w),p=p.child),p;case 16:E=p.elementType;e:{switch(d!==null&&(d.alternate=null,p.alternate=null,p.flags|=2),d=p.pendingProps,I=E._init,E=I(E._payload),p.type=E,I=p.tag=lj(E),d=Bo(E,d),I){case 0:p=Dw(null,p,E,d,w);break e;case 1:p=m3(null,p,E,d,w);break e;case 11:p=u3(null,p,E,d,w);break e;case 14:p=f3(null,p,E,Bo(E.type,d),w);break e}throw Error(s(306,E,""))}return p;case 0:return E=p.type,I=p.pendingProps,I=p.elementType===E?I:Bo(E,I),Dw(d,p,E,I,w);case 1:return E=p.type,I=p.pendingProps,I=p.elementType===E?I:Bo(E,I),m3(d,p,E,I,w);case 3:e:{if(g3(p),d===null)throw Error(s(387));E=p.pendingProps,k=p.memoizedState,I=k.element,MP(d,p),Kg(p,E,null,w);var q=p.memoizedState;if(E=q.element,j&&k.isDehydrated)if(k={element:E,isDehydrated:!1,cache:q.cache,transitions:q.transitions},p.updateQueue.baseState=k,p.memoizedState=k,p.flags&256){I=Error(s(423)),p=v3(d,p,E,w,I);break e}else if(E!==I){I=Error(s(424)),p=v3(d,p,E,w,I);break e}else for(j&&(ji=Pu(p.stateNode.containerInfo),Bi=p,En=!0,jo=null,ch=!1),w=FP(p,null,E,w),p.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling;else{if(Ou(),E===I){p=na(d,p,w);break e}Jr(d,p,E,w)}p=p.child}return p;case 5:return zP(p),d===null&&ww(p),E=p.type,I=p.pendingProps,k=d!==null?d.memoizedProps:null,q=I.children,ae(E,I)?q=null:k!==null&&ae(E,k)&&(p.flags|=32),p3(d,p),Jr(d,p,q,w),p.child;case 6:return d===null&&ww(p),null;case 13:return y3(d,p,w);case 4:return Mw(p,p.stateNode.containerInfo),E=p.pendingProps,d===null?p.child=Du(p,null,E,w):Jr(d,p,E,w),p.child;case 11:return E=p.type,I=p.pendingProps,I=p.elementType===E?I:Bo(E,I),u3(d,p,E,I,w);case 7:return Jr(d,p,p.pendingProps,w),p.child;case 8:return Jr(d,p,p.pendingProps.children,w),p.child;case 12:return Jr(d,p,p.pendingProps.children,w),p.child;case 10:e:{if(E=p.type._context,I=p.pendingProps,k=p.memoizedProps,q=I.value,SP(p,E,q),k!==null)if(ms(k.value,q)){if(k.children===I.children&&!Pt.current){p=na(d,p,w);break e}}else for(k=p.child,k!==null&&(k.return=p);k!==null;){var te=k.dependencies;if(te!==null){q=k.child;for(var Se=te.firstContext;Se!==null;){if(Se.context===E){if(k.tag===1){Se=Js(-1,w&-w),Se.tag=2;var $e=k.updateQueue;if($e!==null){$e=$e.shared;var ut=$e.pending;ut===null?Se.next=Se:(Se.next=ut.next,ut.next=Se),$e.pending=Se}}k.lanes|=w,Se=k.alternate,Se!==null&&(Se.lanes|=w),mw(k.return,w,p),te.lanes|=w;break}Se=Se.next}}else if(k.tag===10)q=k.type===p.type?null:k.child;else if(k.tag===18){if(q=k.return,q===null)throw Error(s(341));q.lanes|=w,te=q.alternate,te!==null&&(te.lanes|=w),mw(q,w,p),q=k.sibling}else q=k.child;if(q!==null)q.return=k;else for(q=k;q!==null;){if(q===p){q=null;break}if(k=q.sibling,k!==null){k.return=q.return,q=k;break}q=q.return}k=q}Jr(d,p,I.children,w),p=p.child}return p;case 9:return I=p.type,E=p.pendingProps.children,Iu(p,w),I=uo(I),E=E(I),p.flags|=1,Jr(d,p,E,w),p.child;case 14:return E=p.type,I=Bo(E,p.pendingProps),I=Bo(E.type,I),f3(d,p,E,I,w);case 15:return d3(d,p,p.type,p.pendingProps,w);case 17:return E=p.type,I=p.pendingProps,I=p.elementType===E?I:Bo(E,I),d!==null&&(d.alternate=null,p.alternate=null,p.flags|=2),p.tag=1,gn(E)?(d=!0,Ba(p)):d=!1,Iu(p,w),AP(p,E,I),yw(p,E,I,w),Fw(null,p,E,!0,d,w);case 19:return w3(d,p,w);case 22:return h3(d,p,w)}throw Error(s(156,p.tag))};function G3(d,p){return lw(d,p)}function aj(d,p,w,E){this.tag=d,this.key=w,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vo(d,p,w,E){return new aj(d,p,w,E)}function oS(d){return d=d.prototype,!(!d||!d.isReactComponent)}function lj(d){if(typeof d=="function")return oS(d)?1:0;if(d!=null){if(d=d.$$typeof,d===x)return 11;if(d===b)return 14}return 2}function Xa(d,p){var w=d.alternate;return w===null?(w=vo(d.tag,p,d.key,d.mode),w.elementType=d.elementType,w.type=d.type,w.stateNode=d.stateNode,w.alternate=d,d.alternate=w):(w.pendingProps=p,w.type=d.type,w.flags=0,w.subtreeFlags=0,w.deletions=null),w.flags=d.flags&14680064,w.childLanes=d.childLanes,w.lanes=d.lanes,w.child=d.child,w.memoizedProps=d.memoizedProps,w.memoizedState=d.memoizedState,w.updateQueue=d.updateQueue,p=d.dependencies,w.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},w.sibling=d.sibling,w.index=d.index,w.ref=d.ref,w}function N0(d,p,w,E,I,k){var q=2;if(E=d,typeof d=="function")oS(d)&&(q=1);else if(typeof d=="string")q=5;else e:switch(d){case u:return tc(w.children,I,k,p);case f:q=8,I|=8;break;case h:return d=vo(12,w,p,I|2),d.elementType=h,d.lanes=k,d;case y:return d=vo(13,w,p,I),d.elementType=y,d.lanes=k,d;case g:return d=vo(19,w,p,I),d.elementType=g,d.lanes=k,d;case S:return I0(w,I,k,p);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case m:q=10;break e;case v:q=9;break e;case x:q=11;break e;case b:q=14;break e;case _:q=16,E=null;break e}throw Error(s(130,d==null?d:typeof d,""))}return p=vo(q,w,p,I),p.elementType=d,p.type=E,p.lanes=k,p}function tc(d,p,w,E){return d=vo(7,d,E,p),d.lanes=w,d}function I0(d,p,w,E){return d=vo(22,d,E,p),d.elementType=S,d.lanes=w,d.stateNode={},d}function sS(d,p,w){return d=vo(6,d,null,p),d.lanes=w,d}function aS(d,p,w){return p=vo(4,d.children!==null?d.children:[],d.key,p),p.lanes=w,p.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},p}function cj(d,p,w,E,I){this.tag=p,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=He,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sw(0),this.expirationTimes=sw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sw(0),this.identifierPrefix=E,this.onRecoverableError=I,j&&(this.mutableSourceEagerHydrationData=null)}function X3(d,p,w,E,I,k,q,te,Se){return d=new cj(d,p,w,te,Se),p===1?(p=1,k===!0&&(p|=8)):p=0,k=vo(3,null,null,p),d.current=k,k.stateNode=d,k.memoizedState={element:E,isDehydrated:w,cache:null,transitions:null},gw(k),d}function q3(d){if(!d)return ft;d=d._reactInternals;e:{if(U(d)!==d||d.tag!==1)throw Error(s(170));var p=d;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(gn(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(s(171))}if(d.tag===1){var w=d.type;if(gn(w))return Uo(d,w,p)}return p}function Y3(d){var p=d._reactInternals;if(p===void 0)throw typeof d.render=="function"?Error(s(188)):(d=Object.keys(d).join(","),Error(s(268,d)));return d=D(p),d===null?null:d.stateNode}function K3(d,p){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var w=d.retryLane;d.retryLane=w!==0&&w=$e&&k>=Nt&&I<=ut&&q<=_t){d.splice(p,1);break}else if(E!==$e||w.width!==Se.width||_tq){if(!(k!==Nt||w.height!==Se.height||utI)){$e>E&&(Se.width+=$e-E,Se.x=E),utk&&(Se.height+=Nt-k,Se.y=k),_tw&&(w=q)),q ")+` + +No matching component was found for: + `)+d.join(" > ")}return null},n.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return H(d.child.stateNode);default:return d.child.stateNode}},n.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:uj,findFiberByHostInstance:d.findFiberByHostInstance||fj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)d=!0;else{try{Wg=p.inject(d),ps=p}catch{}d=!!p.checkDCE}}return d},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(d,p,w,E){if(!$)throw Error(s(363));d=qw(d,p);var I=Fe(d,w,E).disconnect;return{disconnect:function(){I()}}},n.registerMutableSourceForHydration=function(d,p){var w=p._getVersion;w=w(p._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[p,w]:d.mutableSourceEagerHydrationData.push(p,w)},n.runWithPriority=function(d,p){var w=rn;try{return rn=d,p()}finally{rn=w}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(d,p,w,E){var I=p.current,k=Qr(),q=Ha(I);return w=q3(w),p.context===null?p.context=w:p.pendingContext=w,p=Js(k,q),p.payload={element:d},E=E===void 0?null:E,E!==null&&(p.callback=E),Va(I,p),d=go(I,q,k),d!==null&&Yg(d,I,q),q},n};HB.exports=$fe;var Wfe=HB.exports;const Hfe=$s(Wfe),CA={},qB=t=>void Object.assign(CA,t);function Gfe(t,e){function n(u,{args:f=[],attach:h,...m},v){let x=`${u[0].toUpperCase()}${u.slice(1)}`,y;if(u==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;y=Ef(g,{type:u,root:v,attach:h,primitive:!0})}else{const g=CA[x];if(!g)throw new Error(`R3F: ${x} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(f))throw new Error("R3F: The args prop must be an array!");y=Ef(new g(...f),{type:u,root:v,attach:h,memoizedProps:{args:f}})}return y.__r3f.attach===void 0&&(y instanceof zt?y.__r3f.attach="geometry":y instanceof Ir&&(y.__r3f.attach="material")),x!=="inject"&&QM(y,m),y}function r(u,f){let h=!1;if(f){var m,v;(m=f.__r3f)!=null&&m.attach?JM(u,f,f.__r3f.attach):f.isObject3D&&u.isObject3D&&(u.add(f),h=!0),h||(v=u.__r3f)==null||v.objects.push(f),f.__r3f||Ef(f,{}),f.__r3f.parent=u,yC(f),Cf(f)}}function i(u,f,h){let m=!1;if(f){var v,x;if((v=f.__r3f)!=null&&v.attach)JM(u,f,f.__r3f.attach);else if(f.isObject3D&&u.isObject3D){f.parent=u,f.dispatchEvent({type:"added"}),u.dispatchEvent({type:"childadded",child:f});const y=u.children.filter(b=>b!==f),g=y.indexOf(h);u.children=[...y.slice(0,g),f,...y.slice(g)],m=!0}m||(x=u.__r3f)==null||x.objects.push(f),f.__r3f||Ef(f,{}),f.__r3f.parent=u,yC(f),Cf(f)}}function o(u,f,h=!1){u&&[...u].forEach(m=>s(f,m,h))}function s(u,f,h){if(f){var m,v,x;if(f.__r3f&&(f.__r3f.parent=null),(m=u.__r3f)!=null&&m.objects&&(u.__r3f.objects=u.__r3f.objects.filter(S=>S!==f)),(v=f.__r3f)!=null&&v.attach)gk(u,f,f.__r3f.attach);else if(f.isObject3D&&u.isObject3D){var y;u.remove(f),(y=f.__r3f)!=null&&y.root&&ede(Uy(f),f)}const b=(x=f.__r3f)==null?void 0:x.primitive,_=!b&&(h===void 0?f.dispose!==null:h);if(!b){var g;o((g=f.__r3f)==null?void 0:g.objects,f,_),o(f.children,f,_)}if(delete f.__r3f,_&&f.dispose&&f.type!=="Scene"){const S=()=>{try{f.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?gC.unstable_scheduleCallback(gC.unstable_IdlePriority,S):S()}Cf(u)}}function a(u,f,h,m){var v;const x=(v=u.__r3f)==null?void 0:v.parent;if(!x)return;const y=n(f,h,u.__r3f.root);if(u.children){for(const g of u.children)g.__r3f&&r(y,g);u.children=u.children.filter(g=>!g.__r3f)}u.__r3f.objects.forEach(g=>r(y,g)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||s(x,u),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),r(x,y),y.raycast&&y.__r3f.eventCount&&Uy(y).getState().internal.interaction.push(y),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=y,g.ref&&(typeof g.ref=="function"?g.ref(y):g.ref.current=y))})}const l=()=>{};return{reconciler:Hfe({createInstance:n,removeChild:s,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,f)=>{if(!f)return;const h=u.getState().scene;h.__r3f&&(h.__r3f.root=u,r(h,f))},removeChildFromContainer:(u,f)=>{f&&s(u.getState().scene,f)},insertInContainerBefore:(u,f,h)=>{if(!f||!h)return;const m=u.getState().scene;m.__r3f&&i(m,f,h)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var f;return!!((f=u==null?void 0:u.__r3f)!=null?f:{}).handlers},prepareUpdate(u,f,h,m){var v;if(((v=u==null?void 0:u.__r3f)!=null?v:{}).primitive&&m.object&&m.object!==u)return[!0];{const{args:y=[],children:g,...b}=m,{args:_=[],children:S,...P}=h;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((T,L)=>T!==_[L]))return[!0];const N=t8(u,b,P,!0);return N.changes.length?[!1,N]:null}},commitUpdate(u,[f,h],m,v,x,y){f?a(u,m,x,y):QM(u,h)},commitMount(u,f,h,m){var v;const x=(v=u.__r3f)!=null?v:{};u.raycast&&x.handlers&&x.eventCount&&Uy(u).getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>Ef(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var f;const{attach:h,parent:m}=(f=u.__r3f)!=null?f:{};h&&m&&gk(m,u,h),u.isObject3D&&(u.visible=!1),Cf(u)},unhideInstance(u,f){var h;const{attach:m,parent:v}=(h=u.__r3f)!=null?h:{};m&&v&&JM(v,u,m),(u.isObject3D&&f.visible==null||f.visible)&&(u.visible=!0),Cf(u)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Gf.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&wn.fun(performance.now)?performance.now:wn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:wn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:wn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:QM}}var dk,hk;const ZM=t=>"colorSpace"in t||"outputColorSpace"in t,YB=()=>{var t;return(t=CA.ColorManagement)!=null?t:null},KB=t=>t&&t.isOrthographicCamera,Xfe=t=>t&&t.hasOwnProperty("current"),Sg=typeof window<"u"&&((dk=window.document)!=null&&dk.createElement||((hk=window.navigator)==null?void 0:hk.product)==="ReactNative")?A.useLayoutEffect:A.useEffect;function ZB(t){const e=A.useRef(t);return Sg(()=>void(e.current=t),[t]),e}function qfe({set:t}){return Sg(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class JB extends A.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}JB.getDerivedStateFromError=()=>({error:!0});const QB="__default",pk=new Map,Yfe=t=>t&&!!t.memoized&&!!t.changes;function e8(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}const np=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()};function Uy(t){let e=t.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const wn={obj:t=>t===Object(t)&&!wn.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:r="reference",strict:i=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(wn.str(t)||wn.num(t)||wn.boo(t))return t===e;const o=wn.obj(t);if(o&&r==="reference")return t===e;const s=wn.arr(t);if(s&&n==="reference")return t===e;if((s||o)&&t===e)return!0;let a;for(a in t)if(!(a in e))return!1;if(o&&n==="shallow"&&r==="shallow"){for(a in i?e:t)if(!wn.equ(t[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:t)if(t[a]!==e[a])return!1;if(wn.und(a)){if(s&&t.length===0&&e.length===0||o&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function Kfe(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function Ef(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function vC(t,e){let n=t;if(e.includes("-")){const r=e.split("-"),i=r.pop();return n=r.reduce((o,s)=>o[s],t),{target:n,key:i}}else return{target:n,key:e}}const mk=/-\d+$/;function JM(t,e,n){if(wn.str(n)){if(mk.test(n)){const o=n.replace(mk,""),{target:s,key:a}=vC(t,o);Array.isArray(s[a])||(s[a]=[])}const{target:r,key:i}=vC(t,n);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=n(t,e)}function gk(t,e,n){var r,i;if(wn.str(n)){const{target:o,key:s}=vC(t,n),a=e.__r3f.previousAttach;a===void 0?delete o[s]:o[s]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(t,e);(i=e.__r3f)==null||delete i.previousAttach}function t8(t,{children:e,key:n,ref:r,...i},{children:o,key:s,ref:a,...l}={},c=!1){const u=t.__r3f,f=Object.entries(i),h=[];if(c){const v=Object.keys(l);for(let x=0;x{var y;if((y=t.__r3f)!=null&&y.primitive&&v==="object"||wn.equ(x,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return h.push([v,x,!0,[]]);let g=[];v.includes("-")&&(g=v.split("-")),h.push([v,x,!1,g]);for(const b in i){const _=i[b];b.startsWith(`${v}-`)&&h.push([b,_,!1,b.split("-")])}});const m={...i};return u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.args&&(m.args=u.memoizedProps.args),u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.attach&&(m.attach=u.memoizedProps.attach),{memoized:m,changes:h}}const Zfe=typeof process<"u"&&!1;function QM(t,e){var n;const r=t.__r3f,i=r==null?void 0:r.root,o=i==null||i.getState==null?void 0:i.getState(),{memoized:s,changes:a}=Yfe(e)?e:t8(t,e),l=r==null?void 0:r.eventCount;t.__r3f&&(t.__r3f.memoizedProps=s);for(let u=0;ug[b],t),!(y&&y.set))){const[g,...b]=v.reverse();x=b.reverse().reduce((_,S)=>_[S],t),f=g}if(h===QB+"remove")if(x.constructor){let g=pk.get(x.constructor);g||(g=new x.constructor,pk.set(x.constructor,g)),h=g[f]}else h=0;if(m&&r)h?r.handlers[f]=h:delete r.handlers[f],r.eventCount=Object.keys(r.handlers).length;else if(y&&y.set&&(y.copy||y instanceof Wc)){if(Array.isArray(h))y.fromArray?y.fromArray(h):y.set(...h);else if(y.copy&&h&&h.constructor&&(Zfe?y.constructor.name===h.constructor.name:y.constructor===h.constructor))y.copy(h);else if(h!==void 0){const g=y instanceof ot;!g&&y.setScalar?y.setScalar(h):y instanceof Wc&&h instanceof Wc?y.mask=h.mask:y.set(h),!YB()&&o&&!o.linear&&g&&y.convertSRGBToLinear()}}else if(x[f]=h,x[f]instanceof kn&&x[f].format===Rr&&x[f].type===Fi&&o){const g=x[f];ZM(g)&&ZM(o.gl)?g.colorSpace=o.gl.outputColorSpace:g.encoding=o.gl.outputEncoding}Cf(t)}if(r&&r.parent&&t.raycast&&l!==r.eventCount){const u=Uy(t).getState().internal,f=u.interaction.indexOf(t);f>-1&&u.interaction.splice(f,1),r.eventCount&&u.interaction.push(t)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(n=t.__r3f)!=null&&n.parent&&yC(t),t}function Cf(t){var e,n;const r=(e=t.__r3f)==null||(n=e.root)==null||n.getState==null?void 0:n.getState();r&&r.internal.frames===0&&r.invalidate()}function yC(t){t.onUpdate==null||t.onUpdate(t)}function Jfe(t,e){t.manual||(KB(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix(),t.updateMatrixWorld())}function Jv(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function Qfe(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Gf.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Gf.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Gf.ContinuousEventPriority;default:return Gf.DefaultEventPriority}}function n8(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function ede(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(r=>r!==e),n.initialHits=n.initialHits.filter(r=>r!==e),n.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&n.hovered.delete(i)}),n.capturedMap.forEach((r,i)=>{n8(n.capturedMap,e,r,i)})}function tde(t){function e(l){const{internal:c}=t.getState(),u=l.offsetX-c.initialClick[0],f=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+f*f))}function n(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var f;return(f=c.__r3f)==null?void 0:f.handlers["onPointer"+u]}))}function r(l,c){const u=t.getState(),f=new Set,h=[],m=c?c(u.internal.interaction):u.internal.interaction;for(let g=0;g{const _=np(g.object),S=np(b.object);return!_||!S?g.distance-b.distance:S.events.priority-_.events.priority||g.distance-b.distance}).filter(g=>{const b=Jv(g);return f.has(b)?!1:(f.add(b),!0)});u.events.filter&&(x=u.events.filter(x,u));for(const g of x){let b=g.object;for(;b;){var y;(y=b.__r3f)!=null&&y.eventCount&&h.push({...g,eventObject:b}),b=b.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let g of u.internal.capturedMap.get(l.pointerId).values())f.has(Jv(g.intersection))||h.push(g.intersection);return h}function i(l,c,u,f){const h=t.getState();if(l.length){const m={stopped:!1};for(const v of l){const x=np(v.object)||h,{raycaster:y,pointer:g,camera:b,internal:_}=x,S=new G(g.x,g.y,0).unproject(b),P=M=>{var R,D;return(R=(D=_.capturedMap.get(M))==null?void 0:D.has(v.eventObject))!=null?R:!1},N=M=>{const R={intersection:v,target:c.target};_.capturedMap.has(M)?_.capturedMap.get(M).set(v.eventObject,R):_.capturedMap.set(M,new Map([[v.eventObject,R]])),c.target.setPointerCapture(M)},T=M=>{const R=_.capturedMap.get(M);R&&n8(_.capturedMap,v.eventObject,R,M)};let L={};for(let M in c){let R=c[M];typeof R!="function"&&(L[M]=R)}let U={...v,...L,pointer:g,intersections:l,stopped:m.stopped,delta:u,unprojectedPoint:S,ray:y.ray,camera:b,stopPropagation(){const M="pointerId"in c&&_.capturedMap.get(c.pointerId);if((!M||M.has(v.eventObject))&&(U.stopped=m.stopped=!0,_.hovered.size&&Array.from(_.hovered.values()).find(R=>R.eventObject===v.eventObject))){const R=l.slice(0,l.indexOf(v));o([...R,v])}},target:{hasPointerCapture:P,setPointerCapture:N,releasePointerCapture:T},currentTarget:{hasPointerCapture:P,setPointerCapture:N,releasePointerCapture:T},nativeEvent:c};if(f(U),m.stopped===!0)break}}return l}function o(l){const{internal:c}=t.getState();for(const u of c.hovered.values())if(!l.length||!l.find(f=>f.object===u.object&&f.index===u.index&&f.instanceId===u.instanceId)){const h=u.eventObject.__r3f,m=h==null?void 0:h.handlers;if(c.hovered.delete(Jv(u)),h!=null&&h.eventCount){const v={...u,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function s(l,c){for(let u=0;uo([]);case"onLostPointerCapture":return c=>{const{internal:u}=t.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),o([]))})}}return function(u){const{onPointerMissed:f,internal:h}=t.getState();h.lastEvent.current=u;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=r(u,m?n:void 0),g=v?e(u):0;l==="onPointerDown"&&(h.initialClick=[u.offsetX,u.offsetY],h.initialHits=y.map(_=>_.eventObject)),v&&!y.length&&g<=2&&(s(u,h.interaction),f&&f(u)),m&&o(y);function b(_){const S=_.eventObject,P=S.__r3f,N=P==null?void 0:P.handlers;if(P!=null&&P.eventCount)if(m){if(N.onPointerOver||N.onPointerEnter||N.onPointerOut||N.onPointerLeave){const T=Jv(_),L=h.hovered.get(T);L?L.stopped&&_.stopPropagation():(h.hovered.set(T,_),N.onPointerOver==null||N.onPointerOver(_),N.onPointerEnter==null||N.onPointerEnter(_))}N.onPointerMove==null||N.onPointerMove(_)}else{const T=N[l];T?(!v||h.initialHits.includes(S))&&(s(u,h.interaction.filter(L=>!h.initialHits.includes(L))),T(_)):v&&h.initialHits.includes(S)&&s(u,h.interaction.filter(L=>!h.initialHits.includes(L)))}}i(y,u,g,b)}}return{handlePointer:a}}const r8=t=>!!(t!=null&&t.render),i8=A.createContext(null),nde=(t,e)=>{const n=Vfe((a,l)=>{const c=new G,u=new G,f=new G;function h(g=l().camera,b=u,_=l().size){const{width:S,height:P,top:N,left:T}=_,L=S/P;b instanceof G?f.copy(b):f.set(...b);const U=g.getWorldPosition(c).distanceTo(f);if(KB(g))return{width:S/g.zoom,height:P/g.zoom,top:N,left:T,factor:1,distance:U,aspect:L};{const M=g.fov*Math.PI/180,R=2*Math.tan(M/2)*U,D=R*(S/P);return{width:D,height:R,top:N,left:T,factor:S/D,distance:U,aspect:L}}}let m;const v=g=>a(b=>({performance:{...b.performance,current:g}})),x=new Ie;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)=>t(l(),g),advance:(g,b)=>e(g,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new _A,pointer:x,mouse:x,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&&v(g.performance.min),m=setTimeout(()=>v(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:h},setEvents:g=>a(b=>({...b,events:{...b.events,...g}})),setSize:(g,b,_,S,P)=>{const N=l().camera,T={width:g,height:b,top:S||0,left:P||0,updateStyle:_};a(L=>({size:T,viewport:{...L.viewport,...h(N,u,T)}}))},setDpr:g=>a(b=>{const _=e8(g);return{viewport:{...b.viewport,dpr:_,initialDpr:b.viewport.initialDpr||_}}}),setFrameloop:(g="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,g!=="never"&&(b.start(),b.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:A.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,b,_)=>{const S=l().internal;return S.priority=S.priority+(b>0?1:0),S.subscribers.push({ref:g,priority:b,store:_}),S.subscribers=S.subscribers.sort((P,N)=>P.priority-N.priority),()=>{const P=l().internal;P!=null&&P.subscribers&&(P.priority=P.priority-(b>0?1:0),P.subscribers=P.subscribers.filter(N=>N.ref!==g))}}}}}),r=n.getState();let i=r.size,o=r.viewport.dpr,s=r.camera;return n.subscribe(()=>{const{camera:a,size:l,viewport:c,gl:u,set:f}=n.getState();if(l.width!==i.width||l.height!==i.height||c.dpr!==o){var h;i=l,o=c.dpr,Jfe(a,l),u.setPixelRatio(c.dpr);const m=(h=l.updateStyle)!=null?h:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,m)}a!==s&&(s=a,f(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),n.subscribe(a=>t(a)),n};let Qv,rde=new Set,ide=new Set,ode=new Set;function eE(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function rp(t,e){switch(t){case"before":return eE(rde,e);case"after":return eE(ide,e);case"tail":return eE(ode,e)}}let tE,nE;function rE(t,e,n){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof t=="number"&&(r=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),tE=e.internal.subscribers,Qv=0;Qv0)&&!((u=o.gl.xr)!=null&&u.isPresenting)&&(r+=rE(c,o))}if(n=!1,rp("after",c),r===0)return rp("tail",c),e=!1,cancelAnimationFrame(i)}function a(c,u=1){var f;if(!c)return t.forEach(h=>a(h.store.getState(),u));(f=c.gl.xr)!=null&&f.isPresenting||!c.internal.active||c.frameloop==="never"||(u>1?c.internal.frames=Math.min(60,c.internal.frames+u):n?c.internal.frames=2:c.internal.frames=1,e||(e=!0,requestAnimationFrame(s)))}function l(c,u=!0,f,h){if(u&&rp("before",c),f)rE(c,f,h);else for(const m of t.values())rE(c,m.store.getState());u&&rp("after",c)}return{loop:s,invalidate:a,advance:l}}function o8(){const t=A.useContext(i8);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function wr(t=n=>n,e){return o8()(t,e)}function TA(t,e=0){const n=o8(),r=n.getState().internal.subscribe,i=ZB(t);return Sg(()=>r(i,e,n),[e,r,n]),null}const Td=new Map,{invalidate:vk,advance:yk}=sde(Td),{reconciler:gx,applyProps:gf}=Gfe(Td,Qfe),vf={objects:"shallow",strict:!1},ade=(t,e)=>{const n=typeof t=="function"?t(e):t;return r8(n)?n:new YU({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function lde(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:o,left:s,updateStyle:a=n}=e;return{width:r,height:i,top:o,left:s,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:r,height:i,top:o,left:s}=t.parentElement.getBoundingClientRect();return{width:r,height:i,top:o,left:s,updateStyle:n}}else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0,updateStyle:n};return{width:0,height:0,top:0,left:0}}function cde(t){const e=Td.get(t),n=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,o=r||nde(vk,yk),s=n||gx.createContainer(o,Gf.ConcurrentRoot,null,!1,null,"",i,null);e||Td.set(t,{fiber:s,store:o});let a,l=!1,c;return{configure(u={}){let{gl:f,size:h,scene:m,events:v,onCreated:x,shadows:y=!1,linear:g=!1,flat:b=!1,legacy:_=!1,orthographic:S=!1,frameloop:P="always",dpr:N=[1,2],performance:T,raycaster:L,camera:U,onPointerMissed:M}=u,R=o.getState(),D=R.gl;R.gl||R.set({gl:D=ade(f,t)});let O=R.raycaster;O||R.set({raycaster:O=new VB});const{params:B,...X}=L||{};if(wn.equ(X,O,vf)||gf(O,{...X}),wn.equ(B,O.params,vf)||gf(O,{params:{...O.params,...B}}),!R.camera||R.camera===c&&!wn.equ(c,U,vf)){c=U;const K=U instanceof pg,ee=K?U:S?new vg(0,0,0,0,.1,1e3):new vr(75,0,.1,1e3);K||(ee.position.z=5,U&&(gf(ee,U),("aspect"in U||"left"in U||"right"in U||"bottom"in U||"top"in U)&&(ee.manual=!0,ee.updateProjectionMatrix())),!R.camera&&!(U!=null&&U.rotation)&&ee.lookAt(0,0,0)),R.set({camera:ee}),O.camera=ee}if(!R.scene){let K;m instanceof dx?K=m:(K=new dx,m&&gf(K,m)),R.set({scene:Ef(K)})}if(!R.xr){var H;const K=(le,Q)=>{const ae=o.getState();ae.frameloop!=="never"&&yk(le,!0,ae,Q)},ee=()=>{const le=o.getState();le.gl.xr.enabled=le.gl.xr.isPresenting,le.gl.xr.setAnimationLoop(le.gl.xr.isPresenting?K:null),le.gl.xr.isPresenting||vk(le)},me={connect(){const le=o.getState().gl;le.xr.addEventListener("sessionstart",ee),le.xr.addEventListener("sessionend",ee)},disconnect(){const le=o.getState().gl;le.xr.removeEventListener("sessionstart",ee),le.xr.removeEventListener("sessionend",ee)}};typeof((H=D.xr)==null?void 0:H.addEventListener)=="function"&&me.connect(),R.set({xr:me})}if(D.shadowMap){const K=D.shadowMap.enabled,ee=D.shadowMap.type;if(D.shadowMap.enabled=!!y,wn.boo(y))D.shadowMap.type=Ap;else if(wn.str(y)){var Z;const me={basic:H6,percentage:Jb,soft:Ap,variance:Yo};D.shadowMap.type=(Z=me[y])!=null?Z:Ap}else wn.obj(y)&&Object.assign(D.shadowMap,y);(K!==D.shadowMap.enabled||ee!==D.shadowMap.type)&&(D.shadowMap.needsUpdate=!0)}const F=YB();F&&("enabled"in F?F.enabled=!_:"legacyMode"in F&&(F.legacyMode=_)),l||gf(D,{outputEncoding:g?3e3:3001,toneMapping:b?Os:zR}),R.legacy!==_&&R.set(()=>({legacy:_})),R.linear!==g&&R.set(()=>({linear:g})),R.flat!==b&&R.set(()=>({flat:b})),f&&!wn.fun(f)&&!r8(f)&&!wn.equ(f,D,vf)&&gf(D,f),v&&!R.events.handlers&&R.set({events:v(o)});const Y=lde(t,h);return wn.equ(Y,R.size,vf)||R.setSize(Y.width,Y.height,Y.updateStyle,Y.top,Y.left),N&&R.viewport.dpr!==e8(N)&&R.setDpr(N),R.frameloop!==P&&R.setFrameloop(P),R.onPointerMissed||R.set({onPointerMissed:M}),T&&!wn.equ(T,R.performance,vf)&&R.set(K=>({performance:{...K.performance,...T}})),a=x,l=!0,this},render(u){return l||this.configure(),gx.updateContainer(C.jsx(ude,{store:o,children:u,onCreated:a,rootElement:t}),s,null,()=>{}),o},unmount(){s8(t)}}}function ude({store:t,children:e,onCreated:n,rootElement:r}){return Sg(()=>{const i=t.getState();i.set(o=>({internal:{...o.internal,active:!0}})),n&&n(i),t.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),C.jsx(i8.Provider,{value:t,children:e})}function s8(t,e){const n=Td.get(t),r=n==null?void 0:n.fiber;if(r){const i=n==null?void 0:n.store.getState();i&&(i.internal.active=!1),gx.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var o,s,a,l;i.events.disconnect==null||i.events.disconnect(),(o=i.gl)==null||(s=o.renderLists)==null||s.dispose==null||s.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),Kfe(i),Td.delete(t)}catch{}},500)})}}gx.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:A.version});const iE={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 fde(t){const{handlePointer:e}=tde(t);return{priority:1,enabled:!0,compute(n,r,i){r.pointer.set(n.offsetX/r.size.width*2-1,-(n.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(iE).reduce((n,r)=>({...n,[r]:e(r)}),{}),update:()=>{var n;const{events:r,internal:i}=t.getState();(n=i.lastEvent)!=null&&n.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:n=>{var r;const{set:i,events:o}=t.getState();o.disconnect==null||o.disconnect(),i(s=>({events:{...s.events,connected:n}})),Object.entries((r=o.handlers)!=null?r:[]).forEach(([s,a])=>{const[l,c]=iE[s];n.addEventListener(l,a,{passive:c})})},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([o,s])=>{if(r&&r.connected instanceof HTMLElement){const[a]=iE[o];r.connected.removeEventListener(a,s)}}),n(o=>({events:{...o.events,connected:void 0}}))}}}}function xC(t,e,n){var r,i,o,s,a;e==null&&(e=100);function l(){var u=Date.now()-s;u=0?r=setTimeout(l,e-u):(r=null,n||(a=t.apply(o,i),o=i=null))}var c=function(){o=this,i=arguments,s=Date.now();var u=n&&!r;return r||(r=setTimeout(l,e)),u&&(a=t.apply(o,i),o=i=null),a};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(a=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},c}xC.debounce=xC;var dde=xC;const xk=$s(dde);var hde=Object.defineProperty,pde=Object.defineProperties,mde=Object.getOwnPropertyDescriptors,bk=Object.getOwnPropertySymbols,gde=Object.prototype.hasOwnProperty,vde=Object.prototype.propertyIsEnumerable,_k=(t,e,n)=>e in t?hde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,wk=(t,e)=>{for(var n in e||(e={}))gde.call(e,n)&&_k(t,n,e[n]);if(bk)for(var n of bk(e))vde.call(e,n)&&_k(t,n,e[n]);return t},yde=(t,e)=>pde(t,mde(e)),Sk,Mk;typeof window<"u"&&((Sk=window.document)!=null&&Sk.createElement||((Mk=window.navigator)==null?void 0:Mk.product)==="ReactNative")?A.useLayoutEffect:A.useEffect;function a8(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=a8(r,e,n);if(i)return i;r=r.sibling}}function l8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const Ek=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=Ek;return}return Ek.apply(this,arguments)};const RA=l8(A.createContext(null));class c8 extends A.Component{render(){return A.createElement(RA.Provider,{value:this._reactInternals},this.props.children)}}function xde(){const t=A.useContext(RA);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=A.useId();return A.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=a8(r,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}function bde(){const t=xde(),[e]=A.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==RA&&!e.has(i)&&e.set(i,A.useContext(l8(i)))}n=n.return}return e}function _de(){const t=bde();return A.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>A.createElement(e,null,A.createElement(n.Provider,yde(wk({},r),{value:t.get(n)}))),e=>A.createElement(c8,wk({},e))),[t])}function wde({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||typeof window<"u"&&window.ResizeObserver,[o,s]=A.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!i)return o.width=1280,o.height=800,[()=>{},o,()=>{}];const a=A.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,c=t?typeof t=="number"?t:t.resize:null,u=A.useRef(!1);A.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[f,h,m]=A.useMemo(()=>{const g=()=>{if(!a.current.element)return;const{left:b,top:_,width:S,height:P,bottom:N,right:T,x:L,y:U}=a.current.element.getBoundingClientRect(),M={left:b,top:_,width:S,height:P,bottom:N,right:T,x:L,y:U};a.current.element instanceof HTMLElement&&r&&(M.height=a.current.element.offsetHeight,M.width=a.current.element.offsetWidth),Object.freeze(M),u.current&&!Cde(a.current.lastBounds,M)&&s(a.current.lastBounds=M)};return[g,c?xk(g,c):g,l?xk(g,l):g]},[s,r,l,c]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",m,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function x(){var g;a.current.element&&(a.current.resizeObserver=new i(h),(g=a.current.resizeObserver)==null||g.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(b=>b.addEventListener("scroll",m,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const y=g=>{!g||g===a.current.element||(v(),a.current.element=g,a.current.scrollContainers=u8(g),x())};return Mde(m,!!e),Sde(h),A.useEffect(()=>{v(),x()},[e,m,h]),A.useEffect(()=>v,[]),[y,o,f]}function Sde(t){A.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function Mde(t,e){A.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function u8(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(o=>o==="auto"||o==="scroll")&&e.push(t),[...e,...u8(t.parentElement)]}const Ede=["x","y","top","bottom","left","right","width","height"],Cde=(t,e)=>Ede.every(n=>t[n]===e[n]),Tde=A.forwardRef(function({children:e,fallback:n,resize:r,style:i,gl:o,events:s=fde,eventSource:a,eventPrefix:l,shadows:c,linear:u,flat:f,legacy:h,orthographic:m,frameloop:v,dpr:x,performance:y,raycaster:g,camera:b,scene:_,onPointerMissed:S,onCreated:P,...N},T){A.useMemo(()=>qB(Ufe),[]);const L=_de(),[U,M]=wde({scroll:!0,debounce:{scroll:50,resize:0},...r}),R=A.useRef(null),D=A.useRef(null);A.useImperativeHandle(T,()=>R.current);const O=ZB(S),[B,X]=A.useState(!1),[H,Z]=A.useState(!1);if(B)throw B;if(H)throw H;const F=A.useRef(null);Sg(()=>{const K=R.current;M.width>0&&M.height>0&&K&&(F.current||(F.current=cde(K)),F.current.configure({gl:o,events:s,shadows:c,linear:u,flat:f,legacy:h,orthographic:m,frameloop:v,dpr:x,performance:y,raycaster:g,camera:b,scene:_,size:M,onPointerMissed:(...ee)=>O.current==null?void 0:O.current(...ee),onCreated:ee=>{ee.events.connect==null||ee.events.connect(a?Xfe(a)?a.current:a:D.current),l&&ee.setEvents({compute:(me,le)=>{const Q=me[l+"X"],ae=me[l+"Y"];le.pointer.set(Q/le.size.width*2-1,-(ae/le.size.height)*2+1),le.raycaster.setFromCamera(le.pointer,le.camera)}}),P==null||P(ee)}}),F.current.render(C.jsx(L,{children:C.jsx(JB,{set:Z,children:C.jsx(A.Suspense,{fallback:C.jsx(qfe,{set:X}),children:e})})})))}),A.useEffect(()=>{const K=R.current;if(K)return()=>s8(K)},[]);const Y=a?"none":"auto";return C.jsx("div",{ref:D,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Y,...i},...N,children:C.jsx("div",{ref:U,style:{width:"100%",height:"100%"},children:C.jsx("canvas",{ref:R,style:{display:"block"},children:n})})})}),Rde=A.forwardRef(function(e,n){return C.jsx(c8,{children:C.jsx(Tde,{...e,ref:n})})});function R_(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Qd(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Mg(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Hl(){}var fu=.7,Rd=1/fu,sd="\\s*([+-]?\\d+)\\s*",zm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ade=/^#([0-9a-f]{3,8})$/,Pde=new RegExp(`^rgb\\(${sd},${sd},${sd}\\)$`),Nde=new RegExp(`^rgb\\(${Fs},${Fs},${Fs}\\)$`),Ide=new RegExp(`^rgba\\(${sd},${sd},${sd},${zm}\\)$`),Lde=new RegExp(`^rgba\\(${Fs},${Fs},${Fs},${zm}\\)$`),kde=new RegExp(`^hsl\\(${zm},${Fs},${Fs}\\)$`),Ode=new RegExp(`^hsla\\(${zm},${Fs},${Fs},${zm}\\)$`),Ck={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};Qd(Hl,Um,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Tk,formatHex:Tk,formatHex8:Dde,formatHsl:Fde,formatRgb:Rk,toString:Rk});function Tk(){return this.rgb().formatHex()}function Dde(){return this.rgb().formatHex8()}function Fde(){return f8(this).formatHsl()}function Rk(){return this.rgb().formatRgb()}function Um(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ade.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Ak(e):n===3?new yr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ey(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ey(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Pde.exec(t))?new yr(e[1],e[2],e[3],1):(e=Nde.exec(t))?new yr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ide.exec(t))?ey(e[1],e[2],e[3],e[4]):(e=Lde.exec(t))?ey(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=kde.exec(t))?Ik(e[1],e[2]/100,e[3]/100,1):(e=Ode.exec(t))?Ik(e[1],e[2]/100,e[3]/100,e[4]):Ck.hasOwnProperty(t)?Ak(Ck[t]):t==="transparent"?new yr(NaN,NaN,NaN,0):null}function Ak(t){return new yr(t>>16&255,t>>8&255,t&255,1)}function ey(t,e,n,r){return r<=0&&(t=e=n=NaN),new yr(t,e,n,r)}function AA(t){return t instanceof Hl||(t=Um(t)),t?(t=t.rgb(),new yr(t.r,t.g,t.b,t.opacity)):new yr}function Il(t,e,n,r){return arguments.length===1?AA(t):new yr(t,e,n,r??1)}function yr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Qd(yr,Il,Mg(Hl,{brighter(t){return t=t==null?Rd:Math.pow(Rd,t),new yr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?fu:Math.pow(fu,t),new yr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new yr(Gc(this.r),Gc(this.g),Gc(this.b),vx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pk,formatHex:Pk,formatHex8:zde,formatRgb:Nk,toString:Nk}));function Pk(){return`#${Oc(this.r)}${Oc(this.g)}${Oc(this.b)}`}function zde(){return`#${Oc(this.r)}${Oc(this.g)}${Oc(this.b)}${Oc((isNaN(this.opacity)?1:this.opacity)*255)}`}function Nk(){const t=vx(this.opacity);return`${t===1?"rgb(":"rgba("}${Gc(this.r)}, ${Gc(this.g)}, ${Gc(this.b)}${t===1?")":`, ${t})`}`}function vx(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Gc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Oc(t){return t=Gc(t),(t<16?"0":"")+t.toString(16)}function Ik(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new es(t,e,n,r)}function f8(t){if(t instanceof es)return new es(t.h,t.s,t.l,t.opacity);if(t instanceof Hl||(t=Um(t)),!t)return new es;if(t instanceof es)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(n-r)/a+(n0&&l<1?0:s,new es(s,a,l,t.opacity)}function yx(t,e,n,r){return arguments.length===1?f8(t):new es(t,e,n,r??1)}function es(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Qd(es,yx,Mg(Hl,{brighter(t){return t=t==null?Rd:Math.pow(Rd,t),new es(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?fu:Math.pow(fu,t),new es(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new yr(oE(t>=240?t-240:t+120,i,r),oE(t,i,r),oE(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new es(Lk(this.h),ty(this.s),ty(this.l),vx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=vx(this.opacity);return`${t===1?"hsl(":"hsla("}${Lk(this.h)}, ${ty(this.s)*100}%, ${ty(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Lk(t){return t=(t||0)%360,t<0?t+360:t}function ty(t){return Math.max(0,Math.min(1,t||0))}function oE(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const d8=Math.PI/180,h8=180/Math.PI,xx=18,p8=.96422,m8=1,g8=.82521,v8=4/29,ad=6/29,y8=3*ad*ad,Ude=ad*ad*ad;function x8(t){if(t instanceof zs)return new zs(t.l,t.a,t.b,t.opacity);if(t instanceof xa)return b8(t);t instanceof yr||(t=AA(t));var e=cE(t.r),n=cE(t.g),r=cE(t.b),i=sE((.2225045*e+.7168786*n+.0606169*r)/m8),o,s;return e===n&&n===r?o=s=i:(o=sE((.4360747*e+.3850649*n+.1430804*r)/p8),s=sE((.0139322*e+.0971045*n+.7141733*r)/g8)),new zs(116*i-16,500*(o-i),200*(i-s),t.opacity)}function bC(t,e,n,r){return arguments.length===1?x8(t):new zs(t,e,n,r??1)}function zs(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}Qd(zs,bC,Mg(Hl,{brighter(t){return new zs(this.l+xx*(t??1),this.a,this.b,this.opacity)},darker(t){return new zs(this.l-xx*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=p8*aE(e),t=m8*aE(t),n=g8*aE(n),new yr(lE(3.1338561*e-1.6168667*t-.4906146*n),lE(-.9787684*e+1.9161415*t+.033454*n),lE(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function sE(t){return t>Ude?Math.pow(t,1/3):t/y8+v8}function aE(t){return t>ad?t*t*t:y8*(t-v8)}function lE(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function cE(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Bde(t){if(t instanceof xa)return new xa(t.h,t.c,t.l,t.opacity);if(t instanceof zs||(t=x8(t)),t.a===0&&t.b===0)return new xa(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=r()=>t;function w8(t,e){return function(n){return t+n*e}}function Wde(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function IA(t,e){var n=e-t;return n?w8(t,n>180||n<-180?n-360*Math.round(n/360):n):P_(isNaN(t)?e:t)}function Hde(t){return(t=+t)==1?xr:function(e,n){return n-e?Wde(e,n,t):P_(isNaN(e)?n:e)}}function xr(t,e){var n=e-t;return n?w8(t,n):P_(isNaN(t)?e:t)}const wC=function t(e){var n=Hde(e);function r(i,o){var s=n((i=Il(i)).r,(o=Il(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=xr(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function Gde(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Ad(r,i)})),n=uE.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function fhe(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i2?dhe:fhe,l=c=null,f}function f(h){return h==null||isNaN(h=+h)?o:(l||(l=a(t.map(r),e,n)))(r(s(h)))}return f.invert=function(h){return s(i((c||(c=a(e,t.map(r),Ad)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,che),u()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),u()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=kA,u()},f.clamp=function(h){return arguments.length?(s=h?!0:Ps,u()):s!==Ps},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,m){return r=h,i=m,u()}}function hhe(){return L_()(Ps,Ps)}function phe(t,e,n,r){var i=D6(t,e,n),o;switch(r=vm(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=Kne(i,s))&&(r.precision=o),U6(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Zne(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Yne(i))&&(r.precision=o-(r.type==="%")*2);break}}return Gs(r)}function OA(t){var e=t.domain;return t.ticks=function(n){var r=e();return J2(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return phe(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,s=r[i],a=r[o],l,c,u=10;for(a0;){if(c=Q2(s,a,n),c===l)return r[i]=s,r[o]=a,e(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function C8(){var t=hhe();return t.copy=function(){return I_(t,C8())},R_.apply(t,arguments),OA(t)}function mhe(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],s;return oMath.pow(t,e)}function bhe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function Bk(t){return(e,n)=>-t(-e,n)}function _he(t){const e=t(zk,Uk),n=e.domain;let r=10,i,o;function s(){return i=bhe(r),o=xhe(r),n()[0]<0?(i=Bk(i),o=Bk(o),t(ghe,vhe)):t(zk,Uk),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;h<=m;++h)for(v=1;vu)break;g.push(x)}}else for(;h<=m;++h)for(v=r-1;v>=1;--v)if(x=h>0?v/o(-h):v*o(h),!(xu)break;g.push(x)}g.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=vm(l)).precision==null&&(l.trim=!0),l=Gs(l)),a===1/0)return l;const c=Math.max(1,r*a/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(mhe(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),e}function T8(){const t=_he(L_()).domain([1,10]);return t.copy=()=>I_(t,T8()).base(t.base()),R_.apply(t,arguments),t}function jk(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Vk(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function whe(t){var e=1,n=t(jk(e),Vk(e));return n.constant=function(r){return arguments.length?t(jk(e=+r),Vk(e)):e},OA(n)}function R8(){var t=whe(L_());return t.copy=function(){return I_(t,R8()).constant(t.constant())},R_.apply(t,arguments)}function $k(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function She(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Mhe(t){return t<0?-t*t:t*t}function Ehe(t){var e=t(Ps,Ps),n=1;function r(){return n===1?t(Ps,Ps):n===.5?t(She,Mhe):t($k(n),$k(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},OA(e)}function DA(){var t=Ehe(L_());return t.copy=function(){return I_(t,DA()).exponent(t.exponent())},R_.apply(t,arguments),t}function Che(){return DA.apply(null,arguments).exponent(.5)}const fE=new Date,dE=new Date;function Lr(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,a),t(o);while(cLr(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(i.count=(o,s)=>(fE.setTime(+o),dE.setTime(+s),t(fE),t(dE),Math.floor(n(fE,dE))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const jm=1e3,Ll=jm*60,Vm=Ll*60,$m=Vm*24,A8=$m*7,FA=Lr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*jm)},(t,e)=>(e-t)/jm,t=>t.getUTCSeconds());FA.range;const P8=Lr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*jm)},(t,e)=>{t.setTime(+t+e*Ll)},(t,e)=>(e-t)/Ll,t=>t.getMinutes());P8.range;const N8=Lr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Ll)},(t,e)=>(e-t)/Ll,t=>t.getUTCMinutes());N8.range;const I8=Lr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*jm-t.getMinutes()*Ll)},(t,e)=>{t.setTime(+t+e*Vm)},(t,e)=>(e-t)/Vm,t=>t.getHours());I8.range;const L8=Lr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Vm)},(t,e)=>(e-t)/Vm,t=>t.getUTCHours());L8.range;const k8=Lr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Ll)/$m,t=>t.getDate()-1);k8.range;const O8=Lr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/$m,t=>t.getUTCDate()-1);O8.range;const The=Lr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/$m,t=>Math.floor(t/$m));The.range;function Mu(t){return Lr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Ll)/A8)}const D8=Mu(0),Rhe=Mu(1),Ahe=Mu(2),Phe=Mu(3),Nhe=Mu(4),Ihe=Mu(5),Lhe=Mu(6);D8.range;Rhe.range;Ahe.range;Phe.range;Nhe.range;Ihe.range;Lhe.range;function Eu(t){return Lr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/A8)}const F8=Eu(0),khe=Eu(1),Ohe=Eu(2),Dhe=Eu(3),Fhe=Eu(4),zhe=Eu(5),Uhe=Eu(6);F8.range;khe.range;Ohe.range;Dhe.range;Fhe.range;zhe.range;Uhe.range;const z8=Lr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());z8.range;const U8=Lr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());U8.range;const zA=Lr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());zA.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Lr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});zA.range;const UA=Lr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());UA.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Lr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});UA.range;function Bhe(t,e){e.domain&&("nice"in t||"quantiles"in t||"padding"in t,t.domain(e.domain))}function jhe(t,e){e.range&&("padding"in t,t.range(e.range))}function Vhe(t,e){"align"in t&&"align"in e&&typeof e.align<"u"&&t.align(e.align)}function $he(t,e){"base"in t&&"base"in e&&typeof e.base<"u"&&t.base(e.base)}function Whe(t,e){"clamp"in t&&"clamp"in e&&typeof e.clamp<"u"&&t.clamp(e.clamp)}function Hhe(t,e){"constant"in t&&"constant"in e&&typeof e.constant<"u"&&t.constant(e.constant)}function Ghe(t,e){"exponent"in t&&"exponent"in e&&typeof e.exponent<"u"&&t.exponent(e.exponent)}var Wk={lab:ihe,hcl:ohe,"hcl-long":she,hsl:nhe,"hsl-long":rhe,cubehelix:ahe,"cubehelix-long":N_,rgb:wC};function Xhe(t){switch(t){case"lab":case"hcl":case"hcl-long":case"hsl":case"hsl-long":case"cubehelix":case"cubehelix-long":case"rgb":return Wk[t]}var e=t.type,n=t.gamma,r=Wk[e];return typeof n>"u"?r:r.gamma(n)}function qhe(t,e){if("interpolate"in e&&"interpolate"in t&&typeof e.interpolate<"u"){var n=Xhe(e.interpolate);t.interpolate(n)}}var Yhe=new Date(Date.UTC(2020,1,2,3,4,5)),Khe="%Y-%m-%d %H:%M";function Zhe(t){var e=t.tickFormat(1,Khe)(Yhe);return e==="2020-02-02 03:04"}var Hk={day:k8,hour:I8,minute:P8,month:z8,second:FA,week:D8,year:zA},Gk={day:O8,hour:L8,minute:N8,month:U8,second:FA,week:F8,year:UA};function Jhe(t,e){if("nice"in e&&typeof e.nice<"u"&&"nice"in t){var n=e.nice;if(typeof n=="boolean")n&&t.nice();else if(typeof n=="number")t.nice(n);else{var r=t,i=Zhe(r);if(typeof n=="string")r.nice(i?Gk[n]:Hk[n]);else{var o=n.interval,s=n.step,a=(i?Gk[o]:Hk[o]).every(s);a!=null&&r.nice(a)}}}}function Qhe(t,e){"padding"in t&&"padding"in e&&typeof e.padding<"u"&&t.padding(e.padding),"paddingInner"in t&&"paddingInner"in e&&typeof e.paddingInner<"u"&&t.paddingInner(e.paddingInner),"paddingOuter"in t&&"paddingOuter"in e&&typeof e.paddingOuter<"u"&&t.paddingOuter(e.paddingOuter)}function epe(t,e){if(e.reverse){var n=t.range().slice().reverse();"padding"in t,t.range(n)}}function tpe(t,e){"round"in e&&typeof e.round<"u"&&(e.round&&"interpolate"in e&&typeof e.interpolate<"u"?console.warn("[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:",e):"round"in t?t.round(e.round):"interpolate"in t&&e.round&&t.interpolate(kA))}function npe(t,e){"unknown"in t&&"unknown"in e&&typeof e.unknown<"u"&&t.unknown(e.unknown)}function rpe(t,e){if("zero"in e&&e.zero===!0){var n=t.domain(),r=n[0],i=n[1],o=i=0)&&(n[i]=t[i]);return n}function bx(){return bx=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var V8={position:"absolute",backgroundColor:"white",color:"#666666",padding:".3rem .5rem",borderRadius:"3px",fontSize:"14px",boxShadow:"0 1px 2px rgba(33,33,33,0.2)",lineHeight:"1em",pointerEvents:"none"},$A=Mt.forwardRef(function(t,e){var n=t.className,r=t.top,i=t.left,o=t.offsetLeft,s=o===void 0?10:o,a=t.offsetTop,l=a===void 0?10:a,c=t.style,u=c===void 0?V8:c,f=t.children,h=t.unstyled,m=h===void 0?!1:h,v=t.applyPositionStyle,x=v===void 0?!1:v,y=bpe(t,xpe);return Mt.createElement("div",_x({ref:e,className:as("visx-tooltip",n),style:_x({top:r==null||l==null?r:r+l,left:i==null||s==null?i:i+s},x&&{position:"absolute"},!m&&u)},y),f)});$A.propTypes={children:qt.node,className:qt.string,left:qt.number,offsetLeft:qt.number,offsetTop:qt.number,top:qt.number,applyPositionStyle:qt.bool,unstyled:qt.bool};$A.displayName="Tooltip";function EC(){return EC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function W8(t){var e=t.children;t.getRects;var n=t.left,r=n===void 0?0:n,i=t.offsetLeft,o=i===void 0?10:i,s=t.offsetTop,a=s===void 0?10:s,l=t.parentRect,c=t.rect,u=t.style,f=u===void 0?V8:u,h=t.top,m=h===void 0?0:h,v=t.unstyled,x=v===void 0?!1:v,y=t.nodeRef,g=Cpe(t,Epe),b,_=!1,S=!1;if(c&&l){var P=r,N=m;if(l.width){var T=P+o+c.width-l.width,L=c.width-P-o;_=T>0&&T>L}else{var U=P+o+c.width-window.innerWidth,M=c.width-P-o;_=U>0&&U>M}if(l.height){var R=N+a+c.height-l.height,D=c.height-N-a;S=R>0&&R>D}else S=N+a+c.height>window.innerHeight;P=_?P-c.width-o:P+o,N=S?N-c.height-a:N+a,P=Math.round(P),N=Math.round(N),b="translate("+P+"px, "+N+"px)"}return Mt.createElement($A,wx({ref:y,style:wx({left:0,top:0,transform:b},!x&&f)},g),Mt.createElement(Mpe,{value:{isFlippedVertically:!S,isFlippedHorizontally:!_}},e))}W8.propTypes={nodeRef:qt.oneOfType([qt.string,qt.func,qt.object])};const Tpe=Spe(W8);var Rpe=["top","left","transform","className","children","innerRef"];function TC(){return TC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function Cg(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.transform,s=t.className,a=t.children,l=t.innerRef,c=Ape(t,Rpe);return Mt.createElement("g",TC({ref:l,className:as("visx-group",s),transform:o||"translate("+i+", "+n+")"},c),a)}Cg.propTypes={top:qt.number,left:qt.number,transform:qt.string,className:qt.string,children:qt.node,innerRef:qt.oneOfType([qt.string,qt.func,qt.object])};var Ppe=["from","to","fill","className","innerRef"];function RC(){return RC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function Sx(t){var e=t.from,n=e===void 0?{x:0,y:0}:e,r=t.to,i=r===void 0?{x:1,y:1}:r,o=t.fill,s=o===void 0?"transparent":o,a=t.className,l=t.innerRef,c=Npe(t,Ppe),u=n.x===i.x||n.y===i.y;return Mt.createElement("line",RC({ref:l,className:as("visx-line",a),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:s,shapeRendering:u?"crispEdges":"auto"},c))}var Ipe=H8;function H8(t,e,n){t instanceof RegExp&&(t=qk(t,n)),e instanceof RegExp&&(e=qk(e,n));var r=G8(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function qk(t,e){var n=e.match(t);return n?n[0]:null}H8.range=G8;function G8(t,e,n){var r,i,o,s,a,l=n.indexOf(t),c=n.indexOf(e,l+1),u=l;if(l>=0&&c>0){for(r=[],o=n.length;u>=0&&!a;)u==l?(r.push(u),l=n.indexOf(t,u+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i=0?l:c;r.length&&(a=[o,s])}return a}var Lpe=X8;function X8(t,e,n){t instanceof RegExp&&(t=Yk(t,n)),e instanceof RegExp&&(e=Yk(e,n));var r=q8(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function Yk(t,e){var n=e.match(t);return n?n[0]:null}X8.range=q8;function q8(t,e,n){var r,i,o,s,a,l=n.indexOf(t),c=n.indexOf(e,l+1),u=l;if(l>=0&&c>0){if(t===e)return[l,c];for(r=[],o=n.length;u>=0&&!a;)u==l?(r.push(u),l=n.indexOf(t,u+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i=0?l:c;r.length&&(a=[o,s])}return a}var kpe=Lpe,Ope=Y8;function Y8(t,e,n){var r=t;return Dpe(t,e).reduce(function(i,o){return i.replace(o.functionIdentifier+"("+o.matches.body+")",Fpe(o.matches.body,o.functionIdentifier,n,r,e))},t)}function Dpe(t,e){var n=[],r=typeof e=="string"?new RegExp("\\b("+e+")\\("):e;do{var i=r.exec(t);if(!i)return n;if(i[1]===void 0)throw new Error("Missing the first couple of parenthesis to get the function identifier in "+e);var o=i[1],s=i.index,a=kpe("(",")",t.substring(s));if(!a||a.start!==i[0].length-1)throw new SyntaxError(o+"(): missing closing ')' in the value '"+t+"'");n.push({matches:a,functionIdentifier:o}),t=a.post}while(r.test(t));return n}function Fpe(t,e,n,r,i){return n(Y8(t,i,n),e,r)}var ri=function(t){this.value=t};ri.math={isDegree:!0,acos:function(t){return ri.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,e){return t+e},asin:function(t){return ri.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return ri.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,e){var n=1,r=t-e,i=e;ioi.length-2?oi.length-1:t.length-s;i>0;i--)if(oi[i]!==void 0)for(o=0;o0&&cr)s.push(e);else{for(;r>=i&&!c||c&&i"u"?e[e.length-1].value.push(o[a]):e[e.length-1].value=o[a].value(e[e.length-1].value);else if(o[a].type===7)typeof e[e.length-1].type>"u"?e[e.length-1].value.push(o[a]):e[e.length-1].value=o[a].value(e[e.length-1].value);else if(o[a].type===8){for(var l=[],c=0;c"u"?(r.value=r.concat(n),r.value.push(o[a]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[a]),e.push(n)):e.push({type:1,value:o[a].value(r.value,n.value)})):o[a].type===2||o[a].type===9?(n=e.pop(),r=e.pop(),typeof r.type>"u"?(r=r.concat(n),r.push(o[a]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[a]),e.push(n)):e.push({type:1,value:o[a].value(r.value,n.value)})):o[a].type===12?(n=e.pop(),typeof n.type<"u"&&(n=[n]),r=e.pop(),i=e.pop(),e.push({type:1,value:o[a].value(i.value,r.value,new Up(n))})):o[a].type===13&&(s?e.push({value:t[o[a].value],type:3}):e.push([o[a]]));if(e.length>1)throw new Up.Exception("Uncaught Syntax error");return e[0].value>1e15?"Infinity":parseFloat(e[0].value.toFixed(15))};Up.eval=function(t,e,n){return typeof e>"u"?this.lex(t).toPostfix().postfixEval():typeof n>"u"?typeof e.length<"u"?this.lex(t,e).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(e):this.lex(t,e).toPostfix().postfixEval(n)};var Gpe=Up,Z8=Gpe;Z8.prototype.formulaEval=function(){for(var t,e,n,r=[],i=this.value,o=0;o"+e.value+""+i[o].show+""+t.value+"",type:10}):r.push({value:(e.type!=1?"(":"")+e.value+(e.type!=1?")":"")+""+t.value+"",type:1})):i[o].type===2||i[o].type===9?(t=r.pop(),e=r.pop(),r.push({value:(e.type!=1?"(":"")+e.value+(e.type!=1?")":"")+i[o].show+(t.type!=1?"(":"")+t.value+(t.type!=1?")":""),type:i[o].type})):i[o].type===12&&(t=r.pop(),e=r.pop(),n=r.pop(),r.push({value:i[o].show+"("+n.value+","+e.value+","+t.value+")",type:12}));return r[0].value};var Xpe=Z8,qpe=Ipe,Ype=Ope,Kpe=Xpe,Zpe=100,Jpe=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,hE,Qpe=eme;function eme(t,e){hE=0,e=Math.pow(10,e===void 0?5:e),t=t.replace(/\n+/g," ");function n(i,o,s){if(hE++>Zpe)throw hE=0,new Error("Call stack overflow for "+s);if(i==="")throw new Error(o+"(): '"+s+"' must contain a non-whitespace string");i=r(i,s);var a=tme(i);if(a.length>1||i.indexOf("var(")>-1)return o+"("+i+")";var l=a[0]||"";l==="%"&&(i=i.replace(/\b[0-9\.]+%/g,function(f){return parseFloat(f.slice(0,-1))*.01}));var c=i.replace(new RegExp(l,"gi"),""),u;try{u=Kpe.eval(c)}catch{return o+"("+i+")"}return l==="%"&&(u*=100),(o.length||l==="%")&&(u=Math.round(u*e)/e),u+=l,u}function r(i,o){i=i.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var s="",a=i,l;l=Jpe.exec(a);){l[0].index>0&&(s+=a.substring(0,l[0].index));var c=qpe("(",")",a.substring([0].index));if(c.body==="")throw new Error("'"+i+"' must contain a non-whitespace string");var u=n(c.body,"",o);s+=c.pre+u,a=c.post}return s+a}return Ype(t,/((?:\-[a-z]+\-)?calc)\(/,n)}function tme(t){for(var e=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(t);i;)!i||!i[1]||(n.indexOf(i[1].toLowerCase())===-1&&(e.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(t));return e}const pE=$s(Qpe);var nme=typeof k0=="object"&&k0&&k0.Object===Object&&k0,rme=nme,ime=rme,ome=typeof self=="object"&&self&&self.Object===Object&&self,sme=ime||ome||Function("return this")(),WA=sme,ame=WA,lme=ame.Symbol,J8=lme,Kk=J8,Q8=Object.prototype,cme=Q8.hasOwnProperty,ume=Q8.toString,sp=Kk?Kk.toStringTag:void 0;function fme(t){var e=cme.call(t,sp),n=t[sp];try{t[sp]=void 0;var r=!0}catch{}var i=ume.call(t);return r&&(e?t[sp]=n:delete t[sp]),i}var dme=fme,hme=Object.prototype,pme=hme.toString;function mme(t){return pme.call(t)}var gme=mme,Zk=J8,vme=dme,yme=gme,xme="[object Null]",bme="[object Undefined]",Jk=Zk?Zk.toStringTag:void 0;function _me(t){return t==null?t===void 0?bme:xme:Jk&&Jk in Object(t)?vme(t):yme(t)}var wme=_me;function Sme(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var e9=Sme,Mme=wme,Eme=e9,Cme="[object AsyncFunction]",Tme="[object Function]",Rme="[object GeneratorFunction]",Ame="[object Proxy]";function Pme(t){if(!Eme(t))return!1;var e=Mme(t);return e==Tme||e==Rme||e==Cme||e==Ame}var Nme=Pme,Ime=WA,Lme=Ime["__core-js_shared__"],kme=Lme,mE=kme,Qk=function(){var t=/[^.]+$/.exec(mE&&mE.keys&&mE.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ome(t){return!!Qk&&Qk in t}var Dme=Ome,Fme=Function.prototype,zme=Fme.toString;function Ume(t){if(t!=null){try{return zme.call(t)}catch{}try{return t+""}catch{}}return""}var Bme=Ume,jme=Nme,Vme=Dme,$me=e9,Wme=Bme,Hme=/[\\^$.*+?()[\]{}|]/g,Gme=/^\[object .+?Constructor\]$/,Xme=Function.prototype,qme=Object.prototype,Yme=Xme.toString,Kme=qme.hasOwnProperty,Zme=RegExp("^"+Yme.call(Kme).replace(Hme,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Jme(t){if(!$me(t)||Vme(t))return!1;var e=jme(t)?Zme:Gme;return e.test(Wme(t))}var Qme=Jme;function ege(t,e){return t==null?void 0:t[e]}var tge=ege,nge=Qme,rge=tge;function ige(t,e){var n=rge(t,e);return nge(n)?n:void 0}var t9=ige,oge=t9,sge=oge(Object,"create"),k_=sge,eO=k_;function age(){this.__data__=eO?eO(null):{},this.size=0}var lge=age;function cge(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var uge=cge,fge=k_,dge="__lodash_hash_undefined__",hge=Object.prototype,pge=hge.hasOwnProperty;function mge(t){var e=this.__data__;if(fge){var n=e[t];return n===dge?void 0:n}return pge.call(e,t)?e[t]:void 0}var gge=mge,vge=k_,yge=Object.prototype,xge=yge.hasOwnProperty;function bge(t){var e=this.__data__;return vge?e[t]!==void 0:xge.call(e,t)}var _ge=bge,wge=k_,Sge="__lodash_hash_undefined__";function Mge(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=wge&&e===void 0?Sge:e,this}var Ege=Mge,Cge=lge,Tge=uge,Rge=gge,Age=_ge,Pge=Ege;function eh(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var qge=Xge,Yge=O_;function Kge(t,e){var n=this.__data__,r=Yge(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Zge=Kge,Jge=Lge,Qge=Vge,e0e=Hge,t0e=qge,n0e=Zge;function th(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e=0)&&(n[i]=t[i]);return n}function gE(t){return typeof t=="number"}function iO(t){return typeof t=="number"&&Number.isFinite(t)||typeof t=="string"}function B0e(t){var e=t.verticalAnchor,n=e===void 0?"end":e,r=t.scaleToFit,i=r===void 0?!1:r,o=t.angle,s=t.width,a=t.lineHeight,l=a===void 0?"1em":a,c=t.capHeight,u=c===void 0?"0.71em":c,f=t.children,h=t.style,m=U0e(t,z0e),v=m.x,x=v===void 0?0:v,y=m.y,g=y===void 0?0:y,b=!iO(x)||!iO(g),_=A.useMemo(function(){var U=f==null?[]:f.toString().split(/(?:(?!\u00A0+)\s+)/);return{wordsWithWidth:U.map(function(M){return{word:M,wordWidth:rO(M,h)||0}}),spaceWidth:rO(" ",h)||0}},[f,h]),S=_.wordsWithWidth,P=_.spaceWidth,N=A.useMemo(function(){return b?[]:s||i?S.reduce(function(U,M){var R=M.word,D=M.wordWidth,O=U[U.length-1];if(O&&(s==null||i||(O.width||0)+D+P0){var M=N[0].width||1,R=i==="shrink-only"?Math.min(s/M,1):s/M,D=R,O=x-R*x,B=g-D*g;U.push("matrix("+R+", 0, 0, "+D+", "+O+", "+B+")")}return o&&U.push("rotate("+o+", "+x+", "+g+")"),U.length>0?U.join(" "):""},[b,x,g,s,i,N,o]);return{wordsByLines:N,startDy:T,transform:L}}var j0e=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function NC(){return NC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var $0e={overflow:"visible"};function r9(t){var e=t.dx,n=e===void 0?0:e,r=t.dy,i=r===void 0?0:r,o=t.textAnchor,s=o===void 0?"start":o,a=t.innerRef,l=t.innerTextRef;t.verticalAnchor,t.angle;var c=t.lineHeight,u=c===void 0?"1em":c;t.scaleToFit,t.capHeight,t.width;var f=V0e(t,j0e),h=f.x,m=h===void 0?0:h,v=f.fontSize,x=B0e(t),y=x.wordsByLines,g=x.startDy,b=x.transform;return Mt.createElement("svg",{ref:a,x:n,y:i,fontSize:v,style:$0e},y.length>0?Mt.createElement("text",NC({ref:l,transform:b},f,{textAnchor:s}),y.map(function(_,S){return Mt.createElement("tspan",{key:S,x:m,dy:S===0?g:u},_.words.join(" "))})):null)}var Yi={top:"top",left:"left",right:"right",bottom:"bottom"};function W0e(t){var e=t.labelOffset,n=t.labelProps,r=t.orientation,i=t.range,o=t.tickLabelFontSize,s=t.tickLength,a=r===Yi.left||r===Yi.top?-1:1,l,c,u;if(r===Yi.top||r===Yi.bottom){var f=r===Yi.bottom&&typeof n.fontSize=="number"?n.fontSize:0;l=(Number(i[0])+Number(i[i.length-1]))/2,c=a*(s+e+o+f)}else l=a*((Number(i[0])+Number(i[i.length-1]))/2),c=-(s+e),u="rotate("+a*90+")";return{x:l,y:c,transform:u}}function Bp(){return Bp=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function i9(t){var e=t.children,n=e===void 0?G0e:e,r=t.axisClassName,i=t.hideAxisLine,o=i===void 0?!1:i,s=t.hideTicks,a=s===void 0?!1:s,l=t.hideZero,c=l===void 0?!1:l,u=t.innerRef,f=t.left,h=f===void 0?0:f,m=t.numTicks,v=m===void 0?10:m,x=t.orientation,y=x===void 0?Yi.bottom:x,g=t.rangePadding,b=g===void 0?0:g,_=t.scale,S=t.tickFormat,P=t.tickLength,N=P===void 0?8:P,T=t.tickValues,L=t.top,U=L===void 0?0:L,M=Z0e(t,K0e),R=S??q0e(_),D=y===Yi.left,O=y===Yi.top,B=O||y===Yi.bottom,X=X0e(_),H=D||O?-1:1,Z=_.range(),F=Y0e(b),Y=iy({x:Number(Z[0])+.5-F.start,y:0},B),K=iy({x:Number(Z[Z.length-1])+.5+F.end,y:0},B),ee=(T??VA(_,v)).filter(function(le){return!c||le!==0&&le!=="0"}).map(function(le,Q){return{value:le,index:Q}}),me=ee.map(function(le){var Q=le.value,ae=le.index,ge=jA(X(Q));return{value:Q,index:ae,from:iy({x:ge,y:0},B),to:iy({x:ge,y:N*H},B),formattedValue:R(Q,ae,ee)}});return Mt.createElement(Cg,{className:as("visx-axis",r),innerRef:u,top:U,left:h},n(LC({},M,{axisFromPoint:Y,axisToPoint:K,hideAxisLine:o,hideTicks:a,hideZero:c,horizontal:B,numTicks:v,orientation:y,rangePadding:b,scale:_,tickFormat:R,tickLength:N,tickPosition:X,tickSign:H,ticks:me})))}var J0e=["axisClassName","labelOffset","tickLength","tickLabelProps"];function Mx(){return Mx=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var eve={dx:"-0.25em",dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"end"};function tve(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?36:n,i=t.tickLength,o=i===void 0?8:i,s=t.tickLabelProps,a=Q0e(t,J0e),l=typeof s=="function"?s:Mx({},eve,s);return Mt.createElement(i9,Mx({axisClassName:as("visx-axis-left",e),labelOffset:r,orientation:Yi.left,tickLabelProps:l,tickLength:o},a))}var nve=["axisClassName","labelOffset","tickLength","tickLabelProps"];function Ex(){return Ex=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var ive={dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"middle"};function ove(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?8:n,i=t.tickLength,o=i===void 0?8:i,s=t.tickLabelProps,a=rve(t,nve),l=typeof s=="function"?s:Ex({},ive,s);return Mt.createElement(i9,Ex({axisClassName:as("visx-axis-bottom",e),labelOffset:r,orientation:Yi.bottom,tickLabelProps:l,tickLength:o},a))}var o9=uve,sve=s9(A),ave=s9(j8),lve=["from","to","fill","className","innerRef"];function s9(t){return t&&t.__esModule?t:{default:t}}function kC(){return kC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function uve(t){var e=t.from,n=e===void 0?{x:0,y:0}:e,r=t.to,i=r===void 0?{x:1,y:1}:r,o=t.fill,s=o===void 0?"transparent":o,a=t.className,l=t.innerRef,c=cve(t,lve),u=n.x===i.x||n.y===i.y;return sve.default.createElement("line",kC({ref:l,className:(0,ave.default)("visx-line",a),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:s,shapeRendering:u?"crispEdges":"auto"},c))}function a9(t){return"bandwidth"in t?t.bandwidth():0}var fve=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function OC(){return OC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function l9(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,s=t.width,a=t.stroke,l=a===void 0?"#eaf0f6":a,c=t.strokeWidth,u=c===void 0?1:c,f=t.strokeDasharray,h=t.className,m=t.children,v=t.numTicks,x=v===void 0?10:v,y=t.lineStyle,g=t.offset,b=t.tickValues,_=dve(t,fve),S=b??VA(o,x),P=(g??0)+a9(o)/2,N=S.map(function(T,L){var U,M=((U=jA(o(T)))!=null?U:0)+P;return{index:L,from:new Wm({x:0,y:M}),to:new Wm({x:s,y:M})}});return Mt.createElement(Cg,{className:as("visx-rows",h),top:n,left:i},m?m({lines:N}):N.map(function(T){var L=T.from,U=T.to,M=T.index;return Mt.createElement(o9,OC({key:"row-line-"+M,from:L,to:U,stroke:l,strokeWidth:u,strokeDasharray:f,style:y},_))}))}l9.propTypes={tickValues:qt.array,width:qt.number.isRequired};var hve=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function DC(){return DC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function c9(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,s=t.height,a=t.stroke,l=a===void 0?"#eaf0f6":a,c=t.strokeWidth,u=c===void 0?1:c,f=t.strokeDasharray,h=t.className,m=t.numTicks,v=m===void 0?10:m,x=t.lineStyle,y=t.offset,g=t.tickValues,b=t.children,_=pve(t,hve),S=g??VA(o,v),P=(y??0)+a9(o)/2,N=S.map(function(T,L){var U,M=((U=jA(o(T)))!=null?U:0)+P;return{index:L,from:new Wm({x:M,y:0}),to:new Wm({x:M,y:s})}});return Mt.createElement(Cg,{className:as("visx-columns",h),top:n,left:i},b?b({lines:N}):N.map(function(T){var L=T.from,U=T.to,M=T.index;return Mt.createElement(o9,DC({key:"column-line-"+M,from:L,to:U,stroke:l,strokeWidth:u,strokeDasharray:f,style:x},_))}))}c9.propTypes={tickValues:qt.array,height:qt.number.isRequired};function fn(t){for(var e=t.length/6|0,n=new Array(e),r=0;rXde(t[t.length-1]);var mve=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(fn);const gve=yn(mve);var vve=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(fn);const yve=yn(vve);var xve=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(fn);const bve=yn(xve);var _ve=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(fn);const wve=yn(_ve);var Sve=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(fn);const Mve=yn(Sve);var Eve=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(fn);const Cve=yn(Eve);var Tve=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(fn);const Rve=yn(Tve);var Ave=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(fn);const Pve=yn(Ave);var Nve=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(fn);const Ive=yn(Nve);var Lve=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(fn);const kve=yn(Lve);var Ove=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(fn);const Dve=yn(Ove);var Fve=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(fn);const zve=yn(Fve);var Uve=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(fn);const Bve=yn(Uve);var jve=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(fn);const Vve=yn(jve);var $ve=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(fn);const Wve=yn($ve);var Hve=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(fn);const Gve=yn(Hve);var Xve=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(fn);const qve=yn(Xve);var Yve=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(fn);const Kve=yn(Yve);var Zve=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(fn);const Jve=yn(Zve);var Qve=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(fn);const eye=yn(Qve);var tye=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(fn);const nye=yn(tye);var rye=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(fn);const iye=yn(rye);var oye=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(fn);const sye=yn(oye);var aye=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(fn);const lye=yn(aye);var cye=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(fn);const uye=yn(cye);var fye=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(fn);const dye=yn(fye);var hye=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(fn);const pye=yn(hye);function mye(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}const gye=N_(js(300,.5,0),js(-240,.5,1));var vye=N_(js(-100,.75,.35),js(80,1.5,.8)),yye=N_(js(260,.75,.35),js(80,1.5,.8)),oy=js();function xye(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return oy.h=360*t-100,oy.s=1.5-1.5*e,oy.l=.8-.9*e,oy+""}var sy=Il(),bye=Math.PI/3,_ye=Math.PI*2/3;function wye(t){var e;return t=(.5-t)*Math.PI,sy.r=255*(e=Math.sin(t))*e,sy.g=255*(e=Math.sin(t+bye))*e,sy.b=255*(e=Math.sin(t+_ye))*e,sy+""}function Sye(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function F_(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Mye=F_(fn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Eye=F_(fn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Cye=F_(fn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Tye=F_(fn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function GA(t,e=0,n=[]){return A.Children.toArray(t).reduce((r,i,o)=>(V2.isFragment(i)?r.push.apply(r,GA(i.props.children,e+1,n.concat(i.key||o))):A.isValidElement(i)?r.push(A.cloneElement(i,{key:n.concat(String(i.key)).join(".")})):(typeof i=="string"||typeof i=="number")&&r.push(i),r),[])}function z_(){return typeof window<"u"}function rh(t){return u9(t)?(t.nodeName||"").toLowerCase():"#document"}function to(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ys(t){var e;return(e=(u9(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function u9(t){return z_()?t instanceof Node||t instanceof to(t).Node:!1}function li(t){return z_()?t instanceof Element||t instanceof to(t).Element:!1}function io(t){return z_()?t instanceof HTMLElement||t instanceof to(t).HTMLElement:!1}function FC(t){return!z_()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof to(t).ShadowRoot}function Tg(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ls(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Rye(t){return["table","td","th"].includes(rh(t))}function U_(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function XA(t){const e=qA(),n=li(t)?ls(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Aye(t){let e=kl(t);for(;io(e)&&!Pd(e);){if(XA(e))return e;if(U_(e))return null;e=kl(e)}return null}function qA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pd(t){return["html","body","#document"].includes(rh(t))}function ls(t){return to(t).getComputedStyle(t)}function B_(t){return li(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function kl(t){if(rh(t)==="html")return t;const e=t.assignedSlot||t.parentNode||FC(t)&&t.host||Ys(t);return FC(e)?e.host:e}function f9(t){const e=kl(t);return Pd(e)?t.ownerDocument?t.ownerDocument.body:t.body:io(e)&&Tg(e)?e:f9(e)}function Hm(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=f9(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=to(i);if(o){const a=zC(s);return e.concat(s,s.visualViewport||[],Tg(i)?i:[],a&&n?Hm(a):[])}return e.concat(i,Hm(i,[],n))}function zC(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function sO(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function Pye(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&FC(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function d9(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function h9(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}function Nye(t){return t.mozInputSource===0&&t.isTrusted?!0:UC()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Iye(t){return Oye()?!1:!UC()&&t.width===0&&t.height===0||UC()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Lye(){return/apple/i.test(navigator.vendor)}function UC(){const t=/android/i;return t.test(d9())||t.test(h9())}function kye(){return d9().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Oye(){return h9().includes("jsdom/")}function aO(t,e){return["mouse","pen"].includes(t)}function Dye(t){return(t==null?void 0:t.ownerDocument)||document}const Fye="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function p9(t){return io(t)&&t.matches(Fye)}function So(t){t.preventDefault(),t.stopPropagation()}function zye(t){return t?t.getAttribute("role")==="combobox"&&p9(t):!1}const Nd=Math.min,Xi=Math.max,Cx=Math.round,Xf=Math.floor,Ol=t=>({x:t,y:t});function lO(t,e,n){return Xi(t,Nd(e,n))}function j_(t,e){return typeof t=="function"?t(e):t}function Rg(t){return t.split("-")[0]}function YA(t){return t.split("-")[1]}function m9(t){return t==="x"?"y":"x"}function Uye(t){return t==="y"?"height":"width"}function Ag(t){return["top","bottom"].includes(Rg(t))?"y":"x"}function Bye(t){return m9(Ag(t))}function jye(t){return{top:0,right:0,bottom:0,left:0,...t}}function Vye(t){return typeof t!="number"?jye(t):{top:t,right:t,bottom:t,left:t}}function Tx(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function cO(t,e,n){let{reference:r,floating:i}=t;const o=Ag(e),s=Bye(e),a=Uye(s),l=Rg(e),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:u,y:r.y-i.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-i.width,y:f};break;default:m={x:r.x,y:r.y}}switch(YA(e)){case"start":m[s]-=h*(n&&c?-1:1);break;case"end":m[s]+=h*(n&&c?-1:1);break}return m}const $ye=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=cO(c,r,l),h=r,m={},v=0;for(let x=0;x{let{x:g,y:b}=y;return{x:g,y:b}}},...l}=j_(t,e),c={x:n,y:r},u=await g9(e,l),f=Ag(Rg(i)),h=m9(f);let m=c[h],v=c[f];if(o){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",b=m+u[y],_=m-u[g];m=lO(b,m,_)}if(s){const y=f==="y"?"top":"left",g=f==="y"?"bottom":"right",b=v+u[y],_=v-u[g];v=lO(b,v,_)}const x=a.fn({...e,[h]:m,[f]:v});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[h]:o,[f]:s}}}}}},Xye=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=j_(t,e),u=await g9(e,c),f=Rg(i),h=YA(i),m=Ag(i)==="y",{width:v,height:x}=o.floating;let y,g;f==="top"||f==="bottom"?(y=f,g=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,y=h==="end"?"top":"bottom");const b=x-u.top-u.bottom,_=v-u.left-u.right,S=Nd(x-u[y],b),P=Nd(v-u[g],_),N=!e.middlewareData.shift;let T=S,L=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(L=_),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=b),N&&!h){const M=Xi(u.left,0),R=Xi(u.right,0),D=Xi(u.top,0),O=Xi(u.bottom,0);m?L=v-2*(M!==0||R!==0?M+R:Xi(u.left,u.right)):T=x-2*(D!==0||O!==0?D+O:Xi(u.top,u.bottom))}await l({...e,availableWidth:L,availableHeight:T});const U=await s.getDimensions(a.floating);return v!==U.width||x!==U.height?{reset:{rects:!0}}:{}}}};function v9(t){const e=ls(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=io(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Cx(n)!==o||Cx(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function KA(t){return li(t)?t:t.contextElement}function ld(t){const e=KA(t);if(!io(e))return Ol(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=v9(e);let s=(o?Cx(n.width):n.width)/r,a=(o?Cx(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const qye=Ol(0);function y9(t){const e=to(t);return!qA()||!e.visualViewport?qye:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Yye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==to(t)?!1:e}function du(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=KA(t);let s=Ol(1);e&&(r?li(r)&&(s=ld(r)):s=ld(t));const a=Yye(o,n,r)?y9(o):Ol(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=to(o),m=r&&li(r)?to(r):r;let v=h,x=zC(v);for(;x&&r&&m!==v;){const y=ld(x),g=x.getBoundingClientRect(),b=ls(x),_=g.left+(x.clientLeft+parseFloat(b.paddingLeft))*y.x,S=g.top+(x.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=_,c+=S,v=to(x),x=zC(v)}}return Tx({width:u,height:f,x:l,y:c})}function Kye(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Ys(r),a=e?U_(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Ol(1);const u=Ol(0),f=io(r);if((f||!f&&!o)&&((rh(r)!=="body"||Tg(s))&&(l=B_(r)),io(r))){const h=du(r);c=ld(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function Zye(t){return Array.from(t.getClientRects())}function BC(t,e){const n=B_(t).scrollLeft;return e?e.left+n:du(Ys(t)).left+n}function Jye(t){const e=Ys(t),n=B_(t),r=t.ownerDocument.body,i=Xi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Xi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+BC(t);const a=-n.scrollTop;return ls(r).direction==="rtl"&&(s+=Xi(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Qye(t,e){const n=to(t),r=Ys(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=qA();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function e1e(t,e){const n=du(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=io(t)?ld(t):Ol(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function uO(t,e,n){let r;if(e==="viewport")r=Qye(t,n);else if(e==="document")r=Jye(Ys(t));else if(li(e))r=e1e(e,n);else{const i=y9(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Tx(r)}function x9(t,e){const n=kl(t);return n===e||!li(n)||Pd(n)?!1:ls(n).position==="fixed"||x9(n,e)}function t1e(t,e){const n=e.get(t);if(n)return n;let r=Hm(t,[],!1).filter(a=>li(a)&&rh(a)!=="body"),i=null;const o=ls(t).position==="fixed";let s=o?kl(t):t;for(;li(s)&&!Pd(s);){const a=ls(s),l=XA(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Tg(s)&&!l&&x9(t,s))?r=r.filter(u=>u!==s):i=a,s=kl(s)}return e.set(t,r),r}function n1e(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?U_(e)?[]:t1e(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=uO(e,u,i);return c.top=Xi(f.top,c.top),c.right=Nd(f.right,c.right),c.bottom=Nd(f.bottom,c.bottom),c.left=Xi(f.left,c.left),c},uO(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function r1e(t){const{width:e,height:n}=v9(t);return{width:e,height:n}}function i1e(t,e,n){const r=io(e),i=Ys(e),o=n==="fixed",s=du(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Ol(0);if(r||!r&&!o)if((rh(e)!=="body"||Tg(i))&&(a=B_(e)),r){const m=du(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&(l.x=BC(i));let c=0,u=0;if(i&&!r&&!o){const m=i.getBoundingClientRect();u=m.top+a.scrollTop,c=m.left+a.scrollLeft-BC(i,m)}const f=s.left+a.scrollLeft-l.x-c,h=s.top+a.scrollTop-l.y-u;return{x:f,y:h,width:s.width,height:s.height}}function yE(t){return ls(t).position==="static"}function fO(t,e){if(!io(t)||ls(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ys(t)===n&&(n=n.ownerDocument.body),n}function b9(t,e){const n=to(t);if(U_(t))return n;if(!io(t)){let i=kl(t);for(;i&&!Pd(i);){if(li(i)&&!yE(i))return i;i=kl(i)}return n}let r=fO(t,e);for(;r&&Rye(r)&&yE(r);)r=fO(r,e);return r&&Pd(r)&&yE(r)&&!XA(r)?n:r||Aye(t)||n}const o1e=async function(t){const e=this.getOffsetParent||b9,n=this.getDimensions,r=await n(t.floating);return{reference:i1e(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function s1e(t){return ls(t).direction==="rtl"}const a1e={convertOffsetParentRelativeRectToViewportRelativeRect:Kye,getDocumentElement:Ys,getClippingRect:n1e,getOffsetParent:b9,getElementRects:o1e,getClientRects:Zye,getDimensions:r1e,getScale:ld,isElement:li,isRTL:s1e};function l1e(t,e){let n=null,r;const i=Ys(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:f,height:h}=t.getBoundingClientRect();if(a||e(),!f||!h)return;const m=Xf(u),v=Xf(i.clientWidth-(c+f)),x=Xf(i.clientHeight-(u+h)),y=Xf(c),b={rootMargin:-m+"px "+-v+"px "+-x+"px "+-y+"px",threshold:Xi(0,Nd(1,l))||1};let _=!0;function S(P){const N=P[0].intersectionRatio;if(N!==l){if(!_)return s();N?s(!1,N):r=setTimeout(()=>{s(!1,1e-7)},1e3)}_=!1}try{n=new IntersectionObserver(S,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(t)}return s(!0),o}function ZA(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=KA(t),u=i||o?[...c?Hm(c):[],...Hm(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const f=c&&a?l1e(c,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(g=>{let[b]=g;b&&b.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let v,x=l?du(t):null;l&&y();function y(){const g=du(t);x&&(g.x!==x.x||g.y!==x.y||g.width!==x.width||g.height!==x.height)&&n(),x=g,v=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),f==null||f(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const c1e=Hye,u1e=Gye,f1e=Xye,d1e=(t,e,n)=>{const r=new Map,i={platform:a1e,...n},o={...i.platform,_c:r};return $ye(t,e,{...i,platform:o})};var By=typeof document<"u"?A.useLayoutEffect:A.useEffect;function Rx(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Rx(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!Rx(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function _9(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function dO(t,e){const n=_9(t);return Math.round(e*n)/n}function xE(t){const e=A.useRef(t);return By(()=>{e.current=t}),e}function h1e(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[u,f]=A.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,m]=A.useState(r);Rx(h,r)||m(r);const[v,x]=A.useState(null),[y,g]=A.useState(null),b=A.useCallback(F=>{F!==N.current&&(N.current=F,x(F))},[]),_=A.useCallback(F=>{F!==T.current&&(T.current=F,g(F))},[]),S=o||v,P=s||y,N=A.useRef(null),T=A.useRef(null),L=A.useRef(u),U=l!=null,M=xE(l),R=xE(i),D=xE(c),O=A.useCallback(()=>{if(!N.current||!T.current)return;const F={placement:e,strategy:n,middleware:h};R.current&&(F.platform=R.current),d1e(N.current,T.current,F).then(Y=>{const K={...Y,isPositioned:D.current!==!1};B.current&&!Rx(L.current,K)&&(L.current=K,Bl.flushSync(()=>{f(K)}))})},[h,e,n,R,D]);By(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(F=>({...F,isPositioned:!1})))},[c]);const B=A.useRef(!1);By(()=>(B.current=!0,()=>{B.current=!1}),[]),By(()=>{if(S&&(N.current=S),P&&(T.current=P),S&&P){if(M.current)return M.current(S,P,O);O()}},[S,P,O,M,U]);const X=A.useMemo(()=>({reference:N,floating:T,setReference:b,setFloating:_}),[b,_]),H=A.useMemo(()=>({reference:S,floating:P}),[S,P]),Z=A.useMemo(()=>{const F={position:n,left:0,top:0};if(!H.floating)return F;const Y=dO(H.floating,u.x),K=dO(H.floating,u.y);return a?{...F,transform:"translate("+Y+"px, "+K+"px)",..._9(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:K}},[n,a,H.floating,u.x,u.y]);return A.useMemo(()=>({...u,update:O,refs:X,elements:H,floatingStyles:Z}),[u,O,X,H,Z])}const JA=(t,e)=>({...c1e(t),options:[t,e]}),QA=(t,e)=>({...u1e(t),options:[t,e]}),p1e=(t,e)=>({...f1e(t),options:[t,e]}),w9={...Hp},m1e=w9.useInsertionEffect,g1e=m1e||(t=>t());function jC(t){const e=A.useRef(()=>{});return g1e(()=>{e.current=t}),A.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i=t.current.length}function bE(t,e){return Gr(t,{disabledIndices:e})}function hO(t,e){return Gr(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function Gr(t,e){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=e===void 0?{}:e;const s=t.current,a=i?c=>i.includes(c):c=>{const u=s[c];return u==null||u.hasAttribute("disabled")||u.getAttribute("aria-disabled")==="true"};let l=n;do l+=r?-o:o;while(l>=0&&l<=s.length-1&&a(l));return l}function v1e(t,e){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=e,f=c;if(n.key===eP){if(u&&So(n),c===-1)f=l;else if(f=Gr(t,{startingIndex:f,amount:o,decrement:!0,disabledIndices:s}),i&&(c-oh?v:v-o}Vp(t,f)&&(f=c)}if(n.key===Pg&&(u&&So(n),c===-1?f=a:(f=Gr(t,{startingIndex:c,amount:o,disabledIndices:s}),i&&c+o>l&&(f=Gr(t,{startingIndex:c%o-o,amount:o,disabledIndices:s}))),Vp(t,f)&&(f=c)),r==="both"){const h=Xf(c/o);n.key===ih&&(u&&So(n),c%o!==o-1?(f=Gr(t,{startingIndex:c,disabledIndices:s}),i&&ay(f,o,h)&&(f=Gr(t,{startingIndex:c-c%o-1,disabledIndices:s}))):i&&(f=Gr(t,{startingIndex:c-c%o-1,disabledIndices:s})),ay(f,o,h)&&(f=c)),n.key===Id&&(u&&So(n),c%o!==0?(f=Gr(t,{startingIndex:c,disabledIndices:s,decrement:!0}),i&&ay(f,o,h)&&(f=Gr(t,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:s}))):i&&(f=Gr(t,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:s})),ay(f,o,h)&&(f=c));const m=Xf(l/o)===h;Vp(t,f)&&(i&&m?f=n.key===Id?l:Gr(t,{startingIndex:c-c%o-1,disabledIndices:s}):f=c)}return f}function y1e(t,e,n){const r=[];let i=0;return t.forEach((o,s)=>{let{width:a,height:l}=o,c=!1;for(n&&(i=0);!c;){const u=[];for(let f=0;fr[f]==null)?(u.forEach(f=>{r[f]=s}),c=!0):i++}}),[...r]}function x1e(t,e,n,r,i){if(t===-1)return-1;const o=n.indexOf(t);switch(i){case"tl":return o;case"tr":return o+e[t].width-1;case"bl":return o+(e[t].height-1)*r;case"br":return n.lastIndexOf(t)}}function b1e(t,e){return e.flatMap((n,r)=>t.includes(n)?[r]:[])}let pO=0;function mO(t,e){e===void 0&&(e={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=e;r&&cancelAnimationFrame(pO);const o=()=>t==null?void 0:t.focus({preventScroll:n});i?o():pO=requestAnimationFrame(o)}var bi=typeof document<"u"?A.useLayoutEffect:A.useEffect;function _1e(t,e){const n=t.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function w1e(t,e){if(t.size!==e.size)return!1;for(const[n,r]of t.entries())if(r!==e.get(n))return!1;return!0}const S9=A.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function S1e(t){const{children:e,elementsRef:n,labelsRef:r}=t,[i,o]=A.useState(()=>new Map),s=A.useCallback(l=>{o(c=>new Map(c).set(l,null))},[]),a=A.useCallback(l=>{o(c=>{const u=new Map(c);return u.delete(l),u})},[]);return bi(()=>{const l=new Map(i);Array.from(l.keys()).sort(_1e).forEach((u,f)=>{l.set(u,f)}),w1e(i,l)||o(l)},[i]),A.createElement(S9.Provider,{value:A.useMemo(()=>({register:s,unregister:a,map:i,elementsRef:n,labelsRef:r}),[s,a,i,n,r])},e)}function M1e(t){t===void 0&&(t={});const{label:e}=t,{register:n,unregister:r,map:i,elementsRef:o,labelsRef:s}=A.useContext(S9),[a,l]=A.useState(null),c=A.useRef(null),u=A.useCallback(f=>{if(c.current=f,a!==null&&(o.current[a]=f,s)){var h;const m=e!==void 0;s.current[a]=m?e:(h=f==null?void 0:f.textContent)!=null?h:null}},[a,o,s,e]);return bi(()=>{const f=c.current;if(f)return n(f),()=>{r(f)}},[n,r]),bi(()=>{const f=c.current?i.get(c.current):null;f!=null&&l(f)},[i]),A.useMemo(()=>({ref:u,index:a??-1}),[a,u])}let gO=!1,E1e=0;const vO=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+E1e++;function C1e(){const[t,e]=A.useState(()=>gO?vO():void 0);return bi(()=>{t==null&&e(vO())},[]),A.useEffect(()=>{gO=!0},[]),t}const T1e=w9.useId,R1e=T1e||C1e;function A1e(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(i=>i(n))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var r;t.set(e,((r=t.get(e))==null?void 0:r.filter(i=>i!==n))||[])}}}const P1e=A.createContext(null),N1e=A.createContext(null),M9=()=>{var t;return((t=A.useContext(P1e))==null?void 0:t.id)||null},E9=()=>A.useContext(N1e);function ly(t){const e=A.useRef(t);return bi(()=>{e.current=t}),e}function I1e(t,e){let n=t.filter(i=>{var o;return i.parentId===e&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=t.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function L1e(t,e){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),I1e(t,o).forEach(l=>{i(l.id,s+1)})}return i(e,0),t.find(o=>o.id===n)}function yO(t){return io(t.target)&&t.target.tagName==="BUTTON"}function xO(t){return p9(t)}function tP(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=t,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=e,f=A.useRef(),h=A.useRef(!1);return A.useMemo(()=>s?{reference:{onPointerDown(m){f.current=m.pointerType},onMouseDown(m){m.button===0&&(aO(f.current)&&c||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){if(a==="mousedown"&&f.current){f.current=void 0;return}aO(f.current)&&c||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){f.current=void 0,!(m.defaultPrevented||!u||yO(m))&&(m.key===" "&&!xO(o)&&(m.preventDefault(),h.current=!0),m.key==="Enter"&&r(!(n&&l),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||yO(m)||xO(o)||m.key===" "&&h.current&&(h.current=!1,r(!(n&&l),m.nativeEvent,"click"))}}}:{},[s,i,a,c,u,o,l,n,r])}function k1e(t){const{open:e=!1,onOpenChange:n,elements:r}=t,i=R1e(),o=A.useRef({}),[s]=A.useState(()=>A1e()),a=M9()!=null,[l,c]=A.useState(r.reference),u=jC((m,v,x)=>{o.current.openEvent=m?v:void 0,s.emit("openchange",{open:m,event:v,reason:x,nested:a}),n==null||n(m,v,x)}),f=A.useMemo(()=>({setPositionReference:c}),[]),h=A.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return A.useMemo(()=>({dataRef:o,open:e,onOpenChange:u,elements:h,events:s,floatingId:i,refs:f}),[e,u,h,s,i,f])}function nP(t){t===void 0&&(t={});const{nodeId:e}=t,n=k1e({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,i=r.elements,[o,s]=A.useState(null),[a,l]=A.useState(null),u=(i==null?void 0:i.reference)||o,f=A.useRef(null),h=E9();bi(()=>{u&&(f.current=u)},[u]);const m=h1e({...t,elements:{...i,...a&&{reference:a}}}),v=A.useCallback(_=>{const S=li(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;l(S),m.refs.setReference(S)},[m.refs]),x=A.useCallback(_=>{(li(_)||_===null)&&(f.current=_,s(_)),(li(m.refs.reference.current)||m.refs.reference.current===null||_!==null&&!li(_))&&m.refs.setReference(_)},[m.refs]),y=A.useMemo(()=>({...m.refs,setReference:x,setPositionReference:v,domReference:f}),[m.refs,x,v]),g=A.useMemo(()=>({...m.elements,domReference:u}),[m.elements,u]),b=A.useMemo(()=>({...m,...r,refs:y,elements:g,nodeId:e}),[m,y,g,e,r]);return bi(()=>{r.dataRef.current.floatingContext=b;const _=h==null?void 0:h.nodesRef.current.find(S=>S.id===e);_&&(_.context=b)}),A.useMemo(()=>({...m,context:b,refs:y,elements:g}),[m,y,g,b])}const bO="active",_O="selected";function _E(t,e,n){const r=new Map,i=n==="item";let o=t;if(i&&t){const{[bO]:s,[_O]:a,...l}=t;o=l}return{...n==="floating"&&{tabIndex:-1},...o,...e.map(s=>{const a=s?s[n]:null;return typeof a=="function"?t?a(t):null:a}).concat(t).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(i&&[bO,_O].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var h,m=arguments.length,v=new Array(m),x=0;xy(...v)).find(y=>y!==void 0)}}}else s[c]=u}),s),{})}}function rP(t){t===void 0&&(t=[]);const e=t,n=A.useCallback(o=>_E(o,t,"reference"),e),r=A.useCallback(o=>_E(o,t,"floating"),e),i=A.useCallback(o=>_E(o,t,"item"),t.map(o=>o==null?void 0:o.item));return A.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let wO=!1;function V_(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function SO(t,e){return V_(e,t===eP||t===Pg,t===Id||t===ih)}function wE(t,e,n){return V_(e,t===Pg,n?t===Id:t===ih)||t==="Enter"||t===" "||t===""}function O1e(t,e,n){return V_(e,n?t===Id:t===ih,t===Pg)}function MO(t,e,n){return V_(e,n?t===ih:t===Id,t===eP)}function D1e(t,e){const{open:n,onOpenChange:r,elements:{domReference:i,floating:o}}=t,{listRef:s,activeIndex:a,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:f=!1,loop:h=!1,nested:m=!1,rtl:v=!1,virtual:x=!1,focusItemOnOpen:y="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:b=!0,disabledIndices:_=void 0,orientation:S="vertical",cols:P=1,scrollItemIntoView:N=!0,virtualItemRef:T,itemSizes:L,dense:U=!1}=e,M=M9(),R=E9(),D=jC(l),O=A.useRef(y),B=A.useRef(u??-1),X=A.useRef(null),H=A.useRef(!0),Z=A.useRef(D),F=A.useRef(!!o),Y=A.useRef(!1),K=A.useRef(!1),ee=ly(_),me=ly(n),le=ly(N),Q=ly(o),[ae,ge]=A.useState(),[Me,tt]=A.useState(),He=jC(function(se,j,ye){ye===void 0&&(ye=!1);const xe=se.current[j.current];xe&&(x?(ge(xe.id),R==null||R.events.emit("virtualfocus",xe),T&&(T.current=xe)):mO(xe,{preventScroll:!0,sync:kye()&&Lye()?wO||Y.current:!1}),requestAnimationFrame(()=>{const Re=le.current;Re&&xe&&(ye||!H.current)&&(xe.scrollIntoView==null||xe.scrollIntoView(typeof Re=="boolean"?{block:"nearest",inline:"nearest"}:Re))}))});bi(()=>{document.createElement("div").focus({get preventScroll(){return wO=!0,!1}})},[]),bi(()=>{c&&(n&&o?O.current&&u!=null&&(K.current=!0,B.current=u,D(u)):F.current&&(B.current=-1,Z.current(null)))},[c,n,o,u,D]),bi(()=>{if(c&&n&&o)if(a==null){if(Y.current=!1,u!=null)return;if(F.current&&(B.current=-1,He(s,B)),!F.current&&O.current&&(X.current!=null||O.current===!0&&X.current==null)){let se=0;const j=()=>{s.current[0]==null?(se<2&&(se?requestAnimationFrame:queueMicrotask)(j),se++):(B.current=X.current==null||wE(X.current,S,v)||m?bE(s,ee.current):hO(s,ee.current),X.current=null,D(B.current))};j()}}else Vp(s,a)||(B.current=a,He(s,B,K.current),K.current=!1)},[c,n,o,a,u,m,s,S,v,D,He,ee]),bi(()=>{var se;if(!c||o||!R||x||!F.current)return;const j=R.nodesRef.current,ye=(se=j.find(Pe=>Pe.id===M))==null||(se=se.context)==null?void 0:se.elements.floating,xe=sO(Dye(o)),Re=j.some(Pe=>Pe.context&&Pye(Pe.context.elements.floating,xe));ye&&!Re&&H.current&&ye.focus({preventScroll:!0})},[c,o,R,M,x]),bi(()=>{if(!c||!R||!x||M)return;function se(j){tt(j.id),T&&(T.current=j)}return R.events.on("virtualfocus",se),()=>{R.events.off("virtualfocus",se)}},[c,R,x,M,T]),bi(()=>{Z.current=D,F.current=!!o}),bi(()=>{n||(X.current=null)},[n]);const rt=a!=null,Ve=A.useMemo(()=>{function se(ye){if(!n)return;const xe=s.current.indexOf(ye);xe!==-1&&D(xe)}return{onFocus(ye){let{currentTarget:xe}=ye;se(xe)},onClick:ye=>{let{currentTarget:xe}=ye;return xe.focus({preventScroll:!0})},...g&&{onMouseMove(ye){let{currentTarget:xe}=ye;se(xe)},onPointerLeave(ye){let{pointerType:xe}=ye;!H.current||xe==="touch"||(B.current=-1,He(s,B),D(null),x||mO(Q.current,{preventScroll:!0}))}}}},[n,Q,He,g,s,D,x]);return A.useMemo(()=>{if(!c)return{};const se=ee.current;function j(Ee){if(H.current=!1,Y.current=!0,!me.current&&Ee.currentTarget===Q.current)return;if(m&&MO(Ee.key,S,v)){So(Ee),r(!1,Ee.nativeEvent,"list-navigation"),io(i)&&!x&&i.focus();return}const De=B.current,$=bE(s,se),z=hO(s,se);if(Ee.key==="Home"&&(So(Ee),B.current=$,D(B.current)),Ee.key==="End"&&(So(Ee),B.current=z,D(B.current)),P>1){const re=L||Array.from({length:s.current.length},()=>({width:1,height:1})),he=y1e(re,P,U),pe=he.findIndex(Ge=>Ge!=null&&!(se!=null&&se.includes(Ge))),be=he.reduce((Ge,Fe,Ne)=>Fe!=null&&!(se!=null&&se.includes(Fe))?Ne:Ge,-1);if(B.current=he[v1e({current:he.map(Ge=>Ge!=null?s.current[Ge]:null)},{event:Ee,orientation:S,loop:h,cols:P,disabledIndices:b1e([...se||[],void 0],he),minIndex:pe,maxIndex:be,prevIndex:x1e(B.current,re,he,P,Ee.key===Pg?"bl":Ee.key===ih?"tr":"tl"),stopEvent:!0})],D(B.current),S==="both")return}if(SO(Ee.key,S)){if(So(Ee),n&&!x&&sO(Ee.currentTarget.ownerDocument)===Ee.currentTarget){B.current=wE(Ee.key,S,v)?$:z,D(B.current);return}wE(Ee.key,S,v)?h?B.current=De>=z?f&&De!==s.current.length?-1:$:Gr(s,{startingIndex:De,disabledIndices:se}):B.current=Math.min(z,Gr(s,{startingIndex:De,disabledIndices:se})):h?B.current=De<=$?f&&De!==-1?s.current.length:z:Gr(s,{startingIndex:De,decrement:!0,disabledIndices:se}):B.current=Math.max($,Gr(s,{startingIndex:De,decrement:!0,disabledIndices:se})),Vp(s,B.current)?D(null):D(B.current)}}function ye(Ee){y==="auto"&&Nye(Ee.nativeEvent)&&(O.current=!0)}function xe(Ee){O.current=y,y==="auto"&&Iye(Ee.nativeEvent)&&(O.current=!0)}const Re=x&&n&&rt&&{"aria-activedescendant":Me||ae},Pe=s.current.find(Ee=>(Ee==null?void 0:Ee.id)===ae);return{reference:{...Re,onKeyDown(Ee){H.current=!1;const De=Ee.key.indexOf("Arrow")===0,$=O1e(Ee.key,S,v),z=MO(Ee.key,S,v),re=SO(Ee.key,S),he=(m?$:re)||Ee.key==="Enter"||Ee.key.trim()==="";if(x&&n){const Fe=R==null?void 0:R.nodesRef.current.find(ze=>ze.parentId==null),Ne=R&&Fe?L1e(R.nodesRef.current,Fe.id):null;if(De&&Ne&&T){const ze=new KeyboardEvent("keydown",{key:Ee.key,bubbles:!0});if($||z){var pe,be;const Le=((pe=Ne.context)==null?void 0:pe.elements.domReference)===Ee.currentTarget,Xe=z&&!Le?(be=Ne.context)==null?void 0:be.elements.domReference:$?Pe:null;Xe&&(So(Ee),Xe.dispatchEvent(ze),tt(void 0))}if(re&&Ne.context&&Ne.context.open&&Ne.parentId&&Ee.currentTarget!==Ne.context.elements.domReference){var Ge;So(Ee),(Ge=Ne.context.elements.domReference)==null||Ge.dispatchEvent(ze);return}}return j(Ee)}if(!(!n&&!b&&De)){if(he&&(X.current=m&&re?null:Ee.key),m){$&&(So(Ee),n?(B.current=bE(s,se),D(B.current)):r(!0,Ee.nativeEvent,"list-navigation"));return}re&&(u!=null&&(B.current=u),So(Ee),!n&&b?r(!0,Ee.nativeEvent,"list-navigation"):j(Ee),n&&D(B.current))}},onFocus(){n&&D(null)},onPointerDown:xe,onMouseDown:ye,onClick:ye},floating:{"aria-orientation":S==="both"?void 0:S,...!zye(i)&&Re,onKeyDown:j,onPointerMove(){H.current=!0}},item:Ve}},[i,Q,ae,Me,ee,me,s,c,S,v,x,n,rt,m,u,b,f,P,h,y,D,r,Ve,R,T,L,U])}var C9={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},EO=Mt.createContext&&Mt.createContext(C9),F1e=["attr","size","title"];function z1e(t,e){if(t==null)return{};var n=U1e(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function U1e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Ax(){return Ax=Object.assign?Object.assign.bind():function(t){for(var e=1;eMt.createElement(e.tag,Px({key:n},e.attr),T9(e.child)))}function ds(t){return e=>Mt.createElement($1e,Ax({attr:Px({},t.attr)},e),T9(t.child))}function $1e(t){var e=n=>{var{attr:r,size:i,title:o}=t,s=z1e(t,F1e),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),Mt.createElement("svg",Ax({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:Px(Px({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&Mt.createElement("title",null,o),t.children)};return EO!==void 0?Mt.createElement(EO.Consumer,null,n=>e(n)):e(C9)}function W1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(t)}function H1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(t)}function G1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 10 20 15 15 20"},child:[]},{tag:"path",attr:{d:"M4 4v7a4 4 0 0 0 4 4h12"},child:[]}]})(t)}function X1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"path",attr:{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(t)}function q1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"3",y1:"12",x2:"21",y2:"12"},child:[]},{tag:"line",attr:{x1:"3",y1:"6",x2:"21",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"18",x2:"21",y2:"18"},child:[]}]})(t)}function Y1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"},child:[]}]})(t)}function K1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3 5 6.99h3V14h2V6.99h3L9 3z"},child:[]}]})(t)}function Z1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"},child:[]}]})(t)}function J1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"},child:[]}]})(t)}function Q1e(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 11H1v2h6v-2zm2.17-3.24L7.05 5.64 5.64 7.05l2.12 2.12 1.41-1.41zM13 1h-2v6h2V1zm5.36 6.05-1.41-1.41-2.12 2.12 1.41 1.41 2.12-2.12zM17 11v2h6v-2h-6zm-5-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zm2.83 7.24 2.12 2.12 1.41-1.41-2.12-2.12-1.41 1.41zm-9.19.71 1.41 1.41 2.12-2.12-1.41-1.41-2.12 2.12zM11 23h2v-6h-2v6z"},child:[]}]})(t)}function R9(t){return ds({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m7 10 5 5 5-5z"},child:[]}]})(t)}var A9=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i0},t.prototype.connect_=function(){!VC||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),oxe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!VC||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=ixe.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),P9=function(t,e){for(var n=0,r=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof Ld(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new pxe(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Ld(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new mxe(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),I9=typeof WeakMap<"u"?new WeakMap:new A9,L9=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=sxe.getInstance(),r=new gxe(e,n,this);I9.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){L9.prototype[t]=function(){var e;return(e=I9.get(this))[t].apply(e,arguments)}});var vxe=function(){return typeof Nx.ResizeObserver<"u"?Nx.ResizeObserver:L9}(),yxe=["client","offset","scroll","bounds","margin"];function RO(t){var e=[];return yxe.forEach(function(n){t[n]&&e.push(n)}),e}function AO(t,e){var n={};if(e.indexOf("client")>-1&&(n.client={top:t.clientTop,left:t.clientLeft,width:t.clientWidth,height:t.clientHeight}),e.indexOf("offset")>-1&&(n.offset={top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}),e.indexOf("scroll")>-1&&(n.scroll={top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}),e.indexOf("bounds")>-1){var r=t.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(e.indexOf("margin")>-1){var i=getComputedStyle(t);n.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0}}return n}function xxe(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||window}function bxe(t){return function(e){var n,r;return r=n=function(i){wR(o,i);function o(){for(var a,l=arguments.length,c=new Array(l),u=0;u{let e;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){const m=e;e=f??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(v=>v(e,m))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(_xe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=e=t(r,i,l);return l},wxe=t=>t?PO(t):PO;var k9={exports:{}},O9={},D9={exports:{}},F9={};/** + * @license React + * use-sync-external-store-shim.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 kd=A;function Sxe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Mxe=typeof Object.is=="function"?Object.is:Sxe,Exe=kd.useState,Cxe=kd.useEffect,Txe=kd.useLayoutEffect,Rxe=kd.useDebugValue;function Axe(t,e){var n=e(),r=Exe({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return Txe(function(){i.value=n,i.getSnapshot=e,SE(i)&&o({inst:i})},[t,n,e]),Cxe(function(){return SE(i)&&o({inst:i}),t(function(){SE(i)&&o({inst:i})})},[t]),Rxe(n),n}function SE(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Mxe(t,n)}catch{return!0}}function Pxe(t,e){return e()}var Nxe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Pxe:Axe;F9.useSyncExternalStore=kd.useSyncExternalStore!==void 0?kd.useSyncExternalStore:Nxe;D9.exports=F9;var Ixe=D9.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.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 W_=A,Lxe=Ixe;function kxe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Oxe=typeof Object.is=="function"?Object.is:kxe,Dxe=Lxe.useSyncExternalStore,Fxe=W_.useRef,zxe=W_.useEffect,Uxe=W_.useMemo,Bxe=W_.useDebugValue;O9.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=Fxe(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Uxe(function(){function l(m){if(!c){if(c=!0,u=m,m=r(m),i!==void 0&&s.hasValue){var v=s.value;if(i(v,m))return f=v}return f=m}if(v=f,Oxe(u,m))return v;var x=r(m);return i!==void 0&&i(v,x)?v:(u=m,f=x)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,r,i]);var a=Dxe(t,o[0],o[1]);return zxe(function(){s.hasValue=!0,s.value=a},[a]),Bxe(a),a};k9.exports=O9;var jxe=k9.exports;const Vxe=$s(jxe),z9={BASE_URL:"/webxdiviewer/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_XDI_REPO_LOCATION:"jacobfilik/XASDataLibrary"},{useDebugValue:$xe}=Mt,{useSyncExternalStoreWithSelector:Wxe}=Vxe;let NO=!1;const Hxe=t=>t;function Gxe(t,e=Hxe,n){(z9?"production":void 0)!=="production"&&n&&!NO&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),NO=!0);const r=Wxe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return $xe(r),r}const IO=t=>{(z9?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?wxe(t):t,n=(r,i)=>Gxe(e,r,i);return Object.assign(n,e),n},Xxe=t=>t?IO(t):IO;var qxe=Object.defineProperty,Yxe=(t,e,n)=>e in t?qxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mp=(t,e,n)=>(Yxe(t,typeof e!="symbol"?e+"":e,n),n);const oP=A.createContext({}),Kxe=A.createContext(void 0),Zxe="_wrapper_9665499",Jxe="_grid_5146261",Qxe="_innerContainer_27a3adb",ebe="_colHeaders_a985f35",tbe="_rowHeaders_63b4056",nbe="_indexCell_080a16e",rbe="_stickyGrid_33fa7fa",ibe="_cell_2658e21",obe="_topLeftCell_e826718 _indexCell_080a16e",Mc={wrapper:Zxe,grid:Jxe,innerContainer:Qxe,colHeaders:ebe,rowHeaders:tbe,indexCell:nbe,stickyGrid:rbe,cell:ibe,topLeftCell:obe};function sbe(t){const{rowIndex:e,columnIndex:n,style:r}=t,{rowHeaderCellsWidth:i,cellSize:o,cellFormatter:s}=A.useContext(oP);return C.jsx("div",{className:Mc.cell,style:{...r,left:r.left+i,top:r.top+o.height},role:"cell","aria-rowindex":e,"aria-colindex":n,"data-bg":(e+n)%2===1||void 0,children:s(e,n)})}A.memo(sbe);function LO(t){const{indexMin:e,indexMax:n,width:r,transform:i,headers:o}=t,{cellSize:s}=A.useContext(oP);return F6(e,n+1).map(a=>C.jsx("div",{className:Mc.indexCell,style:{width:r||s.width,height:s.height,transform:i},"data-bg":a%2===1?"":void 0,children:a>=0&&o?o[a]:a},a.toString()))}const abe=A.forwardRef((t,e)=>{const{children:n,style:r}=t,{rowCount:i,columnCount:o,cellSize:s,sticky:a,rowHeaderCellsWidth:l,columnHeaders:c}=A.useContext(oP),u=A.useContext(Kxe),{overscanColumnStartIndex:f=0,overscanColumnStopIndex:h=0,overscanRowStartIndex:m=0,overscanRowStopIndex:v=0}=u||{};return C.jsxs("div",{ref:e,className:Mc.stickyGrid,style:{...r,width:r.width+l,height:r.height+s.height},role:"table","aria-rowcount":i,"aria-colcount":o,"data-sticky":a||void 0,children:[C.jsxs("div",{className:Mc.colHeaders,children:[C.jsx("div",{className:Mc.topLeftCell,style:{width:l,height:s.height},"data-bg":!0,"aria-hidden":"true"}),C.jsx(LO,{indexMin:f,indexMax:h,transform:`translateX(${s.width*f}px)`,headers:c})]}),C.jsxs("div",{className:Mc.innerContainer,children:[C.jsx("div",{className:Mc.rowHeaders,"aria-hidden":"true",children:C.jsx(LO,{indexMin:m,indexMax:v,transform:`translateY(${s.height*m}px)`,width:l})}),n]})]})});abe.displayName="StickyGrid";var _c=(t=>(t.Bool="Boolean",t.Integer="Integer",t.Unsigned="Integer (unsigned)",t.Float="Float",t.Complex="Complex",t.String="String",t.Compound="Compound",t.Array="Array",t.VLen="Array (variable length)",t.Enum="Enumeration",t.Time="Time",t.Bitfield="Bitfield",t.Opaque="Opaque",t.Reference="Reference",t.Unknown="Unknown",t))(_c||{}),Ht=(t=>(t.Linear="linear",t.Log="log",t.SymLog="symlog",t.Sqrt="sqrt",t.Gamma="gamma",t))(Ht||{}),jy=(t=>(t.Phase="phase",t.Amplitude="amplitude",t.PhaseAmplitude="phase-amplitude",t))(jy||{});Ht.Linear,Ht.Log,Ht.SymLog;Ht.Linear,Ht.Log,Ht.SymLog,Ht.Sqrt;const kO=Gs(".3~e"),ME=Gs(".5~e");Gs(".5~g");Gs(".3~g");fbe(".12~g");const sP=3,lbe=/0\.([0-9]+)$/u,cbe=Gs(`.${sP}~g`),ube=Gs(`.${sP}~e`);function EE(t){const e=cbe(t),n=lbe.exec(e);return n&&n[1].length>sP?ube(t):e}function fbe(t,e=!1){const n=Gs(t);return r=>{const[i,o]=r;if(o===0&&!e)return`${n(i)}`;if(i===0&&!e)return`${n(o)} i`;const s=Math.sign(o)>=0?" + ":" − ";return`${n(i)}${s}${n(Math.abs(o))} i`}}function $C(t){return vbe(t)?t.data:t}function CE(t,e){const{min:n,max:r,positiveMin:i,strictPositiveMin:o}=t;return{min:Math.min(e,n),max:Math.max(e,r),positiveMin:e>=0?Math.min(e,i):i,strictPositiveMin:e>0?Math.min(e,o):o}}function dbe(t,e,n){const r=$C(t),i=e&&$C(e);gbe(e,r.length,"error");const o=r.reduce((s,a,l)=>{if(!Number.isFinite(a)||n!=null&&n(a))return s;const c=CE(s,a),u=i==null?void 0:i[l];return u?CE(CE(c,a-u),a+u):c},{min:1/0,max:-1/0,positiveMin:1/0,strictPositiveMin:1/0});return Number.isFinite(o.min)?o:void 0}function hbe(t,e){if(t===void 0)return;const{min:n,max:r,positiveMin:i,strictPositiveMin:o}=t;return e===Ht.Log&&n*r<=0?Number.isFinite(o)?[o,r]:void 0:e===Ht.Sqrt&&n*r<0?[i,r]:[n,r]}function pbe(t){const[e,n]=t.shape;return{rows:e,cols:n}}function WC(t){return Array.isArray(t)?t:[t]}_c.Unsigned,_c.Integer,_c.Float,_c.String,_c.Bool,_c.Complex;function U9(t){return t!==void 0}function mbe(t){return t!==null}function Vy(t,e="Expected some value"){if(!U9(t))throw new TypeError(e)}function TE(t,e="Expected value to not be null"){if(!mbe(t))throw new TypeError(e)}function gbe(t,e,n){if(!t)return;const{length:r}=$C(t);if(r!==e)throw new Error(`Expected ${n} array to have length ${e} instead of ${r}`)}function vbe(t){return"data"in t}const ybe=new G(0,0,0);class qf extends Pr{get size(){const{x:e,y:n}=this.getSize(new G);return{width:e,height:n}}get center(){return this.getCenter(new G)}static empty(e=ybe){return new qf(e.clone(),e.clone())}static fromPoints(...e){return new qf().setFromPoints(e)}static fromSize({width:e,height:n}){return qf.empty().expandBySize(e,n)}clampPoint(e){return super.clampPoint(e,new G)}expandBySize(e,n){const{size:r}=this,i=e<0?Math.max(e,-r.width):e,o=n<0?Math.max(n,-r.height):n;return this.expandByVector(new G(i,o).divideScalar(2))}expandToRatio(e){if(e===void 0||e<=0)return this;const{width:n,height:r}=this.size,i=n/r;return e>i?this.expandBySize(r*e-n,0):this.expandBySize(0,n/e-r)}hasMinSize(e,n=e){const{width:r,height:i}=this.size;return r>=e&&i>=n}keepWithin(e){const{center:n,size:r}=this,{width:i,height:o}=e.size,s=qf.empty(e.center).expandBySize(Math.max(i-r.width,0),Math.max(o-r.height,0)).clampPoint(n).sub(n).setZ(0);return this.translate(s)}toRect(){return[this.min,this.max]}}const Dl=qf;function OO(t,e){const n=e-t;return r=>n!==0?(r-t)/n:.5}function B9(t){let e=(t==null?void 0:t.domain)||[0,1],n=(t==null?void 0:t.range)||[0,1],r=(t==null?void 0:t.exponent)??1,i=(t==null?void 0:t.clamp)||!1,o=Ad,s;const a=function(T){const L=typeof T=="number"?T:T.valueOf();return Number.isNaN(L)?s:o(...n)(OO(...e)(l(L))**r)};function l(T){if(!i)return T;const[L,U]=e;return Math.max(L,Math.min(U,T))}function c(T){return T?(e=T,N):[...e]}function u(T){return T?(n=T,N):[...n]}function f(T){return T?(n=T,o=kA,N):[...n]}function h(T){return T?(i=T,N):i}function m(){return s}function v(T){return T?(o=T,N):o}function x(T){return T?(r=T,N):r}function y(T){return l(Ad(...e)(OO(...n)(T)**(1/r)))}function g(){return upe({domain:e,range:n,exponent:r,clamp:i})}function b(T){return e=g().nice(T).domain(),N}function _(T){return g().ticks(T)}function S(T,L){return g().tickFormat(T,L)}function P(){return B9().domain(e).range(n).exponent(r).clamp(i).interpolate(o)}const N=Object.assign(a,{domain:c,range:u,rangeRound:f,clamp:h,interpolate:v,invert:y,unknown:m,exponent:x,nice:b,ticks:_,tickFormat:S,copy:P});return N}const xbe=0,aP=1e3,j9=aP,bbe=j9-aP,wi=bbe-1,_be=[.1,1],wbe={left:80,right:24,top:16,bottom:34},Sbe=28,DO=24;Ht.Linear+"",Ht.Log+"",Number.MIN_VALUE,Ht.SymLog+"",Ht.Sqrt+"",Ht.Gamma+"";const Mbe=BA({domain:[300,900],range:[3,10],clamp:!0,round:!0}),Ebe=BA({domain:[300,500],range:[.8,1.4]});function V9(t,e){if(Array.isArray(t)){const[,n]=t;return B9({...e,exponent:n})}switch(t){case Ht.Linear:return BA(e);case Ht.Log:return lpe(e);case Ht.SymLog:return dpe(e);case Ht.Sqrt:return ppe(e)}throw new Error("Unknown scale type")}function Cbe(t,e){const{width:n,height:r}=t;return e?n/r>e?{width:r*e,height:r}:{width:n,height:n/e}:{width:n,height:r}}function FO(t,e=Ht.Linear,n,r){const i=dbe(t,n,r);return hbe(i,e)}function Tbe(t,e=[-Number.MAX_VALUE/2,Number.MAX_VALUE/2]){const[n,r]=e;return IU.clamp(t,n,r)}function zO(t,e){const{scaleType:n,visDomain:r,flip:i,nice:o=!1}=t;return V9(n??Ht.Linear,{domain:r,range:[-e/2,e/2],reverse:i,nice:o})}function Rbe(t,e){const n=Math.min(...t),r=Math.max(...t),i=Math.ceil(n),o=Math.floor(r),s=o-i+1,a=Math.min(s,e);if(a===0)return[];const l=Math.max(D6(i,o,a),1),c=Math.ceil(n/l),u=Math.floor(r/l)-c+1;return Array.from({length:u},(f,h)=>(c+h)*l)}function Abe(t,e,n){if(n!==Ht.Log)return EE;const[r,i]=t[0]>0?t:[-t[1],-[t[0]]],o=Ebe(e);return i/r<10**o?EE:s=>{const a=Math.log10(Math.abs(s.valueOf()));return a===Math.floor(a)?EE(s):""}}function UO(t){const e=t.filter(U9);if(e.length!==0)return e.reduce((n,r)=>[Math.min(n[0],r[0]),Math.max(n[1],r[1])])}function $9(t,e,n){if(t==="auto")return;if(t==="equal")return $9(1,e,n);const[r,i]=e,[o,s]=n;return Math.abs(i-r)/Math.abs(s-o)/t}function Pbe(t={}){const{left:e,right:n,top:r,bottom:i}=wbe;return{left:e+(t.left?DO:0),right:n,top:r+(t.top?Sbe:0),bottom:i+(t.bottom?DO:0)}}const Nbe=` + varying vec2 coords; + + void main() { + coords = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } +`;function W9(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{value:n}]))}function H_(t,e=3,n=Float32Array){return new hn(new n(t*e),e)}function H9(t){return Object.keys(t).some(e=>/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/u.test(e))}const G9=A.createContext({});function Fn(){return A.useContext(G9)}function Ibe(t){const{visRatio:e,abscissaConfig:n,ordinateConfig:r,svgOverlay:i,floatingToolbar:o,children:s}=t,{width:a,height:l}=wr(D=>D.size),c={width:a,height:l},u=a/l,f=Cbe(c,e),h=A.useMemo(()=>Dl.empty().expandByPoint(new G(a,l)),[a,l]),m=zO(n,f.width),v=zO(r,f.height),x=A.useCallback(D=>new G(m(D.x),v(D.y)),[m,v]),y=A.useCallback(D=>new G(m.invert(D.x),v.invert(D.y)),[m,v]),g=A.useMemo(()=>new wt().makeScale(a/2,-l/2,1).setPosition(a/2,l/2,0),[a,l]),b=A.useMemo(()=>g.clone().invert(),[g]),_=A.useCallback((D,O)=>O.clone().project(D).applyMatrix4(g),[g]),S=A.useCallback((D,O)=>O.clone().applyMatrix4(b).unproject(D),[b]),P=A.useCallback((D,O)=>_(D,x(O)),[x,_]),N=A.useCallback((D,O)=>y(S(D,O)),[S,y]),T=A.useCallback((D,O=D.position)=>{const{scale:B}=D;return Dl.empty(O).expandBySize(a*B.x,l*B.y)},[a,l]),L=A.useCallback(D=>{const[O,B]=T(D).toRect().map(y);return{xVisibleDomain:[O.x,B.x],yVisibleDomain:[O.y,B.y]}},[T,y]),U=wr(D=>{var O;return(O=D.gl.domElement.parentElement)==null?void 0:O.parentElement});Vy(U),TE(U);const M=U.parentElement;TE(M);const R=M.parentElement;return TE(R),C.jsx(G9.Provider,{value:{canvasSize:c,canvasRatio:u,canvasBox:h,visRatio:e,visSize:f,abscissaConfig:n,ordinateConfig:r,abscissaScale:m,ordinateScale:v,dataToWorld:x,dataToHtml:P,worldToHtml:_,worldToData:y,htmlToWorld:S,htmlToData:N,getFovBox:T,getVisibleDomains:L,visCanvas:R,canvasArea:M,r3fRoot:U,svgOverlay:i,floatingToolbar:o},children:s})}var G_=(t=>(t[t.Left=0]="Left",t[t.Middle=1]="Middle",t))(G_||{});class Lbe{constructor(e,n){mp(this,"buttons"),mp(this,"modifierKeys"),mp(this,"isWheel"),mp(this,"isEnabled"),this.id=e;const{button:r=G_.Left,modifierKey:i=[],disabled:o=!1}=n;r==="Wheel"?(this.buttons=[],this.isWheel=!0):(this.buttons=WC(r),this.isWheel=!1),this.modifierKeys=WC(i),this.isEnabled=!o}matches(e){return this.isEnabled&&(e instanceof WheelEvent?this.isWheel:this.buttons.includes(e.button))&&this.modifierKeys.every(n=>e.getModifierState(n))}}const X9=A.createContext({});function kbe(){return A.useContext(X9)}function Obe(t){const{children:e}=t,[n]=A.useState(new Map),r=A.useCallback((s,a)=>{n.has(s)?console.warn(`An interaction with ID "${s}" is already registered.`):n.set(s,new Lbe(s,a))},[n]),i=A.useCallback(s=>{n.delete(s)},[n]),o=A.useCallback((s,a)=>{const l=[...n.values()];if(!n.has(s))throw new Error(`Interaction ${s} is not registered`);const c=l.filter(u=>u.matches(a));return c.length===0?!1:c.length===1?c[0].id===s:c.reduce((u,f)=>f.modifierKeys.length>u.modifierKeys.length?f:u).id===s},[n]);return C.jsx(X9.Provider,{value:{registerInteraction:r,unregisterInteraction:i,shouldInteract:o},children:e})}const BO=.95,jO=new G(1,1,1),Dbe=["Alt","Control","Shift"];function Ng(){const{visSize:t,getFovBox:e}=Fn(),n=wr(i=>i.camera),r=wr(i=>i.invalidate);return A.useCallback(i=>{const{position:o}=n,s=Dl.fromSize(t),a=e(n,i).keepWithin(s);o.copy(a.center.setZ(o.z)),n.updateMatrixWorld(),r()},[n,t,e,r])}function q9(){const{canvasSize:t}=Fn(),e=wr(r=>r.camera),n=Ng();return A.useCallback(({world:r})=>{const{width:i,height:o}=t,s=Dl.fromPoints(...r),{width:a,height:l}=s.size;e.scale.set(Math.max(a,1)/i,Math.max(l,1)/o,1),n(s.center)},[e,t,n])}function lP(){const{canvasArea:t}=Fn();Bc(t,"wheel",e=>e.preventDefault(),{passive:!1})}function cP(t){const e=wr(r=>r.camera),n=Ng();return function(r){const{sourceEvent:i,worldPt:o}=r,{x:s,y:a}=t(i);if(!s&&!a)return;const l=new G(s?BO:1,a?BO:1,1);i.deltaY<0?e.scale.multiply(l).min(jO):e.scale.divide(l).min(jO);const c=e.position.clone().sub(o);i.deltaY<0?c.multiply(l):c.divide(l),n(o.clone().add(c))}}function Sa(t,e,n={}){const r=gr(e),i=wr(c=>c.camera),{htmlToWorld:o,worldToData:s,canvasArea:a}=Fn();function l(c){const{offsetX:u,offsetY:f}=c,h=new G(u,f),m=o(i,h),v=s(m);r.current({htmlPt:h,worldPt:m,dataPt:v,sourceEvent:c})}Bc(a,t,l,n)}function Ig(t,e){const{shouldInteract:n,registerInteraction:r,unregisterInteraction:i}=kbe();return A.useEffect(()=>(r(t,e),()=>i(t)),[t,r,i,e]),A.useCallback(o=>n(t,o),[t,n])}function Y9(t=[]){const{canvasArea:e}=Fn(),n=WC(t),[r]=A.useState(new Map),[i,o]=Kb(!1);function s(){const a=n.every(l=>r.get(l));i!==a&&o(a)}return Bc(window,"keyup",a=>{const{key:l}=a;r.set(l,!1),s()}),Bc(window,"keydown",a=>{const{key:l}=a;r.set(l,!0),s()}),Bc(e,"pointerdown",a=>{Dbe.forEach(l=>{r.set(l,a.getModifierState(l))}),s()}),i}function Fbe(t){const{id:e="Pan",button:n=G_.Left,modifierKey:r,disabled:i}=t,o=Ig(e,{button:n,modifierKey:r,disabled:i}),s=wr(m=>m.camera),a=Ng(),l=A.useRef(),c=Y9(r);function u(m){const{worldPt:v,sourceEvent:x}=m,{target:y,pointerId:g}=x;o(x)&&(y.setPointerCapture(g),l.current=v.clone())}function f(m){if(!l.current||!c)return;const{worldPt:v}=m,x=l.current.clone().sub(v);a(s.position.clone().add(x))}function h(m){const{sourceEvent:v}=m,{target:x,pointerId:y}=v;x.releasePointerCapture(y),l.current=void 0}return Sa("pointerdown",u),Sa("pointermove",f),Sa("pointerup",h),null}function K9(t){const{id:e="Selection",modifierKey:n,disabled:r,transform:i=ee=>ee,validate:o=()=>!0,onSelectionStart:s,onSelectionChange:a,onSelectionEnd:l,onValidSelection:c,children:u}=t,f=gr(i),h=gr(o),m=gr(s),v=gr(a),x=gr(l),y=gr(c),g=wr(ee=>ee.camera),b=Fn(),{canvasBox:_,htmlToWorld:S,worldToData:P}=b,[N,T]=Sne(),L=A.useRef(),U=A.useRef(!1),M=Y9(n),R=Ig(e,{button:G_.Left,modifierKey:n,disabled:r});function D(ee,me=ee){const le=[ee,_.clampPoint(me)],Q=le.map(ge=>S(g,ge)),ae=Q.map(P);return{html:le,world:Q,data:ae}}function O(ee){const{sourceEvent:me}=ee;if(!R(me))return;const{target:le,pointerId:Q}=me;le.setPointerCapture(Q),L.current=ee,T(D(ee.htmlPt))}function B(ee){const{current:me}=L;me&&T(D(me.htmlPt,ee.htmlPt))}function X(ee){if(!L.current)return;const{sourceEvent:me}=ee,{target:le,pointerId:Q}=me;le.releasePointerCapture(Q),L.current=void 0,U.current=R(me),T(void 0)}Sa("pointerdown",O),Sa("pointermove",B),Sa("pointerup",X);function H(){L.current=void 0,T(void 0)}k6("Escape",H,[],{event:"keydown"}),Bc(window,"contextmenu",ee=>{L.current&&(ee.preventDefault(),H())});const Z=A.useMemo(()=>N&&f.current(N,g,b),[N,f,g,b]),F=A.useMemo(()=>!!Z&&h.current(Z),[Z,h]),Y=R4(Z),K=R4(F);return A.useEffect(()=>{var ee,me,le,Q;if(Z){Vy(N),Y||(ee=m.current)==null||ee.call(m),(me=v.current)==null||me.call(v,M?Z:void 0,N,F);return}Y&&(Vy(K),(le=x.current)==null||le.call(x,U.current?Y:void 0,K),K&&U.current&&((Q=y.current)==null||Q.call(y,Y)),U.current=!1)},[Z,Y,N,F,K,M,m,v,x,y]),!Z||!M?null:(Vy(N),u(Z,N,F))}const zbe="_selection_0f4643e",HC={selection:zbe};function X_(t){const{overflowCanvas:e=!1,children:n}=t,{r3fRoot:r,canvasArea:i}=Fn(),o=e?i:r,[s]=A.useState(()=>{const l=document.createElement("div");return l.setAttribute("hidden",""),l}),[a]=A.useState(()=>XT(s));return A.useLayoutEffect(()=>{a.render(Bl.createPortal(n,o))},[n,o,a]),A.useLayoutEffect(()=>(r.append(s),()=>{a.unmount(),s.remove()}),[r,a,s]),null}function Z9(t){const{children:e}=t,{svgOverlay:n}=Fn();return n?C.jsx(X_,{children:Bl.createPortal(e,n)}):null}function GC(t){const{coords:e,strokePosition:n,...r}=t,{stroke:i,strokeWidth:o=1}=r,s=i&&n?o*(n==="outside"?1:-1):0,{min:a,max:l}=Dl.fromPoints(...e).expandBySize(s,s);return C.jsx("path",{d:`M ${a.x},${a.y} H ${l.x} V ${l.y} H ${a.x} z`,...r})}const Ube=20;function Bbe(t){const{minZoom:e=Ube,...n}=t,{canvasSize:r,canvasRatio:i,canvasBox:o,visRatio:s,visSize:a,htmlToWorld:l,worldToData:c}=Fn(),u=q9(),f=wr(v=>v.camera),h=s!==void 0;function m(v){if(!h)return v;const{scale:x}=f,y=Dl.empty(new G(r.width/2,r.height/2)).expandBySize(a.width/x.x,a.height/x.y),g=Dl.fromPoints(...v.html).expandToRatio(i).keepWithin(o).keepWithin(y).toRect(),b=g.map(S=>l(f,S)),_=b.map(c);return{html:g,world:b,data:_}}return C.jsx(K9,{id:"SelectToZoom",transform:m,validate:({html:v})=>v[0].manhattanDistanceTo(v[1])>=e,onValidSelection:u,...n,children:({html:v},{html:x},y)=>C.jsxs(Z9,{children:[C.jsx(GC,{className:HC.selection,coords:x,fill:"white",fillOpacity:!h&&y?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:h||!y?4:void 0}),h&&C.jsx(GC,{className:HC.selection,coords:v,fill:"white",fillOpacity:y?.25:0,stroke:"black",strokePosition:"inside"})]})})}function jbe(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=Fn(),i=Ig("XAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=s=>({x:i(s),y:!1});return lP(),Sa("wheel",cP(o)),null}function Vbe(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=Fn(),i=Ig("YAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=s=>({x:!1,y:i(s)});return lP(),Sa("wheel",cP(o)),null}function $be(t){const{modifierKey:e,disabled:n}=t,r=Ig("Zoom",{button:"Wheel",modifierKey:e,disabled:n}),i=o=>{const s=r(o);return{x:s,y:s}};return lP(),Sa("wheel",cP(i)),null}function Wbe(t){const{axis:e,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,children:o,...s}=t;function a(l,c,u){const{canvasSize:f,htmlToWorld:h,worldToData:m}=u,{width:v,height:x}=f,[y,g]=l.html,b=e==="x"?[new G(y.x,0),new G(g.x,x)]:[new G(0,y.y),new G(v,g.y)],_=b.map(P=>h(c,P)),S=_.map(m);return{html:b,world:_,data:S}}return C.jsx(K9,{transform:a,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,...s,children:o})}const Hbe=20;function VO(t){const{axis:e,modifierKey:n,disabled:r,minZoom:i=Hbe}=t,{visRatio:o}=Fn(),s=q9();return C.jsx(Wbe,{axis:e,id:`${e.toUpperCase()}SelectToZoom`,modifierKey:n,disabled:o!==void 0||r,validate:({html:a})=>Dl.fromPoints(...a).hasMinSize(i),onValidSelection:s,children:({html:a},l,c)=>C.jsx(Z9,{children:C.jsx(GC,{className:HC.selection,coords:a,fill:"white",fillOpacity:c?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:c?void 0:4})})})}function Gbe(t){const{...e}=t;return C.jsxs(C.Fragment,{children:[e.pan!==!1&&C.jsx(Fbe,{...e.pan}),e.zoom!==!1&&C.jsx($be,{...e.zoom}),e.xAxisZoom!==!1&&C.jsx(jbe,{modifierKey:"Alt",...e.xAxisZoom}),e.yAxisZoom!==!1&&C.jsx(Vbe,{modifierKey:"Shift",...e.yAxisZoom}),e.selectToZoom!==!1&&C.jsx(Bbe,{modifierKey:"Control",...e.selectToZoom}),e.xSelectToZoom!==!1&&C.jsx(VO,{axis:"x",modifierKey:["Control","Alt"],...e.xSelectToZoom}),e.ySelectToZoom!==!1&&C.jsx(VO,{axis:"y",modifierKey:["Control","Shift"],...e.ySelectToZoom})]})}function Xbe(t){return(...e)=>A.useMemo(()=>t(...e),e)}function J9(t,e,n=(r,i)=>Object.is(r,i)){const r=wr(a=>a.camera),i=L6(),o=A.useRef(),s=gr(t);return A.useMemo(()=>{o.current=s.current(r)},e),TA(()=>{const a=s.current(r);n(o.current,a)||(o.current=a,i())}),o.current}function Lx(t,e,n,r=!1){const i=A.useMemo(()=>new t(e),[t,e]),o=wr(s=>s.invalidate);return A.useLayoutEffect(()=>{if(n){i.prepare(n);for(let s=0;s{s.needsUpdate=!0}),i.index&&(i.index.needsUpdate=!0),o()}},[i,...Object.values(n||{}),o]),i}function qbe(t){const{children:e}=t,{floatingToolbar:n}=Fn();return n?C.jsx(X_,{children:Bl.createPortal(e,n)}):null}const Ybe="_btnLike_0154b53",Kbe="_icon_bcb8f77",Zbe="_label_5a75092",Jbe="_popup_954b735",Qbe="_btn_f1cebe5 btnClean",uP={btnLike:Ybe,icon:Kbe,label:Zbe,popup:Jbe,btn:Qbe},{btn:e_e,btnLike:t_e}=uP,n_e=`_btn_579cee1 ${e_e}`,r_e=`_btnLike_5797793 ${t_e}`,$O={btn:n_e,btnLike:r_e};function i_e(){const t=wr(i=>i.camera),e=wr(i=>i.invalidate),n=J9(({scale:i})=>i.x<1||i.y<1,[]);function r(){t.scale.x=1,t.scale.y=1,t.position.x=0,t.position.y=0,t.updateMatrixWorld(),e()}return C.jsx(qbe,{children:C.jsx("button",{className:$O.btn,type:"button",hidden:!n,onClick:()=>r(),children:C.jsx("span",{className:$O.btnLike,children:"Reset zoom"})})})}function Q9(t){const{children:e,style:n,className:r}=t,{canvasSize:i}=Fn();return C.jsx(X_,{overflowCanvas:!0,children:C.jsx("div",{className:r,style:{position:"absolute",top:0,left:0,...i,...n},children:e})})}const o_e="_overlay_df4a4fe",s_e="_tooltip_c303daa",a_e="_guides_073d0c4",RE={overlay:o_e,tooltip:s_e,guides:a_e};function l_e(t){const{tooltipOpen:e,tooltipLeft:n,tooltipTop:r,guides:i,children:o}=t,{canvasSize:s}=Fn(),{width:a,height:l}=s;return C.jsx(Q9,{className:RE.overlay,children:e&&o&&C.jsxs(C.Fragment,{children:[C.jsx(Tpe,{className:RE.tooltip,top:r,left:n,unstyled:!0,applyPositionStyle:!0,children:o},Math.random()),i&&C.jsxs("svg",{className:RE.guides,children:[i!=="horizontal"&&C.jsx(Sx,{from:{x:n,y:0},to:{x:n,y:l}}),i!=="vertical"&&C.jsx(Sx,{from:{x:0,y:r},to:{x:a,y:r}})]})]})})}function e7(t){const{children:e,size:n,...r}=t,{visSize:i}=Fn(),{width:o,height:s}=n??i;return C.jsxs("mesh",{...r,children:[C.jsx("planeGeometry",{args:[o,s]}),e]})}function c_e(t){const{guides:e,renderTooltip:n,size:r}=t,{canvasSize:i,worldToData:o}=Fn(),{width:s,height:a}=i,{tooltipOpen:l,tooltipTop:c,tooltipLeft:u,tooltipData:f,showTooltip:h,hideTooltip:m}=ype(),v=A.useCallback(_=>{const{unprojectedPoint:S,nativeEvent:P}=_;if(P.buttons!==0)return;const N=o(S);h({tooltipLeft:P.offsetX,tooltipTop:P.offsetY,tooltipData:[N.x,N.y]})},[o,h]),x=A.useCallback(()=>{l&&m()},[m,l]),y=A.useCallback(()=>m(),[m]),g=A.useCallback(_=>{const{nativeEvent:S}=_,{offsetX:P,offsetY:N}=S;P>=0&&P<=s&&N>=0&&N<=a&&v(_)},[a,v,s]),b=f&&n(...f);return C.jsxs(C.Fragment,{children:[C.jsx(e7,{onPointerMove:v,onPointerOut:x,onPointerDown:y,onPointerUp:g,size:r,children:C.jsx("meshBasicMaterial",{opacity:0,transparent:!0})}),C.jsx(l_e,{tooltipOpen:l,tooltipLeft:u,tooltipTop:c,guides:e,children:b})]})}const u_e="_axis_1002b06",f_e="_grid_a397f58",d_e="_tick_44c4d9c",h_e="_label_4a1d111",kx={axis:u_e,grid:f_e,tick:d_e,label:h_e};function p_e(t){const{formattedValue:e,...n}=t;return C.jsx("text",{...n,dy:"0.3125em",children:e})}const m_e={labelClassName:kx.label,labelProps:{fontSize:"inherit"},tickClassName:kx.tick,tickComponent:p_e},g_e={abscissa:[ove,c9],ordinate:[tve,l9]};function WO(t){const{type:e,config:n,domain:r,canvasSize:i,offset:o,flipAxis:s,showAxis:a}=t,{width:l,height:c}=i,u=e==="abscissa",f=u?l:c,{scaleType:h=Ht.Linear,isIndexAxis:m,showGrid:v,label:x,nice:y=!1}=n,g=V9(h,{domain:r,range:s?[f,0]:[0,f],nice:y}),[b,_]=g_e[e],S=Mbe(f),P=m?{tickValues:Rbe(r,S)}:{numTicks:S};return C.jsxs(C.Fragment,{children:[a&&C.jsx("svg",{className:kx.axis,"data-type":e,style:u?{width:l,height:o}:{width:o,height:c},children:C.jsx(b,{scale:g,tickFormat:Abe(r,f,h),label:x,labelOffset:o-(u?32:36),hideAxisLine:v,...P,...m_e})}),v&&C.jsx("svg",{className:kx.grid,...i,children:C.jsx(_,{scale:g,...i,...P})})]})}function v_e(t){const{axisOffsets:e,showAxes:n}=t,{canvasSize:r,visCanvas:i,abscissaConfig:o,ordinateConfig:s,getVisibleDomains:a}=Fn(),l=J9(a,[a]);return C.jsx(X_,{children:Bl.createPortal(C.jsxs(C.Fragment,{children:[C.jsx(WO,{type:"abscissa",config:o,domain:l.xVisibleDomain,canvasSize:r,offset:e.bottom,showAxis:n}),C.jsx(WO,{type:"ordinate",config:s,domain:l.yVisibleDomain,canvasSize:r,offset:e.left,showAxis:n,flipAxis:!0})]}),i)})}function y_e(t){const{className:e,orthographic:n,children:r}=t;return C.jsxs(Rde,{className:e,orthographic:n,flat:!0,frameloop:"demand",dpr:[1,3],resize:{debounce:{scroll:20,resize:200},scroll:!1},gl:{preserveDrawingBuffer:!0},camera:{near:xbe,far:aP,position:[0,0,j9]},children:[C.jsx("ambientLight",{}),r]})}function x_e(){const{visRatio:t}=Fn(),e=wr(r=>r.camera),n=Ng();return A.useEffect(()=>{if(!t||e.scale.x===e.scale.y)return;const r=Math.max(e.scale.x,e.scale.y);e.scale.x=r,e.scale.y=r,n(e.position)},[e,n,t]),null}function b_e(t){const{value:e}=t,n=wr(i=>i.raycaster),r=wr(i=>i.camera);return A.useEffect(()=>{const i=n.params.Points,o=i?i.threshold:1;return i&&(i.threshold=e),()=>{i&&(i.threshold=o)}},[n,e]),TA(()=>{const i=(r.scale.x+r.scale.y)/2;n.params.Points&&(n.params.Points.threshold=e*i/2)}),null}function __e(){const{dataToWorld:t,worldToData:e}=Fn(),n=A.useRef(),r=wr(o=>o.camera),i=Ng();return TA(()=>{n.current=e(r.position)}),A.useEffect(()=>{n.current&&i(t(n.current))},[n,i,t,r]),null}const w_e="_visCanvas_2387375",S_e="_title_313417a",M_e="_canvasArea_6300bb7",E_e="_r3fRoot_f557f0c",C_e="_svgOverlay_3f84e2f",T_e="_floatingToolbar_de4854e",xf={visCanvas:w_e,title:S_e,canvasArea:M_e,r3fRoot:E_e,svgOverlay:C_e,floatingToolbar:T_e},R_e={left:0,right:0,top:0,bottom:0};function A_e(t){const{title:e,aspect:n="auto",abscissaConfig:r,ordinateConfig:i,raycasterThreshold:o,showAxes:s=!0,children:a}=t,l=$9(n,r.visDomain,i.visDomain),c=s?Pbe({left:!!i.label,bottom:!!r.label,top:!!e}):R_e,[u,f]=A.useState(null),[h,m]=A.useState(null);return C.jsxs("div",{className:xf.visCanvas,style:{gridTemplateColumns:`${c.left}px minmax(0, 1fr) ${c.right}px`,gridTemplateRows:`${c.top}px minmax(0, 1fr) ${c.bottom}px`},children:[s&&e&&C.jsx("p",{className:xf.title,children:e}),C.jsxs("div",{className:xf.canvasArea,children:[C.jsx(y_e,{className:xf.r3fRoot,orthographic:!0,children:C.jsxs(Ibe,{visRatio:l,abscissaConfig:r,ordinateConfig:i,svgOverlay:u,floatingToolbar:h,children:[C.jsx(v_e,{axisOffsets:c,showAxes:s}),C.jsx(Obe,{children:a}),C.jsx(__e,{}),C.jsx(x_e,{}),o!==void 0&&C.jsx(b_e,{value:o})]})}),C.jsx("svg",{ref:f,className:xf.svgOverlay,overflow:"hidden"})]}),C.jsx("div",{ref:m,className:xf.floatingToolbar})]})}class P_e extends zt{constructor(){super(...arguments),mp(this,"params")}prepare(e){this.params=e}}const q_=P_e;class N_e extends q_{constructor(e){super(),this.setAttribute("position",H_(e*2))}update(e){const{abscissas:n,ordinates:r,errors:i,abscissaScale:o,ordinateScale:s,ignoreValue:a}=this.params,l=r[e],c=a?a(l):!1,u=e*2;if(c){this.attributes.position.setXYZ(u,0,0,wi),this.attributes.position.setXYZ(u+1,0,0,wi);return}const f=o(n[e]),h=s(l);if(!Number.isFinite(f)||!Number.isFinite(h)){this.attributes.position.setXYZ(u,0,0,wi),this.attributes.position.setXYZ(u+1,0,0,wi);return}const m=i[e],v=s(l-m),x=s(l+m),y=Number.isFinite(v)?v:h,g=Number.isFinite(x)?x:h;this.attributes.position.setXYZ(u,f,y,0),this.attributes.position.setXYZ(u+1,f,g,0)}}const I_e=N_e;class L_e extends q_{constructor(e){super(),this.setAttribute("position",H_(e*2))}update(e){const{abscissas:n,ordinates:r,errors:i,abscissaScale:o,ordinateScale:s,ignoreValue:a}=this.params,l=r[e],c=a?a(l):!1,u=e*2;if(c){this.attributes.position.setXYZ(u,0,0,wi),this.attributes.position.setXYZ(u+1,0,0,wi);return}const f=o(n[e]),h=s(l);if(!Number.isFinite(f)||!Number.isFinite(h)){this.attributes.position.setXYZ(u,0,0,wi),this.attributes.position.setXYZ(u+1,0,0,wi);return}const m=i[e],v=s(l-m),x=s(l+m);Number.isFinite(v)?this.attributes.position.setXYZ(u,f,v,0):this.attributes.position.setXYZ(u,0,0,wi),Number.isFinite(x)?this.attributes.position.setXYZ(u+1,f,x,0):this.attributes.position.setXYZ(u+1,0,0,wi)}}const k_e=L_e;var $p=(t=>(t.LineOnly="OnlyLine",t.GlyphsOnly="OnlyGlyphs",t.LineAndGlyphs="LineAndGlyphs",t))($p||{}),gl=(t=>(t.Circle="Circle",t.Cross="Cross",t.Square="Square",t.Cap="Cap",t))(gl||{});const O_e={[gl.Cross]:` + float alphaSymbol(vec2 coord, float size) { + vec2 pos = floor(size * coord) + 0.5; + vec2 d_x = abs(pos.x + vec2(- pos.y, pos.y - size)); + if (min(d_x.x, d_x.y) <= 0.5) { + return 1.0; + } else { + return 0.0; + } + } + `,[gl.Cap]:` + float alphaSymbol(vec2 coord, float size) { + float dy = abs(size * (coord.y - 0.5)); + if (dy < 0.5) { + return 1.0; + } else { + return 0.0; + } + } + `,[gl.Circle]:` + float alphaSymbol(vec2 coord, float size) { + float r = distance(coord, vec2(0.5, 0.5)); + if( r < 0.5) { + return 1.0; + } else { + return 0.0; + } + } + `,[gl.Square]:` + float alphaSymbol(vec2 coord, float size) { + return 1.0; + } + `};function t7(t){const{color:e,size:n,glyphType:r}=t,i=!e,o={uniforms:W9({size:n,color:new ot(e)}),vertexShader:` + ${e?"uniform vec3 color;":""} + uniform float size; + varying vec3 vertexColor; + + void main() { + gl_PointSize = size; + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + vertexColor = color; + } + `,fragmentShader:` + uniform float size; + varying vec3 vertexColor; + + ${O_e[r]} + + void main() { + float alpha = alphaSymbol(gl_PointCoord, size); + if (alpha <= 0.0) { + discard; + } else { + gl_FragColor = vec4(vertexColor.rgb, alpha); + } + } + `};return C.jsx("shaderMaterial",{args:[o],vertexColors:i})}function D_e(t){const{abscissas:e,ordinates:n,errors:r,color:i,visible:o,ignoreValue:s}=t,{abscissaScale:a,ordinateScale:l}=Fn(),c=o&&{abscissas:e,ordinates:n,errors:r,abscissaScale:a,ordinateScale:l,ignoreValue:s},u=Lx(I_e,n.length,c),f=Lx(k_e,n.length,c);return C.jsxs(C.Fragment,{children:[C.jsx("lineSegments",{geometry:u,visible:o,children:C.jsx("lineBasicMaterial",{color:i})}),C.jsx("points",{geometry:f,visible:o,children:C.jsx(t7,{glyphType:gl.Cap,color:i,size:9})})]})}class F_e extends q_{constructor(e){super(),this.setAttribute("position",H_(e))}update(e){const{abscissas:n,ordinates:r,abscissaScale:i,ordinateScale:o,ignoreValue:s}=this.params,a=r[e];if(s&&s(a)){this.attributes.position.setXYZ(e,0,0,wi);return}const l=i(n[e]),c=o(a);if(!Number.isFinite(l)||!Number.isFinite(c)){this.attributes.position.setXYZ(e,0,0,wi);return}this.attributes.position.setXYZ(e,l,c,0)}}const z_e=F_e;function U_e(t){const{abscissas:e,ordinates:n,glyphType:r=gl.Cross,color:i,size:o=6,visible:s=!0,ignoreValue:a,...l}=t,{abscissaScale:c,ordinateScale:u}=Fn(),f=Lx(z_e,n.length,s&&{abscissas:e,ordinates:n,abscissaScale:c,ordinateScale:u,ignoreValue:a},H9(l));return C.jsx("points",{geometry:f,visible:s,...l,children:C.jsx(t7,{glyphType:r,color:i,size:o})})}class B_e extends q_{constructor(e){super(),this.setAttribute("position",H_(e))}update(e){const{abscissas:n,ordinates:r,abscissaScale:i,ordinateScale:o,ignoreValue:s}=this.params,a=r[e];if(s&&s(a)){this.attributes.position.setXYZ(e,0,0,wi);return}const l=i(n[e]),c=o(a);if(!Number.isFinite(l)||!Number.isFinite(c)){this.attributes.position.setXYZ(e,0,0,wi);return}this.attributes.position.setXYZ(e,l,c,0)}}const j_e=B_e;class V_e extends La{}qB({Line_:V_e});function $_e(t){const{abscissas:e,ordinates:n,color:r,visible:i=!0,ignoreValue:o,...s}=t,{abscissaScale:a,ordinateScale:l}=Fn(),c=Lx(j_e,n.length,i&&{abscissas:e,ordinates:n,abscissaScale:a,ordinateScale:l,ignoreValue:o},H9(s));return C.jsx("line_",{geometry:c,visible:i,...s,children:C.jsx("lineBasicMaterial",{color:r})})}function W_e(t){const{abscissas:e,ordinates:n,errors:r,showErrors:i,color:o,curveType:s=$p.LineOnly,glyphType:a=gl.Cross,glyphSize:l=6,visible:c=!0,onDataPointClick:u,onDataPointEnter:f,onDataPointLeave:h,ignoreValue:m}=t,v=A.useCallback(g=>{const{index:b}=g;u&&b!==void 0&&u(b,g)},[u]),x=A.useCallback(g=>{const{index:b}=g;f&&b!==void 0&&f(b,g)},[f]),y=A.useCallback(g=>{const{index:b}=g;h&&b!==void 0&&h(b,g)},[h]);return C.jsxs(C.Fragment,{children:[C.jsx($_e,{abscissas:e,ordinates:n,color:o,ignoreValue:m,visible:s!==$p.GlyphsOnly&&c}),C.jsx(U_e,{abscissas:e,ordinates:n,glyphType:a,color:o,size:l,ignoreValue:m,visible:s!==$p.LineOnly&&c,onClick:u&&v,onPointerEnter:f&&x,onPointerLeave:h&&y}),r&&C.jsx(D_e,{abscissas:e,ordinates:n,errors:r,color:o,ignoreValue:m,visible:c&&i})]})}var Yf=(t=>(t.MinGreater="min-greater",t.InvalidMinWithScale="invalid-min-with-scale",t.InvalidMaxWithScale="invalid-max-with-scale",t.CustomMaxFallback="custom-max-fallback",t))(Yf||{});function H_e(t){return yx(t*360,1,.5).formatRgb()}function bf(t){return e=>t(1-e)}const G_e={Blues:bf(iye),Greens:bf(sye),Greys:bf(lye),Oranges:bf(pye),Purples:bf(uye),Reds:bf(dye),Turbo:Sye,Viridis:Mye,Inferno:Cye,Magma:Eye,Plasma:Tye,Cividis:mye,Warm:vye,Cool:yye,Cubehelix:gye,BuGn:kve,BuPu:Dve,GnBu:zve,OrRd:Bve,PuBuGn:Vve,PuBu:Wve,PuRd:Gve,RdPu:qve,YlGnBu:Kve,YlGn:Jve,YlOrBr:eye,YlOrRd:nye,Rainbow:xye,Sinebow:wye,HSL:H_e,BrBG:gve,PRGn:yve,PiYG:bve,PuOr:wve,RdBu:Mve,RdGy:Cve,RdYlBu:Rve,RdYlGn:Pve,Spectral:Ive},HO=1/20;F6(0,1+HO,HO);const X_e={[Ht.Linear]:t=>t,[Ht.Log]:Math.log10,[Ht.SymLog]:t=>Math.sign(t)*Math.log10(1+Math.abs(t)),[Ht.Sqrt]:Math.sqrt,[Ht.Gamma]:t=>t},q_e={float32:ai,uint16:xu,uint8:Fi,uint8_clamped:Fi};function Y_e(t,e){const n=G_e[t];return e?r=>n(1-r):n}function K_e(t,e=Ht.Linear){const n=X_e[e];return[n(t[0]),n(t[1])]}function Z_e(t,e=lr){if(!t)return;const{rows:n,cols:r}=pbe(t),i=new No(t.data,r,n,fg,q_e[t.dtype],ug,Ti,Ti,e);return i.needsUpdate=!0,i}const AE=Xbe(Z_e),J_e=Il(255,255,255,0),PE=256,Q_e={[Ht.Log]:"log(value) * oneOverLog10",[Ht.SymLog]:"sign(value) * log(1. + abs(value)) * oneOverLog10",[Ht.Sqrt]:"sqrt(value)"},ewe={[Ht.Log]:"value > 0.",[Ht.Sqrt]:"value >= 0."};function twe(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o=!1,magFilter:s,alphaValues:a,alphaDomain:l=_be,badColor:c=J_e,mask:u}=t,f=AE(e,s),h=AE(a),m=AE(u),v=A.useMemo(()=>{const S=Y_e(i,o),P=Array.from({length:PE}).flatMap((T,L)=>{const{r:U,g:M,b:R}=Il(S(L/(PE-1)));return[U,M,R,255]}),N=new No(Uint8Array.from(P),PE,1,Rr,Fi);return N.needsUpdate=!0,N},[i,o]),[x,y]=Array.isArray(r)?r:[r,1],g=K_e(n,x),b=typeof c=="string"?Il(c):c,_={uniforms:W9({data:f,mask:m,colorMap:v,min:g[0],oneOverRange:1/(g[1]-g[0]),gammaExponent:y,normRevertFactor:e.dtype==="uint8"?255:1,alpha:h,withAlpha:a?1:0,alphaMin:l[0],oneOverAlphaRange:1/(l[1]-l[0]),badColor:new Zt(b.r/255,b.g/255,b.b/255,b.opacity)}),vertexShader:Nbe,fragmentShader:` + uniform sampler2D data; + uniform sampler2D colorMap; + + uniform float min; + uniform float oneOverRange; + uniform float gammaExponent; + uniform float normRevertFactor; + + uniform sampler2D alpha; + uniform float alphaMin; + uniform float oneOverAlphaRange; + uniform int withAlpha; + uniform vec4 badColor; + + uniform sampler2D mask; + + const float oneOverLog10 = 0.43429448190325176; + + varying vec2 coords; + + bool isSupported(float value) { + return ${ewe[x]||"true"}; + } + + float scale(float value) { + return ${Q_e[x]||"value"}; + } + + void main() { + float value = texture2D(data, coords).r * normRevertFactor; + float maskValue = texture2D(mask, coords).r; + + if (isnan(value) || !isSupported(value) || maskValue == 1.) { + gl_FragColor = badColor; + } else { + float scaledValue = scale(value); + float normalizedValue = clamp(oneOverRange * (scaledValue - min), 0., 1.); + + gl_FragColor = texture2D(colorMap, vec2(pow(normalizedValue, gammaExponent), 0.5)); + + if (withAlpha == 1) { + gl_FragColor.a = oneOverAlphaRange * (texture2D(alpha, coords).r - alphaMin); + } + } + } + `};return C.jsx("shaderMaterial",{args:[_],side:Qo})}const nwe=A.memo(twe);function rwe(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:s,alphaValues:a,alphaDomain:l,badColor:c,mask:u,...f}=t;return C.jsx(e7,{...f,children:C.jsx(nwe,{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:s,alphaValues:a,alphaDomain:l,badColor:c,mask:u})})}const{btn:iwe,btnLike:owe,icon:swe,label:awe,popup:lwe}=uP,cwe="_toolbar_d77010c",uwe="_controls_6f2898a",fwe="_controlWrapper_c53184f",dwe="_control_72c50d3",hwe="_sep_9963159",pwe="_arrowIcon_52a7a56",mwe="_menu_9a962f8",gwe="_btnOption_14b8d45 btnClean",vwe=`_btn_ea88005 ${iwe}`,ywe=`_btnLike_059b9d6 ${owe}`,xwe=`_icon_b73dfea ${swe}`,bwe=`_label_917dfbf ${awe}`,_we=`_popup_486e2ed ${lwe}`,Ei={toolbar:cwe,controls:uwe,controlWrapper:fwe,control:dwe,sep:hwe,arrowIcon:pwe,menu:mwe,btnOption:gwe,btn:vwe,btnLike:ywe,icon:xwe,label:bwe,popup:_we},wwe=A.forwardRef((t,e)=>{const{label:n,icon:r,iconOnly:i,small:o,raised:s,withArrow:a,disabled:l,...c}=t;return C.jsx("button",{ref:e,className:Ei.btn,type:"button",title:i?n:void 0,"aria-label":i?n:void 0,disabled:l,"data-small":o||void 0,"data-raised":s||void 0,...c,children:C.jsxs("span",{className:Ei.btnLike,children:[r&&C.jsx(r,{className:Ei.icon}),!i&&C.jsx("span",{className:Ei.label,children:n}),a&&C.jsx(R9,{className:Ei.arrowIcon})]})})}),fP=wwe,qc=6,Swe=320;function Mwe(){const[t,e]=Kb();return nP({open:t,middleware:[JA(qc),p1e({padding:qc*2,apply({availableHeight:n,elements:r,rects:i}){Object.assign(r.floating.style,{maxHeight:`${Math.min(n,Swe)}px`,minWidth:`${i.reference.width}px`})}}),QA({padding:qc})],onOpenChange:e,whileElementsMounted:ZA})}function dP(t){const{refs:e,onOpenChange:n}=t,{domReference:r,floating:i}=e,o=A.useCallback(l=>{var c,u;const{relatedTarget:f}=l;f&&!((c=r.current)!=null&&c.contains(f))&&!((u=i.current)!=null&&u.contains(f))&&n(!1)},[r,i,n]),s=A.useMemo(()=>({onBlur:o}),[o]),a=A.useMemo(()=>({onBlur:o}),[o]);return k6("Escape",()=>n(!1)),Ine(e.floating,l=>{const c=e.domReference.current;l.target instanceof Element&&c!=null&&c.contains(l.target)||n(!1)}),A.useMemo(()=>({reference:s,floating:a}),[s,a])}const Ewe="_list_0eb2b49",Cwe="_entry_d2776e7",Twe="_shortcut_cf4534d",NE={list:Ewe,entry:Cwe,shortcut:Twe};function Rwe(t){const{interactions:e}=t,[n,r]=Kb(),i=A.useId(),{refs:o,floatingStyles:s,context:a}=nP({open:n,middleware:[JA(qc),QA({padding:qc})],onOpenChange:r,whileElementsMounted:ZA}),{getReferenceProps:l,getFloatingProps:c}=rP([tP(a),dP(a)]);return C.jsxs(C.Fragment,{children:[C.jsx(fP,{ref:o.setReference,id:i,label:"Show help",icon:X1e,iconOnly:!0,"aria-haspopup":"dialog","aria-expanded":n,"aria-controls":n&&a.floatingId||void 0,...l()}),n&&C.jsx("div",{ref:o.setFloating,id:a.floatingId,className:Ei.popup,style:s,role:"dialog","aria-labelledby":i,...c(),children:C.jsx("ul",{className:NE.list,children:e.map(({shortcut:u,description:f})=>C.jsxs("li",{className:NE.entry,children:[C.jsx("span",{children:f})," ",C.jsx("kbd",{className:NE.shortcut,children:u})]},u))})})]})}const Awe="_controlWrapper_8627c21",Pwe="_control_0b569a9",GO={controlWrapper:Awe,control:Pwe};function Nwe(t){const{children:e,knownWidth:n,onMeasure:r}=t;return C.jsx(iP,{onResize:({entry:i})=>{i&&i.width>(n||0)&&r(i.width)},children:({measureRef:i})=>C.jsx("div",{className:GO.controlWrapper,"data-measured":n!==void 0,children:C.jsx("div",{ref:i,className:GO.control,children:e})})})}const{popup:Iwe}=uP,Lwe="_control_ad90dfa",kwe=`_popup_c29165d ${Iwe}`,XO={control:Lwe,popup:kwe};function Yc(t){return C.jsx("span",{className:Ei.sep,...t})}function Owe(t){const{children:e}=t,n=GA(e).filter(A.isValidElement),[r,i]=Kb(),o=A.useId(),{refs:s,floatingStyles:a,context:l}=nP({open:r,placement:"bottom-end",middleware:[JA(qc),QA({padding:qc})],onOpenChange:i,whileElementsMounted:ZA}),{getReferenceProps:c,getFloatingProps:u}=rP([tP(l),dP(l)]);return n.length===0?null:C.jsxs(C.Fragment,{children:[C.jsx(Yc,{}),C.jsx(fP,{ref:s.setReference,id:o,label:"More controls",icon:q1e,iconOnly:!0,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r&&l.floatingId||void 0,...c()}),r&&C.jsx("div",{ref:s.setFloating,id:l.floatingId,className:XO.popup,style:a,role:"dialog","aria-labelledby":o,...u(),children:n.map(f=>C.jsx("div",{className:XO.control,children:A.cloneElement(f)},f.key))})]})}function Dwe(t){var e;const{children:n,interactions:r,overflowChildren:i=[]}=t,o=GA(n).filter(A.isValidElement),[s,a]=Tne(),l=s?s.width:0,c=wne(),[u,f]=o.reduce(([m,v,x],y)=>{const g=c.get(y.key)??0,b=x+g>l;return[b?m:[...m,y],b?[...v,y]:v,x+g]},[[],[],0]),h=((e=u[u.length-1])==null?void 0:e.type)===Yc;return C.jsxs("div",{className:Ei.toolbar,children:[C.jsx("div",{ref:a,className:Ei.controls,children:(h?u.slice(0,-1):u).map(m=>C.jsx(Nwe,{knownWidth:c.get(m.key),onMeasure:v=>{c.set(m.key,v)},children:m},m.key))}),C.jsxs(Owe,{children:[i,f.filter(m=>m.type!==Yc)]}),r&&C.jsx(Yc,{}),r&&C.jsx(Rwe,{interactions:r})]})}function Ec(t){const{value:e,onToggle:n,...r}=t;return C.jsx(fP,{...r,"aria-pressed":e,onClick:()=>n()})}A.createContext(void 0);const Fwe="_boundEditor_ce4a770",zwe="_label_1e85446",Uwe="_value_c7f465d",IE={boundEditor:Fwe,label:zwe,value:Uwe},Bwe="_root_86b0b1e",jwe="_dataRange_03d542e",Vwe="_autoscale_8ea032e",$we="_error_841a0df",Wwe="_errorMessage_a16acf6",Hwe="_actionBtn_18350cd btnClean",Gwe="_swapBtn_2e22485 _actionBtn_18350cd btnClean",Tl={root:Bwe,dataRange:jwe,autoscale:Vwe,error:$we,errorMessage:Wwe,actionBtn:Hwe,swapBtn:Gwe},XC=A.forwardRef((t,e)=>{const{bound:n,value:r,isEditing:i,hasError:o,onEditToggle:s,onChange:a}=t,l=`${n}-bound`,c=A.useRef(null),[u,f]=A.useState("");function h(){s(!1),f(ME(r))}return A.useImperativeHandle(e,()=>({cancel:h})),A.useEffect(()=>{f(ME(r))},[r,f]),A.useEffect(()=>{var m,v;i||(m=c.current)==null||m.blur(),i&&n==="min"&&((v=c.current)==null||v.focus())},[i,n]),C.jsxs("form",{className:IE.boundEditor,"data-error":o||void 0,"data-editing":i,onSubmit:m=>{m.preventDefault();const v=Number.parseFloat(u.replace("−","-")),x=Number.isNaN(v)?r:Tbe(v);f(ME(x)),a(x),s(!1)},children:[C.jsx("label",{id:`${l}-label`,className:IE.label,htmlFor:l,children:n}),C.jsx("input",{id:l,ref:c,className:IE.value,type:"text",name:"bound",value:u,title:i?void 0:r.toString(),"aria-labelledby":`${l}-label`,onChange:m=>f(m.target.value),onFocus:()=>{i||s(!0)}}),C.jsx("button",{className:Tl.actionBtn,type:"submit",disabled:!i,"aria-label":`Apply ${n}`,children:C.jsx(H1e,{})}),C.jsx("button",{className:Tl.actionBtn,type:"button",disabled:!i,"aria-label":`Cancel ${n}`,onClick:()=>h(),children:C.jsx(Y1e,{})})]})});XC.displayName="BoundEditor";const Xwe={[Yf.MinGreater]:{message:"Min greater than max",fallback:"data range"},[Yf.InvalidMinWithScale]:{message:"Custom min invalid with this scale",fallback:"data min"},[Yf.InvalidMaxWithScale]:{message:"Custom max invalid with this scale",fallback:"data max"},[Yf.CustomMaxFallback]:{message:"Custom min invalid with this scale",fallback:"custom max"}};function LE(t){const{error:e,showSwapBtn:n=!1,onSwap:r}=t,{message:i,fallback:o}=Xwe[e];return C.jsxs("p",{className:Tl.error,children:[C.jsxs("span",{className:Tl.errorMessage,children:[i,C.jsx("br",{}),C.jsx(G1e,{})," falling back to ",C.jsx("strong",{children:o})]}),n&&r&&C.jsx("button",{className:Tl.swapBtn,type:"button","aria-label":"Swap min and max",onClick:()=>r(),children:C.jsx(K1e,{})})]})}const qwe=A.forwardRef((t,e)=>{const{sliderDomain:n,dataDomain:r,errors:i}=t,{isAutoMin:o,isAutoMax:s,isEditingMin:a,isEditingMax:l}=t,{onAutoMinToggle:c,onAutoMaxToggle:u,onEditMin:f,onEditMax:h,onChangeMin:m,onChangeMax:v,onSwap:x}=t,{minGreater:y,minError:g,maxError:b}=i,_=A.useRef(null),S=A.useRef(null);return A.useImperativeHandle(e,()=>({cancelEditing:()=>{var P,N;(P=_.current)==null||P.cancel(),(N=S.current)==null||N.cancel()}})),C.jsxs("div",{className:Tl.root,children:[y&&C.jsx(LE,{error:Yf.MinGreater,showSwapBtn:!o&&!s,onSwap:x}),C.jsx(XC,{ref:_,bound:"min",value:n[0],isEditing:a,hasError:y||!!g,onEditToggle:f,onChange:m}),g&&C.jsx(LE,{error:g}),C.jsx(XC,{ref:S,bound:"max",value:n[1],isEditing:l,hasError:y||!!b,onEditToggle:h,onChange:v}),b&&C.jsx(LE,{error:b}),C.jsxs("p",{className:Tl.dataRange,children:["Data range"," ",C.jsxs("span",{children:["["," ",C.jsx("abbr",{title:r[0].toString(),children:kO(r[0])})," ",","," ",C.jsx("abbr",{title:r[1].toString(),children:kO(r[1])})," ","]"]})]}),C.jsxs("p",{className:Tl.autoscale,children:["Autoscale"," ",C.jsx(Ec,{label:"Min",raised:!0,value:o,onToggle:c}),C.jsx(Ec,{label:"Max",raised:!0,value:s,onToggle:u})]})]})});qwe.displayName="DomainControls";const Ywe="_thumb_be15bc7",Kwe="_thumbBtnLike_3744319",Zwe="_icon_4b34f14",cy={thumb:Ywe,thumbBtnLike:Kwe,icon:Zwe},Jwe=A.forwardRef((t,e)=>{const{bound:n,isAuto:r,hasError:i,disabled:o,AutoIcon:s,...a}=t;return C.jsx("div",{ref:e,...a,className:cy.thumb,"aria-label":`Change ${n} limit`,"aria-disabled":o||void 0,tabIndex:o?-1:a.tabIndex,"data-auto":r,"data-error":i||void 0,children:C.jsxs("div",{className:cy.thumbBtnLike,children:[r&&C.jsx(s,{className:cy.icon}),!r&&i&&C.jsx(W1e,{className:cy.icon,strokeWidth:"3"})]})})});Jwe.displayName="Thumb";function Qwe(t){return Array.isArray(t)?t:Object.values(t).flat()}function qO(t){const{activeIndex:e,selectedIndex:n,children:r,getItemProps:i,onSelect:o}=t,{ref:s,index:a}=M1e();return C.jsx("button",{ref:s,className:Ei.btnOption,type:"button",role:"option","aria-selected":a===n||void 0,tabIndex:a===e?0:-1,"data-active":a===e||void 0,...i({onClick:()=>o(a)}),children:r})}const eSe="_label_568c73e",tSe="_groups_6cecc1b",nSe="_groupLabel_b6d0922",kE={label:eSe,groups:tSe,groupLabel:nSe};function rSe(t){const{label:e,value:n,disabled:r,onChange:i,options:o,renderOption:s}=t,{context:a,refs:l,floatingStyles:c}=Mwe(),{open:u,onOpenChange:f}=a,h=A.useId(),m=A.useId(),v=A.useId(),x=A.useRef([]),[y,g]=A.useState(null),[b,_]=A.useState(()=>Qwe(o).indexOf(n)),{getReferenceProps:S,getFloatingProps:P,getItemProps:N}=rP([tP(a),dP(a),D1e(a,{listRef:x,activeIndex:y,loop:!0,focusItemOnHover:!1,onNavigate:g})]);function T(L,U){_(L),f(!1),i(U)}return C.jsxs(C.Fragment,{children:[e&&C.jsx("span",{id:h,className:kE.label,children:e}),C.jsx("button",{ref:l.setReference,id:m,className:Ei.btn,type:"button",disabled:r,role:"combobox","aria-labelledby":`${e?h:""} ${v}`,"aria-haspopup":"listbox","aria-expanded":u,"aria-controls":u&&a.floatingId||void 0,...S(),children:C.jsxs("span",{id:v,className:Ei.btnLike,children:[s(n),C.jsx(R9,{className:Ei.arrowIcon})]})}),u&&C.jsx("div",{ref:l.setFloating,id:a.floatingId,className:Ei.menu,style:c,role:"listbox","aria-labelledby":m,...P(),children:C.jsx(S1e,{elementsRef:x,children:Array.isArray(o)?o.map(L=>C.jsx(qO,{activeIndex:y,selectedIndex:b,getItemProps:N,onSelect:U=>T(U,L),children:s(L)},L)):C.jsx("ul",{className:kE.groups,children:Object.entries(o).map(([L,U])=>C.jsxs("li",{children:[C.jsx("span",{className:kE.groupLabel,children:L}),U.map(M=>C.jsx(qO,{activeIndex:y,selectedIndex:b,getItemProps:N,onSelect:R=>T(R,M),children:s(M)},M))]},L))})})})]})}function iSe(t){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:C.jsx("path",{d:"M18 17v-2H6v2zm4-4v-2H2v2zm-8 8v-2h-4v2zm4-12V7H6v2zm-8-4h4V3h-4z",stroke:"none"})})}function oSe(t){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",fill:"none",strokeWidth:"2",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"1em",width:"1em",...t,children:C.jsx("polyline",{points:"2 12 6 12 9 21 15 3 19 3"})})}Ht.Linear+"",Ht.Log+"",Ht.SymLog+"",Ht.Sqrt+"",Ht.Gamma+"";jy.Phase+"",jy.Amplitude+"",jy.PhaseAmplitude+"";Xxe(t=>({val:void 0,setTooltipValue:(e,n,r)=>t(()=>({val:{x:e,y:n,v:r}}))}));function sSe(t){const{api:e,layer:n,x:r,y:i,magFilter:o,onPointerMove:s,...a}=t,l=e.get(n,new Ie(r,i)),[c,u]=l.shape,f=vne(h=>{s==null||s(h,l)},[s],50);return C.jsx("group",{position:[r+u/2,i+c/2,0],children:C.jsx(rwe,{values:l,...a,magFilter:o,size:{width:u,height:c},onPointerMove:s&&f})})}A.memo(sSe);new Pr(new G(-1,-1,-1),new G(1,1,1));var n7={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},YO=Mt.createContext&&Mt.createContext(n7),aSe=["attr","size","title"];function lSe(t,e){if(t==null)return{};var n=cSe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function cSe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Ox(){return Ox=Object.assign?Object.assign.bind():function(t){for(var e=1;eMt.createElement(e.tag,Dx({key:n},e.attr),r7(e.child)))}function hP(t){return e=>Mt.createElement(hSe,Ox({attr:Dx({},t.attr)},e),r7(t.child))}function hSe(t){var e=n=>{var{attr:r,size:i,title:o}=t,s=lSe(t,aSe),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),Mt.createElement("svg",Ox({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:Dx(Dx({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&Mt.createElement("title",null,o),t.children)};return YO!==void 0?Mt.createElement(YO.Consumer,null,n=>e(n)):e(n7)}function pSe(t){return hP({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26 5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z"},child:[]}]})(t)}function mSe(t){return hP({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"},child:[]}]})(t)}function gSe(t){return hP({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"},child:[]}]})(t)}var Xt={};const vSe=Object.prototype.toString;function Vs(t){const e=vSe.call(t);return e.endsWith("Array]")&&!e.includes("Big")}const ySe=Object.freeze(Object.defineProperty({__proto__:null,isAnyArray:Vs},Symbol.toStringTag,{value:"Module"})),xSe=Ws(ySe);function bSe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Vs(t))throw new TypeError("input must be an array");if(t.length===0)throw new TypeError("input must not be empty");var n=e.fromIndex,r=n===void 0?0:n,i=e.toIndex,o=i===void 0?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],a=r+1;as&&(s=t[a]);return s}function _Se(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Vs(t))throw new TypeError("input must be an array");if(t.length===0)throw new TypeError("input must not be empty");var n=e.fromIndex,r=n===void 0?0:n,i=e.toIndex,o=i===void 0?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],a=r+1;a1&&arguments[1]!==void 0?arguments[1]:{};if(Vs(t)){if(t.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var n;if(e.output!==void 0){if(!Vs(e.output))throw new TypeError("output option must be an array if specified");n=e.output}else n=new Array(t.length);var r=_Se(t),i=bSe(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=e.min,s=o===void 0?e.autoMinMax?r:0:o,a=e.max,l=a===void 0?e.autoMinMax?i:1:a;if(s>=l)throw new RangeError("min option must be smaller than max option");for(var c=(l-s)/(i-r),u=0;u=0&&n?` ${JO(t,e-1)}`:JO(t,e)).padEnd(e)}function JO(t,e){let n=t.toString();if(n.length<=e)return n;let r=t.toFixed(e);if(r.length>e&&(r=t.toFixed(Math.max(0,e-(r.length-e)))),r.length<=e&&!r.startsWith("0.000")&&!r.startsWith("-0.000"))return r;let i=t.toExponential(e);return i.length>e&&(i=t.toExponential(Math.max(0,e-(i.length-e)))),i.slice(0)}function RSe(t,e){t.prototype.add=function(r){return typeof r=="number"?this.addS(r):this.addM(r)},t.prototype.addS=function(r){for(let i=0;i>r);return this},t.prototype.signPropagatingRightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i>r.get(i,o));return this},t.signPropagatingRightShift=function(r,i){return new e(r).signPropagatingRightShift(i)},t.prototype.rightShift=function(r){return typeof r=="number"?this.rightShiftS(r):this.rightShiftM(r)},t.prototype.rightShiftS=function(r){for(let i=0;i>>r);return this},t.prototype.rightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i>>r.get(i,o));return this},t.rightShift=function(r,i){return new e(r).rightShift(i)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let r=0;rr)throw new RangeError("Row index out of range")}function _o(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function Tf(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Rf(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function pP(t,e){if(!Si.isAnyArray(e))throw new TypeError("row indices must be an array");for(let n=0;n=t.rows)throw new RangeError("row indices are out of range")}function mP(t,e){if(!Si.isAnyArray(e))throw new TypeError("column indices must be an array");for(let n=0;n=t.columns)throw new RangeError("column indices are out of range")}function qC(t,e,n,r,i){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(fy("startRow",e),fy("endRow",n),fy("startColumn",r),fy("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function Y_(t,e=0){let n=[];for(let r=0;r=o)throw new RangeError("min must be smaller than max");let a=o-i,l=new Ze(e,n);for(let c=0;cr?(o=!0,r=n):(i=!1,o=!0);e++}return i}isReducedEchelonForm(){let e=0,n=0,r=-1,i=!0,o=!1;for(;er?(o=!0,r=n):(i=!1,o=!0);for(let s=n+1;se.get(i,r)&&(i=o);if(e.get(i,r)===0)r++;else{e.swapRows(n,i);let o=e.get(n,r);for(let s=r;s=0;)if(e.maxRow(i)===0)i--;else{let o=0,s=!1;for(;on[r]&&(n[r]=this.get(r,i));return n}case"column":{const n=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let r=0;rn[i]&&(n[i]=this.get(r,i));return n}case void 0:{let n=this.get(0,0);for(let r=0;rn&&(n=this.get(r,i));return n}default:throw new Error(`invalid option: ${e}`)}}maxIndex(){_f(this);let e=this.get(0,0),n=[0,0];for(let r=0;re&&(e=this.get(r,i),n[0]=r,n[1]=i);return n}min(e){if(this.isEmpty())return NaN;switch(e){case"row":{const n=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let r=0;rn&&(n=this.get(e,r));return n}maxRowIndex(e){bo(this,e),_f(this);let n=this.get(e,0),r=[e,0];for(let i=1;in&&(n=this.get(e,i),r[1]=i);return r}minRow(e){if(bo(this,e),this.isEmpty())return NaN;let n=this.get(e,0);for(let r=1;rn&&(n=this.get(r,e));return n}maxColumnIndex(e){_o(this,e),_f(this);let n=this.get(0,e),r=[0,e];for(let i=1;in&&(n=this.get(i,e),r[0]=i);return r}minColumn(e){if(_o(this,e),this.isEmpty())return NaN;let n=this.get(0,e);for(let r=1;r1;i/=2)i&1&&(n=n.mmul(r)),r=r.mmul(r);return n}strassen2x2(e){e=Ze.checkMatrix(e);let n=new Ze(2,2);const r=this.get(0,0),i=e.get(0,0),o=this.get(0,1),s=e.get(0,1),a=this.get(1,0),l=e.get(1,0),c=this.get(1,1),u=e.get(1,1),f=(r+c)*(i+u),h=(a+c)*i,m=r*(s-u),v=c*(l-i),x=(r+o)*u,y=(a-r)*(i+s),g=(o-c)*(l+u),b=f+v-x+g,_=m+x,S=h+v,P=f-h+m+y;return n.set(0,0,b),n.set(0,1,_),n.set(1,0,S),n.set(1,1,P),n}strassen3x3(e){e=Ze.checkMatrix(e);let n=new Ze(3,3);const r=this.get(0,0),i=this.get(0,1),o=this.get(0,2),s=this.get(1,0),a=this.get(1,1),l=this.get(1,2),c=this.get(2,0),u=this.get(2,1),f=this.get(2,2),h=e.get(0,0),m=e.get(0,1),v=e.get(0,2),x=e.get(1,0),y=e.get(1,1),g=e.get(1,2),b=e.get(2,0),_=e.get(2,1),S=e.get(2,2),P=(r+i+o-s-a-u-f)*y,N=(r-s)*(-m+y),T=a*(-h+m+x-y-g-b+S),L=(-r+s+a)*(h-m+y),U=(s+a)*(-h+m),M=r*h,R=(-r+c+u)*(h-v+g),D=(-r+c)*(v-g),O=(c+u)*(-h+v),B=(r+i+o-a-l-c-u)*g,X=u*(-h+v+x-y-g-b+_),H=(-o+u+f)*(y+b-_),Z=(o-f)*(y-_),F=o*b,Y=(u+f)*(-b+_),K=(-o+a+l)*(g+b-S),ee=(o-l)*(g-S),me=(a+l)*(-b+S),le=i*x,Q=l*_,ae=s*v,ge=c*m,Me=f*S,tt=M+F+le,He=P+L+U+M+H+F+Y,rt=M+R+O+B+F+K+me,Ve=N+T+L+M+F+K+ee,se=N+L+U+M+Q,j=F+K+ee+me+ae,ye=M+R+D+X+H+Z+F,xe=H+Z+F+Y+ge,Re=M+R+D+O+Me;return n.set(0,0,tt),n.set(0,1,He),n.set(0,2,rt),n.set(1,0,Ve),n.set(1,1,se),n.set(1,2,j),n.set(2,0,ye),n.set(2,1,xe),n.set(2,2,Re),n}mmulStrassen(e){e=Ze.checkMatrix(e);let n=this.clone(),r=n.rows,i=n.columns,o=e.rows,s=e.columns;i!==o&&console.warn(`Multiplying ${r} x ${i} and ${o} x ${s} matrix: dimensions do not match.`);function a(f,h,m){let v=f.rows,x=f.columns;if(v===h&&x===m)return f;{let y=kt.zeros(h,m);return y=y.setSubMatrix(f,0,0),y}}let l=Math.max(r,o),c=Math.max(i,s);n=a(n,l,c),e=a(e,l,c);function u(f,h,m,v){if(m<=512||v<=512)return f.mmul(h);m%2===1&&v%2===1?(f=a(f,m+1,v+1),h=a(h,m+1,v+1)):m%2===1?(f=a(f,m+1,v),h=a(h,m+1,v)):v%2===1&&(f=a(f,m,v+1),h=a(h,m,v+1));let x=parseInt(f.rows/2,10),y=parseInt(f.columns/2,10),g=f.subMatrix(0,x-1,0,y-1),b=h.subMatrix(0,x-1,0,y-1),_=f.subMatrix(0,x-1,y,f.columns-1),S=h.subMatrix(0,x-1,y,h.columns-1),P=f.subMatrix(x,f.rows-1,0,y-1),N=h.subMatrix(x,h.rows-1,0,y-1),T=f.subMatrix(x,f.rows-1,y,f.columns-1),L=h.subMatrix(x,h.rows-1,y,h.columns-1),U=u(kt.add(g,T),kt.add(b,L),x,y),M=u(kt.add(P,T),b,x,y),R=u(g,kt.sub(S,L),x,y),D=u(T,kt.sub(N,b),x,y),O=u(kt.add(g,_),L,x,y),B=u(kt.sub(P,g),kt.add(b,S),x,y),X=u(kt.sub(_,T),kt.add(N,L),x,y),H=kt.add(U,D);H.sub(O),H.add(X);let Z=kt.add(R,O),F=kt.add(M,D),Y=kt.sub(U,M);Y.add(R),Y.add(B);let K=kt.zeros(2*H.rows,2*H.columns);return K=K.setSubMatrix(H,0,0),K=K.setSubMatrix(Z,H.rows,0),K=K.setSubMatrix(F,0,H.columns),K=K.setSubMatrix(Y,H.rows,H.columns),K.subMatrix(0,m-1,0,v-1)}return u(n,e,l,c)}scaleRows(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:n=0,max:r=1}=e;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(n>=r)throw new RangeError("min must be smaller than max");let i=new Ze(this.rows,this.columns);for(let o=0;o0&&ZO(s,{min:n,max:r,output:s}),i.setRow(o,s)}return i}scaleColumns(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:n=0,max:r=1}=e;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(n>=r)throw new RangeError("min must be smaller than max");let i=new Ze(this.rows,this.columns);for(let o=0;or||n<0||n>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");let i=new Ze(e.length,r-n+1);for(let o=0;o=this.rows)throw new RangeError(`Row index out of range: ${e[o]}`);i.set(o,s-n,this.get(e[o],s))}return i}subMatrixColumn(e,n,r){if(n===void 0&&(n=0),r===void 0&&(r=this.rows-1),n>r||n<0||n>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");let i=new Ze(r-n+1,e.length);for(let o=0;o=this.columns)throw new RangeError(`Column index out of range: ${e[o]}`);i.set(s-n,o,this.get(s,e[o]))}return i}setSubMatrix(e,n,r){if(e=Ze.checkMatrix(e),e.isEmpty())return this;let i=n+e.rows-1,o=r+e.columns-1;qC(this,n,i,r,o);for(let s=0;stypeof e=="number")}kt.random=kt.rand;kt.randomInt=kt.randInt;kt.diagonal=kt.diag;kt.prototype.diagonal=kt.prototype.diag;kt.identity=kt.eye;kt.prototype.negate=kt.prototype.neg;kt.prototype.tensorProduct=kt.prototype.kroneckerProduct;var qm,YC,Zc;let Ze=(Zc=class extends kt{constructor(n,r){super();uS(this,qm);Vt(this,"data");if(Zc.isMatrix(n))fS(this,qm,YC).call(this,n.rows,n.columns),Zc.copy(n,this);else if(Number.isInteger(n)&&n>=0)fS(this,qm,YC).call(this,n,r);else if(Si.isAnyArray(n)){const i=n;if(n=i.length,r=n?i[0].length:0,typeof r!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let o=0;o"u"&&(r=n,n=this.columns),_o(this,n,!0),r=Rf(this,r);for(let i=0;i=0)for(let i=0;i=0)L0(this,Hr,new Ze(n,n));else if(L0(this,Hr,new Ze(n)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return Vo(this,Hr).size}get rows(){return Vo(this,Hr).rows}get columns(){return Vo(this,Hr).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(n){return Ze.isMatrix(n)&&n.klassType==="SymmetricMatrix"}static zeros(n){return new this(n)}static ones(n){return new this(n).fill(1)}clone(){const n=new Vx(this.diagonalSize);for(const[r,i,o]of this.upperRightEntries())n.set(r,i,o);return n}toMatrix(){return new Ze(this)}get(n,r){return Vo(this,Hr).get(n,r)}set(n,r,i){return Vo(this,Hr).set(n,r,i),Vo(this,Hr).set(r,n,i),this}removeCross(n){return Vo(this,Hr).removeRow(n),Vo(this,Hr).removeColumn(n),this}addCross(n,r){r===void 0&&(r=n,n=this.diagonalSize);const i=r.slice();return i.splice(n,1),Vo(this,Hr).addRow(n,i),Vo(this,Hr).addColumn(n,r),this}applyMask(n){if(n.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const r=[];for(const[i,o]of n.entries())o||r.push(i);r.reverse();for(const i of r)this.removeCross(i);return this}toCompact(){const{diagonalSize:n}=this,r=new Array(n*(n+1)/2);for(let i=0,o=0,s=0;s=n&&(i=++o);return r}static fromCompact(n){const r=n.length,i=(Math.sqrt(8*r+1)-1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(n)}`);const o=new Vx(i);for(let s=0,a=0,l=0;l=i&&(s=++a);return o}*upperRightEntries(){for(let n=0,r=0;n=this.diagonalSize&&(r=++n)}}*upperRightValues(){for(let n=0,r=0;n=this.diagonalSize&&(r=++n)}};Hr=new WeakMap;let Kc=Vx;Kc.prototype.klassType="SymmetricMatrix";class K_ extends Kc{static isDistanceMatrix(e){return Kc.isSymmetricMatrix(e)&&e.klassSubType==="DistanceMatrix"}constructor(e){if(super(e),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(e,n,r){return e===n&&(r=0),super.set(e,n,r)}addCross(e,n){return n===void 0&&(n=e,e=this.diagonalSize),n=n.slice(),n[e]=0,super.addCross(e,n)}toSymmetricMatrix(){return new Kc(this)}clone(){const e=new K_(this.diagonalSize);for(const[n,r,i]of this.upperRightEntries())n!==r&&e.set(n,r,i);return e}toCompact(){const{diagonalSize:e}=this,n=(e-1)*e/2,r=new Array(n);for(let i=1,o=0,s=0;s=e&&(i=++o+1);return r}static fromCompact(e){const n=e.length;if(n===0)return new this(0);const r=(Math.sqrt(8*n+1)+1)/2;if(!Number.isInteger(r))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(e)}`);const i=new this(r);for(let o=1,s=0,a=0;a=r&&(o=++s+1);return i}}K_.prototype.klassSubType="DistanceMatrix";class za extends kt{constructor(e,n,r){super(),this.matrix=e,this.rows=n,this.columns=r}}class qSe extends za{constructor(e,n){_o(e,n),super(e,e.rows,1),this.column=n}set(e,n,r){return this.matrix.set(e,this.column,r),this}get(e){return this.matrix.get(e,this.column)}}class YSe extends za{constructor(e,n){mP(e,n),super(e,e.rows,n.length),this.columnIndices=n}set(e,n,r){return this.matrix.set(e,this.columnIndices[n],r),this}get(e,n){return this.matrix.get(e,this.columnIndices[n])}}class KSe extends za{constructor(e){super(e,e.rows,e.columns)}set(e,n,r){return this.matrix.set(e,this.columns-n-1,r),this}get(e,n){return this.matrix.get(e,this.columns-n-1)}}class ZSe extends za{constructor(e){super(e,e.rows,e.columns)}set(e,n,r){return this.matrix.set(this.rows-e-1,n,r),this}get(e,n){return this.matrix.get(this.rows-e-1,n)}}class JSe extends za{constructor(e,n){bo(e,n),super(e,1,e.columns),this.row=n}set(e,n,r){return this.matrix.set(this.row,n,r),this}get(e,n){return this.matrix.get(this.row,n)}}class QSe extends za{constructor(e,n){pP(e,n),super(e,n.length,e.columns),this.rowIndices=n}set(e,n,r){return this.matrix.set(this.rowIndices[e],n,r),this}get(e,n){return this.matrix.get(this.rowIndices[e],n)}}class $y extends za{constructor(e,n,r){pP(e,n),mP(e,r),super(e,n.length,r.length),this.rowIndices=n,this.columnIndices=r}set(e,n,r){return this.matrix.set(this.rowIndices[e],this.columnIndices[n],r),this}get(e,n){return this.matrix.get(this.rowIndices[e],this.columnIndices[n])}}class eMe extends za{constructor(e,n,r,i,o){qC(e,n,r,i,o),super(e,r-n+1,o-i+1),this.startRow=n,this.startColumn=i}set(e,n,r){return this.matrix.set(this.startRow+e,this.startColumn+n,r),this}get(e,n){return this.matrix.get(this.startRow+e,this.startColumn+n)}}let tMe=class extends za{constructor(e){super(e,e.columns,e.rows)}set(e,n,r){return this.matrix.set(n,e,r),this}get(e,n){return this.matrix.get(n,e)}};class s7 extends kt{constructor(e,n={}){const{rows:r=1}=n;if(e.length%r!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=r,this.columns=e.length/r,this.data=e}set(e,n,r){let i=this._calculateIndex(e,n);return this.data[i]=r,this}get(e,n){let r=this._calculateIndex(e,n);return this.data[r]}_calculateIndex(e,n){return e*this.columns+n}}class oo extends kt{constructor(e){super(),this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,n,r){return this.data[e][n]=r,this}get(e,n){return this.data[e][n]}}function nMe(t,e){if(Si.isAnyArray(t))return t[0]&&Si.isAnyArray(t[0])?new oo(t):new s7(t,e);throw new Error("the argument is not an array")}class Z_{constructor(e){e=oo.checkMatrix(e);let n=e.clone(),r=n.rows,i=n.columns,o=new Float64Array(r),s=1,a,l,c,u,f,h,m,v,x;for(a=0;aMath.abs(v[u])&&(u=a);if(u!==l){for(c=0;c=0;c--){for(l=0;ls?i.set(o,s,e.get(o,s)):o===s?i.set(o,s,1):i.set(o,s,0);return i}get upperTriangularMatrix(){let e=this.LU,n=e.rows,r=e.columns,i=new Ze(n,r);for(let o=0;oMath.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):e!==0?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class gP{constructor(e){e=oo.checkMatrix(e);let n=e.clone(),r=e.rows,i=e.columns,o=new Float64Array(i),s,a,l,c;for(l=0;l=0;c--){for(l=0;l=0;a--){for(o=0;o=0;M--)if(v[M]!==0){for(let R=M+1;R=0;M--){if(M0;){let M,R;for(M=T-2;M>=-1&&M!==-1;M--){const D=Number.MIN_VALUE+U*Math.abs(v[M]+Math.abs(v[M+1]));if(Math.abs(g[M])<=D||Number.isNaN(g[M])){g[M]=0;break}}if(M===T-2)R=4;else{let D;for(D=T-1;D>=M&&D!==M;D--){let O=(D!==T?Math.abs(g[D]):0)+(D!==M+1?Math.abs(g[D-1]):0);if(Math.abs(v[D])<=U*O){v[D]=0;break}}D===M?R=3:D===T-1?R=1:(R=2,M=D)}switch(M++,R){case 1:{let D=g[T-2];g[T-2]=0;for(let O=T-2;O>=M;O--){let B=fa(v[O],D),X=v[O]/B,H=D/B;if(v[O]=B,O!==M&&(D=-H*g[O-1],g[O-1]=X*g[O-1]),c)for(let Z=0;Z=v[M+1]);){let D=v[M];if(v[M]=v[M+1],v[M+1]=D,c&&Mn&&o.set(u,f,e.get(u,f)/this.s[f]);let s=this.U,a=s.rows,l=s.columns,c=new Ze(r,a);for(let u=0;ue&&n++;return n}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return Ze.diag(this.s)}}function rMe(t,e=!1){return t=oo.checkMatrix(t),e?new oh(t).inverse():a7(t,Ze.eye(t.rows))}function a7(t,e,n=!1){return t=oo.checkMatrix(t),e=oo.checkMatrix(e),n?new oh(t).solve(e):t.isSquare()?new Z_(t).solve(e):new gP(t).solve(e)}function Wy(t){if(t=Ze.checkMatrix(t),t.isSquare()){if(t.columns===0)return 1;let e,n,r,i;if(t.columns===2)return e=t.get(0,0),n=t.get(0,1),r=t.get(1,0),i=t.get(1,1),e*i-n*r;if(t.columns===3){let o,s,a;return o=new $y(t,[1,2],[1,2]),s=new $y(t,[1,2],[0,2]),a=new $y(t,[1,2],[0,1]),e=t.get(0,0),n=t.get(0,1),r=t.get(0,2),e*Wy(o)-n*Wy(s)+r*Wy(a)}else return new Z_(t).determinant}else throw Error("determinant can only be calculated for a square matrix")}function iMe(t,e){let n=[];for(let r=0;ri)return new Array(e.rows+1).fill(0);{let o=e.addRow(n,[0]);for(let s=0;se?o[s]=1/o[s]:o[s]=0;return i.mmul(Ze.diag(o).mmul(r.transpose()))}function lMe(t,e=t,n={}){t=new Ze(t);let r=!1;if(typeof e=="object"&&!Ze.isMatrix(e)&&!Si.isAnyArray(e)?(n=e,e=t,r=!0):e=new Ze(e),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:i=!0}=n;i&&(t=t.center("column"),r||(e=e.center("column")));const o=t.transpose().mmul(e);for(let s=0;s0?i.set(o,o+1,n[o]):n[o]<0&&i.set(o,o-1,n[o])}return i}}function uMe(t,e,n,r){let i,o,s,a,l,c,u,f;for(l=0;l0;a--){for(f=0,s=0,c=0;c0&&(o=-o),e[a]=f*o,s=s-i*o,n[a-1]=i-o,l=0;lc)do{for(i=n[c],f=(n[c+1]-i)/(2*e[c]),h=fa(f,1),f<0&&(h=-h),n[c]=e[c]/(f+h),n[c+1]=e[c]*(f+h),m=n[c+1],o=i-n[c],s=c+2;s=c;s--)for(y=x,x=v,_=b,i=v*e[s],o=v*f,h=fa(f,e[s]),e[s+1]=b*h,b=e[s]/h,v=f/h,f=v*n[s]-b*i,n[s+1]=o+b*(v*i+b*n[s]),l=0;lN*P);n[c]=n[c]+S,e[c]=0}for(s=0;s=f;c--)n[c]=e.get(c,f-1)/h,l+=n[c]*n[c];for(a=Math.sqrt(l),n[f]>0&&(a=-a),l=l-n[f]*a,n[f]=n[f]-a,u=f;u=f;c--)s+=n[c]*e.get(c,u);for(s=s/l,c=f;c<=o;c++)e.set(c,u,e.get(c,u)-s*n[c])}for(c=0;c<=o;c++){for(s=0,u=o;u>=f;u--)s+=n[u]*e.get(c,u);for(s=s/l,u=f;u<=o;u++)e.set(c,u,e.get(c,u)-s*n[u])}n[f]=h*n[f],e.set(f,f-1,h*a)}}for(c=0;c=i+1;f--)if(e.get(f,f-1)!==0){for(c=f+1;c<=o;c++)n[c]=e.get(c,f-1);for(u=f;u<=o;u++){for(a=0,c=f;c<=o;c++)a+=n[c]*r.get(c,u);for(a=a/n[f]/e.get(f,f-1),c=f;c<=o;c++)r.set(c,u,r.get(c,u)+a*n[c])}}}function hMe(t,e,n,r,i){let o=t-1,s=0,a=t-1,l=Number.EPSILON,c=0,u=0,f=0,h=0,m=0,v=0,x=0,y=0,g,b,_,S,P,N,T,L,U,M,R,D,O,B,X;for(g=0;ga)&&(n[g]=i.get(g,g),e[g]=0),b=Math.max(g-1,0);b=s;){for(S=o;S>s&&(v=Math.abs(i.get(S-1,S-1))+Math.abs(i.get(S,S)),v===0&&(v=u),!(Math.abs(i.get(S,S-1))=0){for(x=f>=0?f+x:f-x,n[o-1]=L+x,n[o]=n[o-1],x!==0&&(n[o]=L-T/x),e[o-1]=0,e[o]=0,L=i.get(o,o-1),v=Math.abs(L)+Math.abs(x),f=L/v,h=x/v,m=Math.sqrt(f*f+h*h),f=f/m,h=h/m,b=o-1;b0)){for(v=Math.sqrt(v),U=S&&(x=i.get(P,P),m=L-x,v=U-x,f=(m*v-T)/i.get(P+1,P)+i.get(P,P+1),h=i.get(P+1,P+1)-x-m-v,m=i.get(P+2,P+1),v=Math.abs(f)+Math.abs(h)+Math.abs(m),f=f/v,h=h/v,m=m/v,!(P===S||Math.abs(i.get(P,P-1))*(Math.abs(h)+Math.abs(m))P+2&&i.set(g,g-3,0);for(_=P;_<=o-1&&(B=_!==o-1,_!==P&&(f=i.get(_,_-1),h=i.get(_+1,_-1),m=B?i.get(_+2,_-1):0,L=Math.abs(f)+Math.abs(h)+Math.abs(m),L!==0&&(f=f/L,h=h/L,m=m/L)),L!==0);_++)if(v=Math.sqrt(f*f+h*h+m*m),f<0&&(v=-v),v!==0){for(_!==P?i.set(_,_-1,-v*L):S!==P&&i.set(_,_-1,-i.get(_,_-1)),f=f+v,L=f/v,U=h/v,x=m/v,h=h/f,m=m/f,b=_;b=0;o--)if(f=n[o],h=e[o],h===0)for(S=o,i.set(o,o,1),g=o-1;g>=0;g--){for(T=i.get(g,g)-f,m=0,b=S;b<=o;b++)m=m+i.get(g,b)*i.get(b,o);if(e[g]<0)x=T,v=m;else if(S=g,e[g]===0?i.set(g,o,T!==0?-m/T:-m/(l*u)):(L=i.get(g,g+1),U=i.get(g+1,g),h=(n[g]-f)*(n[g]-f)+e[g]*e[g],N=(L*v-x*m)/h,i.set(g,o,N),i.set(g+1,o,Math.abs(L)>Math.abs(x)?(-m-T*N)/L:(-v-U*N)/x)),N=Math.abs(i.get(g,o)),l*N*N>1)for(b=g;b<=o;b++)i.set(b,o,i.get(b,o)/N)}else if(h<0)for(S=o-1,Math.abs(i.get(o,o-1))>Math.abs(i.get(o-1,o))?(i.set(o-1,o-1,h/i.get(o,o-1)),i.set(o-1,o,-(i.get(o,o)-f)/i.get(o,o-1))):(X=dy(0,-i.get(o-1,o),i.get(o-1,o-1)-f,h),i.set(o-1,o-1,X[0]),i.set(o-1,o,X[1])),i.set(o,o-1,0),i.set(o,o,1),g=o-2;g>=0;g--){for(M=0,R=0,b=S;b<=o;b++)M=M+i.get(g,b)*i.get(b,o-1),R=R+i.get(g,b)*i.get(b,o);if(T=i.get(g,g)-f,e[g]<0)x=T,m=M,v=R;else if(S=g,e[g]===0?(X=dy(-M,-R,T,h),i.set(g,o-1,X[0]),i.set(g,o,X[1])):(L=i.get(g,g+1),U=i.get(g+1,g),D=(n[g]-f)*(n[g]-f)+e[g]*e[g]-h*h,O=(n[g]-f)*2*h,D===0&&O===0&&(D=l*u*(Math.abs(T)+Math.abs(h)+Math.abs(L)+Math.abs(U)+Math.abs(x))),X=dy(L*m-x*M+h*R,L*v-x*R-h*M,D,O),i.set(g,o-1,X[0]),i.set(g,o,X[1]),Math.abs(L)>Math.abs(x)+Math.abs(h)?(i.set(g+1,o-1,(-M-T*i.get(g,o-1)+h*i.get(g,o))/L),i.set(g+1,o,(-R-T*i.get(g,o)-h*i.get(g,o-1))/L)):(X=dy(-m-U*i.get(g,o-1),-v-U*i.get(g,o),x,h),i.set(g+1,o-1,X[0]),i.set(g+1,o,X[1]))),N=Math.max(Math.abs(i.get(g,o-1)),Math.abs(i.get(g,o))),l*N*N>1)for(b=g;b<=o;b++)i.set(b,o-1,i.get(b,o-1)/N),i.set(b,o,i.get(b,o)/N)}for(g=0;ga)for(b=g;b=s;b--)for(g=s;g<=a;g++){for(x=0,_=s;_<=Math.min(b,a);_++)x=x+r.get(g,_)*i.get(_,b);r.set(g,b,x)}}}function dy(t,e,n,r){let i,o;return Math.abs(n)>Math.abs(r)?(i=r/n,o=n+i*r,[(t+i*e)/o,(e-i*t)/o]):(i=n/r,o=r+i*n,[(i*t+e)/o,(i*e-t)/o])}class c7{constructor(e){if(e=oo.checkMatrix(e),!e.isSymmetric())throw new Error("Matrix is not symmetric");let n=e,r=n.rows,i=new Ze(r,r),o=!0,s,a,l;for(a=0;a0),i.set(a,a,Math.sqrt(Math.max(c,0))),l=a+1;l=0;l--)for(a=0;as;m++)f=e.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),f=f.div(f.norm()),c=e.mmul(f).div(f.transpose().mmul(f).get(0,0)),m>0&&(l=c.clone().sub(h).pow(2).sum()),h=c.clone(),r?(u=r.transpose().mmul(c).div(c.transpose().mmul(c).get(0,0)),u=u.div(u.norm()),a=r.mmul(u).div(u.transpose().mmul(u).get(0,0))):a=c;if(r){let m=e.transpose().mmul(c).div(c.transpose().mmul(c).get(0,0));m=m.div(m.norm());let v=e.clone().sub(c.clone().mmul(m.transpose())),x=a.transpose().mmul(c).div(c.transpose().mmul(c).get(0,0)),y=r.clone().sub(c.clone().mulS(x.get(0,0)).mmul(u.transpose()));this.t=c,this.p=m.transpose(),this.w=f.transpose(),this.q=u,this.u=a,this.s=c.transpose().mmul(c),this.xResidual=v,this.yResidual=y,this.betas=x}else this.w=f.transpose(),this.s=c.transpose().mmul(c).sqrt(),i?this.t=c.clone().div(this.s.get(0,0)):this.t=c,this.xResidual=e.sub(c.mmul(f.transpose()))}}Xt.AbstractMatrix=kt;Xt.CHO=c7;Xt.CholeskyDecomposition=c7;Xt.DistanceMatrix=K_;Xt.EVD=l7;Xt.EigenvalueDecomposition=l7;Xt.LU=Z_;Xt.LuDecomposition=Z_;var f7=Xt.Matrix=Ze;Xt.MatrixColumnSelectionView=YSe;Xt.MatrixColumnView=qSe;Xt.MatrixFlipColumnView=KSe;Xt.MatrixFlipRowView=ZSe;Xt.MatrixRowSelectionView=QSe;Xt.MatrixRowView=JSe;Xt.MatrixSelectionView=$y;Xt.MatrixSubView=eMe;var pMe=Xt.MatrixTransposeView=tMe;Xt.NIPALS=u7;Xt.Nipals=u7;Xt.QR=gP;Xt.QrDecomposition=gP;Xt.SVD=oh;Xt.SingularValueDecomposition=oh;Xt.SymmetricMatrix=Kc;Xt.WrapperMatrix1D=s7;Xt.WrapperMatrix2D=oo;Xt.correlation=cMe;Xt.covariance=lMe;var e5=Xt.default=Ze;Xt.determinant=Wy;Xt.inverse=rMe;Xt.linearDependencies=sMe;Xt.pseudoInverse=aMe;var mMe=Xt.solve=a7;Xt.wrap=nMe;const t5=f7,n5=pMe;e5.Matrix&&e5.Matrix;const gMe=mMe;function d7(t,e){if(!Vs(t)||!Vs(e))throw new TypeError("x and y must be arrays");if(t.length!==e.length)throw new RangeError("x and y arrays must have the same length")}class vP{constructor(){if(new.target===vP)throw new Error("BaseRegression must be subclassed")}predict(e){if(typeof e=="number")return this._predict(e);if(Vs(e)){const n=[];for(const r of e)n.push(this._predict(r));return n}else throw new TypeError("x must be a number or array")}_predict(e){throw new Error("_predict must be implemented")}train(){}toString(e){return""}toLaTeX(e){return""}score(e,n){d7(e,n);const r=e.length,i=new Array(r);for(let m=0;m0&&l!==this.coefficients.length-1?a=` + ${a}`:l!==this.coefficients.length-1&&(a=` ${a}`)),s=a+s;return s.startsWith("+")&&(s=s.slice(1)),`f(x) = ${s}`}static load(e){if(e.name!=="polynomialRegression")throw new TypeError("not a polynomial regression model");return new Fx(!0,e)}}function vMe(t,e,n,r={}){const i=t.length;let{interceptAtZero:o=!1}=r,s=[];if(Array.isArray(n))s=n,o=!1;else if(typeof n=="number")if(o){s=new Array(n);for(let m=0;m"u")throw new TypeError("X must be defined");if(r>t.length)throw new RangeError(`Window size is higher than the data length ${r}>${t.length}`);if(i<0||!Number.isInteger(i))throw new RangeError("Derivative should be a positive integer");if(o<1||!Number.isInteger(o))throw new RangeError("Polynomial should be a positive integer");o>=6&&console.warn("You should not use polynomial grade higher than 5 if you are not sure that your data arises from such a model. Possible polynomial oscillation problems");const s=Math.floor(r/2),a=t.length,l=new Float64Array(a),c=bMe(r,o,i);let u=0,f=!0;Vs(e)?f=!1:u=e**i;for(let m=0;m=0&&s0?i=(4*n-2)/(n*(2*e-n+1))*(t*Wp(t,e,n-1,r)+r*Wp(t,e,n-1,r-1))-(n-1)*(2*e+n)/(n*(2*e-n+1))*Wp(t,e,n-2,r):n===0&&r===0?i=1:i=0,i}function r5(t,e){let n=1;if(t>=e)for(let r=t-e+1;r<=t;r++)n*=r;return n}function xMe(t,e,n,r,i){let o=0;for(let s=0;s<=r;s++)o+=(2*s+1)*(r5(2*n,s)/r5(2*n+s+1,s+1))*Wp(t,n,s,0)*Wp(e,n,s,i);return o}function bMe(t,e,n){const r=new Array(t),i=Math.floor(t/2);for(let o=-i;o<=i;o++){r[o+i]=new Float64Array(t);for(let s=-i;s<=i;s++)r[o+i][s+i]=xMe(s,o,i,e,n)}return r}function hy(t,e){let n=1/0,r=0;for(let i=0;ie&&(e=t[r],n=r);return n}function wMe(t,e){const n=yMe(e,t,{windowSize:9,derivative:1,polynomial:3}),r=_Me(n),i=t[r];let o=5;r<20&&(o=2);const s=o*Math.round((t[1]-i)/o),a=.5*s,l=hy(t,s+i),c=hy(t,a+i),u=e.slice(l,c),f=t.slice(l,c),h=new Fx(f,u,1),m=e.map((N,T)=>N-h.predict(t[T])),v=5*Math.round((t[t.length-1]-i)/5),x=5*Math.round(v/15),y=2,g=hy(t,x+i),b=hy(t,v+i),_=new Fx(t.slice(g,b),m.slice(g,b),y),S=_.predict(i);for(let N=r;NN/S),[m.length])}function FE(t,e,n,r,i){const o=t[e],s=t.energy,a=n?wMe(s,o):j6(o,[o.length]);return{x:s,y:a,label:r+":"+e,color:i}}function i5(t,e,n,r,i,o){const s=!e&&!n&&!r,a=[];return s||t==null||(r&&t.murefer&&a.push(FE(t,"murefer",i,t.id,o[2])),n&&t.mufluor&&a.push(FE(t,"mufluor",i,t.id,o[1])),e&&t.mutrans&&a.push(FE(t,"mutrans",i,t.id,o[0]))),a}function SMe(t,e){return C.jsx(W_e,{abscissas:t.x,ordinates:t.y.data,curveType:e,color:t.color},t.label)}function MMe(t){var M,R,D,O;const[e,n]=A.useState({showTrans:!1,showFluor:!1,showRefer:!1});A.useEffect(()=>{var B,X,H;n({showTrans:((B=t.xasData)==null?void 0:B.mutrans)!=null,showFluor:((X=t.xasData)==null?void 0:X.mufluor)!=null,showRefer:((H=t.xasData)==null?void 0:H.murefer)!=null})},[t.xasData]);const r=Object.values($p),[i,o]=A.useState(!0),[s,a]=A.useState(!0),[l,c]=A.useState(r[0]),u=mu(),{showTrans:f,showFluor:h,showRefer:m}=e,v=[((M=t.xasData)==null?void 0:M.mutrans)!=null,((R=t.xasData)==null?void 0:R.mufluor)!=null,((D=t.xasData)==null?void 0:D.murefer)!=null],x=(B,X)=>C.jsxs("p",{children:[B.toPrecision(8),", ",X.toPrecision(8)]}),y=i5(t.xasData,f,h,m,s,[WS(u.palette.primary.dark,.3),WS(u.palette.success.light,.3),WS(u.palette.secondary.dark,.3)]),b=t.comparisonFiles.filter(B=>{var X;return B.id!=((X=t.xasData)==null?void 0:X.id)}).map((B,X)=>i5(B,f,h,m,s,[HS(u.palette.primary.dark,X*.3),HS(u.palette.success.light,X*.3),HS(u.palette.secondary.dark,X*.3)])).flat();y.push(...b);const _=UO(y.map(B=>FO(B.y))),P={visDomain:UO(y.map(B=>FO(B.x)))??[0,1],showGrid:!0,isIndexAxis:!1,label:"Energy (eV)"},N={visDomain:_??[0,1],showGrid:!0,isIndexAxis:!1,label:s?"mu(E) (norm)":"mu(E)"},T=u.palette.action.hover,L={"--h5w-toolbar--bgColor":u.palette.action.hover,"--h5w-tickLabels--color":u.palette.text.primary,"--h5w-ticks--color":u.palette.text.primary,"--h5w-grid--color":"black","--h5w-toolbar-label--color":u.palette.primary.dark,"--h5w-btn-hover--bgColor":u.palette.action.hover,"--h5w-btnPressed--bgColor":u.palette.action.selected,"--h5w-selector-menu--bgColor":u.palette.background.default,"--h5w-selector-option-selected--bgColor":u.palette.action.selected},U={"--h5w-tickLabels--color":u.palette.text.primary,"--h5w-ticks--color":u.palette.text.primary,"--h5w-grid--color":u.palette.text.secondary,"--h5w-axisLabels--color":u.palette.text.primary,"--h5w-line--color":u.palette.primary.dark,"--h5w-tooltip--bgColor":u.palette.action.hover,"--h5w-tooltip--color":u.palette.text.primary,"--h5w-line--colorAux":[u.palette.success.light,u.palette.secondary.dark]};return C.jsxs(gu,{sx:{height:"100%",display:"flex",flexDirection:"column",backgroundColor:B=>B.palette.background.default,fontFamily:B=>B.typography.fontFamily},children:[C.jsx(Bs,{style:L,children:C.jsxs(Dwe,{children:[C.jsx(Ec,{label:"Normalize",value:s,onToggle:()=>{a(!s)}}),C.jsx(Yc,{}),C.jsx(Ec,{label:"Transmission",value:f,onToggle:()=>{n({...e,showTrans:!f})},disabled:!v[0]}),C.jsx(Ec,{label:"Fluorescence",value:h,onToggle:()=>{n({...e,showFluor:!h})},disabled:!v[1]}),C.jsx(Ec,{label:"Reference",value:m,onToggle:()=>{n({...e,showRefer:!m})},disabled:!v[2]}),C.jsx(Yc,{}),C.jsx(rSe,{label:"Line Style",onChange:B=>{c(B)},options:r,value:l,renderOption:B=>C.jsx("div",{children:C.jsx("span",{children:String(B)})})}),C.jsx(Yc,{}),C.jsx(Ec,{label:"Grid",icon:gSe,value:i,onToggle:()=>o(!i)})]})}),C.jsx(Bs,{style:U,flex:1,display:"flex",children:C.jsxs(A_e,{title:((O=t.xasData)==null?void 0:O.id)??" ",abscissaConfig:P,ordinateConfig:N,children:[y.map(B=>SMe(B,l)),C.jsx(c_e,{renderTooltip:x}),C.jsx(Gbe,{}),C.jsx(i_e,{}),C.jsx(Q9,{children:C.jsx("div",{style:{color:u.palette.text.primary,position:"absolute",maxWidth:"35%",minWidth:"15em",padding:"0 1rem",bottom:"2.5rem",right:"0px",background:T},children:y.reverse().map(B=>C.jsxs("div",{children:[C.jsx("span",{style:{color:B.color},children:" ■"}),C.jsx("span",{children:" "+B.label})]},B.label))})})]})})]})}function yP(){const t=A.useContext(lg);let e=null,n=[];if(t.xdiFile!=null){const r=t.xdiFile,i=r.energy(),o=r.muTrans(),s=r.muFluor(),a=r.muRefer();e={id:r.id,energy:i,mutrans:o,mufluor:s,murefer:a},n=t.comparisonFiles.map(l=>({id:l.id,energy:l.energy(),mutrans:l.muTrans(),mufluor:l.muFluor(),murefer:l.muRefer()}))}return C.jsx(MMe,{xasData:e,comparisonFiles:n})}function EMe(){const[t,e]=A.useState(null),[n,r]=A.useState([]),i=A.useContext(OR);function o(){return a=>{Dn.get("/webxdiviewer/xdidata/"+a).then(l=>{const c=_d.parseFile(l.data,a);e(c)})}}const s=o();return C.jsx(LR,{value:{xdiFile:t,setXDIFile:e,comparisonFiles:n,setComparisonFiles:r},children:C.jsxs(_a,{height:"100%",container:!0,children:[C.jsx(_a,{item:!0,lg:5,md:12,padding:1,children:C.jsx(dne,{standards:i,updatePlot:s})}),C.jsx(_a,{item:!0,height:"100%",lg:7,md:12,padding:1,children:C.jsx(yP,{})})]})})}/** + * @remix-run/router v1.20.0 + * + * 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 Gm(){return Gm=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function xP(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function TMe(){return Math.random().toString(36).substr(2,8)}function s5(t,e){return{usr:t.state,key:t.key,idx:e}}function KC(t,e,n,r){return n===void 0&&(n=null),Gm({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Cu(e):e,{state:n,key:e&&e.key||r||TMe()})}function zx(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Cu(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function RMe(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=vl.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(Gm({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function f(){a=vl.Pop;let y=u(),g=y==null?null:y-c;c=y,l&&l({action:a,location:x.location,delta:g})}function h(y,g){a=vl.Push;let b=KC(x.location,y,g);n&&n(b,y),c=u()+1;let _=s5(b,c),S=x.createHref(b);try{s.pushState(_,"",S)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(S)}o&&l&&l({action:a,location:x.location,delta:1})}function m(y,g){a=vl.Replace;let b=KC(x.location,y,g);n&&n(b,y),c=u();let _=s5(b,c),S=x.createHref(b);s.replaceState(_,"",S),o&&l&&l({action:a,location:x.location,delta:0})}function v(y){let g=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof y=="string"?y:zx(y);return b=b.replace(/ $/,"%20"),Wn(g,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,g)}let x={get action(){return a},get location(){return t(i,s)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(o5,f),l=y,()=>{i.removeEventListener(o5,f),l=null}},createHref(y){return e(i,y)},createURL:v,encodeLocation(y){let g=v(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:m,go(y){return s.go(y)}};return x}var a5;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(a5||(a5={}));function AMe(t,e,n){return n===void 0&&(n="/"),PMe(t,e,n,!1)}function PMe(t,e,n,r){let i=typeof e=="string"?Cu(e):e,o=Od(i.pathname||"/",n);if(o==null)return null;let s=h7(t);NMe(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(Wn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Rl([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(Wn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),h7(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:zMe(c,o.index),routesMeta:u})};return t.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of p7(o.path))i(o,s,l)}),e}function p7(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=p7(r.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function NMe(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:UMe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const IMe=/^:[\w-]+$/,LMe=3,kMe=2,OMe=1,DMe=10,FMe=-2,l5=t=>t==="*";function zMe(t,e){let n=t.split("/"),r=n.length;return n.some(l5)&&(r+=FMe),e&&(r+=kMe),n.filter(i=>!l5(i)).reduce((i,o)=>i+(IMe.test(o)?LMe:o===""?OMe:DMe),r)}function UMe(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function BMe(t,e,n){let{routesMeta:r}=t,i={},o="/",s=[];for(let a=0;a{let{paramName:h,isOptional:m}=u;if(h==="*"){let x=a[f]||"";s=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const v=a[f];return m&&!v?c[h]=void 0:c[h]=(v||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:s,pattern:t}}function jMe(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),xP(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function VMe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return xP(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Od(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function $Me(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Cu(t):t;return{pathname:n?n.startsWith("/")?n:WMe(n,e):e,search:XMe(r),hash:qMe(i)}}function WMe(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function zE(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function HMe(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function m7(t,e){let n=HMe(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function g7(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Cu(t):(i=Gm({},t),Wn(!i.pathname||!i.pathname.includes("?"),zE("?","pathname","search",i)),Wn(!i.pathname||!i.pathname.includes("#"),zE("#","pathname","hash",i)),Wn(!i.search||!i.search.includes("#"),zE("#","search","hash",i)));let o=t===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let f=e.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}a=f>=0?e[f]:"/"}let l=$Me(i,a),c=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Rl=t=>t.join("/").replace(/\/\/+/g,"/"),GMe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),XMe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,qMe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function YMe(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const v7=["post","put","patch","delete"];new Set(v7);const KMe=["get",...v7];new Set(KMe);/** + * React Router v6.27.0 + * + * 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 Xm(){return Xm=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),A.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=g7(c,JSON.parse(s),o,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Rl([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,s,o,t])}function ew(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=A.useContext(Gl),{matches:i}=A.useContext(Tu),{pathname:o}=sh(),s=JSON.stringify(m7(i,r.v7_relativeSplatPath));return A.useMemo(()=>g7(t,JSON.parse(s),o,n==="path"),[t,s,o,n])}function eEe(t,e){return tEe(t,e)}function tEe(t,e,n,r){Lg()||Wn(!1);let{navigator:i}=A.useContext(Gl),{matches:o}=A.useContext(Tu),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=sh(),u;if(e){var f;let y=typeof e=="string"?Cu(e):e;l==="/"||(f=y.pathname)!=null&&f.startsWith(l)||Wn(!1),u=y}else u=c;let h=u.pathname||"/",m=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=AMe(t,{pathname:m}),x=sEe(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Rl([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Rl([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,n,r);return e&&x?A.createElement(Q_.Provider,{value:{location:Xm({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:vl.Pop}},x):x}function nEe(){let t=uEe(),e=YMe(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return A.createElement(A.Fragment,null,A.createElement("h2",null,"Unexpected Application Error!"),A.createElement("h3",{style:{fontStyle:"italic"}},e),n?A.createElement("pre",{style:i},n):null,null)}const rEe=A.createElement(nEe,null);class iEe extends A.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?A.createElement(Tu.Provider,{value:this.props.routeContext},A.createElement(x7.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function oEe(t){let{routeContext:e,match:n,children:r}=t,i=A.useContext(J_);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),A.createElement(Tu.Provider,{value:e},r)}function sEe(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let u=s.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);u>=0||Wn(!1),s=s.slice(0,Math.min(s.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((u,f,h)=>{let m,v=!1,x=null,y=null;n&&(m=a&&f.route.id?a[f.route.id]:void 0,x=f.route.errorElement||rEe,l&&(c<0&&h===0?(v=!0,y=null):c===h&&(v=!0,y=f.route.hydrateFallbackElement||null)));let g=e.concat(s.slice(0,h+1)),b=()=>{let _;return m?_=x:v?_=y:f.route.Component?_=A.createElement(f.route.Component,null):f.route.element?_=f.route.element:_=u,A.createElement(oEe,{match:f,routeContext:{outlet:u,matches:g,isDataRoute:n!=null},children:_})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?A.createElement(iEe,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:b(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):b()},null)}var _7=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(_7||{}),Bx=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Bx||{});function aEe(t){let e=A.useContext(J_);return e||Wn(!1),e}function lEe(t){let e=A.useContext(y7);return e||Wn(!1),e}function cEe(t){let e=A.useContext(Tu);return e||Wn(!1),e}function w7(t){let e=cEe(),n=e.matches[e.matches.length-1];return n.route.id||Wn(!1),n.route.id}function uEe(){var t;let e=A.useContext(x7),n=lEe(Bx.UseRouteError),r=w7(Bx.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function fEe(){let{router:t}=aEe(_7.UseNavigateStable),e=w7(Bx.UseNavigateStable),n=A.useRef(!1);return b7(()=>{n.current=!0}),A.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Xm({fromRouteId:e},o)))},[t,e])}function gp(t){Wn(!1)}function dEe(t){let{basename:e="/",children:n=null,location:r,navigationType:i=vl.Pop,navigator:o,static:s=!1,future:a}=t;Lg()&&Wn(!1);let l=e.replace(/^\/*/,"/"),c=A.useMemo(()=>({basename:l,navigator:o,static:s,future:Xm({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof r=="string"&&(r=Cu(r));let{pathname:u="/",search:f="",hash:h="",state:m=null,key:v="default"}=r,x=A.useMemo(()=>{let y=Od(u,l);return y==null?null:{location:{pathname:y,search:f,hash:h,state:m,key:v},navigationType:i}},[l,u,f,h,m,v,i]);return x==null?null:A.createElement(Gl.Provider,{value:c},A.createElement(Q_.Provider,{children:n,value:x}))}function hEe(t){let{children:e,location:n}=t;return eEe(ZC(e),n)}new Promise(()=>{});function ZC(t,e){e===void 0&&(e=[]);let n=[];return A.Children.forEach(t,(r,i)=>{if(!A.isValidElement(r))return;let o=[...e,i];if(r.type===A.Fragment){n.push.apply(n,ZC(r.props.children,o));return}r.type!==gp&&Wn(!1),!r.props.index||!r.props.children||Wn(!1);let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=ZC(r.props.children,o)),n.push(s)}),n}/** + * React Router DOM v6.27.0 + * + * 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 jx(){return jx=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function pEe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function mEe(t,e){return t.button===0&&(!e||e==="_self")&&!pEe(t)}const gEe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],vEe=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],yEe="6";try{window.__reactRouterVersion=yEe}catch{}const xEe=A.createContext({isTransitioning:!1}),bEe="startTransition",c5=Hp[bEe];function _Ee(t){let{basename:e,children:n,future:r,window:i}=t,o=A.useRef();o.current==null&&(o.current=CMe({window:i,v5Compat:!0}));let s=o.current,[a,l]=A.useState({action:s.action,location:s.location}),{v7_startTransition:c}=r||{},u=A.useCallback(f=>{c&&c5?c5(()=>l(f)):l(f)},[l,c]);return A.useLayoutEffect(()=>s.listen(u),[s,u]),A.createElement(dEe,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const wEe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",SEe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hy=A.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,viewTransition:f}=e,h=S7(e,gEe),{basename:m}=A.useContext(Gl),v,x=!1;if(typeof c=="string"&&SEe.test(c)&&(v=c,wEe))try{let _=new URL(window.location.href),S=c.startsWith("//")?new URL(_.protocol+c):new URL(c),P=Od(S.pathname,m);S.origin===_.origin&&P!=null?c=P+S.search+S.hash:x=!0}catch{}let y=ZMe(c,{relative:i}),g=CEe(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:f});function b(_){r&&r(_),_.defaultPrevented||g(_)}return A.createElement("a",jx({},h,{href:v||y,onClick:x||o?r:b,ref:n,target:l}))}),MEe=A.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:s=!1,style:a,to:l,viewTransition:c,children:u}=e,f=S7(e,vEe),h=ew(l,{relative:f.relative}),m=sh(),v=A.useContext(y7),{navigator:x,basename:y}=A.useContext(Gl),g=v!=null&&TEe(h)&&c===!0,b=x.encodeLocation?x.encodeLocation(h).pathname:h.pathname,_=m.pathname,S=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;i||(_=_.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase()),S&&y&&(S=Od(S,y)||S);const P=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let N=_===b||!s&&_.startsWith(b)&&_.charAt(P)==="/",T=S!=null&&(S===b||!s&&S.startsWith(b)&&S.charAt(b.length)==="/"),L={isActive:N,isPending:T,isTransitioning:g},U=N?r:void 0,M;typeof o=="function"?M=o(L):M=[o,N?"active":null,T?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let R=typeof a=="function"?a(L):a;return A.createElement(Hy,jx({},f,{"aria-current":U,className:M,ref:n,style:R,to:l,viewTransition:c}),typeof u=="function"?u(L):u)});var JC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(JC||(JC={}));var u5;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(u5||(u5={}));function EEe(t){let e=A.useContext(J_);return e||Wn(!1),e}function CEe(t,e){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,viewTransition:a}=e===void 0?{}:e,l=JMe(),c=sh(),u=ew(t,{relative:s});return A.useCallback(f=>{if(mEe(f,n)){f.preventDefault();let h=r!==void 0?r:zx(c)===zx(u);l(t,{replace:h,state:i,preventScrollReset:o,relative:s,viewTransition:a})}},[c,l,u,r,i,n,t,o,s,a])}function TEe(t,e){e===void 0&&(e={});let n=A.useContext(xEe);n==null&&Wn(!1);let{basename:r}=EEe(JC.useViewTransitionState),i=ew(t,{relative:e.relative});if(!n.isTransitioning)return!1;let o=Od(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Od(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ux(i.pathname,s)!=null||Ux(i.pathname,o)!=null}const REe="jacobfilik/XASDataLibrary";function AEe(){const t=REe;return C.jsxs(jZ,{maxWidth:"md",sx:{alignSelf:"center",p:"24px"},children:[C.jsx(sr,{variant:"h4",padding:"24px",children:"Welcome to the XAS Data Viewer!"}),C.jsxs(Bs,{children:[C.jsxs(sr,{paragraph:!0,children:["A prototype viewer for"," ",C.jsx(Hy,{to:"https://docs.xrayabsorption.org/xaslib/xdi.html",children:"XDI files"})," ","stored in a github repository. As part of the website build process, the XDI files are pulled in and indexed, giving simple static website to display open data. The website is currently pointing as a fork of the data in"," ",C.jsx(Hy,{to:"https://github.com/"+t,children:t}),"."]}),C.jsxs(sr,{paragraph:!0,children:["The database is open to ",C.jsx(Hy,{to:"view",children:" search and download "}),"."]})]})]})}function PEe(){return C.jsx(_1,{fontSize:"large",children:C.jsx("svg",{"xmlns:cc":"http://creativecommons.org/ns#","xmlns:rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns:svg":"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/svg","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape",width:"128mm",height:"128mm",stroke:"currentColor",strokeWidth:"10",fill:"currentColor",fillOpacity:0,viewBox:"0 0 128 128",version:"1.1",id:"svg8","inkscape:version":"1.0.2 (e86c870879, 2021-01-15)","sodipodi:docname":"xas.svg",children:C.jsxs("g",{children:[C.jsx("ellipse",{id:"path10",cx:"63.999969",cy:"63.999977","inkscape:transform-center-x":"-5.865903","inkscape:transform-center-y":"5.0209768",rx:"56.583519",ry:"56.583527"}),C.jsx("path",{d:"m 16.735593,100.44088 c 0,0 7.70744,-0.26134 11.237986,-2.870607 3.530546,-2.609263 5.156198,-5.498236 7.679809,-12.583372 2.523611,-7.085136 2.848188,-18.380097 4.131012,-30.102996 1.282824,-11.722899 3.230562,-44.480225 3.230562,-44.480225 4.962867,19.231513 6.224793,38.773768 14.888602,57.69454 2.414322,5.272605 9.885109,-17.110327 17.038135,-18.175536 7.378059,-1.10638 11.361319,13.99222 22.096164,13.889823 7.447127,0.173557 14.641057,-5.092574 22.300757,-7.450702 v 0",id:"path835","sodipodi:nodetypes":"czzzcscccc"})]})})})}function NEe(t){const e={Home:"/",Explore:"/view",Viewer:"/xdiviewer"};return C.jsx(AK,{style:{position:"static"},children:C.jsxs(ute,{sx:{justifyContent:"space-between",alignItems:"center"},children:[C.jsxs(rs,{direction:"row",alignItems:"center",spacing:2,children:[C.jsx(Bs,{children:C.jsx(PEe,{})}),C.jsx(sr,{variant:"h4",component:"div",sx:{flexGrow:1},children:"XAS Data Viewer"}),C.jsx(m6,{component:rs,direction:"row",children:Object.entries(e).map(([n,r])=>C.jsx(PQ,{children:C.jsx(xQ,{component:MEe,to:r,sx:{"&.active":{color:i=>i.palette.text.secondary}},children:C.jsx(OQ,{primary:n})})},n))})]}),C.jsx(rs,{direction:"row",alignItems:"center",children:C.jsx(BZ,{icon:C.jsx(mSe,{}),checkedIcon:C.jsx(pSe,{}),checked:t.colorMode==="dark",onChange:t.toggleColorMode})})]})})}const IEe=qe("input")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",bottom:0,left:0,whiteSpace:"nowrap",width:1});function LEe(t){const[e,n]=A.useState(""),[r,i]=A.useState("No file"),o=A.useContext(lg),s=l=>{l.preventDefault(),Dn.get(e).then(c=>{const u=_d.parseFile(c.data,e);o.setXDIFile(u);const f={id:e,beamline:u.beamline,edge:u.edge,element:u.element,sample:u.sample,start_time:u.date};i(e),t.setXASMetadata(f)})},a=l=>{if(l.target.files!=null){const c=new FileReader;c.onload=async u=>{if(u.target!=null&&typeof u.target.result=="string"){let f;try{f=_d.parseFile(u.target.result,"localfile"),o.setXDIFile(f);const h={id:e,beamline:{name:f.beamline},edge:f.edge,element:f.element,sample:f.build_sample(),start_time:f.date};t.setXASMetadata(h)}catch(h){console.log(h)}}},i(l.target.files[0].name),c.readAsText(l.target.files[0])}};return C.jsx(gu,{elevation:3,variant:"outlined",square:!1,sx:{p:2},children:C.jsxs(rs,{spacing:2,sx:{justifyContent:"flex-start",alignItems:"flex-start"},children:[C.jsx(sr,{variant:"h5",children:"Upload XDI File"}),C.jsxs(rs,{direction:"row",component:"form",onSubmit:s,spacing:1,children:[C.jsx(Vte,{margin:"dense",sx:{width:"75%"},id:"xdi-url",label:"XDI file URL",variant:"outlined",value:e,onChange:l=>{n(l.target.value)}}),C.jsx(ou,{variant:"contained",type:"submit",children:"Fetch"})]}),C.jsxs(ou,{variant:"contained",role:void 0,tabIndex:-1,component:"label",children:["Upload Local File",C.jsx(IEe,{type:"file",name:"file1",onChange:a})]}),C.jsx(sr,{noWrap:!0,sx:{overflow:"hidden",textOverflow:"ellipsis",width:"100%"},children:r})]})})}function kEe(){const[t,e]=A.useState(null);return C.jsxs(rs,{spacing:2,children:[C.jsx(LEe,{setXASMetadata:e}),t&&C.jsx(kR,{standard:t,showDownload:!1,showCompare:!1})]})}function OEe(){const[t,e]=A.useState(null);return C.jsx(LR,{value:{xdiFile:t,setXDIFile:e,comparisonFiles:[],setComparisonFiles:()=>{}},children:C.jsxs(_a,{height:"100%",container:!0,children:[C.jsx(_a,{item:!0,lg:5,md:12,padding:1,children:C.jsx(kEe,{})}),C.jsx(_a,{item:!0,height:"100%",lg:7,md:12,padding:1,children:C.jsx(yP,{})})]})})}function DEe(){const e=sh().pathname.slice(5),[n,r]=A.useState(null),o=A.useContext(OR).find(s=>s.location===e);return A.useEffect(()=>{Dn.get("/webxdiviewer/xdidata/"+e).then(s=>{let a=null;try{a=_d.parseFile(s.data,e)}catch{console.log("Could not read {}",focus)}r(a)})},[e]),C.jsx(LR,{value:{xdiFile:n,setXDIFile:r,comparisonFiles:[],setComparisonFiles:()=>{}},children:C.jsxs(_a,{height:"100%",container:!0,children:[C.jsx(_a,{item:!0,lg:5,md:12,padding:1,children:o?C.jsx(kR,{standard:o,showDownload:!0,showCompare:!1}):C.jsxs(sr,{children:[" Could not find ",e," "]})}),C.jsx(_a,{item:!0,height:"100%",lg:7,md:12,padding:1,children:C.jsx(yP,{})})]})})}function FEe(){const t=Oz("(prefers-color-scheme: dark)"),[e,n]=A.useState(t?"dark":"light"),r=A.useMemo(()=>({toggleColorMode:()=>{n(o=>o==="light"?"dark":"light")}}),[]),i=A.useMemo(()=>bR({palette:{mode:e}}),[e]);return C.jsxs($Y,{theme:i,children:[C.jsx(HZ,{}),C.jsxs(rs,{height:"100vh",width:"100vw",spacing:1,children:[C.jsx(NEe,{colorMode:e,toggleColorMode:r.toggleColorMode}),C.jsx(gne,{children:C.jsxs(hEe,{children:[C.jsx(gp,{path:"/",element:C.jsx(AEe,{})}),C.jsx(gp,{path:"/view",element:C.jsx(EMe,{})}),C.jsx(gp,{path:"/xdiviewer",element:C.jsx(OEe,{})}),C.jsx(gp,{path:"/xdi/:id/*",element:C.jsx(DEe,{})})]})})]})]})}XT(document.getElementById("root")).render(C.jsx(A.StrictMode,{children:C.jsx(_Ee,{children:C.jsx(FEe,{})})})); diff --git a/assets/index-M1BD4Zx-.js b/assets/index-M1BD4Zx-.js deleted file mode 100644 index 0399cbb..0000000 --- a/assets/index-M1BD4Zx-.js +++ /dev/null @@ -1,4191 +0,0 @@ -var cj=Object.defineProperty;var Z3=t=>{throw TypeError(t)};var uj=(t,e,n)=>e in t?cj(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ht=(t,e,n)=>uj(t,typeof e!="symbol"?e+"":e,n),fS=(t,e,n)=>e.has(t)||Z3("Cannot "+n);var Vo=(t,e,n)=>(fS(t,e,"read from private field"),n?n.call(t):e.get(t)),dS=(t,e,n)=>e.has(t)?Z3("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),O0=(t,e,n,r)=>(fS(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),hS=(t,e,n)=>(fS(t,e,"access private method"),n);function fj(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var D0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function js(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Vs(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var d5={exports:{}},Wx={},h5={exports:{}},Gt={};/** - * @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 Jm=Symbol.for("react.element"),dj=Symbol.for("react.portal"),hj=Symbol.for("react.fragment"),pj=Symbol.for("react.strict_mode"),mj=Symbol.for("react.profiler"),gj=Symbol.for("react.provider"),vj=Symbol.for("react.context"),yj=Symbol.for("react.forward_ref"),xj=Symbol.for("react.suspense"),bj=Symbol.for("react.memo"),_j=Symbol.for("react.lazy"),J3=Symbol.iterator;function wj(t){return t===null||typeof t!="object"?null:(t=J3&&t[J3]||t["@@iterator"],typeof t=="function"?t:null)}var p5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m5=Object.assign,g5={};function Dd(t,e,n){this.props=t,this.context=e,this.refs=g5,this.updater=n||p5}Dd.prototype.isReactComponent={};Dd.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Dd.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function v5(){}v5.prototype=Dd.prototype;function QC(t,e,n){this.props=t,this.context=e,this.refs=g5,this.updater=n||p5}var eT=QC.prototype=new v5;eT.constructor=QC;m5(eT,Dd.prototype);eT.isPureReactComponent=!0;var Q3=Array.isArray,y5=Object.prototype.hasOwnProperty,tT={current:null},x5={key:!0,ref:!0,__self:!0,__source:!0};function b5(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)y5.call(e,r)&&!x5.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,he=F[J];if(0>>1;Ji(ae,K))gei(Me,ae)?(F[J]=Me,F[ge]=K,J=ge):(F[J]=ae,F[ee]=K,J=ee);else if(gei(Me,K))F[J]=Me,F[ge]=K,J=ge;else break e}}return q}function i(F,q){var K=F.sortIndex-q.sortIndex;return K!==0?K:F.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,h=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(F){for(var q=n(c);q!==null;){if(q.callback===null)r(c);else if(q.startTime<=F)r(c),q.sortIndex=q.expirationTime,e(l,q);else break;q=n(c)}}function S(F){if(x=!1,_(F),!v)if(n(l)!==null)v=!0,H(P);else{var q=n(c);q!==null&&Z(S,q.startTime-F)}}function P(F,q){v=!1,x&&(x=!1,g(L),L=-1),m=!0;var K=h;try{for(_(q),f=n(l);f!==null&&(!(f.expirationTime>q)||F&&!T());){var J=f.callback;if(typeof J=="function"){f.callback=null,h=f.priorityLevel;var he=J(f.expirationTime<=q);q=t.unstable_now(),typeof he=="function"?f.callback=he:f===n(l)&&r(l),_(q)}else r(l);f=n(l)}if(f!==null)var le=!0;else{var ee=n(c);ee!==null&&Z(S,ee.startTime-q),le=!1}return le}finally{f=null,h=K,m=!1}}var N=!1,R=null,L=-1,U=5,M=-1;function T(){return!(t.unstable_now()-MF||125J?(F.sortIndex=K,e(c,F),n(l)===null&&F===n(c)&&(x?(g(L),L=-1):x=!0,Z(S,K-J))):(F.sortIndex=he,e(l,F),v||m||(v=!0,H(P))),F},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(F){var q=h;return function(){var K=h;h=q;try{return F.apply(this,arguments)}finally{h=K}}}})(E5);M5.exports=E5;var Lj=M5.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 kj=A,no=Lj;function Be(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),DE=Object.prototype.hasOwnProperty,Oj=/^[: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]*$/,tN={},nN={};function Dj(t){return DE.call(nN,t)?!0:DE.call(tN,t)?!1:Oj.test(t)?nN[t]=!0:(tN[t]=!0,!1)}function Fj(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function zj(t,e,n,r){if(e===null||typeof e>"u"||Fj(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 hi(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Nr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Nr[t]=new hi(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Nr[e]=new hi(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Nr[t]=new hi(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Nr[t]=new hi(t,2,!1,t,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(t){Nr[t]=new hi(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Nr[t]=new hi(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Nr[t]=new hi(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Nr[t]=new hi(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Nr[t]=new hi(t,5,!1,t.toLowerCase(),null,!1,!1)});var rT=/[\-:]([a-z])/g;function iT(t){return t[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(t){var e=t.replace(rT,iT);Nr[e]=new hi(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(rT,iT);Nr[e]=new hi(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(rT,iT);Nr[e]=new hi(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Nr[t]=new hi(t,1,!1,t.toLowerCase(),null,!1,!1)});Nr.xlinkHref=new hi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Nr[t]=new hi(t,1,!1,t.toLowerCase(),null,!0,!0)});function oT(t,e,n,r){var i=Nr.hasOwnProperty(e)?Nr[e]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{gS=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?up(t):""}function Uj(t){switch(t.tag){case 5:return up(t.type);case 16:return up("Lazy");case 13:return up("Suspense");case 19:return up("SuspenseList");case 0:case 2:case 15:return t=vS(t.type,!1),t;case 11:return t=vS(t.type.render,!1),t;case 1:return t=vS(t.type,!0),t;default:return""}}function BE(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Af:return"Fragment";case Rf:return"Portal";case FE:return"Profiler";case sT:return"StrictMode";case zE:return"Suspense";case UE:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case R5:return(t.displayName||"Context")+".Consumer";case T5:return(t._context.displayName||"Context")+".Provider";case aT:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case lT:return e=t.displayName||null,e!==null?e:BE(t.type)||"Memo";case sl:e=t._payload,t=t._init;try{return BE(t(e))}catch{}}return null}function Bj(t){var e=t.type;switch(t.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 t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return BE(e);case 8:return e===sT?"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 Tl(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function P5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function jj(t){var e=P5(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function U0(t){t._valueTracker||(t._valueTracker=jj(t))}function N5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=P5(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Xy(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function jE(t,e){var n=e.checked;return On({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function iN(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Tl(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function I5(t,e){e=e.checked,e!=null&&oT(t,"checked",e,!1)}function VE(t,e){I5(t,e);var n=Tl(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?$E(t,e.type,n):e.hasOwnProperty("defaultValue")&&$E(t,e.type,Tl(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function oN(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function $E(t,e,n){(e!=="number"||Xy(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var fp=Array.isArray;function Yf(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=B0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Kp(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var bp={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},Vj=["Webkit","ms","Moz","O"];Object.keys(bp).forEach(function(t){Vj.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),bp[e]=bp[t]})});function D5(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||bp.hasOwnProperty(t)&&bp[t]?(""+e).trim():e+"px"}function F5(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=D5(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var $j=On({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 GE(t,e){if(e){if($j[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Be(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Be(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Be(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Be(62))}}function XE(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 qE=null;function cT(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var YE=null,Kf=null,Zf=null;function lN(t){if(t=tg(t)){if(typeof YE!="function")throw Error(Be(280));var e=t.stateNode;e&&(e=Yx(e),YE(t.stateNode,t.type,e))}}function z5(t){Kf?Zf?Zf.push(t):Zf=[t]:Kf=t}function U5(){if(Kf){var t=Kf,e=Zf;if(Zf=Kf=null,lN(t),e)for(t=0;t>>=0,t===0?32:31-(eV(t)/tV|0)|0}var j0=64,V0=4194304;function dp(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Zy(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=dp(a):(o&=s,o!==0&&(r=dp(o)))}else s=n&~i,s!==0?r=dp(s):o!==0&&(r=dp(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Qm(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ts(e),t[e]=n}function oV(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=wp),vN=" ",yN=!1;function oD(t,e){switch(t){case"keyup":return LV.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sD(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Pf=!1;function OV(t,e){switch(t){case"compositionend":return sD(e);case"keypress":return e.which!==32?null:(yN=!0,vN);case"textInput":return t=e.data,t===vN&&yN?null:t;default:return null}}function DV(t,e){if(Pf)return t==="compositionend"||!vT&&oD(t,e)?(t=rD(),xy=pT=dl=null,Pf=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wN(n)}}function uD(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?uD(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function fD(){for(var t=window,e=Xy();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Xy(t.document)}return e}function yT(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function HV(t){var e=fD(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&uD(n.ownerDocument.documentElement,n)){if(r!==null&&yT(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=SN(n,o);var s=SN(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Nf=null,t2=null,Mp=null,n2=!1;function MN(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;n2||Nf==null||Nf!==Xy(r)||(r=Nf,"selectionStart"in r&&yT(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mp&&nm(Mp,r)||(Mp=r,r=e1(t2,"onSelect"),0kf||(t.current=l2[kf],l2[kf]=null,kf--)}function bn(t,e){kf++,l2[kf]=t.current,t.current=e}var Rl={},Yr=Dl(Rl),Ri=Dl(!1),Zc=Rl;function ud(t,e){var n=t.type.contextTypes;if(!n)return Rl;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ai(t){return t=t.childContextTypes,t!=null}function n1(){Sn(Ri),Sn(Yr)}function NN(t,e,n){if(Yr.current!==Rl)throw Error(Be(168));bn(Yr,e),bn(Ri,n)}function bD(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Be(108,Bj(t)||"Unknown",i));return On({},n,r)}function r1(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Rl,Zc=Yr.current,bn(Yr,t),bn(Ri,Ri.current),!0}function IN(t,e,n){var r=t.stateNode;if(!r)throw Error(Be(169));n?(t=bD(t,e,Zc),r.__reactInternalMemoizedMergedChildContext=t,Sn(Ri),Sn(Yr),bn(Yr,t)):Sn(Ri),bn(Ri,n)}var la=null,Kx=!1,NS=!1;function _D(t){la===null?la=[t]:la.push(t)}function r$(t){Kx=!0,_D(t)}function Fl(){if(!NS&&la!==null){NS=!0;var t=0,e=dn;try{var n=la;for(dn=1;t>=s,i-=s,ha=1<<32-ts(e)+i|n<L?(U=R,R=null):U=R.sibling;var M=h(g,R,_[L],S);if(M===null){R===null&&(R=U);break}t&&R&&M.alternate===null&&e(g,R),b=o(M,b,L),N===null?P=M:N.sibling=M,N=M,R=U}if(L===_.length)return n(g,R),Tn&&hc(g,L),P;if(R===null){for(;L<_.length;L++)R=f(g,_[L],S),R!==null&&(b=o(R,b,L),N===null?P=R:N.sibling=R,N=R);return Tn&&hc(g,L),P}for(R=r(g,R);L<_.length;L++)U=m(R,g,L,_[L],S),U!==null&&(t&&U.alternate!==null&&R.delete(U.key===null?L:U.key),b=o(U,b,L),N===null?P=U:N.sibling=U,N=U);return t&&R.forEach(function(T){return e(g,T)}),Tn&&hc(g,L),P}function x(g,b,_,S){var P=Rh(_);if(typeof P!="function")throw Error(Be(150));if(_=P.call(_),_==null)throw Error(Be(151));for(var N=P=null,R=b,L=b=0,U=null,M=_.next();R!==null&&!M.done;L++,M=_.next()){R.index>L?(U=R,R=null):U=R.sibling;var T=h(g,R,M.value,S);if(T===null){R===null&&(R=U);break}t&&R&&T.alternate===null&&e(g,R),b=o(T,b,L),N===null?P=T:N.sibling=T,N=T,R=U}if(M.done)return n(g,R),Tn&&hc(g,L),P;if(R===null){for(;!M.done;L++,M=_.next())M=f(g,M.value,S),M!==null&&(b=o(M,b,L),N===null?P=M:N.sibling=M,N=M);return Tn&&hc(g,L),P}for(R=r(g,R);!M.done;L++,M=_.next())M=m(R,g,L,M.value,S),M!==null&&(t&&M.alternate!==null&&R.delete(M.key===null?L:M.key),b=o(M,b,L),N===null?P=M:N.sibling=M,N=M);return t&&R.forEach(function(D){return e(g,D)}),Tn&&hc(g,L),P}function y(g,b,_,S){if(typeof _=="object"&&_!==null&&_.type===Af&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case z0:e:{for(var P=_.key,N=b;N!==null;){if(N.key===P){if(P=_.type,P===Af){if(N.tag===7){n(g,N.sibling),b=i(N,_.props.children),b.return=g,g=b;break e}}else if(N.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===sl&&ON(P)===N.type){n(g,N.sibling),b=i(N,_.props),b.ref=Lh(g,N,_),b.return=g,g=b;break e}n(g,N);break}else e(g,N);N=N.sibling}_.type===Af?(b=Dc(_.props.children,g.mode,S,_.key),b.return=g,g=b):(S=Ty(_.type,_.key,_.props,null,g.mode,S),S.ref=Lh(g,b,_),S.return=g,g=S)}return s(g);case Rf:e:{for(N=_.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===_.containerInfo&&b.stateNode.implementation===_.implementation){n(g,b.sibling),b=i(b,_.children||[]),b.return=g,g=b;break e}else{n(g,b);break}else e(g,b);b=b.sibling}b=US(_,g.mode,S),b.return=g,g=b}return s(g);case sl:return N=_._init,y(g,b,N(_._payload),S)}if(fp(_))return v(g,b,_,S);if(Rh(_))return x(g,b,_,S);Y0(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,b!==null&&b.tag===6?(n(g,b.sibling),b=i(b,_),b.return=g,g=b):(n(g,b),b=zS(_,g.mode,S),b.return=g,g=b),s(g)):n(g,b)}return y}var dd=ED(!0),CD=ED(!1),s1=Dl(null),a1=null,Ff=null,wT=null;function ST(){wT=Ff=a1=null}function MT(t){var e=s1.current;Sn(s1),t._currentValue=e}function f2(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Qf(t,e){a1=t,wT=Ff=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Ci=!0),t.firstContext=null)}function Io(t){var e=t._currentValue;if(wT!==t)if(t={context:t,memoizedValue:e,next:null},Ff===null){if(a1===null)throw Error(Be(308));Ff=t,a1.dependencies={lanes:0,firstContext:t}}else Ff=Ff.next=t;return e}var Cc=null;function ET(t){Cc===null?Cc=[t]:Cc.push(t)}function TD(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,ET(e)):(n.next=i.next,i.next=n),e.interleaved=n,Ma(t,r)}function Ma(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var al=!1;function CT(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function RD(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ya(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function bl(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,en&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Ma(t,n)}return i=r.interleaved,i===null?(e.next=e,ET(r)):(e.next=i.next,i.next=e),r.interleaved=e,Ma(t,n)}function _y(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fT(t,n)}}function DN(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function l1(t,e,n,r){var i=t.updateQueue;al=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var h=a.lane,m=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=t,x=a;switch(h=e,m=n,x.tag){case 1:if(v=x.payload,typeof v=="function"){f=v.call(m,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,h=typeof v=="function"?v.call(m,f,h):v,h==null)break e;f=On({},f,h);break e;case 2:al=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else m={eventTime:m,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=m,l=f):u=u.next=m,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);eu|=s,t.lanes=s,t.memoizedState=f}}function FN(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=LS.transition;LS.transition={};try{t(!1),e()}finally{dn=n,LS.transition=r}}function HD(){return Lo().memoizedState}function a$(t,e,n){var r=wl(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},GD(t))XD(e,n);else if(n=TD(t,e,n,r),n!==null){var i=ci();ns(n,t,r,i),qD(n,e,r)}}function l$(t,e,n){var r=wl(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(GD(t))XD(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,rs(a,s)){var l=e.interleaved;l===null?(i.next=i,ET(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=TD(t,e,i,r),n!==null&&(i=ci(),ns(n,t,r,i),qD(n,e,r))}}function GD(t){var e=t.alternate;return t===Ln||e!==null&&e===Ln}function XD(t,e){Ep=u1=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function qD(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fT(t,n)}}var f1={readContext:Io,useCallback:Ur,useContext:Ur,useEffect:Ur,useImperativeHandle:Ur,useInsertionEffect:Ur,useLayoutEffect:Ur,useMemo:Ur,useReducer:Ur,useRef:Ur,useState:Ur,useDebugValue:Ur,useDeferredValue:Ur,useTransition:Ur,useMutableSource:Ur,useSyncExternalStore:Ur,useId:Ur,unstable_isNewReconciler:!1},c$={readContext:Io,useCallback:function(t,e){return ws().memoizedState=[t,e===void 0?null:e],t},useContext:Io,useEffect:UN,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Sy(4194308,4,BD.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Sy(4194308,4,t,e)},useInsertionEffect:function(t,e){return Sy(4,2,t,e)},useMemo:function(t,e){var n=ws();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ws();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=a$.bind(null,Ln,t),[r.memoizedState,t]},useRef:function(t){var e=ws();return t={current:t},e.memoizedState=t},useState:zN,useDebugValue:kT,useDeferredValue:function(t){return ws().memoizedState=t},useTransition:function(){var t=zN(!1),e=t[0];return t=s$.bind(null,t[1]),ws().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ln,i=ws();if(Tn){if(n===void 0)throw Error(Be(407));n=n()}else{if(n=e(),br===null)throw Error(Be(349));Qc&30||ID(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,UN(kD.bind(null,r,o,t),[t]),r.flags|=2048,um(9,LD.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=ws(),e=br.identifierPrefix;if(Tn){var n=pa,r=ha;n=(r&~(1<<32-ts(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=lm++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Es]=e,t[om]=r,iF(t,e,!1,!1),e.stateNode=t;e:{switch(s=XE(n,r),n){case"dialog":_n("cancel",t),_n("close",t),i=r;break;case"iframe":case"object":case"embed":_n("load",t),i=r;break;case"video":case"audio":for(i=0;imd&&(e.flags|=128,r=!0,kh(o,!1),e.lanes=4194304)}else{if(!r)if(t=c1(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),kh(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Tn)return Br(e),null}else 2*Xn()-o.renderingStartTime>md&&n!==1073741824&&(e.flags|=128,r=!0,kh(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Xn(),e.sibling=null,n=Nn.current,bn(Nn,r?n&1|2:n&1),e):(Br(e),null);case 22:case 23:return BT(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Gi&1073741824&&(Br(e),e.subtreeFlags&6&&(e.flags|=8192)):Br(e),null;case 24:return null;case 25:return null}throw Error(Be(156,e.tag))}function v$(t,e){switch(bT(e),e.tag){case 1:return Ai(e.type)&&n1(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return hd(),Sn(Ri),Sn(Yr),AT(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return RT(e),null;case 13:if(Sn(Nn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Be(340));fd()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sn(Nn),null;case 4:return hd(),null;case 10:return MT(e.type._context),null;case 22:case 23:return BT(),null;case 24:return null;default:return null}}var Z0=!1,Xr=!1,y$=typeof WeakSet=="function"?WeakSet:Set,at=null;function zf(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vn(t,e,r)}else n.current=null}function b2(t,e,n){try{n()}catch(r){Vn(t,e,r)}}var KN=!1;function x$(t,e){if(r2=Jy,t=fD(),yT(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===t)break t;if(h===n&&++c===i&&(a=s),h===o&&++u===r&&(l=s),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(i2={focusedElem:t,selectionRange:n},Jy=!1,at=e;at!==null;)if(e=at,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,at=t;else for(;at!==null;){e=at;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,y=v.memoizedState,g=e.stateNode,b=g.getSnapshotBeforeUpdate(e.elementType===e.type?x:qo(e.type,x),y);g.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Be(163))}}catch(S){Vn(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,at=t;break}at=e.return}return v=KN,KN=!1,v}function Cp(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&b2(e,n,o)}i=i.next}while(i!==r)}}function Qx(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function _2(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function aF(t){var e=t.alternate;e!==null&&(t.alternate=null,aF(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Es],delete e[om],delete e[a2],delete e[t$],delete e[n$])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function lF(t){return t.tag===5||t.tag===3||t.tag===4}function ZN(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||lF(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function w2(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=t1));else if(r!==4&&(t=t.child,t!==null))for(w2(t,e,n),t=t.sibling;t!==null;)w2(t,e,n),t=t.sibling}function S2(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(S2(t,e,n),t=t.sibling;t!==null;)S2(t,e,n),t=t.sibling}var Cr=null,Ko=!1;function Xa(t,e,n){for(n=n.child;n!==null;)cF(t,e,n),n=n.sibling}function cF(t,e,n){if(As&&typeof As.onCommitFiberUnmount=="function")try{As.onCommitFiberUnmount(Hx,n)}catch{}switch(n.tag){case 5:Xr||zf(n,e);case 6:var r=Cr,i=Ko;Cr=null,Xa(t,e,n),Cr=r,Ko=i,Cr!==null&&(Ko?(t=Cr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Cr.removeChild(n.stateNode));break;case 18:Cr!==null&&(Ko?(t=Cr,n=n.stateNode,t.nodeType===8?PS(t.parentNode,n):t.nodeType===1&&PS(t,n),em(t)):PS(Cr,n.stateNode));break;case 4:r=Cr,i=Ko,Cr=n.stateNode.containerInfo,Ko=!0,Xa(t,e,n),Cr=r,Ko=i;break;case 0:case 11:case 14:case 15:if(!Xr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&b2(n,e,s),i=i.next}while(i!==r)}Xa(t,e,n);break;case 1:if(!Xr&&(zf(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Vn(n,e,a)}Xa(t,e,n);break;case 21:Xa(t,e,n);break;case 22:n.mode&1?(Xr=(r=Xr)||n.memoizedState!==null,Xa(t,e,n),Xr=r):Xa(t,e,n);break;default:Xa(t,e,n)}}function JN(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new y$),e.forEach(function(r){var i=R$.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function $o(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Xn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_$(r/1960))-r,10t?16:t,hl===null)var r=!1;else{if(t=hl,hl=null,p1=0,en&6)throw Error(Be(331));var i=en;for(en|=4,at=t.current;at!==null;){var o=at,s=o.child;if(at.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lXn()-zT?Oc(t,0):FT|=n),Pi(t,e)}function vF(t,e){e===0&&(t.mode&1?(e=V0,V0<<=1,!(V0&130023424)&&(V0=4194304)):e=1);var n=ci();t=Ma(t,e),t!==null&&(Qm(t,e,n),Pi(t,n))}function T$(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),vF(t,n)}function R$(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Be(314))}r!==null&&r.delete(e),vF(t,n)}var yF;yF=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ri.current)Ci=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Ci=!1,m$(t,e,n);Ci=!!(t.flags&131072)}else Ci=!1,Tn&&e.flags&1048576&&wD(e,o1,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;My(t,e),t=e.pendingProps;var i=ud(e,Yr.current);Qf(e,n),i=NT(null,e,r,t,i,n);var o=IT();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ai(r)?(o=!0,r1(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,CT(e),i.updater=Jx,e.stateNode=i,i._reactInternals=e,h2(e,r,t,n),e=g2(null,e,r,!0,o,n)):(e.tag=0,Tn&&o&&xT(e),ii(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(My(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=P$(r),t=qo(r,t),i){case 0:e=m2(null,e,r,t,n);break e;case 1:e=XN(null,e,r,t,n);break e;case 11:e=HN(null,e,r,t,n);break e;case 14:e=GN(null,e,r,qo(r.type,t),n);break e}throw Error(Be(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:qo(r,i),m2(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:qo(r,i),XN(t,e,r,i,n);case 3:e:{if(tF(e),t===null)throw Error(Be(387));r=e.pendingProps,o=e.memoizedState,i=o.element,RD(t,e),l1(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=pd(Error(Be(423)),e),e=qN(t,e,r,n,i);break e}else if(r!==i){i=pd(Error(Be(424)),e),e=qN(t,e,r,n,i);break e}else for(Ki=xl(e.stateNode.containerInfo.firstChild),Zi=e,Tn=!0,Zo=null,n=CD(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fd(),r===i){e=Ea(t,e,n);break e}ii(t,e,r,n)}e=e.child}return e;case 5:return AD(e),t===null&&u2(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,o2(r,i)?s=null:o!==null&&o2(r,o)&&(e.flags|=32),eF(t,e),ii(t,e,s,n),e.child;case 6:return t===null&&u2(e),null;case 13:return nF(t,e,n);case 4:return TT(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=dd(e,null,r,n):ii(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:qo(r,i),HN(t,e,r,i,n);case 7:return ii(t,e,e.pendingProps,n),e.child;case 8:return ii(t,e,e.pendingProps.children,n),e.child;case 12:return ii(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,bn(s1,r._currentValue),r._currentValue=s,o!==null)if(rs(o.value,s)){if(o.children===i.children&&!Ri.current){e=Ea(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=ya(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),f2(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Be(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),f2(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ii(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Qf(e,n),i=Io(i),r=r(i),e.flags|=1,ii(t,e,r,n),e.child;case 14:return r=e.type,i=qo(r,e.pendingProps),i=qo(r.type,i),GN(t,e,r,i,n);case 15:return JD(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:qo(r,i),My(t,e),e.tag=1,Ai(r)?(t=!0,r1(e)):t=!1,Qf(e,n),YD(e,r,i),h2(e,r,i,n),g2(null,e,r,!0,t,n);case 19:return rF(t,e,n);case 22:return QD(t,e,n)}throw Error(Be(156,e.tag))};function xF(t,e){return G5(t,e)}function A$(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ao(t,e,n,r){return new A$(t,e,n,r)}function VT(t){return t=t.prototype,!(!t||!t.isReactComponent)}function P$(t){if(typeof t=="function")return VT(t)?1:0;if(t!=null){if(t=t.$$typeof,t===aT)return 11;if(t===lT)return 14}return 2}function Sl(t,e){var n=t.alternate;return n===null?(n=Ao(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ty(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")VT(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Af:return Dc(n.children,i,o,e);case sT:s=8,i|=8;break;case FE:return t=Ao(12,n,e,i|2),t.elementType=FE,t.lanes=o,t;case zE:return t=Ao(13,n,e,i),t.elementType=zE,t.lanes=o,t;case UE:return t=Ao(19,n,e,i),t.elementType=UE,t.lanes=o,t;case A5:return tb(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case T5:s=10;break e;case R5:s=9;break e;case aT:s=11;break e;case lT:s=14;break e;case sl:s=16,r=null;break e}throw Error(Be(130,t==null?t:typeof t,""))}return e=Ao(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Dc(t,e,n,r){return t=Ao(7,t,r,e),t.lanes=n,t}function tb(t,e,n,r){return t=Ao(22,t,r,e),t.elementType=A5,t.lanes=n,t.stateNode={isHidden:!1},t}function zS(t,e,n){return t=Ao(6,t,null,e),t.lanes=n,t}function US(t,e,n){return e=Ao(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function N$(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xS(0),this.expirationTimes=xS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xS(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $T(t,e,n,r,i,o,s,a,l){return t=new N$(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Ao(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},CT(o),t}function I$(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(SF)}catch(t){console.error(t)}}SF(),S5.exports=so;var zl=S5.exports;const pp=js(zl);var XT,sI=zl;XT=sI.createRoot,sI.hydrateRoot;function MF(t,e){return function(){return t.apply(e,arguments)}}const{toString:F$}=Object.prototype,{getPrototypeOf:qT}=Object,sb=(t=>e=>{const n=F$.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ls=t=>(t=t.toLowerCase(),e=>sb(e)===t),ab=t=>e=>typeof e===t,{isArray:Ud}=Array,dm=ab("undefined");function z$(t){return t!==null&&!dm(t)&&t.constructor!==null&&!dm(t.constructor)&&Ji(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const EF=ls("ArrayBuffer");function U$(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&EF(t.buffer),e}const B$=ab("string"),Ji=ab("function"),CF=ab("number"),lb=t=>t!==null&&typeof t=="object",j$=t=>t===!0||t===!1,Ry=t=>{if(sb(t)!=="object")return!1;const e=qT(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},V$=ls("Date"),$$=ls("File"),W$=ls("Blob"),H$=ls("FileList"),G$=t=>lb(t)&&Ji(t.pipe),X$=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ji(t.append)&&((e=sb(t))==="formdata"||e==="object"&&Ji(t.toString)&&t.toString()==="[object FormData]"))},q$=ls("URLSearchParams"),[Y$,K$,Z$,J$]=["ReadableStream","Request","Response","Headers"].map(ls),Q$=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rg(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),Ud(t))for(r=0,i=t.length;r0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Rc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,RF=t=>!dm(t)&&t!==Rc;function R2(){const{caseless:t}=RF(this)&&this||{},e={},n=(r,i)=>{const o=t&&TF(e,i)||i;Ry(e[o])&&Ry(r)?e[o]=R2(e[o],r):Ry(r)?e[o]=R2({},r):Ud(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r(rg(e,(i,o)=>{n&&Ji(i)?t[o]=MF(i,n):t[o]=i},{allOwnKeys:r}),t),tW=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),nW=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},rW=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&qT(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},iW=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},oW=t=>{if(!t)return null;if(Ud(t))return t;let e=t.length;if(!CF(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},sW=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&qT(Uint8Array)),aW=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},lW=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},cW=ls("HTMLFormElement"),uW=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),aI=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),fW=ls("RegExp"),AF=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};rg(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},dW=t=>{AF(t,(e,n)=>{if(Ji(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Ji(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},hW=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Ud(t)?r(t):r(String(t).split(e)),n},pW=()=>{},mW=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,BS="abcdefghijklmnopqrstuvwxyz",lI="0123456789",PF={DIGIT:lI,ALPHA:BS,ALPHA_DIGIT:BS+BS.toUpperCase()+lI},gW=(t=16,e=PF.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function vW(t){return!!(t&&Ji(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const yW=t=>{const e=new Array(10),n=(r,i)=>{if(lb(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=Ud(r)?[]:{};return rg(r,(s,a)=>{const l=n(s,i+1);!dm(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},xW=ls("AsyncFunction"),bW=t=>t&&(lb(t)||Ji(t))&&Ji(t.then)&&Ji(t.catch),NF=((t,e)=>t?setImmediate:e?((n,r)=>(Rc.addEventListener("message",({source:i,data:o})=>{i===Rc&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Rc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ji(Rc.postMessage)),_W=typeof queueMicrotask<"u"?queueMicrotask.bind(Rc):typeof process<"u"&&process.nextTick||NF,_e={isArray:Ud,isArrayBuffer:EF,isBuffer:z$,isFormData:X$,isArrayBufferView:U$,isString:B$,isNumber:CF,isBoolean:j$,isObject:lb,isPlainObject:Ry,isReadableStream:Y$,isRequest:K$,isResponse:Z$,isHeaders:J$,isUndefined:dm,isDate:V$,isFile:$$,isBlob:W$,isRegExp:fW,isFunction:Ji,isStream:G$,isURLSearchParams:q$,isTypedArray:sW,isFileList:H$,forEach:rg,merge:R2,extend:eW,trim:Q$,stripBOM:tW,inherits:nW,toFlatObject:rW,kindOf:sb,kindOfTest:ls,endsWith:iW,toArray:oW,forEachEntry:aW,matchAll:lW,isHTMLForm:cW,hasOwnProperty:aI,hasOwnProp:aI,reduceDescriptors:AF,freezeMethods:dW,toObjectSet:hW,toCamelCase:uW,noop:pW,toFiniteNumber:mW,findKey:TF,global:Rc,isContextDefined:RF,ALPHABET:PF,generateString:gW,isSpecCompliantForm:vW,toJSONObject:yW,isAsyncFn:xW,isThenable:bW,setImmediate:NF,asap:_W};function zt(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}_e.inherits(zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_e.toJSONObject(this.config),code:this.code,status:this.status}}});const IF=zt.prototype,LF={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{LF[t]={value:t}});Object.defineProperties(zt,LF);Object.defineProperty(IF,"isAxiosError",{value:!0});zt.from=(t,e,n,r,i,o)=>{const s=Object.create(IF);return _e.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),zt.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const wW=null;function A2(t){return _e.isPlainObject(t)||_e.isArray(t)}function kF(t){return _e.endsWith(t,"[]")?t.slice(0,-2):t}function cI(t,e,n){return t?t.concat(e).map(function(i,o){return i=kF(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function SW(t){return _e.isArray(t)&&!t.some(A2)}const MW=_e.toFlatObject(_e,{},null,function(e){return/^is[A-Z]/.test(e)});function cb(t,e,n){if(!_e.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=_e.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,y){return!_e.isUndefined(y[x])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&_e.isSpecCompliantForm(e);if(!_e.isFunction(i))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(_e.isDate(v))return v.toISOString();if(!l&&_e.isBlob(v))throw new zt("Blob is not supported. Use a Buffer instead.");return _e.isArrayBuffer(v)||_e.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function u(v,x,y){let g=v;if(v&&!y&&typeof v=="object"){if(_e.endsWith(x,"{}"))x=r?x:x.slice(0,-2),v=JSON.stringify(v);else if(_e.isArray(v)&&SW(v)||(_e.isFileList(v)||_e.endsWith(x,"[]"))&&(g=_e.toArray(v)))return x=kF(x),g.forEach(function(_,S){!(_e.isUndefined(_)||_===null)&&e.append(s===!0?cI([x],S,o):s===null?x:x+"[]",c(_))}),!1}return A2(v)?!0:(e.append(cI(y,x,o),c(v)),!1)}const f=[],h=Object.assign(MW,{defaultVisitor:u,convertValue:c,isVisitable:A2});function m(v,x){if(!_e.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+x.join("."));f.push(v),_e.forEach(v,function(g,b){(!(_e.isUndefined(g)||g===null)&&i.call(e,g,_e.isString(b)?b.trim():b,x,h))===!0&&m(g,x?x.concat(b):[b])}),f.pop()}}if(!_e.isObject(t))throw new TypeError("data must be an object");return m(t),e}function uI(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function YT(t,e){this._pairs=[],t&&cb(t,this,e)}const OF=YT.prototype;OF.append=function(e,n){this._pairs.push([e,n])};OF.toString=function(e){const n=e?function(r){return e.call(this,r,uI)}:uI;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function EW(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function DF(t,e,n){if(!e)return t;const r=n&&n.encode||EW,i=n&&n.serialize;let o;if(i?o=i(e,n):o=_e.isURLSearchParams(e)?e.toString():new YT(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class fI{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){_e.forEach(this.handlers,function(r){r!==null&&e(r)})}}const FF={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},CW=typeof URLSearchParams<"u"?URLSearchParams:YT,TW=typeof FormData<"u"?FormData:null,RW=typeof Blob<"u"?Blob:null,AW={isBrowser:!0,classes:{URLSearchParams:CW,FormData:TW,Blob:RW},protocols:["http","https","file","blob","url","data"]},KT=typeof window<"u"&&typeof document<"u",P2=typeof navigator=="object"&&navigator||void 0,PW=KT&&(!P2||["ReactNative","NativeScript","NS"].indexOf(P2.product)<0),NW=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",IW=KT&&window.location.href||"http://localhost",LW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:KT,hasStandardBrowserEnv:PW,hasStandardBrowserWebWorkerEnv:NW,navigator:P2,origin:IW},Symbol.toStringTag,{value:"Module"})),Ni={...LW,...AW};function kW(t,e){return cb(t,new Ni.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Ni.isNode&&_e.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function OW(t){return _e.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function DW(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&_e.isArray(i)?i.length:s,l?(_e.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!_e.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&_e.isArray(i[s])&&(i[s]=DW(i[s])),!a)}if(_e.isFormData(t)&&_e.isFunction(t.entries)){const n={};return _e.forEachEntry(t,(r,i)=>{e(OW(r),i,n,0)}),n}return null}function FW(t,e,n){if(_e.isString(t))try{return(e||JSON.parse)(t),_e.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(t)}const ig={transitional:FF,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=_e.isObject(e);if(o&&_e.isHTMLForm(e)&&(e=new FormData(e)),_e.isFormData(e))return i?JSON.stringify(zF(e)):e;if(_e.isArrayBuffer(e)||_e.isBuffer(e)||_e.isStream(e)||_e.isFile(e)||_e.isBlob(e)||_e.isReadableStream(e))return e;if(_e.isArrayBufferView(e))return e.buffer;if(_e.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return kW(e,this.formSerializer).toString();if((a=_e.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return cb(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),FW(e)):e}],transformResponse:[function(e){const n=this.transitional||ig.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(_e.isResponse(e)||_e.isReadableStream(e))return e;if(e&&_e.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?zt.from(a,zt.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ni.classes.FormData,Blob:Ni.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_e.forEach(["delete","get","head","post","put","patch"],t=>{ig.headers[t]={}});const zW=_e.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),UW=t=>{const e={};let n,r,i;return t&&t.split(` -`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&zW[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},dI=Symbol("internals");function Dh(t){return t&&String(t).trim().toLowerCase()}function Ay(t){return t===!1||t==null?t:_e.isArray(t)?t.map(Ay):String(t)}function BW(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const jW=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function jS(t,e,n,r,i){if(_e.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!_e.isString(e)){if(_e.isString(r))return e.indexOf(r)!==-1;if(_e.isRegExp(r))return r.test(e)}}function VW(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function $W(t,e){const n=_e.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}class Ii{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,l,c){const u=Dh(l);if(!u)throw new Error("header name must be a non-empty string");const f=_e.findKey(i,u);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||l]=Ay(a))}const s=(a,l)=>_e.forEach(a,(c,u)=>o(c,u,l));if(_e.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(_e.isString(e)&&(e=e.trim())&&!jW(e))s(UW(e),n);else if(_e.isHeaders(e))for(const[a,l]of e.entries())o(l,a,r);else e!=null&&o(n,e,r);return this}get(e,n){if(e=Dh(e),e){const r=_e.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return BW(i);if(_e.isFunction(n))return n.call(this,i,r);if(_e.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Dh(e),e){const r=_e.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||jS(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=Dh(s),s){const a=_e.findKey(r,s);a&&(!n||jS(r,r[a],a,n))&&(delete r[a],i=!0)}}return _e.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||jS(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return _e.forEach(this,(i,o)=>{const s=_e.findKey(r,o);if(s){n[s]=Ay(i),delete n[o];return}const a=e?VW(o):String(o).trim();a!==o&&delete n[o],n[a]=Ay(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return _e.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&_e.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[dI]=this[dI]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Dh(s);r[a]||($W(i,s),r[a]=!0)}return _e.isArray(e)?e.forEach(o):o(e),this}}Ii.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_e.reduceDescriptors(Ii.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});_e.freezeMethods(Ii);function VS(t,e){const n=this||ig,r=e||n,i=Ii.from(r.headers);let o=r.data;return _e.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function UF(t){return!!(t&&t.__CANCEL__)}function Bd(t,e,n){zt.call(this,t??"canceled",zt.ERR_CANCELED,e,n),this.name="CanceledError"}_e.inherits(Bd,zt,{__CANCEL__:!0});function BF(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new zt("Request failed with status code "+n.status,[zt.ERR_BAD_REQUEST,zt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function WW(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function HW(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[o];s||(s=c),n[i]=l,r[i]=c;let f=o,h=0;for(;f!==i;)h+=n[f++],f=f%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),c-s{n=u,i=null,o&&(clearTimeout(o),o=null),t.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?s(c,u):(i=c,o||(o=setTimeout(()=>{o=null,s(i)},r-f)))},()=>i&&s(i)]}const v1=(t,e,n=3)=>{let r=0;const i=HW(50,250);return GW(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-r,c=i(l),u=s<=a;r=s;const f={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-s)/c:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(f)},n)},hI=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},pI=t=>(...e)=>_e.asap(()=>t(...e)),XW=Ni.hasStandardBrowserEnv?function(){const e=Ni.navigator&&/(msie|trident)/i.test(Ni.navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=_e.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),qW=Ni.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];_e.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),_e.isString(r)&&s.push("path="+r),_e.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function YW(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function KW(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function jF(t,e){return t&&!YW(e)?KW(t,e):e}const mI=t=>t instanceof Ii?{...t}:t;function nu(t,e){e=e||{};const n={};function r(c,u,f){return _e.isPlainObject(c)&&_e.isPlainObject(u)?_e.merge.call({caseless:f},c,u):_e.isPlainObject(u)?_e.merge({},u):_e.isArray(u)?u.slice():u}function i(c,u,f){if(_e.isUndefined(u)){if(!_e.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function o(c,u){if(!_e.isUndefined(u))return r(void 0,u)}function s(c,u){if(_e.isUndefined(u)){if(!_e.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in e)return r(c,u);if(f in t)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>i(mI(c),mI(u),!0)};return _e.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,h=f(t[u],e[u],u);_e.isUndefined(h)&&f!==a||(n[u]=h)}),n}const VF=t=>{const e=nu({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=e;e.headers=s=Ii.from(s),e.url=DF(jF(e.baseURL,e.url),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(_e.isFormData(n)){if(Ni.hasStandardBrowserEnv||Ni.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[c,...u]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Ni.hasStandardBrowserEnv&&(r&&_e.isFunction(r)&&(r=r(e)),r||r!==!1&&XW(e.url))){const c=i&&o&&qW.read(o);c&&s.set(i,c)}return e},ZW=typeof XMLHttpRequest<"u",JW=ZW&&function(t){return new Promise(function(n,r){const i=VF(t);let o=i.data;const s=Ii.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,f,h,m,v;function x(){m&&m(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function g(){if(!y)return;const _=Ii.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),P={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:t,request:y};BF(function(R){n(R),x()},function(R){r(R),x()},P),y=null}"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(g)},y.onabort=function(){y&&(r(new zt("Request aborted",zt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new zt("Network Error",zt.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const P=i.transitional||FF;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),r(new zt(S,P.clarifyTimeoutError?zt.ETIMEDOUT:zt.ECONNABORTED,t,y)),y=null},o===void 0&&s.setContentType(null),"setRequestHeader"in y&&_e.forEach(s.toJSON(),function(S,P){y.setRequestHeader(P,S)}),_e.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),a&&a!=="json"&&(y.responseType=i.responseType),c&&([h,v]=v1(c,!0),y.addEventListener("progress",h)),l&&y.upload&&([f,m]=v1(l),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(u=_=>{y&&(r(!_||_.type?new Bd(null,t,y):_),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const b=WW(i.url);if(b&&Ni.protocols.indexOf(b)===-1){r(new zt("Unsupported protocol "+b+":",zt.ERR_BAD_REQUEST,t));return}y.send(o||null)})},QW=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const o=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof zt?u:new Bd(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,o(new zt(`timeout ${e} of ms exceeded`,zt.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),t=null)};t.forEach(c=>c.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>_e.asap(a),l}},eH=function*(t,e){let n=t.byteLength;if(n{const i=tH(t,e);let o=0,s,a=l=>{s||(s=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let f=u.byteLength;if(n){let h=o+=f;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},ub=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",$F=ub&&typeof ReadableStream=="function",rH=ub&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),WF=(t,...e)=>{try{return!!t(...e)}catch{return!1}},iH=$F&&WF(()=>{let t=!1;const e=new Request(Ni.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),vI=64*1024,N2=$F&&WF(()=>_e.isReadableStream(new Response("").body)),y1={stream:N2&&(t=>t.body)};ub&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!y1[e]&&(y1[e]=_e.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new zt(`Response type '${e}' is not supported`,zt.ERR_NOT_SUPPORT,r)})})})(new Response);const oH=async t=>{if(t==null)return 0;if(_e.isBlob(t))return t.size;if(_e.isSpecCompliantForm(t))return(await new Request(Ni.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(_e.isArrayBufferView(t)||_e.isArrayBuffer(t))return t.byteLength;if(_e.isURLSearchParams(t)&&(t=t+""),_e.isString(t))return(await rH(t)).byteLength},sH=async(t,e)=>{const n=_e.toFiniteNumber(t.getContentLength());return n??oH(e)},aH=ub&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:h}=VF(t);c=c?(c+"").toLowerCase():"text";let m=QW([i,o&&o.toAbortSignal()],s),v;const x=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let y;try{if(l&&iH&&n!=="get"&&n!=="head"&&(y=await sH(u,r))!==0){let P=new Request(e,{method:"POST",body:r,duplex:"half"}),N;if(_e.isFormData(r)&&(N=P.headers.get("content-type"))&&u.setContentType(N),P.body){const[R,L]=hI(y,v1(pI(l)));r=gI(P.body,vI,R,L)}}_e.isString(f)||(f=f?"include":"omit");const g="credentials"in Request.prototype;v=new Request(e,{...h,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:g?f:void 0});let b=await fetch(v);const _=N2&&(c==="stream"||c==="response");if(N2&&(a||_&&x)){const P={};["status","statusText","headers"].forEach(U=>{P[U]=b[U]});const N=_e.toFiniteNumber(b.headers.get("content-length")),[R,L]=a&&hI(N,v1(pI(a),!0))||[];b=new Response(gI(b.body,vI,R,()=>{L&&L(),x&&x()}),P)}c=c||"text";let S=await y1[_e.findKey(y1,c)||"text"](b,t);return!_&&x&&x(),await new Promise((P,N)=>{BF(P,N,{data:S,headers:Ii.from(b.headers),status:b.status,statusText:b.statusText,config:t,request:v})})}catch(g){throw x&&x(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new zt("Network Error",zt.ERR_NETWORK,t,v),{cause:g.cause||g}):zt.from(g,g&&g.code,t,v)}}),I2={http:wW,xhr:JW,fetch:aH};_e.forEach(I2,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const yI=t=>`- ${t}`,lH=t=>_e.isFunction(t)||t===null||t===!1,HF={getAdapter:t=>{t=_e.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since : -`+o.map(yI).join(` -`):" "+yI(o[0]):"as no adapter specified";throw new zt("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:I2};function $S(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Bd(null,t)}function xI(t){return $S(t),t.headers=Ii.from(t.headers),t.data=VS.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),HF.getAdapter(t.adapter||ig.adapter)(t).then(function(r){return $S(t),r.data=VS.call(t,t.transformResponse,r),r.headers=Ii.from(r.headers),r},function(r){return UF(r)||($S(t),r&&r.response&&(r.response.data=VS.call(t,t.transformResponse,r.response),r.response.headers=Ii.from(r.response.headers))),Promise.reject(r)})}const GF="1.7.7",ZT={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ZT[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const bI={};ZT.transitional=function(e,n,r){function i(o,s){return"[Axios v"+GF+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new zt(i(s," has been removed"+(n?" in "+n:"")),zt.ERR_DEPRECATED);return n&&!bI[s]&&(bI[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function cH(t,e,n){if(typeof t!="object")throw new zt("options must be an object",zt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new zt("option "+o+" must be "+l,zt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new zt("Unknown option "+o,zt.ERR_BAD_OPTION)}}const L2={assertOptions:cH,validators:ZT},qa=L2.validators;class Fc{constructor(e){this.defaults=e,this.interceptors={request:new fI,response:new fI}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=nu(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&L2.assertOptions(r,{silentJSONParsing:qa.transitional(qa.boolean),forcedJSONParsing:qa.transitional(qa.boolean),clarifyTimeoutError:qa.transitional(qa.boolean)},!1),i!=null&&(_e.isFunction(i)?n.paramsSerializer={serialize:i}:L2.assertOptions(i,{encode:qa.function,serialize:qa.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&_e.merge(o.common,o[n.method]);o&&_e.forEach(["delete","get","head","post","put","patch","common"],v=>{delete o[v]}),n.headers=Ii.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(l=l&&x.synchronous,a.unshift(x.fulfilled,x.rejected))});const c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let u,f=0,h;if(!l){const v=[xI.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),h=v.length,u=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new Bd(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new JT(function(i){e=i}),cancel:e}}}function uH(t){return function(n){return t.apply(null,n)}}function fH(t){return _e.isObject(t)&&t.isAxiosError===!0}const k2={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(k2).forEach(([t,e])=>{k2[e]=t});function XF(t){const e=new Fc(t),n=MF(Fc.prototype.request,e);return _e.extend(n,Fc.prototype,e,{allOwnKeys:!0}),_e.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return XF(nu(t,i))},n}const Dn=XF(ig);Dn.Axios=Fc;Dn.CanceledError=Bd;Dn.CancelToken=JT;Dn.isCancel=UF;Dn.VERSION=GF;Dn.toFormData=cb;Dn.AxiosError=zt;Dn.Cancel=Dn.CanceledError;Dn.all=function(e){return Promise.all(e)};Dn.spread=uH;Dn.isAxiosError=fH;Dn.mergeConfig=nu;Dn.AxiosHeaders=Ii;Dn.formToJSON=t=>zF(_e.isHTMLForm(t)?new FormData(t):t);Dn.getAdapter=HF.getAdapter;Dn.HttpStatusCode=k2;Dn.default=Dn;const hm={black:"#000",white:"#fff"},Vu={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},$u={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Wu={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Hu={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Gu={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Fh={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},dH={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function ru(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;n0?Tr(jd,--Oi):0,vd--,Qn===10&&(vd=1,db--),Qn}function Qi(){return Qn=Oi2||mm(Qn)>3?"":" "}function PH(t,e){for(;--e&&Qi()&&!(Qn<48||Qn>102||Qn>57&&Qn<65||Qn>70&&Qn<97););return og(t,Py()+(e<6&&Ns()==32&&Qi()==32))}function D2(t){for(;Qi();)switch(Qn){case t:return Oi;case 34:case 39:t!==34&&t!==39&&D2(Qn);break;case 40:t===41&&D2(t);break;case 92:Qi();break}return Oi}function NH(t,e){for(;Qi()&&t+Qn!==57;)if(t+Qn===84&&Ns()===47)break;return"/*"+og(e,Oi-1)+"*"+fb(t===47?t:Qi())}function IH(t){for(;!mm(Ns());)Qi();return og(t,Oi)}function LH(t){return ez(Iy("",null,null,null,[""],t=QF(t),0,[0],t))}function Iy(t,e,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,h=0,m=0,v=0,x=1,y=1,g=1,b=0,_="",S=i,P=o,N=r,R=_;y;)switch(v=b,b=Qi()){case 40:if(v!=108&&Tr(R,f-1)==58){O2(R+=un(Ny(b),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:R+=Ny(b);break;case 9:case 10:case 13:case 32:R+=AH(v);break;case 92:R+=PH(Py()-1,7);continue;case 47:switch(Ns()){case 42:case 47:ev(kH(NH(Qi(),Py()),e,n),l);break;default:R+="/"}break;case 123*x:a[c++]=Ss(R)*g;case 125*x:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+u:g==-1&&(R=un(R,/\f/g,"")),m>0&&Ss(R)-f&&ev(m>32?wI(R+";",r,n,f-1):wI(un(R," ","")+";",r,n,f-2),l);break;case 59:R+=";";default:if(ev(N=_I(R,e,n,c,u,i,a,_,S=[],P=[],f),o),b===123)if(u===0)Iy(R,e,N,N,S,o,f,a,P);else switch(h===99&&Tr(R,3)===110?100:h){case 100:case 108:case 109:case 115:Iy(t,N,N,r&&ev(_I(t,N,N,0,0,i,a,_,i,S=[],f),P),i,P,f,a,r?S:P);break;default:Iy(R,N,N,N,[""],P,0,a,P)}}c=u=m=0,x=g=1,_=R="",f=s;break;case 58:f=1+Ss(R),m=v;default:if(x<1){if(b==123)--x;else if(b==125&&x++==0&&RH()==125)continue}switch(R+=fb(b),b*x){case 38:g=u>0?1:(R+="\f",-1);break;case 44:a[c++]=(Ss(R)-1)*g,g=1;break;case 64:Ns()===45&&(R+=Ny(Qi())),h=Ns(),u=f=Ss(_=R+=IH(Py())),b++;break;case 45:v===45&&Ss(R)==2&&(x=0)}}return o}function _I(t,e,n,r,i,o,s,a,l,c,u){for(var f=i-1,h=i===0?o:[""],m=tR(h),v=0,x=0,y=0;v0?h[g]+" "+b:un(b,/&\f/g,h[g])))&&(l[y++]=_);return hb(t,e,n,i===0?QT:a,l,c,u)}function kH(t,e,n){return hb(t,e,n,YF,fb(TH()),pm(t,2,-2),0)}function wI(t,e,n,r){return hb(t,e,n,eR,pm(t,0,r),pm(t,r+1,-1),r)}function td(t,e){for(var n="",r=tR(t),i=0;i6)switch(Tr(t,e+1)){case 109:if(Tr(t,e+4)!==45)break;case 102:return un(t,/(.+:)(.+)-([^]+)/,"$1"+cn+"$2-$3$1"+x1+(Tr(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~O2(t,"stretch")?tz(un(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Tr(t,e+1)!==115)break;case 6444:switch(Tr(t,Ss(t)-3-(~O2(t,"!important")&&10))){case 107:return un(t,":",":"+cn)+t;case 101:return un(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+cn+(Tr(t,14)===45?"inline-":"")+"box$3$1"+cn+"$2$3$1"+Wr+"$2box$3")+t}break;case 5936:switch(Tr(t,e+11)){case 114:return cn+t+Wr+un(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return cn+t+Wr+un(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return cn+t+Wr+un(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return cn+t+Wr+t+t}return t}var $H=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case eR:e.return=tz(e.value,e.length);break;case KF:return td([zh(e,{value:un(e.value,"@","@"+cn)})],i);case QT:if(e.length)return CH(e.props,function(o){switch(EH(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return td([zh(e,{props:[un(o,/:(read-\w+)/,":"+x1+"$1")]})],i);case"::placeholder":return td([zh(e,{props:[un(o,/:(plac\w+)/,":"+cn+"input-$1")]}),zh(e,{props:[un(o,/:(plac\w+)/,":"+x1+"$1")]}),zh(e,{props:[un(o,/:(plac\w+)/,Wr+"input-$1")]})],i)}return""})}},WH=[$H],nz=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(x){var y=x.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var i=e.stylisPlugins||WH,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var y=x.getAttribute("data-emotion").split(" "),g=1;g=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var nG={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},rG=!1,iG=/[A-Z]|^ms/g,oG=/_EMO_([^_]+?)_([^]*?)_EMO_/g,cz=function(e){return e.charCodeAt(1)===45},MI=function(e){return e!=null&&typeof e!="boolean"},WS=qF(function(t){return cz(t)?t:t.replace(iG,"-$&").toLowerCase()}),EI=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(oG,function(r,i,o){return Ms={name:i,styles:o,next:Ms},i})}return nG[e]!==1&&!cz(e)&&typeof n=="number"&&n!==0?n+"px":n},sG="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function gm(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Ms={name:i.name,styles:i.styles,next:Ms},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Ms={name:s.name,styles:s.styles,next:Ms},s=s.next;var a=o.styles+";";return a}return aG(t,e,n)}case"function":{if(t!==void 0){var l=Ms,c=n(t);return Ms=l,gm(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function aG(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?dG:hG},AI=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(s){return e.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},pG=!1,mG=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return az(n,r,i),cG(function(){return lz(n,r,i)}),null},gG=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,s;n!==void 0&&(o=n.label,s=n.target);var a=AI(e,n,r),l=a||RI(i),c=!l("as");return function(){var u=arguments,f=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var h=u.length,m=1;me(MG(i)?n:i):e;return C.jsx(fG,{styles:r})}function sR(t,e){return F2(t,e)}const yz=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},EG=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:vz,StyledEngineProvider:SG,ThemeContext:sg,css:hz,default:sR,internal_processStyles:yz,keyframes:Mb},Symbol.toStringTag,{value:"Module"}));function ua(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function xz(t){if(!ua(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=xz(t[n])}),e}function ui(t,e,n={clone:!0}){const r=n.clone?W({},t):t;return ua(t)&&ua(e)&&Object.keys(e).forEach(i=>{ua(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&ua(t[i])?r[i]=ui(t[i],e[i],n):n.clone?r[i]=ua(e[i])?xz(e[i]):e[i]:r[i]=e[i]}),r}const CG=Object.freeze(Object.defineProperty({__proto__:null,default:ui,isPlainObject:ua},Symbol.toStringTag,{value:"Module"})),TG=["values","unit","step"],RG=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>W({},n,{[r.key]:r.val}),{})};function bz(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Qe(t,TG),o=RG(e),s=Object.keys(o);function a(h){return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof e[h]=="number"?e[h]:h)-r/100}${n})`}function c(h,m){const v=s.indexOf(m);return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${n}) and (max-width:${(v!==-1&&typeof e[s[v]]=="number"?e[s[v]]:m)-r/100}${n})`}function u(h){return s.indexOf(h)+1`@media (min-width:${aR[t]}px)`};function Di(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||PI;return e.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(e[l]),s),{})}if(typeof e=="object"){const o=r.breakpoints||PI;return Object.keys(e).reduce((s,a)=>{if(Object.keys(o.values||aR).indexOf(a)!==-1){const l=o.up(a);s[l]=n(e[a],a)}else{const l=a;s[l]=e[l]}return s},{})}return n(e)}function _z(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function wz(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function PG(t,...e){const n=_z(t),r=[n,...e].reduce((i,o)=>ui(i,o),{});return wz(Object.keys(n),r)}function NG(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o{t[i]!=null&&(n[i]=!0)}),n}function zc({values:t,breakpoints:e,base:n}){const r=n||NG(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((s,a,l)=>(Array.isArray(t)?(s[a]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(s[a]=t[a]!=null?t[a]:t[o],o=a):s[a]=t,s),{})}function bt(t){if(typeof t!="string")throw new Error(ru(7));return t.charAt(0).toUpperCase()+t.slice(1)}const IG=Object.freeze(Object.defineProperty({__proto__:null,default:bt},Symbol.toStringTag,{value:"Module"}));function yd(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function b1(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=yd(t,n)||r,e&&(i=e(i,r,t)),i}function qn(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=s=>{if(s[e]==null)return null;const a=s[e],l=s.theme,c=yd(l,r)||{};return Di(s,a,f=>{let h=b1(c,i,f);return f===h&&typeof f=="string"&&(h=b1(c,i,`${e}${f==="default"?"":bt(f)}`,f)),n===!1?h:{[n]:h}})};return o.propTypes={},o.filterProps=[e],o}function LG(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const kG={m:"margin",p:"padding"},OG={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},NI={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},DG=LG(t=>{if(t.length>2)if(NI[t])t=NI[t];else return[t];const[e,n]=t.split(""),r=kG[e],i=OG[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),lR=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],cR=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...lR,...cR];function ag(t,e,n,r){var i;const o=(i=yd(t,e,!1))!=null?i:n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}function uR(t){return ag(t,"spacing",8)}function iu(t,e){if(typeof e=="string"||e==null)return e;const n=Math.abs(e),r=t(n);return e>=0?r:typeof r=="number"?-r:`-${r}`}function FG(t,e){return n=>t.reduce((r,i)=>(r[i]=iu(e,n),r),{})}function zG(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=DG(n),o=FG(i,r),s=t[n];return Di(t,s,o)}function Sz(t,e){const n=uR(t.theme);return Object.keys(t).map(r=>zG(t,e,r,n)).reduce(Ap,{})}function Bn(t){return Sz(t,lR)}Bn.propTypes={};Bn.filterProps=lR;function jn(t){return Sz(t,cR)}jn.propTypes={};jn.filterProps=cR;function UG(t=8){if(t.mui)return t;const e=uR({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=e(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function Eb(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?Ap(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Ro(t){return typeof t!="number"?t:`${t}px solid`}function Do(t,e){return qn({prop:t,themeKey:"borders",transform:e})}const BG=Do("border",Ro),jG=Do("borderTop",Ro),VG=Do("borderRight",Ro),$G=Do("borderBottom",Ro),WG=Do("borderLeft",Ro),HG=Do("borderColor"),GG=Do("borderTopColor"),XG=Do("borderRightColor"),qG=Do("borderBottomColor"),YG=Do("borderLeftColor"),KG=Do("outline",Ro),ZG=Do("outlineColor"),Cb=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=ag(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:iu(e,r)});return Di(t,t.borderRadius,n)}return null};Cb.propTypes={};Cb.filterProps=["borderRadius"];Eb(BG,jG,VG,$G,WG,HG,GG,XG,qG,YG,Cb,KG,ZG);const Tb=t=>{if(t.gap!==void 0&&t.gap!==null){const e=ag(t.theme,"spacing",8),n=r=>({gap:iu(e,r)});return Di(t,t.gap,n)}return null};Tb.propTypes={};Tb.filterProps=["gap"];const Rb=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=ag(t.theme,"spacing",8),n=r=>({columnGap:iu(e,r)});return Di(t,t.columnGap,n)}return null};Rb.propTypes={};Rb.filterProps=["columnGap"];const Ab=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=ag(t.theme,"spacing",8),n=r=>({rowGap:iu(e,r)});return Di(t,t.rowGap,n)}return null};Ab.propTypes={};Ab.filterProps=["rowGap"];const JG=qn({prop:"gridColumn"}),QG=qn({prop:"gridRow"}),eX=qn({prop:"gridAutoFlow"}),tX=qn({prop:"gridAutoColumns"}),nX=qn({prop:"gridAutoRows"}),rX=qn({prop:"gridTemplateColumns"}),iX=qn({prop:"gridTemplateRows"}),oX=qn({prop:"gridTemplateAreas"}),sX=qn({prop:"gridArea"});Eb(Tb,Rb,Ab,JG,QG,eX,tX,nX,rX,iX,oX,sX);function nd(t,e){return e==="grey"?e:t}const aX=qn({prop:"color",themeKey:"palette",transform:nd}),lX=qn({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:nd}),cX=qn({prop:"backgroundColor",themeKey:"palette",transform:nd});Eb(aX,lX,cX);function qi(t){return t<=1&&t!==0?`${t*100}%`:t}const uX=qn({prop:"width",transform:qi}),fR=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var r,i;const o=((r=t.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||aR[n];return o?((i=t.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${t.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:qi(n)}};return Di(t,t.maxWidth,e)}return null};fR.filterProps=["maxWidth"];const fX=qn({prop:"minWidth",transform:qi}),dX=qn({prop:"height",transform:qi}),hX=qn({prop:"maxHeight",transform:qi}),pX=qn({prop:"minHeight",transform:qi});qn({prop:"size",cssProperty:"width",transform:qi});qn({prop:"size",cssProperty:"height",transform:qi});const mX=qn({prop:"boxSizing"});Eb(uX,fR,fX,dX,hX,pX,mX);const lg={border:{themeKey:"borders",transform:Ro},borderTop:{themeKey:"borders",transform:Ro},borderRight:{themeKey:"borders",transform:Ro},borderBottom:{themeKey:"borders",transform:Ro},borderLeft:{themeKey:"borders",transform:Ro},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Ro},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Cb},color:{themeKey:"palette",transform:nd},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:nd},backgroundColor:{themeKey:"palette",transform:nd},p:{style:jn},pt:{style:jn},pr:{style:jn},pb:{style:jn},pl:{style:jn},px:{style:jn},py:{style:jn},padding:{style:jn},paddingTop:{style:jn},paddingRight:{style:jn},paddingBottom:{style:jn},paddingLeft:{style:jn},paddingX:{style:jn},paddingY:{style:jn},paddingInline:{style:jn},paddingInlineStart:{style:jn},paddingInlineEnd:{style:jn},paddingBlock:{style:jn},paddingBlockStart:{style:jn},paddingBlockEnd:{style:jn},m:{style:Bn},mt:{style:Bn},mr:{style:Bn},mb:{style:Bn},ml:{style:Bn},mx:{style:Bn},my:{style:Bn},margin:{style:Bn},marginTop:{style:Bn},marginRight:{style:Bn},marginBottom:{style:Bn},marginLeft:{style:Bn},marginX:{style:Bn},marginY:{style:Bn},marginInline:{style:Bn},marginInlineStart:{style:Bn},marginInlineEnd:{style:Bn},marginBlock:{style:Bn},marginBlockStart:{style:Bn},marginBlockEnd:{style:Bn},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Tb},rowGap:{style:Ab},columnGap:{style:Rb},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:qi},maxWidth:{style:fR},minWidth:{transform:qi},height:{transform:qi},maxHeight:{transform:qi},minHeight:{transform:qi},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function gX(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function vX(t,e){return typeof t=="function"?t(e):t}function Mz(){function t(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const h=yd(i,c)||{};return f?f(s):Di(s,r,v=>{let x=b1(h,u,v);return v===x&&typeof v=="string"&&(x=b1(h,u,`${n}${v==="default"?"":bt(v)}`,v)),l===!1?x:{[l]:x}})}function e(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const s=(r=o.unstable_sxConfig)!=null?r:lg;function a(l){let c=l;if(typeof l=="function")c=l(o);else if(typeof l!="object")return l;if(!c)return null;const u=_z(o.breakpoints),f=Object.keys(u);let h=u;return Object.keys(c).forEach(m=>{const v=vX(c[m],o);if(v!=null)if(typeof v=="object")if(s[m])h=Ap(h,t(m,v,o,s));else{const x=Di({theme:o},v,y=>({[m]:y}));gX(x,v)?h[m]=e({sx:v,theme:o}):h=Ap(h,x)}else h=Ap(h,t(m,v,o,s))}),wz(f,h)}return Array.isArray(i)?i.map(a):a(i)}return e}const Vd=Mz();Vd.filterProps=["sx"];function Ez(t,e){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:n.palette.mode===t?e:{}}const yX=["breakpoints","palette","spacing","shape"];function $d(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,s=Qe(t,yX),a=bz(n),l=UG(i);let c=ui({breakpoints:a,direction:"ltr",components:{},palette:W({mode:"light"},r),spacing:l,shape:W({},AG,o)},s);return c.applyStyles=Ez,c=e.reduce((u,f)=>ui(u,f),c),c.unstable_sxConfig=W({},lg,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(f){return Vd({sx:f,theme:this})},c}const xX=Object.freeze(Object.defineProperty({__proto__:null,default:$d,private_createBreakpoints:bz,unstable_applyStyles:Ez},Symbol.toStringTag,{value:"Module"}));function bX(t){return Object.keys(t).length===0}function dR(t=null){const e=A.useContext(sg);return!e||bX(e)?t:e}const _X=$d();function Pb(t=_X){return dR(t)}function wX({styles:t,themeId:e,defaultTheme:n={}}){const r=Pb(n),i=typeof t=="function"?t(e&&r[e]||r):t;return C.jsx(vz,{styles:i})}const SX=["sx"],MX=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:lg;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function cg(t){const{sx:e}=t,n=Qe(t,SX),{systemProps:r,otherProps:i}=MX(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...s)=>{const a=e(...s);return ua(a)?W({},r,a):r}:o=W({},r,e),W({},i,{sx:o})}const EX=Object.freeze(Object.defineProperty({__proto__:null,default:Vd,extendSxProp:cg,unstable_createStyleFunctionSx:Mz,unstable_defaultSxConfig:lg},Symbol.toStringTag,{value:"Module"})),II=t=>t,CX=()=>{let t=II;return{configure(e){t=e},generate(e){return t(e)},reset(){t=II}}},Cz=CX();function Tz(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;ea!=="theme"&&a!=="sx"&&a!=="as"})(Vd);return A.forwardRef(function(l,c){const u=Pb(n),f=cg(l),{className:h,component:m="div"}=f,v=Qe(f,TX);return C.jsx(o,W({as:m,ref:c,className:st(h,i?i(r):r),theme:e&&u[e]||u},v))})}const AX={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Tt(t,e,n="Mui"){const r=AX[e];return r?`${n}-${r}`:`${Cz.generate(t)}-${e}`}function Ct(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=Tt(t,i,n)}),r}var Rz={exports:{}},mn={};/** - * @license React - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var hR=Symbol.for("react.element"),pR=Symbol.for("react.portal"),Nb=Symbol.for("react.fragment"),Ib=Symbol.for("react.strict_mode"),Lb=Symbol.for("react.profiler"),kb=Symbol.for("react.provider"),Ob=Symbol.for("react.context"),PX=Symbol.for("react.server_context"),Db=Symbol.for("react.forward_ref"),Fb=Symbol.for("react.suspense"),zb=Symbol.for("react.suspense_list"),Ub=Symbol.for("react.memo"),Bb=Symbol.for("react.lazy"),NX=Symbol.for("react.offscreen"),Az;Az=Symbol.for("react.module.reference");function Fo(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case hR:switch(t=t.type,t){case Nb:case Lb:case Ib:case Fb:case zb:return t;default:switch(t=t&&t.$$typeof,t){case PX:case Ob:case Db:case Bb:case Ub:case kb:return t;default:return e}}case pR:return e}}}mn.ContextConsumer=Ob;mn.ContextProvider=kb;mn.Element=hR;mn.ForwardRef=Db;mn.Fragment=Nb;mn.Lazy=Bb;mn.Memo=Ub;mn.Portal=pR;mn.Profiler=Lb;mn.StrictMode=Ib;mn.Suspense=Fb;mn.SuspenseList=zb;mn.isAsyncMode=function(){return!1};mn.isConcurrentMode=function(){return!1};mn.isContextConsumer=function(t){return Fo(t)===Ob};mn.isContextProvider=function(t){return Fo(t)===kb};mn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===hR};mn.isForwardRef=function(t){return Fo(t)===Db};mn.isFragment=function(t){return Fo(t)===Nb};mn.isLazy=function(t){return Fo(t)===Bb};mn.isMemo=function(t){return Fo(t)===Ub};mn.isPortal=function(t){return Fo(t)===pR};mn.isProfiler=function(t){return Fo(t)===Lb};mn.isStrictMode=function(t){return Fo(t)===Ib};mn.isSuspense=function(t){return Fo(t)===Fb};mn.isSuspenseList=function(t){return Fo(t)===zb};mn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Nb||t===Lb||t===Ib||t===Fb||t===zb||t===NX||typeof t=="object"&&t!==null&&(t.$$typeof===Bb||t.$$typeof===Ub||t.$$typeof===kb||t.$$typeof===Ob||t.$$typeof===Db||t.$$typeof===Az||t.getModuleId!==void 0)};mn.typeOf=Fo;Rz.exports=mn;var U2=Rz.exports;const IX=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Pz(t){const e=`${t}`.match(IX);return e&&e[1]||""}function Nz(t,e=""){return t.displayName||t.name||Pz(t)||e}function LI(t,e,n){const r=Nz(e);return t.displayName||(r!==""?`${n}(${r})`:n)}function LX(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return Nz(t,"Component");if(typeof t=="object")switch(t.$$typeof){case U2.ForwardRef:return LI(t,t.render,"ForwardRef");case U2.Memo:return LI(t,t.type,"memo");default:return}}}const kX=Object.freeze(Object.defineProperty({__proto__:null,default:LX,getFunctionName:Pz},Symbol.toStringTag,{value:"Module"})),OX=["ownerState"],DX=["variants"],FX=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function zX(t){return Object.keys(t).length===0}function UX(t){return typeof t=="string"&&t.charCodeAt(0)>96}function HS(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const BX=$d(),jX=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function tv({defaultTheme:t,theme:e,themeId:n}){return zX(e)?t:e[n]||e}function VX(t){return t?(e,n)=>n[t]:null}function Ly(t,e){let{ownerState:n}=e,r=Qe(e,OX);const i=typeof t=="function"?t(W({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>Ly(o,W({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=Qe(i,DX);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props(W({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style(W({ownerState:n},r,n)):l.style))}),a}return i}function $X(t={}){const{themeId:e,defaultTheme:n=BX,rootShouldForwardProp:r=HS,slotShouldForwardProp:i=HS}=t,o=s=>Vd(W({},s,{theme:tv(W({},s,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(s,a={})=>{yz(s,P=>P.filter(N=>!(N!=null&&N.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:h=VX(jX(c))}=a,m=Qe(a,FX),v=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,x=f||!1;let y,g=HS;c==="Root"||c==="root"?g=r:c?g=i:UX(s)&&(g=void 0);const b=sR(s,W({shouldForwardProp:g,label:y},m)),_=P=>typeof P=="function"&&P.__emotion_real!==P||ua(P)?N=>Ly(P,W({},N,{theme:tv({theme:N.theme,defaultTheme:n,themeId:e})})):P,S=(P,...N)=>{let R=_(P);const L=N?N.map(_):[];l&&h&&L.push(T=>{const D=tv(W({},T,{defaultTheme:n,themeId:e}));if(!D.components||!D.components[l]||!D.components[l].styleOverrides)return null;const O=D.components[l].styleOverrides,j={};return Object.entries(O).forEach(([X,H])=>{j[X]=Ly(H,W({},T,{theme:D}))}),h(T,j)}),l&&!v&&L.push(T=>{var D;const O=tv(W({},T,{defaultTheme:n,themeId:e})),j=O==null||(D=O.components)==null||(D=D[l])==null?void 0:D.variants;return Ly({variants:j},W({},T,{theme:O}))}),x||L.push(o);const U=L.length-N.length;if(Array.isArray(P)&&U>0){const T=new Array(U).fill("");R=[...P,...T],R.raw=[...P.raw,...T]}const M=b(R,...L);return s.muiName&&(M.muiName=s.muiName),M};return b.withConfig&&(S.withConfig=b.withConfig),S}}const Iz=$X();function vm(t,e){const n=W({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=W({},t[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=t[r]||{},o=e[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=W({},o),Object.keys(i).forEach(s=>{n[r][s]=vm(i[s],o[s])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function Lz(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:vm(e.components[n].defaultProps,r)}function kz({props:t,name:e,defaultTheme:n,themeId:r}){let i=Pb(n);return r&&(i=i[r]||i),Lz({theme:i,name:e,props:t})}const ko=typeof window<"u"?A.useLayoutEffect:A.useEffect;function WX(t,e,n,r,i){const[o,s]=A.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return ko(()=>{let a=!0;if(!n)return;const l=n(t),c=()=>{a&&s(l.matches)};return c(),l.addListener(c),()=>{a=!1,l.removeListener(c)}},[t,n]),o}const Oz=A.useSyncExternalStore;function HX(t,e,n,r,i){const o=A.useCallback(()=>e,[e]),s=A.useMemo(()=>{if(i&&n)return()=>n(t).matches;if(r!==null){const{matches:u}=r(t);return()=>u}return o},[o,t,r,i,n]),[a,l]=A.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,f=>(u.addListener(f),()=>{u.removeListener(f)})]},[o,n,t]);return Oz(l,a,s)}function Dz(t,e={}){const n=dR(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:a=!1}=Lz({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(Oz!==void 0?HX:WX)(l,i,o,s,a)}function GX(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const XX=Object.freeze(Object.defineProperty({__proto__:null,default:GX},Symbol.toStringTag,{value:"Module"}));function kI(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function jb(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function ky(t,e){var n,r;return A.isValidElement(t)&&e.indexOf((n=t.type.muiName)!=null?n:(r=t.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Li(t){return t&&t.ownerDocument||document}function Ca(t){return Li(t).defaultView||window}function B2(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let OI=0;function qX(t){const[e,n]=A.useState(t),r=t||e;return A.useEffect(()=>{e==null&&(OI+=1,n(`mui-${OI}`))},[e]),r}const DI=qp.useId;function Fz(t){if(DI!==void 0){const e=DI();return t??e}return qX(t)}function j2({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=A.useRef(t!==void 0),[o,s]=A.useState(e),a=i?t:o,l=A.useCallback(c=>{i||s(c)},[]);return[a,l]}function ma(t){const e=A.useRef(t);return ko(()=>{e.current=t}),A.useRef((...n)=>(0,e.current)(...n)).current}function _r(...t){return A.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{B2(n,e)})},t)}const FI={};function YX(t,e){const n=A.useRef(FI);return n.current===FI&&(n.current=t(e)),n}const KX=[];function ZX(t){A.useEffect(t,KX)}class Vb{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Vb}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function zz(){const t=YX(Vb.create).current;return ZX(t.disposeEffect),t}let $b=!0,V2=!1;const JX=new Vb,QX={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function eq(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&QX[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function tq(t){t.metaKey||t.altKey||t.ctrlKey||($b=!0)}function GS(){$b=!1}function nq(){this.visibilityState==="hidden"&&V2&&($b=!0)}function rq(t){t.addEventListener("keydown",tq,!0),t.addEventListener("mousedown",GS,!0),t.addEventListener("pointerdown",GS,!0),t.addEventListener("touchstart",GS,!0),t.addEventListener("visibilitychange",nq,!0)}function iq(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return $b||eq(e)}function Uz(){const t=A.useCallback(i=>{i!=null&&rq(i.ownerDocument)},[]),e=A.useRef(!1);function n(){return e.current?(V2=!0,JX.start(100,()=>{V2=!1}),e.current=!1,!0):!1}function r(i){return iq(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function Bz(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}let Xu;function jz(){if(Xu)return Xu;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),Xu="reverse",t.scrollLeft>0?Xu="default":(t.scrollLeft=1,t.scrollLeft===0&&(Xu="negative")),document.body.removeChild(t),Xu}function oq(t,e){const n=t.scrollLeft;if(e!=="rtl")return n;switch(jz()){case"negative":return t.scrollWidth-t.clientWidth+n;case"reverse":return t.scrollWidth-t.clientWidth-n;default:return n}}function Rt(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((o,s)=>{if(s){const a=e(s);a!==""&&o.push(a),n&&n[s]&&o.push(n[s])}return o},[]).join(" ")}),r}function xd(t){return typeof t=="string"}function sq(t,e,n){return t===void 0||xd(t)?e:W({},e,{ownerState:W({},e.ownerState,n)})}function Vz(t,e=[]){if(t===void 0)return{};const n={};return Object.keys(t).filter(r=>r.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function zI(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function aq(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const m=st(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),v=W({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),x=W({},n,i,r);return m.length>0&&(x.className=m),Object.keys(v).length>0&&(x.style=v),{props:x,internalRef:void 0}}const s=Vz(W({},i,r)),a=zI(r),l=zI(i),c=e(s),u=st(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),f=W({},c==null?void 0:c.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),h=W({},c,n,l,a);return u.length>0&&(h.className=u),Object.keys(f).length>0&&(h.style=f),{props:h,internalRef:c.ref}}function lq(t,e,n){return typeof t=="function"?t(e,n):t}const cq=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function zs(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,s=Qe(t,cq),a=o?{}:lq(r,i),{props:l,internalRef:c}=aq(W({},s,{externalSlotProps:a})),u=_r(c,a==null?void 0:a.ref,(e=t.additionalProps)==null?void 0:e.ref);return sq(n,W({},l,{ref:u}),i)}const $z=A.createContext(null);function Wz(){return A.useContext($z)}const uq=typeof Symbol=="function"&&Symbol.for,fq=uq?Symbol.for("mui.nested"):"__THEME_NESTED__";function dq(t,e){return typeof e=="function"?e(t):W({},t,e)}function hq(t){const{children:e,theme:n}=t,r=Wz(),i=A.useMemo(()=>{const o=r===null?n:dq(r,n);return o!=null&&(o[fq]=r!==null),o},[n,r]);return C.jsx($z.Provider,{value:i,children:e})}const pq=["value"],Hz=A.createContext();function mq(t){let{value:e}=t,n=Qe(t,pq);return C.jsx(Hz.Provider,W({value:e??!0},n))}const mR=()=>{const t=A.useContext(Hz);return t??!1},Gz=A.createContext(void 0);function gq({value:t,children:e}){return C.jsx(Gz.Provider,{value:t,children:e})}function vq(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n])return r;const i=e.components[n];return i.defaultProps?vm(i.defaultProps,r):!i.styleOverrides&&!i.variants?vm(i,r):r}function yq({props:t,name:e}){const n=A.useContext(Gz);return vq({props:t,name:e,theme:{components:n}})}const UI={};function BI(t,e,n,r=!1){return A.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),s=t?W({},e,{[t]:o}):o;return r?()=>s:s}return t?W({},e,{[t]:n}):W({},e,n)},[t,e,n,r])}function xq(t){const{children:e,theme:n,themeId:r}=t,i=dR(UI),o=Wz()||UI,s=BI(r,i,n),a=BI(r,o,n,!0),l=s.direction==="rtl";return C.jsx(hq,{theme:a,children:C.jsx(sg.Provider,{value:s,children:C.jsx(mq,{value:l,children:C.jsx(gq,{value:s==null?void 0:s.components,children:e})})})})}const bq=["className","component","disableGutters","fixed","maxWidth","classes"],_q=$d(),wq=Iz("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`maxWidth${bt(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),Sq=t=>kz({props:t,name:"MuiContainer",defaultTheme:_q}),Mq=(t,e)=>{const n=l=>Tt(e,l),{classes:r,fixed:i,disableGutters:o,maxWidth:s}=t,a={root:["root",s&&`maxWidth${bt(String(s))}`,i&&"fixed",o&&"disableGutters"]};return Rt(a,n,r)};function Eq(t={}){const{createStyledComponent:e=wq,useThemeProps:n=Sq,componentName:r="MuiContainer"}=t,i=e(({theme:s,ownerState:a})=>W({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:s.spacing(2),paddingRight:s.spacing(2),[s.breakpoints.up("sm")]:{paddingLeft:s.spacing(3),paddingRight:s.spacing(3)}}),({theme:s,ownerState:a})=>a.fixed&&Object.keys(s.breakpoints.values).reduce((l,c)=>{const u=c,f=s.breakpoints.values[u];return f!==0&&(l[s.breakpoints.up(u)]={maxWidth:`${f}${s.breakpoints.unit}`}),l},{}),({theme:s,ownerState:a})=>W({},a.maxWidth==="xs"&&{[s.breakpoints.up("xs")]:{maxWidth:Math.max(s.breakpoints.values.xs,444)}},a.maxWidth&&a.maxWidth!=="xs"&&{[s.breakpoints.up(a.maxWidth)]:{maxWidth:`${s.breakpoints.values[a.maxWidth]}${s.breakpoints.unit}`}}));return A.forwardRef(function(a,l){const c=n(a),{className:u,component:f="div",disableGutters:h=!1,fixed:m=!1,maxWidth:v="lg"}=c,x=Qe(c,bq),y=W({},c,{component:f,disableGutters:h,fixed:m,maxWidth:v}),g=Mq(y,r);return C.jsx(i,W({as:f,ownerState:y,className:st(g.root,u),ref:l},x))})}const Cq=["component","direction","spacing","divider","children","className","useFlexGap"],Tq=$d(),Rq=Iz("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function Aq(t){return kz({props:t,name:"MuiStack",defaultTheme:Tq})}function Pq(t,e){const n=A.Children.toArray(t).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],Iq=({ownerState:t,theme:e})=>{let n=W({display:"flex",flexDirection:"column"},Di({theme:e},zc({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=uR(e),i=Object.keys(e.breakpoints.values).reduce((l,c)=>((typeof t.spacing=="object"&&t.spacing[c]!=null||typeof t.direction=="object"&&t.direction[c]!=null)&&(l[c]=!0),l),{}),o=zc({values:t.direction,base:i}),s=zc({values:t.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,c,u)=>{if(!o[l]){const h=c>0?o[u[c-1]]:"column";o[l]=h}}),n=ui(n,Di({theme:e},s,(l,c)=>t.useFlexGap?{gap:iu(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Nq(c?o[c]:t.direction)}`]:iu(r,l)}}))}return n=PG(e.breakpoints,n),n};function Lq(t={}){const{createStyledComponent:e=Rq,useThemeProps:n=Aq,componentName:r="MuiStack"}=t,i=()=>Rt({root:["root"]},l=>Tt(r,l),{}),o=e(Iq);return A.forwardRef(function(l,c){const u=n(l),f=cg(u),{component:h="div",direction:m="column",spacing:v=0,divider:x,children:y,className:g,useFlexGap:b=!1}=f,_=Qe(f,Cq),S={direction:m,spacing:v,useFlexGap:b},P=i();return C.jsx(o,W({as:h,ownerState:S,ref:c,className:st(P.root,g)},_,{children:x?Pq(y,x):y}))})}function kq(t,e){return W({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var Yn={},Xz={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(Xz);var qz=Xz.exports;const Oq=Vs(hH),Dq=Vs(XX);var Yz=qz;Object.defineProperty(Yn,"__esModule",{value:!0});var Rn=Yn.alpha=t6;Yn.blend=Xq;Yn.colorChannel=void 0;var Kz=Yn.darken=vR;Yn.decomposeColor=Oo;Yn.emphasize=n6;var Fq=Yn.getContrastRatio=Vq;Yn.getLuminance=_1;Yn.hexToRgb=Jz;Yn.hslToRgb=e6;var Zz=Yn.lighten=yR;Yn.private_safeAlpha=$q;Yn.private_safeColorChannel=void 0;Yn.private_safeDarken=Wq;Yn.private_safeEmphasize=Gq;Yn.private_safeLighten=Hq;Yn.recomposeColor=Wd;Yn.rgbToHex=jq;var jI=Yz(Oq),zq=Yz(Dq);function gR(t,e=0,n=1){return(0,zq.default)(t,e,n)}function Jz(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Uq(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function Oo(t){if(t.type)return t;if(t.charAt(0)==="#")return Oo(Jz(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,jI.default)(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,jI.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const Qz=t=>{const e=Oo(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};Yn.colorChannel=Qz;const Bq=(t,e)=>{try{return Qz(t)}catch{return t}};Yn.private_safeColorChannel=Bq;function Wd(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function jq(t){if(t.indexOf("#")===0)return t;const{values:e}=Oo(t);return`#${e.map((n,r)=>Uq(r===3?Math.round(255*n):n)).join("")}`}function e6(t){t=Oo(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),Wd({type:a,values:l})}function _1(t){t=Oo(t);let e=t.type==="hsl"||t.type==="hsla"?Oo(e6(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function Vq(t,e){const n=_1(t),r=_1(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function t6(t,e){return t=Oo(t),e=gR(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Wd(t)}function $q(t,e,n){try{return t6(t,e)}catch{return t}}function vR(t,e){if(t=Oo(t),e=gR(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Wd(t)}function Wq(t,e,n){try{return vR(t,e)}catch{return t}}function yR(t,e){if(t=Oo(t),e=gR(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Wd(t)}function Hq(t,e,n){try{return yR(t,e)}catch{return t}}function n6(t,e=.15){return _1(t)>.5?vR(t,e):yR(t,e)}function Gq(t,e,n){try{return n6(t,e)}catch{return t}}function Xq(t,e,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=Oo(t),s=Oo(e),a=[i(o.values[0],s.values[0]),i(o.values[1],s.values[1]),i(o.values[2],s.values[2])];return Wd({type:"rgb",values:a})}const qq=["mode","contrastThreshold","tonalOffset"],VI={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:hm.white,default:hm.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},XS={text:{primary:hm.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:hm.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function $I(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=Zz(t.main,i):e==="dark"&&(t.dark=Kz(t.main,o)))}function Yq(t="light"){return t==="dark"?{main:Wu[200],light:Wu[50],dark:Wu[400]}:{main:Wu[700],light:Wu[400],dark:Wu[800]}}function Kq(t="light"){return t==="dark"?{main:$u[200],light:$u[50],dark:$u[400]}:{main:$u[500],light:$u[300],dark:$u[700]}}function Zq(t="light"){return t==="dark"?{main:Vu[500],light:Vu[300],dark:Vu[700]}:{main:Vu[700],light:Vu[400],dark:Vu[800]}}function Jq(t="light"){return t==="dark"?{main:Hu[400],light:Hu[300],dark:Hu[700]}:{main:Hu[700],light:Hu[500],dark:Hu[900]}}function Qq(t="light"){return t==="dark"?{main:Gu[400],light:Gu[300],dark:Gu[700]}:{main:Gu[800],light:Gu[500],dark:Gu[900]}}function eY(t="light"){return t==="dark"?{main:Fh[400],light:Fh[300],dark:Fh[700]}:{main:"#ed6c02",light:Fh[500],dark:Fh[900]}}function tY(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Qe(t,qq),o=t.primary||Yq(e),s=t.secondary||Kq(e),a=t.error||Zq(e),l=t.info||Jq(e),c=t.success||Qq(e),u=t.warning||eY(e);function f(x){return Fq(x,XS.text.primary)>=n?XS.text.primary:VI.text.primary}const h=({color:x,name:y,mainShade:g=500,lightShade:b=300,darkShade:_=700})=>{if(x=W({},x),!x.main&&x[g]&&(x.main=x[g]),!x.hasOwnProperty("main"))throw new Error(ru(11,y?` (${y})`:"",g));if(typeof x.main!="string")throw new Error(ru(12,y?` (${y})`:"",JSON.stringify(x.main)));return $I(x,"light",b,r),$I(x,"dark",_,r),x.contrastText||(x.contrastText=f(x.main)),x},m={dark:XS,light:VI};return ui(W({common:W({},hm),mode:e,primary:h({color:o,name:"primary"}),secondary:h({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:a,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:l,name:"info"}),success:h({color:c,name:"success"}),grey:dH,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:r},m[e]),i)}const nY=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function rY(t){return Math.round(t*1e5)/1e5}const WI={textTransform:"uppercase"},HI='"Roboto", "Helvetica", "Arial", sans-serif';function iY(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=HI,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=n,h=Qe(n,nY),m=i/14,v=f||(g=>`${g/c*m}rem`),x=(g,b,_,S,P)=>W({fontFamily:r,fontWeight:g,fontSize:v(b),lineHeight:_},r===HI?{letterSpacing:`${rY(S/b)}em`}:{},P,u),y={h1:x(o,96,1.167,-1.5),h2:x(o,60,1.2,-.5),h3:x(s,48,1.167,0),h4:x(s,34,1.235,.25),h5:x(s,24,1.334,0),h6:x(a,20,1.6,.15),subtitle1:x(s,16,1.75,.15),subtitle2:x(a,14,1.57,.1),body1:x(s,16,1.5,.15),body2:x(s,14,1.43,.15),button:x(a,14,1.75,.4,WI),caption:x(s,12,1.66,.4),overline:x(s,12,2.66,1,WI),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ui(W({htmlFontSize:c,pxToRem:v,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},y),h,{clone:!1})}const oY=.2,sY=.14,aY=.12;function Cn(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${oY})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${sY})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${aY})`].join(",")}const lY=["none",Cn(0,2,1,-1,0,1,1,0,0,1,3,0),Cn(0,3,1,-2,0,2,2,0,0,1,5,0),Cn(0,3,3,-2,0,3,4,0,0,1,8,0),Cn(0,2,4,-1,0,4,5,0,0,1,10,0),Cn(0,3,5,-1,0,5,8,0,0,1,14,0),Cn(0,3,5,-1,0,6,10,0,0,1,18,0),Cn(0,4,5,-2,0,7,10,1,0,2,16,1),Cn(0,5,5,-3,0,8,10,1,0,3,14,2),Cn(0,5,6,-3,0,9,12,1,0,3,16,2),Cn(0,6,6,-3,0,10,14,1,0,4,18,3),Cn(0,6,7,-4,0,11,15,1,0,4,20,3),Cn(0,7,8,-4,0,12,17,2,0,5,22,4),Cn(0,7,8,-4,0,13,19,2,0,5,24,4),Cn(0,7,9,-4,0,14,21,2,0,5,26,4),Cn(0,8,9,-5,0,15,22,2,0,6,28,5),Cn(0,8,10,-5,0,16,24,2,0,6,30,5),Cn(0,8,11,-5,0,17,26,2,0,6,32,5),Cn(0,9,11,-5,0,18,28,2,0,7,34,6),Cn(0,9,12,-6,0,19,29,2,0,7,36,6),Cn(0,10,13,-6,0,20,31,3,0,8,38,7),Cn(0,10,13,-6,0,21,33,3,0,8,40,7),Cn(0,10,14,-6,0,22,35,3,0,8,42,7),Cn(0,11,14,-7,0,23,36,3,0,9,44,8),Cn(0,11,15,-7,0,24,38,3,0,9,46,8)],cY=["duration","easing","delay"],uY={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},fY={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function GI(t){return`${Math.round(t)}ms`}function dY(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function hY(t){const e=W({},uY,t.easing),n=W({},fY,t.duration);return W({getAutoHeightDuration:dY,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=e.easeInOut,delay:l=0}=o;return Qe(o,cY),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof s=="string"?s:GI(s)} ${a} ${typeof l=="string"?l:GI(l)}`).join(",")}},t,{easing:e,duration:n})}const pY={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},mY=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function xR(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,s=Qe(t,mY);if(t.vars)throw new Error(ru(18));const a=tY(r),l=$d(t);let c=ui(l,{mixins:kq(l.breakpoints,n),palette:a,shadows:lY.slice(),typography:iY(a,o),transitions:hY(i),zIndex:W({},pY)});return c=ui(c,s),c=e.reduce((u,f)=>ui(u,f),c),c.unstable_sxConfig=W({},lg,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(f){return Vd({sx:f,theme:this})},c}const bR=xR();function pu(){const t=Pb(bR);return t[gd]||t}var ug={},qS={exports:{}},XI;function gY(){return XI||(XI=1,function(t){function e(){return t.exports=e=Object.assign?Object.assign.bind():function(n){for(var r=1;r96}function Oy(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const kY=ug.systemDefaultTheme=(0,CY.default)(),OY=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function nv({defaultTheme:t,theme:e,themeId:n}){return IY(e)?t:e[n]||e}function DY(t){return t?(e,n)=>n[t]:null}function Dy(t,e){let{ownerState:n}=e,r=(0,$2.default)(e,RY);const i=typeof t=="function"?t((0,wo.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>Dy(o,(0,wo.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=(0,$2.default)(i,AY);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,wo.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style((0,wo.default)({ownerState:n},r,n)):l.style))}),a}return i}function FY(t={}){const{themeId:e,defaultTheme:n=kY,rootShouldForwardProp:r=Oy,slotShouldForwardProp:i=Oy}=t,o=s=>(0,TY.default)((0,wo.default)({},s,{theme:nv((0,wo.default)({},s,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(s,a={})=>{(0,YI.internal_processStyles)(s,P=>P.filter(N=>!(N!=null&&N.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:h=DY(OY(c))}=a,m=(0,$2.default)(a,PY),v=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,x=f||!1;let y,g=Oy;c==="Root"||c==="root"?g=r:c?g=i:LY(s)&&(g=void 0);const b=(0,YI.default)(s,(0,wo.default)({shouldForwardProp:g,label:y},m)),_=P=>typeof P=="function"&&P.__emotion_real!==P||(0,EY.isPlainObject)(P)?N=>Dy(P,(0,wo.default)({},N,{theme:nv({theme:N.theme,defaultTheme:n,themeId:e})})):P,S=(P,...N)=>{let R=_(P);const L=N?N.map(_):[];l&&h&&L.push(T=>{const D=nv((0,wo.default)({},T,{defaultTheme:n,themeId:e}));if(!D.components||!D.components[l]||!D.components[l].styleOverrides)return null;const O=D.components[l].styleOverrides,j={};return Object.entries(O).forEach(([X,H])=>{j[X]=Dy(H,(0,wo.default)({},T,{theme:D}))}),h(T,j)}),l&&!v&&L.push(T=>{var D;const O=nv((0,wo.default)({},T,{defaultTheme:n,themeId:e})),j=O==null||(D=O.components)==null||(D=D[l])==null?void 0:D.variants;return Dy({variants:j},(0,wo.default)({},T,{theme:O}))}),x||L.push(o);const U=L.length-N.length;if(Array.isArray(P)&&U>0){const T=new Array(U).fill("");R=[...P,...T],R.raw=[...P.raw,...T]}const M=b(R,...L);return s.muiName&&(M.muiName=s.muiName),M};return b.withConfig&&(S.withConfig=b.withConfig),S}}function i6(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const pi=t=>i6(t)&&t!=="classes",Ze=MY({themeId:gd,defaultTheme:bR,rootShouldForwardProp:pi}),zY=["theme"];function UY(t){let{theme:e}=t,n=Qe(t,zY);const r=e[gd];return C.jsx(xq,W({},n,{themeId:r?gd:void 0,theme:r||e}))}const KI=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function At(t){return yq(t)}function BY(t){return Tt("MuiSvgIcon",t)}Ct("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const jY=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],VY=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${bt(e)}`,`fontSize${bt(n)}`]};return Rt(i,BY,r)},$Y=Ze("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${bt(n.color)}`],e[`fontSize${bt(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,o,s,a,l,c,u,f,h,m,v;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=t.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=t.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=t.typography)==null||(s=o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem",medium:((a=t.typography)==null||(l=a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem",large:((c=t.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[e.fontSize],color:(f=(h=(t.vars||t).palette)==null||(h=h[e.color])==null?void 0:h.main)!=null?f:{action:(m=(t.vars||t).palette)==null||(m=m.action)==null?void 0:m.active,disabled:(v=(t.vars||t).palette)==null||(v=v.action)==null?void 0:v.disabled,inherit:void 0}[e.color]}}),w1=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:h="0 0 24 24"}=r,m=Qe(r,jY),v=A.isValidElement(i)&&i.type==="svg",x=W({},r,{color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:v}),y={};u||(y.viewBox=h);const g=VY(x);return C.jsxs($Y,W({as:a,className:st(g.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},y,m,v&&i.props,{ownerState:x,children:[v?i.props.children:i,f?C.jsx("title",{children:f}):null]}))});w1.muiName="SvgIcon";function Gd(t,e){function n(r,i){return C.jsx(w1,W({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=w1.muiName,A.memo(A.forwardRef(n))}function W2(t,e){return W2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},W2(t,e)}function _R(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,W2(t,e)}const ZI={disabled:!1},S1=Mt.createContext(null);var WY=function(e){return e.scrollTop},mp="unmounted",mc="exited",gc="entering",bf="entered",H2="exiting",$s=function(t){_R(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=mc,o.appearStatus=gc):l=bf:r.unmountOnExit||r.mountOnEnter?l=mp:l=mc,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===mp?{status:mc}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==gc&&s!==bf&&(o=gc):(s===gc||s===bf)&&(o=H2)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===gc){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:pp.findDOMNode(this);s&&WY(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===mc&&this.setState({status:mp})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[pp.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),h=a?f.appear:f.enter;if(!i&&!s||ZI.disabled){this.safeSetState({status:bf},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:gc},function(){o.props.onEntering(c,u),o.onTransitionEnd(h,function(){o.safeSetState({status:bf},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:pp.findDOMNode(this);if(!o||ZI.disabled){this.safeSetState({status:mc},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:H2},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:mc},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:pp.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===mp)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=Qe(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Mt.createElement(S1.Provider,{value:null},typeof s=="function"?s(i,a):Mt.cloneElement(Mt.Children.only(s),a))},e}(Mt.Component);$s.contextType=S1;$s.propTypes={};function qu(){}$s.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:qu,onEntering:qu,onEntered:qu,onExit:qu,onExiting:qu,onExited:qu};$s.UNMOUNTED=mp;$s.EXITED=mc;$s.ENTERING=gc;$s.ENTERED=bf;$s.EXITING=H2;function HY(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wR(t,e){var n=function(o){return e&&A.isValidElement(o)?e(o):o},r=Object.create(null);return t&&A.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function GY(t,e){t=t||{},e=e||{};function n(u){return u in e?e[u]:t[u]}var r=Object.create(null),i=[];for(var o in t)o in e?i.length&&(r[o]=i,i=[]):i.push(o);var s,a={};for(var l in e){if(r[l])for(s=0;st.scrollTop;function M1(t,e){var n,r;const{timeout:i,easing:o,style:s={}}=t;return{duration:(n=s.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=s.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:s.transitionDelay}}function ZY(t){return Tt("MuiPaper",t)}Ct("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const JY=["className","component","elevation","square","variant"],QY=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Rt(o,ZY,i)},eK=Ze("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(({theme:t,ownerState:e})=>{var n;return W({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&W({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Rn("#fff",KI(e.elevation))}, ${Rn("#fff",KI(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),Xd=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiPaper"}),{className:i,component:o="div",elevation:s=1,square:a=!1,variant:l="elevation"}=r,c=Qe(r,JY),u=W({},r,{component:o,elevation:s,square:a,variant:l}),f=QY(u);return C.jsx(eK,W({as:o,ownerState:u,className:st(f.root,i),ref:n},c))});function tK(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:c}=t,[u,f]=A.useState(!1),h=st(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),m={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},v=st(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),A.useEffect(()=>{if(!a&&l!=null){const x=setTimeout(l,c);return()=>{clearTimeout(x)}}},[l,a,c]),C.jsx("span",{className:h,style:m,children:C.jsx("span",{className:v})})}const Mo=Ct("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),nK=["center","classes","className"];let Wb=t=>t,JI,QI,e4,t4;const G2=550,rK=80,iK=Mb(JI||(JI=Wb` - 0% { - transform: scale(0); - opacity: 0.1; - } - - 100% { - transform: scale(1); - opacity: 0.3; - } -`)),oK=Mb(QI||(QI=Wb` - 0% { - opacity: 1; - } - - 100% { - opacity: 0; - } -`)),sK=Mb(e4||(e4=Wb` - 0% { - transform: scale(1); - } - - 50% { - transform: scale(0.92); - } - - 100% { - transform: scale(1); - } -`)),aK=Ze("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),lK=Ze(tK,{name:"MuiTouchRipple",slot:"Ripple"})(t4||(t4=Wb` - opacity: 0; - position: absolute; - - &.${0} { - opacity: 0.3; - transform: scale(1); - animation-name: ${0}; - animation-duration: ${0}ms; - animation-timing-function: ${0}; - } - - &.${0} { - animation-duration: ${0}ms; - } - - & .${0} { - opacity: 1; - display: block; - width: 100%; - height: 100%; - border-radius: 50%; - background-color: currentColor; - } - - & .${0} { - opacity: 0; - animation-name: ${0}; - animation-duration: ${0}ms; - animation-timing-function: ${0}; - } - - & .${0} { - position: absolute; - /* @noflip */ - left: 0px; - top: 0; - animation-name: ${0}; - animation-duration: 2500ms; - animation-timing-function: ${0}; - animation-iteration-count: infinite; - animation-delay: 200ms; - } -`),Mo.rippleVisible,iK,G2,({theme:t})=>t.transitions.easing.easeInOut,Mo.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Mo.child,Mo.childLeaving,oK,G2,({theme:t})=>t.transitions.easing.easeInOut,Mo.childPulsate,sK,({theme:t})=>t.transitions.easing.easeInOut),cK=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s}=r,a=Qe(r,nK),[l,c]=A.useState([]),u=A.useRef(0),f=A.useRef(null);A.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const h=A.useRef(!1),m=zz(),v=A.useRef(null),x=A.useRef(null),y=A.useCallback(S=>{const{pulsate:P,rippleX:N,rippleY:R,rippleSize:L,cb:U}=S;c(M=>[...M,C.jsx(lK,{classes:{ripple:st(o.ripple,Mo.ripple),rippleVisible:st(o.rippleVisible,Mo.rippleVisible),ripplePulsate:st(o.ripplePulsate,Mo.ripplePulsate),child:st(o.child,Mo.child),childLeaving:st(o.childLeaving,Mo.childLeaving),childPulsate:st(o.childPulsate,Mo.childPulsate)},timeout:G2,pulsate:P,rippleX:N,rippleY:R,rippleSize:L},u.current)]),u.current+=1,f.current=U},[o]),g=A.useCallback((S={},P={},N=()=>{})=>{const{pulsate:R=!1,center:L=i||P.pulsate,fakeElement:U=!1}=P;if((S==null?void 0:S.type)==="mousedown"&&h.current){h.current=!1;return}(S==null?void 0:S.type)==="touchstart"&&(h.current=!0);const M=U?null:x.current,T=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let D,O,j;if(L||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)D=Math.round(T.width/2),O=Math.round(T.height/2);else{const{clientX:X,clientY:H}=S.touches&&S.touches.length>0?S.touches[0]:S;D=Math.round(X-T.left),O=Math.round(H-T.top)}if(L)j=Math.sqrt((2*T.width**2+T.height**2)/3),j%2===0&&(j+=1);else{const X=Math.max(Math.abs((M?M.clientWidth:0)-D),D)*2+2,H=Math.max(Math.abs((M?M.clientHeight:0)-O),O)*2+2;j=Math.sqrt(X**2+H**2)}S!=null&&S.touches?v.current===null&&(v.current=()=>{y({pulsate:R,rippleX:D,rippleY:O,rippleSize:j,cb:N})},m.start(rK,()=>{v.current&&(v.current(),v.current=null)})):y({pulsate:R,rippleX:D,rippleY:O,rippleSize:j,cb:N})},[i,y,m]),b=A.useCallback(()=>{g({},{pulsate:!0})},[g]),_=A.useCallback((S,P)=>{if(m.clear(),(S==null?void 0:S.type)==="touchend"&&v.current){v.current(),v.current=null,m.start(0,()=>{_(S,P)});return}v.current=null,c(N=>N.length>0?N.slice(1):N),f.current=P},[m]);return A.useImperativeHandle(n,()=>({pulsate:b,start:g,stop:_}),[b,g,_]),C.jsx(aK,W({className:st(Mo.root,o.root,s),ref:x},a,{children:C.jsx(SR,{component:null,exit:!0,children:l})}))});function uK(t){return Tt("MuiButtonBase",t)}const fK=Ct("MuiButtonBase",["root","disabled","focusVisible"]),dK=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],hK=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,s=Rt({root:["root",e&&"disabled",n&&"focusVisible"]},uK,i);return n&&r&&(s.root+=` ${r}`),s},pK=Ze("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${fK.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),mu=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:h=!1,LinkComponent:m="a",onBlur:v,onClick:x,onContextMenu:y,onDragLeave:g,onFocus:b,onFocusVisible:_,onKeyDown:S,onKeyUp:P,onMouseDown:N,onMouseLeave:R,onMouseUp:L,onTouchEnd:U,onTouchMove:M,onTouchStart:T,tabIndex:D=0,TouchRippleProps:O,touchRippleRef:j,type:X}=r,H=Qe(r,dK),Z=A.useRef(null),F=A.useRef(null),q=_r(F,j),{isFocusVisibleRef:K,onFocus:J,onBlur:he,ref:le}=Uz(),[ee,ae]=A.useState(!1);c&&ee&&ae(!1),A.useImperativeHandle(i,()=>({focusVisible:()=>{ae(!0),Z.current.focus()}}),[]);const[ge,Me]=A.useState(!1);A.useEffect(()=>{Me(!0)},[]);const tt=ge&&!u&&!c;A.useEffect(()=>{ee&&h&&!u&&ge&&F.current.pulsate()},[u,h,ee,ge]);function He(ze,Le,Xe=f){return ma(xt=>(Le&&Le(xt),!Xe&&F.current&&F.current[ze](xt),!0))}const rt=He("start",N),Ve=He("stop",y),se=He("stop",g),B=He("stop",L),ye=He("stop",ze=>{ee&&ze.preventDefault(),R&&R(ze)}),xe=He("start",T),Re=He("stop",U),Pe=He("stop",M),Ee=He("stop",ze=>{he(ze),K.current===!1&&ae(!1),v&&v(ze)},!1),De=ma(ze=>{Z.current||(Z.current=ze.currentTarget),J(ze),K.current===!0&&(ae(!0),_&&_(ze)),b&&b(ze)}),$=()=>{const ze=Z.current;return l&&l!=="button"&&!(ze.tagName==="A"&&ze.href)},z=A.useRef(!1),re=ma(ze=>{h&&!z.current&&ee&&F.current&&ze.key===" "&&(z.current=!0,F.current.stop(ze,()=>{F.current.start(ze)})),ze.target===ze.currentTarget&&$()&&ze.key===" "&&ze.preventDefault(),S&&S(ze),ze.target===ze.currentTarget&&$()&&ze.key==="Enter"&&!c&&(ze.preventDefault(),x&&x(ze))}),pe=ma(ze=>{h&&ze.key===" "&&F.current&&ee&&!ze.defaultPrevented&&(z.current=!1,F.current.stop(ze,()=>{F.current.pulsate(ze)})),P&&P(ze),x&&ze.target===ze.currentTarget&&$()&&ze.key===" "&&!ze.defaultPrevented&&x(ze)});let me=l;me==="button"&&(H.href||H.to)&&(me=m);const be={};me==="button"?(be.type=X===void 0?"button":X,be.disabled=c):(!H.href&&!H.to&&(be.role="button"),c&&(be["aria-disabled"]=c));const Ge=_r(n,le,Z),Fe=W({},r,{centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:h,tabIndex:D,focusVisible:ee}),Ne=hK(Fe);return C.jsxs(pK,W({as:me,className:st(Ne.root,a),ownerState:Fe,onBlur:Ee,onClick:x,onContextMenu:Ve,onFocus:De,onKeyDown:re,onKeyUp:pe,onMouseDown:rt,onMouseLeave:ye,onMouseUp:B,onDragLeave:se,onTouchEnd:Re,onTouchMove:Pe,onTouchStart:xe,ref:Ge,tabIndex:c?-1:D,type:X},be,H,{children:[s,tt?C.jsx(cK,W({ref:q,center:o},O)):null]}))});function mK(t){return Tt("MuiTypography",t)}Ct("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const gK=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],vK=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=t,a={root:["root",o,t.align!=="inherit"&&`align${bt(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Rt(a,mK,s)},yK=Ze("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${bt(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>W({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),n4={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},xK={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},bK=t=>xK[t]||t,sr=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTypography"}),i=bK(r.color),o=cg(W({},r,{color:i})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:f=!1,variant:h="body1",variantMapping:m=n4}=o,v=Qe(o,gK),x=W({},o,{align:s,color:i,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:f,variant:h,variantMapping:m}),y=l||(f?"p":m[h]||n4[h])||"span",g=vK(x);return C.jsx(yK,W({as:y,ref:n,ownerState:x,className:st(g.root,a)},v))});function _K(t){return Tt("MuiAppBar",t)}Ct("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const wK=["className","color","enableColorOnDark","position"],SK=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${bt(e)}`,`position${bt(n)}`]};return Rt(i,_K,r)},rv=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,MK=Ze(Xd,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${bt(n.position)}`],e[`color${bt(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return W({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&W({},e.color==="default"&&{backgroundColor:n,color:t.palette.getContrastText(n)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&W({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&W({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:rv(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:rv(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:rv(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:rv(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},!["inherit","transparent"].includes(e.color)&&{backgroundColor:"var(--AppBar-background)"},{color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),EK=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed"}=r,l=Qe(r,wK),c=W({},r,{color:o,position:a,enableColorOnDark:s}),u=SK(c);return C.jsx(MK,W({square:!0,component:"header",ownerState:c,elevation:4,className:st(u.root,i,a==="fixed"&&"mui-fixed"),ref:n},l))});function CK(t){return typeof t=="function"?t():t}const TK=A.forwardRef(function(e,n){const{children:r,container:i,disablePortal:o=!1}=e,[s,a]=A.useState(null),l=_r(A.isValidElement(r)?r.ref:null,n);if(ko(()=>{o||a(CK(i)||document.body)},[i,o]),ko(()=>{if(s&&!o)return B2(n,s),()=>{B2(n,null)}},[n,s,o]),o){if(A.isValidElement(r)){const c={ref:l};return A.cloneElement(r,c)}return C.jsx(A.Fragment,{children:r})}return C.jsx(A.Fragment,{children:s&&zl.createPortal(r,s)})}),RK=["onChange","maxRows","minRows","style","value"];function iv(t){return parseInt(t,10)||0}const AK={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function PK(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const NK=A.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a}=e,l=Qe(e,RK),{current:c}=A.useRef(a!=null),u=A.useRef(null),f=_r(n,u),h=A.useRef(null),m=A.useRef(null),v=A.useCallback(()=>{const g=u.current,_=Ca(g).getComputedStyle(g);if(_.width==="0px")return{outerHeightStyle:0,overflowing:!1};const S=m.current;S.style.width=_.width,S.value=g.value||e.placeholder||"x",S.value.slice(-1)===` -`&&(S.value+=" ");const P=_.boxSizing,N=iv(_.paddingBottom)+iv(_.paddingTop),R=iv(_.borderBottomWidth)+iv(_.borderTopWidth),L=S.scrollHeight;S.value="x";const U=S.scrollHeight;let M=L;o&&(M=Math.max(Number(o)*U,M)),i&&(M=Math.min(Number(i)*U,M)),M=Math.max(M,U);const T=M+(P==="border-box"?N+R:0),D=Math.abs(M-L)<=1;return{outerHeightStyle:T,overflowing:D}},[i,o,e.placeholder]),x=A.useCallback(()=>{const g=v();if(PK(g))return;const b=g.outerHeightStyle,_=u.current;h.current!==b&&(h.current=b,_.style.height=`${b}px`),_.style.overflow=g.overflowing?"hidden":""},[v]);ko(()=>{const g=()=>{x()};let b;const _=jb(g),S=u.current,P=Ca(S);P.addEventListener("resize",_);let N;return typeof ResizeObserver<"u"&&(N=new ResizeObserver(g),N.observe(S)),()=>{_.clear(),cancelAnimationFrame(b),P.removeEventListener("resize",_),N&&N.disconnect()}},[v,x]),ko(()=>{x()});const y=g=>{c||x(),r&&r(g)};return C.jsxs(A.Fragment,{children:[C.jsx("textarea",W({value:a,onChange:y,ref:f,rows:o,style:s},l)),C.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:m,tabIndex:-1,style:W({},AK.shadow,s,{paddingTop:0,paddingBottom:0})})]})});function qd({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const MR=A.createContext(void 0);function gu(){return A.useContext(MR)}function s6(t){return C.jsx(wX,W({},t,{defaultTheme:bR,themeId:gd}))}function r4(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function E1(t,e=!1){return t&&(r4(t.value)&&t.value!==""||e&&r4(t.defaultValue)&&t.defaultValue!=="")}function IK(t){return t.startAdornment}function LK(t){return Tt("MuiInputBase",t)}const bd=Ct("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),kK=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],Hb=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${bt(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},Gb=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},OK=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:h,startAdornment:m,type:v}=t,x={root:["root",`color${bt(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",h&&h!=="medium"&&`size${bt(h)}`,u&&"multiline",m&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",v==="search"&&"inputTypeSearch",u&&"inputMultiline",h==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",m&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return Rt(x,LK,e)},Xb=Ze("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Hb})(({theme:t,ownerState:e})=>W({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${bd.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&W({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),qb=Ze("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Gb})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=W({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),i={opacity:"0 !important"},o=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return W({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${bd.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${bd.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),DK=C.jsx(s6,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),ER=A.forwardRef(function(e,n){var r;const i=At({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:s,autoFocus:a,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:h,disableInjectingGlobalStyles:m,endAdornment:v,fullWidth:x=!1,id:y,inputComponent:g="input",inputProps:b={},inputRef:_,maxRows:S,minRows:P,multiline:N=!1,name:R,onBlur:L,onChange:U,onClick:M,onFocus:T,onKeyDown:D,onKeyUp:O,placeholder:j,readOnly:X,renderSuffix:H,rows:Z,slotProps:F={},slots:q={},startAdornment:K,type:J="text",value:he}=i,le=Qe(i,kK),ee=b.value!=null?b.value:he,{current:ae}=A.useRef(ee!=null),ge=A.useRef(),Me=A.useCallback(Ne=>{},[]),tt=_r(ge,_,b.ref,Me),[He,rt]=A.useState(!1),Ve=gu(),se=qd({props:i,muiFormControl:Ve,states:["color","disabled","error","hiddenLabel","size","required","filled"]});se.focused=Ve?Ve.focused:He,A.useEffect(()=>{!Ve&&h&&He&&(rt(!1),L&&L())},[Ve,h,He,L]);const B=Ve&&Ve.onFilled,ye=Ve&&Ve.onEmpty,xe=A.useCallback(Ne=>{E1(Ne)?B&&B():ye&&ye()},[B,ye]);ko(()=>{ae&&xe({value:ee})},[ee,xe,ae]);const Re=Ne=>{if(se.disabled){Ne.stopPropagation();return}T&&T(Ne),b.onFocus&&b.onFocus(Ne),Ve&&Ve.onFocus?Ve.onFocus(Ne):rt(!0)},Pe=Ne=>{L&&L(Ne),b.onBlur&&b.onBlur(Ne),Ve&&Ve.onBlur?Ve.onBlur(Ne):rt(!1)},Ee=(Ne,...ze)=>{if(!ae){const Le=Ne.target||ge.current;if(Le==null)throw new Error(ru(1));xe({value:Le.value})}b.onChange&&b.onChange(Ne,...ze),U&&U(Ne,...ze)};A.useEffect(()=>{xe(ge.current)},[]);const De=Ne=>{ge.current&&Ne.currentTarget===Ne.target&&ge.current.focus(),M&&M(Ne)};let $=g,z=b;N&&$==="input"&&(Z?z=W({type:void 0,minRows:Z,maxRows:Z},z):z=W({type:void 0,maxRows:S,minRows:P},z),$=NK);const re=Ne=>{xe(Ne.animationName==="mui-auto-fill-cancel"?ge.current:{value:"x"})};A.useEffect(()=>{Ve&&Ve.setAdornedStart(!!K)},[Ve,K]);const pe=W({},i,{color:se.color||"primary",disabled:se.disabled,endAdornment:v,error:se.error,focused:se.focused,formControl:Ve,fullWidth:x,hiddenLabel:se.hiddenLabel,multiline:N,size:se.size,startAdornment:K,type:J}),me=OK(pe),be=q.root||c.Root||Xb,Ge=F.root||u.root||{},Fe=q.input||c.Input||qb;return z=W({},z,(r=F.input)!=null?r:u.input),C.jsxs(A.Fragment,{children:[!m&&DK,C.jsxs(be,W({},Ge,!xd(be)&&{ownerState:W({},pe,Ge.ownerState)},{ref:n,onClick:De},le,{className:st(me.root,Ge.className,l,X&&"MuiInputBase-readOnly"),children:[K,C.jsx(MR.Provider,{value:null,children:C.jsx(Fe,W({ownerState:pe,"aria-invalid":se.error,"aria-describedby":o,autoComplete:s,autoFocus:a,defaultValue:f,disabled:se.disabled,id:y,onAnimationStart:re,name:R,placeholder:j,readOnly:X,required:se.required,rows:Z,value:ee,onKeyDown:D,onKeyUp:O,type:J},z,!xd(Fe)&&{as:$,ownerState:W({},pe,z.ownerState)},{ref:tt,className:st(me.input,z.className,X&&"MuiInputBase-readOnly"),onBlur:Pe,onChange:Ee,onFocus:Re}))}),v,H?H(W({},se,{startAdornment:K})):null]}))]})});function FK(t){return Tt("MuiInput",t)}const Uh=W({},bd,Ct("MuiInput",["root","underline","input"]));function zK(t){return Tt("MuiOutlinedInput",t)}const Ya=W({},bd,Ct("MuiOutlinedInput",["root","notchedOutline","input"]));function UK(t){return Tt("MuiFilledInput",t)}const ec=W({},bd,Ct("MuiFilledInput",["root","underline","input"])),BK=Gd(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),jK=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],VK={entering:{opacity:1},entered:{opacity:1}},$K=A.forwardRef(function(e,n){const r=pu(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:h,onExit:m,onExited:v,onExiting:x,style:y,timeout:g=i,TransitionComponent:b=$s}=e,_=Qe(e,jK),S=A.useRef(null),P=_r(S,a.ref,n),N=j=>X=>{if(j){const H=S.current;X===void 0?j(H):j(H,X)}},R=N(h),L=N((j,X)=>{o6(j);const H=M1({style:y,timeout:g,easing:l},{mode:"enter"});j.style.webkitTransition=r.transitions.create("opacity",H),j.style.transition=r.transitions.create("opacity",H),u&&u(j,X)}),U=N(f),M=N(x),T=N(j=>{const X=M1({style:y,timeout:g,easing:l},{mode:"exit"});j.style.webkitTransition=r.transitions.create("opacity",X),j.style.transition=r.transitions.create("opacity",X),m&&m(j)}),D=N(v),O=j=>{o&&o(S.current,j)};return C.jsx(b,W({appear:s,in:c,nodeRef:S,onEnter:L,onEntered:U,onEntering:R,onExit:T,onExited:D,onExiting:M,addEndListener:O,timeout:g},_,{children:(j,X)=>A.cloneElement(a,W({style:W({opacity:0,visibility:j==="exited"&&!c?"hidden":void 0},VK[j],y,a.props.style),ref:P},X))}))});function WK(t){return Tt("MuiBackdrop",t)}Ct("MuiBackdrop",["root","invisible"]);const HK=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],GK=t=>{const{classes:e,invisible:n}=t;return Rt({root:["root",n&&"invisible"]},WK,e)},XK=Ze("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>W({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})),qK=A.forwardRef(function(e,n){var r,i,o;const s=At({props:e,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:f={},invisible:h=!1,open:m,slotProps:v={},slots:x={},TransitionComponent:y=$K,transitionDuration:g}=s,b=Qe(s,HK),_=W({},s,{component:c,invisible:h}),S=GK(_),P=(r=v.root)!=null?r:f.root;return C.jsx(y,W({in:m,timeout:g},b,{children:C.jsx(XK,W({"aria-hidden":!0},P,{as:(i=(o=x.root)!=null?o:u.Root)!=null?i:c,className:st(S.root,l,P==null?void 0:P.className),ownerState:W({},_,P==null?void 0:P.ownerState),classes:S,ref:n,children:a}))}))}),YK=Ct("MuiBox",["root"]),KK=xR(),Ta=RX({themeId:gd,defaultTheme:KK,defaultClassName:YK.root,generateClassName:Cz.generate});function ZK(t){return Tt("MuiButton",t)}const ov=Ct("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),JK=A.createContext({}),QK=A.createContext(void 0),eZ=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],tZ=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:s}=t,a={root:["root",o,`${o}${bt(e)}`,`size${bt(i)}`,`${o}Size${bt(i)}`,`color${bt(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${bt(i)}`],endIcon:["icon","endIcon",`iconSize${bt(i)}`]},l=Rt(a,ZK,s);return W({},s,l)},a6=t=>W({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),nZ=Ze(mu,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${bt(n.color)}`],e[`size${bt(n.size)}`],e[`${n.variant}Size${bt(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var n,r;const i=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],o=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return W({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":W({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Rn(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Rn(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Rn(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":W({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${ov.focusVisible}`]:W({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${ov.disabled}`]:W({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${Rn(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(n=(r=t.palette).getContrastText)==null?void 0:n.call(r,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:i,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${ov.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${ov.disabled}`]:{boxShadow:"none"}}),rZ=Ze("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${bt(n.size)}`]]}})(({ownerState:t})=>W({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},a6(t))),iZ=Ze("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${bt(n.size)}`]]}})(({ownerState:t})=>W({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},a6(t))),ym=A.forwardRef(function(e,n){const r=A.useContext(JK),i=A.useContext(QK),o=vm(r,e),s=At({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:h=!1,disableFocusRipple:m=!1,endIcon:v,focusVisibleClassName:x,fullWidth:y=!1,size:g="medium",startIcon:b,type:_,variant:S="text"}=s,P=Qe(s,eZ),N=W({},s,{color:l,component:c,disabled:f,disableElevation:h,disableFocusRipple:m,fullWidth:y,size:g,type:_,variant:S}),R=tZ(N),L=b&&C.jsx(rZ,{className:R.startIcon,ownerState:N,children:b}),U=v&&C.jsx(iZ,{className:R.endIcon,ownerState:N,children:v}),M=i||"";return C.jsxs(nZ,W({ownerState:N,className:st(r.className,R.root,u,M),component:c,disabled:f,focusRipple:!m,focusVisibleClassName:st(R.focusVisible,x),ref:n,type:_},P,{classes:R,children:[L,a,U]}))});function oZ(t){return Tt("MuiCard",t)}Ct("MuiCard",["root"]);const sZ=["className","raised"],aZ=t=>{const{classes:e}=t;return Rt({root:["root"]},oZ,e)},lZ=Ze(Xd,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),cZ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,s=Qe(r,sZ),a=W({},r,{raised:o}),l=aZ(a);return C.jsx(lZ,W({className:st(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a},s))});function uZ(t){return Tt("MuiCardActions",t)}Ct("MuiCardActions",["root","spacing"]);const fZ=["disableSpacing","className"],dZ=t=>{const{classes:e,disableSpacing:n}=t;return Rt({root:["root",!n&&"spacing"]},uZ,e)},hZ=Ze("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})(({ownerState:t})=>W({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),pZ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o}=r,s=Qe(r,fZ),a=W({},r,{disableSpacing:i}),l=dZ(a);return C.jsx(hZ,W({className:st(l.root,o),ownerState:a,ref:n},s))});function mZ(t){return Tt("MuiCardContent",t)}Ct("MuiCardContent",["root"]);const gZ=["className","component"],vZ=t=>{const{classes:e}=t;return Rt({root:["root"]},mZ,e)},yZ=Ze("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),xZ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,s=Qe(r,gZ),a=W({},r,{component:o}),l=vZ(a);return C.jsx(yZ,W({as:o,className:st(l.root,i),ownerState:a,ref:n},s))});function bZ(t){return Tt("PrivateSwitchBase",t)}Ct("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const _Z=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],wZ=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${bt(i)}`],input:["input"]};return Rt(o,bZ,e)},SZ=Ze(mu)(({ownerState:t})=>W({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),MZ=Ze("input",{shouldForwardProp:pi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),EZ=A.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:s,defaultChecked:a,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:h,inputProps:m,inputRef:v,name:x,onBlur:y,onChange:g,onFocus:b,readOnly:_,required:S=!1,tabIndex:P,type:N,value:R}=e,L=Qe(e,_Z),[U,M]=j2({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),T=gu(),D=q=>{b&&b(q),T&&T.onFocus&&T.onFocus(q)},O=q=>{y&&y(q),T&&T.onBlur&&T.onBlur(q)},j=q=>{if(q.nativeEvent.defaultPrevented)return;const K=q.target.checked;M(K),g&&g(q,K)};let X=l;T&&typeof X>"u"&&(X=T.disabled);const H=N==="checkbox"||N==="radio",Z=W({},e,{checked:U,disabled:X,disableFocusRipple:c,edge:u}),F=wZ(Z);return C.jsxs(SZ,W({component:"span",className:st(F.root,s),centerRipple:!0,focusRipple:!c,disabled:X,tabIndex:null,role:void 0,onFocus:D,onBlur:O,ownerState:Z,ref:n},L,{children:[C.jsx(MZ,W({autoFocus:r,checked:i,defaultChecked:a,className:F.input,disabled:X,id:H?h:void 0,name:x,onChange:j,readOnly:_,ref:v,required:S,ownerState:Z,tabIndex:P,type:N},N==="checkbox"&&R===void 0?{}:{value:R},m)),U?o:f]}))}),CZ=Gd(C.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),TZ=Gd(C.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),RZ=Gd(C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function AZ(t){return Tt("MuiCheckbox",t)}const KS=Ct("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),PZ=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],NZ=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${bt(r)}`,`size${bt(i)}`]},s=Rt(o,AZ,e);return W({},e,s)},IZ=Ze(EZ,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${bt(n.size)}`],n.color!=="default"&&e[`color${bt(n.color)}`]]}})(({theme:t,ownerState:e})=>W({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Rn(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${KS.checked}, &.${KS.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${KS.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),LZ=C.jsx(TZ,{}),kZ=C.jsx(CZ,{}),OZ=C.jsx(RZ,{}),DZ=A.forwardRef(function(e,n){var r,i;const o=At({props:e,name:"MuiCheckbox"}),{checkedIcon:s=LZ,color:a="primary",icon:l=kZ,indeterminate:c=!1,indeterminateIcon:u=OZ,inputProps:f,size:h="medium",className:m}=o,v=Qe(o,PZ),x=c?u:l,y=c?u:s,g=W({},o,{color:a,indeterminate:c,size:h}),b=NZ(g);return C.jsx(IZ,W({type:"checkbox",inputProps:W({"data-indeterminate":c},f),icon:A.cloneElement(x,{fontSize:(r=x.props.fontSize)!=null?r:h}),checkedIcon:A.cloneElement(y,{fontSize:(i=y.props.fontSize)!=null?i:h}),ownerState:g,ref:n,className:st(b.root,m)},v,{classes:b}))}),FZ=Eq({createStyledComponent:Ze("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`maxWidth${bt(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),useThemeProps:t=>At({props:t,name:"MuiContainer"})}),zZ=(t,e)=>W({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),UZ=t=>W({color:(t.vars||t).palette.text.primary},t.typography.body1,{backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),BZ=(t,e=!1)=>{var n;const r={};e&&t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([s,a])=>{var l;r[t.getColorSchemeSelector(s).replace(/\s*&/,"")]={colorScheme:(l=a.palette)==null?void 0:l.mode}});let i=W({html:zZ(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:W({margin:0},UZ(t),{"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}})},r);const o=(n=t.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return o&&(i=[i,o]),i};function jZ(t){const e=At({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return C.jsxs(A.Fragment,{children:[C.jsx(s6,{styles:i=>BZ(i,r)}),n]})}function VZ(t){const e=Li(t);return e.body===t?Ca(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Pp(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function i4(t){return parseInt(Ca(t).getComputedStyle(t).paddingRight,10)||0}function $Z(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function o4(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,s=>{const a=o.indexOf(s)===-1,l=!$Z(s);a&&l&&Pp(s,i)})}function ZS(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function WZ(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(VZ(r)){const s=Bz(Li(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${i4(r)+s}px`;const a=Li(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${i4(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=Li(r).body;else{const s=r.parentElement,a=Ca(r);o=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function HZ(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class GZ{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&Pp(e.modalRef,!1);const i=HZ(n);o4(n,e.mount,e.modalRef,i,!0);const o=ZS(this.containers,s=>s.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=ZS(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=WZ(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=ZS(this.containers,s=>s.modals.indexOf(e)!==-1),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&Pp(e.modalRef,n),o4(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&Pp(s.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}const XZ=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function qZ(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function YZ(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function KZ(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||YZ(t))}function ZZ(t){const e=[],n=[];return Array.from(t.querySelectorAll(XZ)).forEach((r,i)=>{const o=qZ(r);o===-1||!KZ(r)||(o===0?e.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function JZ(){return!0}function QZ(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=ZZ,isEnabled:s=JZ,open:a}=t,l=A.useRef(!1),c=A.useRef(null),u=A.useRef(null),f=A.useRef(null),h=A.useRef(null),m=A.useRef(!1),v=A.useRef(null),x=_r(e.ref,v),y=A.useRef(null);A.useEffect(()=>{!a||!v.current||(m.current=!n)},[n,a]),A.useEffect(()=>{if(!a||!v.current)return;const _=Li(v.current);return v.current.contains(_.activeElement)||(v.current.hasAttribute("tabIndex")||v.current.setAttribute("tabIndex","-1"),m.current&&v.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),A.useEffect(()=>{if(!a||!v.current)return;const _=Li(v.current),S=R=>{y.current=R,!(r||!s()||R.key!=="Tab")&&_.activeElement===v.current&&R.shiftKey&&(l.current=!0,u.current&&u.current.focus())},P=()=>{const R=v.current;if(R===null)return;if(!_.hasFocus()||!s()||l.current){l.current=!1;return}if(R.contains(_.activeElement)||r&&_.activeElement!==c.current&&_.activeElement!==u.current)return;if(_.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!m.current)return;let L=[];if((_.activeElement===c.current||_.activeElement===u.current)&&(L=o(v.current)),L.length>0){var U,M;const T=!!((U=y.current)!=null&&U.shiftKey&&((M=y.current)==null?void 0:M.key)==="Tab"),D=L[0],O=L[L.length-1];typeof D!="string"&&typeof O!="string"&&(T?O.focus():D.focus())}else R.focus()};_.addEventListener("focusin",P),_.addEventListener("keydown",S,!0);const N=setInterval(()=>{_.activeElement&&_.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(N),_.removeEventListener("focusin",P),_.removeEventListener("keydown",S,!0)}},[n,r,i,s,a,o]);const g=_=>{f.current===null&&(f.current=_.relatedTarget),m.current=!0,h.current=_.target;const S=e.props.onFocus;S&&S(_)},b=_=>{f.current===null&&(f.current=_.relatedTarget),m.current=!0};return C.jsxs(A.Fragment,{children:[C.jsx("div",{tabIndex:a?0:-1,onFocus:b,ref:c,"data-testid":"sentinelStart"}),A.cloneElement(e,{ref:x,onFocus:g}),C.jsx("div",{tabIndex:a?0:-1,onFocus:b,ref:u,"data-testid":"sentinelEnd"})]})}function eJ(t){return typeof t=="function"?t():t}function tJ(t){return t?t.props.hasOwnProperty("in"):!1}const nJ=new GZ;function rJ(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=nJ,closeAfterTransition:o=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:f}=t,h=A.useRef({}),m=A.useRef(null),v=A.useRef(null),x=_r(v,f),[y,g]=A.useState(!u),b=tJ(l);let _=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(_=!1);const S=()=>Li(m.current),P=()=>(h.current.modalRef=v.current,h.current.mount=m.current,h.current),N=()=>{i.mount(P(),{disableScrollLock:r}),v.current&&(v.current.scrollTop=0)},R=ma(()=>{const H=eJ(e)||S().body;i.add(P(),H),v.current&&N()}),L=A.useCallback(()=>i.isTopModal(P()),[i]),U=ma(H=>{m.current=H,H&&(u&&L()?N():v.current&&Pp(v.current,_))}),M=A.useCallback(()=>{i.remove(P(),_)},[_,i]);A.useEffect(()=>()=>{M()},[M]),A.useEffect(()=>{u?R():(!b||!o)&&M()},[u,M,b,o,R]);const T=H=>Z=>{var F;(F=H.onKeyDown)==null||F.call(H,Z),!(Z.key!=="Escape"||Z.which===229||!L())&&(n||(Z.stopPropagation(),c&&c(Z,"escapeKeyDown")))},D=H=>Z=>{var F;(F=H.onClick)==null||F.call(H,Z),Z.target===Z.currentTarget&&c&&c(Z,"backdropClick")};return{getRootProps:(H={})=>{const Z=Vz(t);delete Z.onTransitionEnter,delete Z.onTransitionExited;const F=W({},Z,H);return W({role:"presentation"},F,{onKeyDown:T(F),ref:x})},getBackdropProps:(H={})=>{const Z=H;return W({"aria-hidden":!0},Z,{onClick:D(Z),open:u})},getTransitionProps:()=>{const H=()=>{g(!1),s&&s()},Z=()=>{g(!0),a&&a(),o&&M()};return{onEnter:kI(H,l==null?void 0:l.props.onEnter),onExited:kI(Z,l==null?void 0:l.props.onExited)}},rootRef:x,portalRef:U,isTopModal:L,exited:y,hasTransition:b}}function iJ(t){return Tt("MuiModal",t)}Ct("MuiModal",["root","hidden","backdrop"]);const oJ=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],sJ=t=>{const{open:e,exited:n,classes:r}=t;return Rt({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},iJ,r)},aJ=Ze("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(({theme:t,ownerState:e})=>W({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),lJ=Ze(qK,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),cJ=A.forwardRef(function(e,n){var r,i,o,s,a,l;const c=At({name:"MuiModal",props:e}),{BackdropComponent:u=lJ,BackdropProps:f,className:h,closeAfterTransition:m=!1,children:v,container:x,component:y,components:g={},componentsProps:b={},disableAutoFocus:_=!1,disableEnforceFocus:S=!1,disableEscapeKeyDown:P=!1,disablePortal:N=!1,disableRestoreFocus:R=!1,disableScrollLock:L=!1,hideBackdrop:U=!1,keepMounted:M=!1,onBackdropClick:T,open:D,slotProps:O,slots:j}=c,X=Qe(c,oJ),H=W({},c,{closeAfterTransition:m,disableAutoFocus:_,disableEnforceFocus:S,disableEscapeKeyDown:P,disablePortal:N,disableRestoreFocus:R,disableScrollLock:L,hideBackdrop:U,keepMounted:M}),{getRootProps:Z,getBackdropProps:F,getTransitionProps:q,portalRef:K,isTopModal:J,exited:he,hasTransition:le}=rJ(W({},H,{rootRef:n})),ee=W({},H,{exited:he}),ae=sJ(ee),ge={};if(v.props.tabIndex===void 0&&(ge.tabIndex="-1"),le){const{onEnter:B,onExited:ye}=q();ge.onEnter=B,ge.onExited=ye}const Me=(r=(i=j==null?void 0:j.root)!=null?i:g.Root)!=null?r:aJ,tt=(o=(s=j==null?void 0:j.backdrop)!=null?s:g.Backdrop)!=null?o:u,He=(a=O==null?void 0:O.root)!=null?a:b.root,rt=(l=O==null?void 0:O.backdrop)!=null?l:b.backdrop,Ve=zs({elementType:Me,externalSlotProps:He,externalForwardedProps:X,getSlotProps:Z,additionalProps:{ref:n,as:y},ownerState:ee,className:st(h,He==null?void 0:He.className,ae==null?void 0:ae.root,!ee.open&&ee.exited&&(ae==null?void 0:ae.hidden))}),se=zs({elementType:tt,externalSlotProps:rt,additionalProps:f,getSlotProps:B=>F(W({},B,{onClick:ye=>{T&&T(ye),B!=null&&B.onClick&&B.onClick(ye)}})),className:st(rt==null?void 0:rt.className,f==null?void 0:f.className,ae==null?void 0:ae.backdrop),ownerState:ee});return!M&&!D&&(!le||he)?null:C.jsx(TK,{ref:K,container:x,disablePortal:N,children:C.jsxs(Me,W({},Ve,{children:[!U&&u?C.jsx(tt,W({},se)):null,C.jsx(QZ,{disableEnforceFocus:S,disableAutoFocus:_,disableRestoreFocus:R,isEnabled:J,open:D,children:A.cloneElement(v,ge)})]}))})}),s4=Ct("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),uJ=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],fJ=t=>{const{classes:e,disableUnderline:n}=t,i=Rt({root:["root",!n&&"underline"],input:["input"]},UK,e);return W({},e,i)},dJ=Ze(Xb,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...Hb(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var n;const r=t.palette.mode==="light",i=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return W({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${ec.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${ec.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:a}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(t.vars||t).palette[e.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ec.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ec.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ec.disabled}, .${ec.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${ec.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&W({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),hJ=Ze(qb,{name:"MuiFilledInput",slot:"Input",overridesResolver:Gb})(({theme:t,ownerState:e})=>W({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),CR=A.forwardRef(function(e,n){var r,i,o,s;const a=At({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:f="input",multiline:h=!1,slotProps:m,slots:v={},type:x="text"}=a,y=Qe(a,uJ),g=W({},a,{fullWidth:u,inputComponent:f,multiline:h,type:x}),b=fJ(a),_={root:{ownerState:g},input:{ownerState:g}},S=m??c?ui(_,m??c):_,P=(r=(i=v.root)!=null?i:l.Root)!=null?r:dJ,N=(o=(s=v.input)!=null?s:l.Input)!=null?o:hJ;return C.jsx(ER,W({slots:{root:P,input:N},componentsProps:S,fullWidth:u,inputComponent:f,multiline:h,ref:n,type:x},y,{classes:b}))});CR.muiName="Input";function pJ(t){return Tt("MuiFormControl",t)}Ct("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const mJ=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],gJ=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${bt(n)}`,r&&"fullWidth"]};return Rt(i,pJ,e)},vJ=Ze("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>W({},e.root,e[`margin${bt(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>W({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),l6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:h=!1,margin:m="none",required:v=!1,size:x="medium",variant:y="outlined"}=r,g=Qe(r,mJ),b=W({},r,{color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:h,margin:m,required:v,size:x,variant:y}),_=gJ(b),[S,P]=A.useState(()=>{let O=!1;return i&&A.Children.forEach(i,j=>{if(!ky(j,["Input","Select"]))return;const X=ky(j,["Select"])?j.props.input:j;X&&IK(X.props)&&(O=!0)}),O}),[N,R]=A.useState(()=>{let O=!1;return i&&A.Children.forEach(i,j=>{ky(j,["Input","Select"])&&(E1(j.props,!0)||E1(j.props.inputProps,!0))&&(O=!0)}),O}),[L,U]=A.useState(!1);l&&L&&U(!1);const M=u!==void 0&&!l?u:L;let T;const D=A.useMemo(()=>({adornedStart:S,setAdornedStart:P,color:s,disabled:l,error:c,filled:N,focused:M,fullWidth:f,hiddenLabel:h,size:x,onBlur:()=>{U(!1)},onEmpty:()=>{R(!1)},onFilled:()=>{R(!0)},onFocus:()=>{U(!0)},registerEffect:T,required:v,variant:y}),[S,s,l,c,N,M,f,h,T,v,x,y]);return C.jsx(MR.Provider,{value:D,children:C.jsx(vJ,W({as:a,ownerState:b,className:st(_.root,o),ref:n},g,{children:i}))})}),Is=Lq({createStyledComponent:Ze("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>At({props:t,name:"MuiStack"})});function yJ(t){return Tt("MuiFormHelperText",t)}const a4=Ct("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var l4;const xJ=["children","className","component","disabled","error","filled","focused","margin","required","variant"],bJ=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${bt(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Rt(c,yJ,e)},_J=Ze("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${bt(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>W({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${a4.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${a4.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),wJ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p"}=r,a=Qe(r,xJ),l=gu(),c=qd({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=W({},r,{component:s,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=bJ(u);return C.jsx(_J,W({as:s,ownerState:u,className:st(f.root,o),ref:n},a,{children:i===" "?l4||(l4=C.jsx("span",{className:"notranslate",children:"​"})):i}))});function SJ(t){return Tt("MuiFormLabel",t)}const Np=Ct("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),MJ=["children","className","color","component","disabled","error","filled","focused","required"],EJ=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=t,l={root:["root",`color${bt(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return Rt(l,SJ,e)},CJ=Ze("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>W({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>W({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Np.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Np.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Np.error}`]:{color:(t.vars||t).palette.error.main}})),TJ=Ze("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Np.error}`]:{color:(t.vars||t).palette.error.main}})),RJ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:s="label"}=r,a=Qe(r,MJ),l=gu(),c=qd({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=W({},r,{color:c.color||"primary",component:s,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=EJ(u);return C.jsxs(CJ,W({as:s,ownerState:u,className:st(f.root,o),ref:n},a,{children:[i,c.required&&C.jsxs(TJ,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),c4=A.createContext();function AJ(t){return Tt("MuiGrid",t)}const PJ=[0,1,2,3,4,5,6,7,8,9,10],NJ=["column-reverse","column","row-reverse","row"],IJ=["nowrap","wrap-reverse","wrap"],Bh=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],xm=Ct("MuiGrid",["root","container","item","zeroMinWidth",...PJ.map(t=>`spacing-xs-${t}`),...NJ.map(t=>`direction-xs-${t}`),...IJ.map(t=>`wrap-xs-${t}`),...Bh.map(t=>`grid-xs-${t}`),...Bh.map(t=>`grid-sm-${t}`),...Bh.map(t=>`grid-md-${t}`),...Bh.map(t=>`grid-lg-${t}`),...Bh.map(t=>`grid-xl-${t}`)]),LJ=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function rd(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function kJ({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=zc({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${rd(u)})`;c={flexBasis:f,maxWidth:f}}}o=W({flexBasis:l,flexGrow:0,maxWidth:l},c)}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function OJ({theme:t,ownerState:e}){const n=zc({values:e.direction,breakpoints:t.breakpoints.values});return Di({theme:t},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${xm.item}`]={maxWidth:"none"}),i})}function c6({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function DJ({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=zc({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=c6({breakpoints:t.breakpoints.values,values:o})),i=Di({theme:t},o,(a,l)=>{var c;const u=t.spacing(a);return u!=="0px"?{marginTop:`-${rd(u)}`,[`& > .${xm.item}`]:{paddingTop:rd(u)}}:(c=s)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${xm.item}`]:{paddingTop:0}}})}return i}function FJ({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=zc({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=c6({breakpoints:t.breakpoints.values,values:o})),i=Di({theme:t},o,(a,l)=>{var c;const u=t.spacing(a);return u!=="0px"?{width:`calc(100% + ${rd(u)})`,marginLeft:`-${rd(u)}`,[`& > .${xm.item}`]:{paddingLeft:rd(u)}}:(c=s)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${xm.item}`]:{paddingLeft:0}}})}return i}function zJ(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const UJ=Ze("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=zJ(s,c,e));const f=[];return c.forEach(h=>{const m=n[h];m&&f.push(e[`grid-${h}-${String(m)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...u,i!=="row"&&e[`direction-xs-${String(i)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...f]}})(({ownerState:t})=>W({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),OJ,DJ,FJ,kJ);function BJ(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const jJ=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let c=[];n&&(c=BJ(o,l));const u=[];l.forEach(h=>{const m=t[h];m&&u.push(`grid-${h}-${String(m)}`)});const f={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return Rt(f,AJ,e)},xa=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiGrid"}),{breakpoints:i}=pu(),o=cg(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:h=!1,rowSpacing:m,spacing:v=0,wrap:x="wrap",zeroMinWidth:y=!1}=o,g=Qe(o,LJ),b=m||v,_=l||v,S=A.useContext(c4),P=u?a||12:S,N={},R=W({},g);i.keys.forEach(M=>{g[M]!=null&&(N[M]=g[M],delete R[M])});const L=W({},o,{columns:P,container:u,direction:f,item:h,rowSpacing:b,columnSpacing:_,wrap:x,zeroMinWidth:y,spacing:v},N,{breakpoints:i.keys}),U=jJ(L);return C.jsx(c4.Provider,{value:P,children:C.jsx(UJ,W({ownerState:L,className:st(U.root,s),as:c,ref:n},R))})}),VJ=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function X2(t){return`scale(${t}, ${t**2})`}const $J={entering:{opacity:1,transform:X2(1)},entered:{opacity:1,transform:"none"}},JS=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),u6=A.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:h,onExiting:m,style:v,timeout:x="auto",TransitionComponent:y=$s}=e,g=Qe(e,VJ),b=zz(),_=A.useRef(),S=pu(),P=A.useRef(null),N=_r(P,o.ref,n),R=X=>H=>{if(X){const Z=P.current;H===void 0?X(Z):X(Z,H)}},L=R(u),U=R((X,H)=>{o6(X);const{duration:Z,delay:F,easing:q}=M1({style:v,timeout:x,easing:s},{mode:"enter"});let K;x==="auto"?(K=S.transitions.getAutoHeightDuration(X.clientHeight),_.current=K):K=Z,X.style.transition=[S.transitions.create("opacity",{duration:K,delay:F}),S.transitions.create("transform",{duration:JS?K:K*.666,delay:F,easing:q})].join(","),l&&l(X,H)}),M=R(c),T=R(m),D=R(X=>{const{duration:H,delay:Z,easing:F}=M1({style:v,timeout:x,easing:s},{mode:"exit"});let q;x==="auto"?(q=S.transitions.getAutoHeightDuration(X.clientHeight),_.current=q):q=H,X.style.transition=[S.transitions.create("opacity",{duration:q,delay:Z}),S.transitions.create("transform",{duration:JS?q:q*.666,delay:JS?Z:Z||q*.333,easing:F})].join(","),X.style.opacity=0,X.style.transform=X2(.75),f&&f(X)}),O=R(h),j=X=>{x==="auto"&&b.start(_.current||0,X),r&&r(P.current,X)};return C.jsx(y,W({appear:i,in:a,nodeRef:P,onEnter:U,onEntered:M,onEntering:L,onExit:D,onExited:O,onExiting:T,addEndListener:j,timeout:x==="auto"?null:x},g,{children:(X,H)=>A.cloneElement(o,W({style:W({opacity:0,transform:X2(.75),visibility:X==="exited"&&!a?"hidden":void 0},$J[X],v,o.props.style),ref:N},H))}))});u6.muiSupportAuto=!0;const WJ=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],HJ=t=>{const{classes:e,disableUnderline:n}=t,i=Rt({root:["root",!n&&"underline"],input:["input"]},FK,e);return W({},e,i)},GJ=Ze(Xb,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...Hb(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),W({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Uh.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Uh.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Uh.disabled}, .${Uh.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Uh.disabled}:before`]:{borderBottomStyle:"dotted"}})}),XJ=Ze(qb,{name:"MuiInput",slot:"Input",overridesResolver:Gb})({}),TR=A.forwardRef(function(e,n){var r,i,o,s;const a=At({props:e,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:f=!1,inputComponent:h="input",multiline:m=!1,slotProps:v,slots:x={},type:y="text"}=a,g=Qe(a,WJ),b=HJ(a),S={root:{ownerState:{disableUnderline:l}}},P=v??u?ui(v??u,S):S,N=(r=(i=x.root)!=null?i:c.Root)!=null?r:GJ,R=(o=(s=x.input)!=null?s:c.Input)!=null?o:XJ;return C.jsx(ER,W({slots:{root:N,input:R},slotProps:P,fullWidth:f,inputComponent:h,multiline:m,ref:n,type:y},g,{classes:b}))});TR.muiName="Input";function qJ(t){return Tt("MuiInputLabel",t)}Ct("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const YJ=["disableAnimation","margin","shrink","variant","className"],KJ=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${bt(r)}`,s],asterisk:[a&&"asterisk"]},c=Rt(l,qJ,e);return W({},e,c)},ZJ=Ze(RJ,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Np.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(({theme:t,ownerState:e})=>W({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&W({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&W({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&W({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),f6=A.forwardRef(function(e,n){const r=At({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:s}=r,a=Qe(r,YJ),l=gu();let c=o;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=qd({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=W({},r,{disableAnimation:i,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),h=KJ(f);return C.jsx(ZJ,W({"data-shrink":c,ownerState:f,ref:n,className:st(h.root,s)},a,{classes:h}))});function JJ(t){return Tt("MuiLink",t)}const QJ=Ct("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),d6={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},eQ=t=>d6[t]||t,tQ=({theme:t,ownerState:e})=>{const n=eQ(e.color),r=yd(t,`palette.${n}`,!1)||e.color,i=yd(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:Rn(r,.4)},nQ=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],rQ=t=>{const{classes:e,component:n,focusVisible:r,underline:i}=t,o={root:["root",`underline${bt(i)}`,n==="button"&&"button",r&&"focusVisible"]};return Rt(o,JJ,e)},iQ=Ze(sr,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${bt(n.underline)}`],n.component==="button"&&e.button]}})(({theme:t,ownerState:e})=>W({},e.underline==="none"&&{textDecoration:"none"},e.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},e.underline==="always"&&W({textDecoration:"underline"},e.color!=="inherit"&&{textDecorationColor:tQ({theme:t,ownerState:e})},{"&:hover":{textDecorationColor:"inherit"}}),e.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${QJ.focusVisible}`]:{outline:"auto"}})),oQ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiLink"}),{className:i,color:o="primary",component:s="a",onBlur:a,onFocus:l,TypographyClasses:c,underline:u="always",variant:f="inherit",sx:h}=r,m=Qe(r,nQ),{isFocusVisibleRef:v,onBlur:x,onFocus:y,ref:g}=Uz(),[b,_]=A.useState(!1),S=_r(n,g),P=U=>{x(U),v.current===!1&&_(!1),a&&a(U)},N=U=>{y(U),v.current===!0&&_(!0),l&&l(U)},R=W({},r,{color:o,component:s,focusVisible:b,underline:u,variant:f}),L=rQ(R);return C.jsx(iQ,W({color:o,className:st(L.root,i),classes:c,component:s,onBlur:P,onFocus:N,ref:S,ownerState:R,variant:f,sx:[...Object.keys(d6).includes(o)?[]:[{color:o}],...Array.isArray(h)?h:[h]]},m))}),Ls=A.createContext({});function sQ(t){return Tt("MuiList",t)}Ct("MuiList",["root","padding","dense","subheader"]);const aQ=["children","className","component","dense","disablePadding","subheader"],lQ=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Rt({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},sQ,e)},cQ=Ze("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})(({ownerState:t})=>W({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),h6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=r,u=Qe(r,aQ),f=A.useMemo(()=>({dense:a}),[a]),h=W({},r,{component:s,dense:a,disablePadding:l}),m=lQ(h);return C.jsx(Ls.Provider,{value:f,children:C.jsxs(cQ,W({as:s,className:st(m.root,o),ref:n,ownerState:h},u,{children:[c,i]}))})});function uQ(t){return Tt("MuiListItem",t)}const _f=Ct("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);function fQ(t){return Tt("MuiListItemButton",t)}const wf=Ct("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),dQ=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],hQ=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},pQ=t=>{const{alignItems:e,classes:n,dense:r,disabled:i,disableGutters:o,divider:s,selected:a}=t,c=Rt({root:["root",r&&"dense",!o&&"gutters",s&&"divider",i&&"disabled",e==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},fQ,n);return W({},n,c)},mQ=Ze(mu,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:hQ})(({theme:t,ownerState:e})=>W({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${wf.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${wf.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${wf.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${wf.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${wf.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.alignItems==="flex-start"&&{alignItems:"flex-start"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.dense&&{paddingTop:4,paddingBottom:4})),gQ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:s="div",children:a,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:h=!1,className:m}=r,v=Qe(r,dQ),x=A.useContext(Ls),y=A.useMemo(()=>({dense:l||x.dense||!1,alignItems:i,disableGutters:c}),[i,x.dense,l,c]),g=A.useRef(null);ko(()=>{o&&g.current&&g.current.focus()},[o]);const b=W({},r,{alignItems:i,dense:y.dense,disableGutters:c,divider:u,selected:h}),_=pQ(b),S=_r(g,n);return C.jsx(Ls.Provider,{value:y,children:C.jsx(mQ,W({ref:S,href:v.href||v.to,component:(v.href||v.to)&&s==="div"?"button":s,focusVisibleClassName:st(_.focusVisible,f),ownerState:b,className:st(_.root,m)},v,{classes:_,children:a}))})});function vQ(t){return Tt("MuiListItemSecondaryAction",t)}Ct("MuiListItemSecondaryAction",["root","disableGutters"]);const yQ=["className"],xQ=t=>{const{disableGutters:e,classes:n}=t;return Rt({root:["root",e&&"disableGutters"]},vQ,n)},bQ=Ze("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})(({ownerState:t})=>W({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),p6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,o=Qe(r,yQ),s=A.useContext(Ls),a=W({},r,{disableGutters:s.disableGutters}),l=xQ(a);return C.jsx(bQ,W({className:st(l.root,i),ownerState:a,ref:n},o))});p6.muiName="ListItemSecondaryAction";const _Q=["className"],wQ=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],SQ=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.button&&e.button,n.hasSecondaryAction&&e.secondaryAction]},MQ=t=>{const{alignItems:e,button:n,classes:r,dense:i,disabled:o,disableGutters:s,disablePadding:a,divider:l,hasSecondaryAction:c,selected:u}=t;return Rt({root:["root",i&&"dense",!s&&"gutters",!a&&"padding",l&&"divider",o&&"disabled",n&&"button",e==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",u&&"selected"],container:["container"]},uQ,r)},EQ=Ze("div",{name:"MuiListItem",slot:"Root",overridesResolver:SQ})(({theme:t,ownerState:e})=>W({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&W({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${wf.root}`]:{paddingRight:48}},{[`&.${_f.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${_f.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${_f.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${_f.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.alignItems==="flex-start"&&{alignItems:"flex-start"},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${_f.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),CQ=Ze("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),TQ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiListItem"}),{alignItems:i="center",autoFocus:o=!1,button:s=!1,children:a,className:l,component:c,components:u={},componentsProps:f={},ContainerComponent:h="li",ContainerProps:{className:m}={},dense:v=!1,disabled:x=!1,disableGutters:y=!1,disablePadding:g=!1,divider:b=!1,focusVisibleClassName:_,secondaryAction:S,selected:P=!1,slotProps:N={},slots:R={}}=r,L=Qe(r.ContainerProps,_Q),U=Qe(r,wQ),M=A.useContext(Ls),T=A.useMemo(()=>({dense:v||M.dense||!1,alignItems:i,disableGutters:y}),[i,M.dense,v,y]),D=A.useRef(null);ko(()=>{o&&D.current&&D.current.focus()},[o]);const O=A.Children.toArray(a),j=O.length&&ky(O[O.length-1],["ListItemSecondaryAction"]),X=W({},r,{alignItems:i,autoFocus:o,button:s,dense:T.dense,disabled:x,disableGutters:y,disablePadding:g,divider:b,hasSecondaryAction:j,selected:P}),H=MQ(X),Z=_r(D,n),F=R.root||u.Root||EQ,q=N.root||f.root||{},K=W({className:st(H.root,q.className,l),disabled:x},U);let J=c||"li";return s&&(K.component=c||"div",K.focusVisibleClassName=st(_f.focusVisible,_),J=mu),j?(J=!K.component&&!c?"div":J,h==="li"&&(J==="li"?J="div":K.component==="li"&&(K.component="div")),C.jsx(Ls.Provider,{value:T,children:C.jsxs(CQ,W({as:h,className:st(H.container,m),ref:Z,ownerState:X},L,{children:[C.jsx(F,W({},q,!xd(F)&&{as:J,ownerState:W({},X,q.ownerState)},K,{children:O})),O.pop()]}))})):C.jsx(Ls.Provider,{value:T,children:C.jsxs(F,W({},q,{as:J,ref:Z},!xd(F)&&{ownerState:W({},X,q.ownerState)},K,{children:[O,S&&C.jsx(p6,{children:S})]}))})}),u4=Ct("MuiListItemIcon",["root","alignItemsFlexStart"]);function RQ(t){return Tt("MuiListItemText",t)}const C1=Ct("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),AQ=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],PQ=t=>{const{classes:e,inset:n,primary:r,secondary:i,dense:o}=t;return Rt({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},RQ,e)},NQ=Ze("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${C1.primary}`]:e.primary},{[`& .${C1.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})(({ownerState:t})=>W({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},t.primary&&t.secondary&&{marginTop:6,marginBottom:6},t.inset&&{paddingLeft:56})),IQ=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiListItemText"}),{children:i,className:o,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f}=r,h=Qe(r,AQ),{dense:m}=A.useContext(Ls);let v=l??i,x=u;const y=W({},r,{disableTypography:s,inset:a,primary:!!v,secondary:!!x,dense:m}),g=PQ(y);return v!=null&&v.type!==sr&&!s&&(v=C.jsx(sr,W({variant:m?"body2":"body1",className:g.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:v}))),x!=null&&x.type!==sr&&!s&&(x=C.jsx(sr,W({variant:"body2",className:g.secondary,color:"text.secondary",display:"block"},f,{children:x}))),C.jsxs(NQ,W({className:st(g.root,o),ownerState:y,ref:n},h,{children:[v,x]}))}),LQ=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function QS(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function f4(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function m6(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.indexOf(e.keys.join(""))===0}function jh(t,e,n,r,i,o){let s=!1,a=i(t,e,e?n:!1);for(;a;){if(a===t.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!m6(a,o)||l)a=i(t,a,n);else return a.focus(),!0}return!1}const kQ=A.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu"}=e,h=Qe(e,LQ),m=A.useRef(null),v=A.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});ko(()=>{i&&m.current.focus()},[i]),A.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(_,{direction:S})=>{const P=!m.current.style.width;if(_.clientHeight{const S=m.current,P=_.key,N=Li(S).activeElement;if(P==="ArrowDown")_.preventDefault(),jh(S,N,c,l,QS);else if(P==="ArrowUp")_.preventDefault(),jh(S,N,c,l,f4);else if(P==="Home")_.preventDefault(),jh(S,null,c,l,QS);else if(P==="End")_.preventDefault(),jh(S,null,c,l,f4);else if(P.length===1){const R=v.current,L=P.toLowerCase(),U=performance.now();R.keys.length>0&&(U-R.lastTime>500?(R.keys=[],R.repeating=!0,R.previousKeyMatched=!0):R.repeating&&L!==R.keys[0]&&(R.repeating=!1)),R.lastTime=U,R.keys.push(L);const M=N&&!R.repeating&&m6(N,R);R.previousKeyMatched&&(M||jh(S,N,!1,l,QS,R))?_.preventDefault():R.previousKeyMatched=!1}u&&u(_)},y=_r(m,n);let g=-1;A.Children.forEach(s,(_,S)=>{if(!A.isValidElement(_)){g===S&&(g+=1,g>=s.length&&(g=-1));return}_.props.disabled||(f==="selectedMenu"&&_.props.selected||g===-1)&&(g=S),g===S&&(_.props.disabled||_.props.muiSkipListHighlight||_.type.muiSkipListHighlight)&&(g+=1,g>=s.length&&(g=-1))});const b=A.Children.map(s,(_,S)=>{if(S===g){const P={};return o&&(P.autoFocus=!0),_.props.tabIndex===void 0&&f==="selectedMenu"&&(P.tabIndex=0),A.cloneElement(_,P)}return _});return C.jsx(h6,W({role:"menu",ref:y,className:a,onKeyDown:x,tabIndex:i?0:-1},h,{children:b}))});function OQ(t){return Tt("MuiPopover",t)}Ct("MuiPopover",["root","paper"]);const DQ=["onEntering"],FQ=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],zQ=["slotProps"];function d4(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function h4(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function p4(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function eM(t){return typeof t=="function"?t():t}const UQ=t=>{const{classes:e}=t;return Rt({root:["root"],paper:["paper"]},OQ,e)},BQ=Ze(cJ,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),g6=Ze(Xd,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),v6=A.forwardRef(function(e,n){var r,i,o;const s=At({props:e,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:f="anchorEl",children:h,className:m,container:v,elevation:x=8,marginThreshold:y=16,open:g,PaperProps:b={},slots:_,slotProps:S,transformOrigin:P={vertical:"top",horizontal:"left"},TransitionComponent:N=u6,transitionDuration:R="auto",TransitionProps:{onEntering:L}={},disableScrollLock:U=!1}=s,M=Qe(s.TransitionProps,DQ),T=Qe(s,FQ),D=(r=S==null?void 0:S.paper)!=null?r:b,O=A.useRef(),j=_r(O,D.ref),X=W({},s,{anchorOrigin:c,anchorReference:f,elevation:x,marginThreshold:y,externalPaperSlotProps:D,transformOrigin:P,TransitionComponent:N,transitionDuration:R,TransitionProps:M}),H=UQ(X),Z=A.useCallback(()=>{if(f==="anchorPosition")return u;const B=eM(l),xe=(B&&B.nodeType===1?B:Li(O.current).body).getBoundingClientRect();return{top:xe.top+d4(xe,c.vertical),left:xe.left+h4(xe,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),F=A.useCallback(B=>({vertical:d4(B,P.vertical),horizontal:h4(B,P.horizontal)}),[P.horizontal,P.vertical]),q=A.useCallback(B=>{const ye={width:B.offsetWidth,height:B.offsetHeight},xe=F(ye);if(f==="none")return{top:null,left:null,transformOrigin:p4(xe)};const Re=Z();let Pe=Re.top-xe.vertical,Ee=Re.left-xe.horizontal;const De=Pe+ye.height,$=Ee+ye.width,z=Ca(eM(l)),re=z.innerHeight-y,pe=z.innerWidth-y;if(y!==null&&Pere){const me=De-re;Pe-=me,xe.vertical+=me}if(y!==null&&Eepe){const me=$-pe;Ee-=me,xe.horizontal+=me}return{top:`${Math.round(Pe)}px`,left:`${Math.round(Ee)}px`,transformOrigin:p4(xe)}},[l,f,Z,F,y]),[K,J]=A.useState(g),he=A.useCallback(()=>{const B=O.current;if(!B)return;const ye=q(B);ye.top!==null&&(B.style.top=ye.top),ye.left!==null&&(B.style.left=ye.left),B.style.transformOrigin=ye.transformOrigin,J(!0)},[q]);A.useEffect(()=>(U&&window.addEventListener("scroll",he),()=>window.removeEventListener("scroll",he)),[l,U,he]);const le=(B,ye)=>{L&&L(B,ye),he()},ee=()=>{J(!1)};A.useEffect(()=>{g&&he()}),A.useImperativeHandle(a,()=>g?{updatePosition:()=>{he()}}:null,[g,he]),A.useEffect(()=>{if(!g)return;const B=jb(()=>{he()}),ye=Ca(l);return ye.addEventListener("resize",B),()=>{B.clear(),ye.removeEventListener("resize",B)}},[l,g,he]);let ae=R;R==="auto"&&!N.muiSupportAuto&&(ae=void 0);const ge=v||(l?Li(eM(l)).body:void 0),Me=(i=_==null?void 0:_.root)!=null?i:BQ,tt=(o=_==null?void 0:_.paper)!=null?o:g6,He=zs({elementType:tt,externalSlotProps:W({},D,{style:K?D.style:W({},D.style,{opacity:0})}),additionalProps:{elevation:x,ref:j},ownerState:X,className:st(H.paper,D==null?void 0:D.className)}),rt=zs({elementType:Me,externalSlotProps:(S==null?void 0:S.root)||{},externalForwardedProps:T,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:ge,open:g},ownerState:X,className:st(H.root,m)}),{slotProps:Ve}=rt,se=Qe(rt,zQ);return C.jsx(Me,W({},se,!xd(Me)&&{slotProps:Ve,disableScrollLock:U},{children:C.jsx(N,W({appear:!0,in:g,onEntering:le,onExited:ee,timeout:ae},M,{children:C.jsx(tt,W({},He,{children:h}))}))}))});function jQ(t){return Tt("MuiMenu",t)}Ct("MuiMenu",["root","paper","list"]);const VQ=["onEntering"],$Q=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],WQ={vertical:"top",horizontal:"right"},HQ={vertical:"top",horizontal:"left"},GQ=t=>{const{classes:e}=t;return Rt({root:["root"],paper:["paper"],list:["list"]},jQ,e)},XQ=Ze(v6,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),qQ=Ze(g6,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),YQ=Ze(kQ,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),KQ=A.forwardRef(function(e,n){var r,i;const o=At({props:e,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:h,PaperProps:m={},PopoverClasses:v,transitionDuration:x="auto",TransitionProps:{onEntering:y}={},variant:g="selectedMenu",slots:b={},slotProps:_={}}=o,S=Qe(o.TransitionProps,VQ),P=Qe(o,$Q),N=mR(),R=W({},o,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:y,PaperProps:m,transitionDuration:x,TransitionProps:S,variant:g}),L=GQ(R),U=s&&!c&&h,M=A.useRef(null),T=(F,q)=>{M.current&&M.current.adjustStyleForScrollbar(F,{direction:N?"rtl":"ltr"}),y&&y(F,q)},D=F=>{F.key==="Tab"&&(F.preventDefault(),f&&f(F,"tabKeyDown"))};let O=-1;A.Children.map(a,(F,q)=>{A.isValidElement(F)&&(F.props.disabled||(g==="selectedMenu"&&F.props.selected||O===-1)&&(O=q))});const j=(r=b.paper)!=null?r:qQ,X=(i=_.paper)!=null?i:m,H=zs({elementType:b.root,externalSlotProps:_.root,ownerState:R,className:[L.root,l]}),Z=zs({elementType:j,externalSlotProps:X,ownerState:R,className:L.paper});return C.jsx(XQ,W({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:N?"right":"left"},transformOrigin:N?WQ:HQ,slots:{paper:j,root:b.root},slotProps:{root:H,paper:Z},open:h,ref:n,transitionDuration:x,TransitionProps:W({onEntering:T},S),ownerState:R},P,{classes:v,children:C.jsx(YQ,W({onKeyDown:D,actions:M,autoFocus:s&&(O===-1||c),autoFocusItem:U,variant:g},u,{className:st(L.list,u.className),children:a}))}))});function ZQ(t){return Tt("MuiMenuItem",t)}const Vh=Ct("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),JQ=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],QQ=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},eee=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=t,l=Rt({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},ZQ,s);return W({},s,l)},tee=Ze(mu,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:QQ})(({theme:t,ownerState:e})=>W({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Vh.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Vh.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Vh.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Vh.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Vh.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${s4.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${s4.inset}`]:{marginLeft:52},[`& .${C1.root}`]:{marginTop:0,marginBottom:0},[`& .${C1.inset}`]:{paddingLeft:36},[`& .${u4.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&W({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${u4.root} svg`]:{fontSize:"1.25rem"}}))),m4=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:h}=r,m=Qe(r,JQ),v=A.useContext(Ls),x=A.useMemo(()=>({dense:s||v.dense||!1,disableGutters:l}),[v.dense,s,l]),y=A.useRef(null);ko(()=>{i&&y.current&&y.current.focus()},[i]);const g=W({},r,{dense:x.dense,divider:a,disableGutters:l}),b=eee(r),_=_r(y,n);let S;return r.disabled||(S=f!==void 0?f:-1),C.jsx(Ls.Provider,{value:x,children:C.jsx(tee,W({ref:_,role:u,tabIndex:S,component:o,focusVisibleClassName:st(b.focusVisible,c),className:st(b.root,h)},m,{ownerState:g,classes:b}))})});function nee(t){return Tt("MuiNativeSelect",t)}const RR=Ct("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),ree=["className","disabled","error","IconComponent","inputRef","variant"],iee=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${bt(n)}`,o&&"iconOpen",r&&"disabled"]};return Rt(a,nee,e)},y6=({ownerState:t,theme:e})=>W({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":W({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${RR.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),oee=Ze("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:pi,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${RR.multiple}`]:e.multiple}]}})(y6),x6=({ownerState:t,theme:e})=>W({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${RR.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),see=Ze("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${bt(n.variant)}`],n.open&&e.iconOpen]}})(x6),aee=A.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard"}=e,c=Qe(e,ree),u=W({},e,{disabled:i,variant:l,error:o}),f=iee(u);return C.jsxs(A.Fragment,{children:[C.jsx(oee,W({ownerState:u,className:st(f.select,r),disabled:i,ref:a||n},c)),e.multiple?null:C.jsx(see,{as:s,ownerState:u,className:f.icon})]})});var g4;const lee=["children","classes","className","label","notched"],cee=Ze("fieldset",{shouldForwardProp:pi})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),uee=Ze("legend",{shouldForwardProp:pi})(({ownerState:t,theme:e})=>W({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&W({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function fee(t){const{className:e,label:n,notched:r}=t,i=Qe(t,lee),o=n!=null&&n!=="",s=W({},t,{notched:r,withLabel:o});return C.jsx(cee,W({"aria-hidden":!0,className:e,ownerState:s},i,{children:C.jsx(uee,{ownerState:s,children:o?C.jsx("span",{children:n}):g4||(g4=C.jsx("span",{className:"notranslate",children:"​"}))})}))}const dee=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],hee=t=>{const{classes:e}=t,r=Rt({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},zK,e);return W({},e,r)},pee=Ze(Xb,{shouldForwardProp:t=>pi(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Hb})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return W({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Ya.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Ya.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Ya.focused} .${Ya.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${Ya.error} .${Ya.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Ya.disabled} .${Ya.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&W({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),mee=Ze(fee,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),gee=Ze(qb,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Gb})(({theme:t,ownerState:e})=>W({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),AR=A.forwardRef(function(e,n){var r,i,o,s,a;const l=At({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:f="input",label:h,multiline:m=!1,notched:v,slots:x={},type:y="text"}=l,g=Qe(l,dee),b=hee(l),_=gu(),S=qd({props:l,muiFormControl:_,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),P=W({},l,{color:S.color||"primary",disabled:S.disabled,error:S.error,focused:S.focused,formControl:_,fullWidth:u,hiddenLabel:S.hiddenLabel,multiline:m,size:S.size,type:y}),N=(r=(i=x.root)!=null?i:c.Root)!=null?r:pee,R=(o=(s=x.input)!=null?s:c.Input)!=null?o:gee;return C.jsx(ER,W({slots:{root:N,input:R},renderSuffix:L=>C.jsx(mee,{ownerState:P,className:b.notchedOutline,label:h!=null&&h!==""&&S.required?a||(a=C.jsxs(A.Fragment,{children:[h," ","*"]})):h,notched:typeof v<"u"?v:!!(L.startAdornment||L.filled||L.focused)}),fullWidth:u,inputComponent:f,multiline:m,ref:n,type:y},g,{classes:W({},b,{notchedOutline:null})}))});AR.muiName="Input";function vee(t){return Tt("MuiSelect",t)}const $h=Ct("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var v4;const yee=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],xee=Ze("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${$h.select}`]:e.select},{[`&.${$h.select}`]:e[n.variant]},{[`&.${$h.error}`]:e.error},{[`&.${$h.multiple}`]:e.multiple}]}})(y6,{[`&.${$h.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),bee=Ze("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${bt(n.variant)}`],n.open&&e.iconOpen]}})(x6),_ee=Ze("input",{shouldForwardProp:t=>i6(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function y4(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function wee(t){return t==null||typeof t=="string"&&!t.trim()}const See=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${bt(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Rt(a,vee,e)},Mee=A.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":o,autoFocus:s,autoWidth:a,children:l,className:c,defaultOpen:u,defaultValue:f,disabled:h,displayEmpty:m,error:v=!1,IconComponent:x,inputRef:y,labelId:g,MenuProps:b={},multiple:_,name:S,onBlur:P,onChange:N,onClose:R,onFocus:L,onOpen:U,open:M,readOnly:T,renderValue:D,SelectDisplayProps:O={},tabIndex:j,value:X,variant:H="standard"}=e,Z=Qe(e,yee),[F,q]=j2({controlled:X,default:f,name:"Select"}),[K,J]=j2({controlled:M,default:u,name:"Select"}),he=A.useRef(null),le=A.useRef(null),[ee,ae]=A.useState(null),{current:ge}=A.useRef(M!=null),[Me,tt]=A.useState(),He=_r(n,y),rt=A.useCallback(Oe=>{le.current=Oe,Oe&&ae(Oe)},[]),Ve=ee==null?void 0:ee.parentNode;A.useImperativeHandle(He,()=>({focus:()=>{le.current.focus()},node:he.current,value:F}),[F]),A.useEffect(()=>{u&&K&&ee&&!ge&&(tt(a?null:Ve.clientWidth),le.current.focus())},[ee,a]),A.useEffect(()=>{s&&le.current.focus()},[s]),A.useEffect(()=>{if(!g)return;const Oe=Li(le.current).getElementById(g);if(Oe){const Ue=()=>{getSelection().isCollapsed&&le.current.focus()};return Oe.addEventListener("click",Ue),()=>{Oe.removeEventListener("click",Ue)}}},[g]);const se=(Oe,Ue)=>{Oe?U&&U(Ue):R&&R(Ue),ge||(tt(a?null:Ve.clientWidth),J(Oe))},B=Oe=>{Oe.button===0&&(Oe.preventDefault(),le.current.focus(),se(!0,Oe))},ye=Oe=>{se(!1,Oe)},xe=A.Children.toArray(l),Re=Oe=>{const Ue=xe.find(Ae=>Ae.props.value===Oe.target.value);Ue!==void 0&&(q(Ue.props.value),N&&N(Oe,Ue))},Pe=Oe=>Ue=>{let Ae;if(Ue.currentTarget.hasAttribute("tabindex")){if(_){Ae=Array.isArray(F)?F.slice():[];const ke=F.indexOf(Oe.props.value);ke===-1?Ae.push(Oe.props.value):Ae.splice(ke,1)}else Ae=Oe.props.value;if(Oe.props.onClick&&Oe.props.onClick(Ue),F!==Ae&&(q(Ae),N)){const ke=Ue.nativeEvent||Ue,dt=new ke.constructor(ke.type,ke);Object.defineProperty(dt,"target",{writable:!0,value:{value:Ae,name:S}}),N(dt,Oe)}_||se(!1,Ue)}},Ee=Oe=>{T||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Oe.key)!==-1&&(Oe.preventDefault(),se(!0,Oe))},De=ee!==null&&K,$=Oe=>{!De&&P&&(Object.defineProperty(Oe,"target",{writable:!0,value:{value:F,name:S}}),P(Oe))};delete Z["aria-invalid"];let z,re;const pe=[];let me=!1;(E1({value:F})||m)&&(D?z=D(F):me=!0);const be=xe.map(Oe=>{if(!A.isValidElement(Oe))return null;let Ue;if(_){if(!Array.isArray(F))throw new Error(ru(2));Ue=F.some(Ae=>y4(Ae,Oe.props.value)),Ue&&me&&pe.push(Oe.props.children)}else Ue=y4(F,Oe.props.value),Ue&&me&&(re=Oe.props.children);return A.cloneElement(Oe,{"aria-selected":Ue?"true":"false",onClick:Pe(Oe),onKeyUp:Ae=>{Ae.key===" "&&Ae.preventDefault(),Oe.props.onKeyUp&&Oe.props.onKeyUp(Ae)},role:"option",selected:Ue,value:void 0,"data-value":Oe.props.value})});me&&(_?pe.length===0?z=null:z=pe.reduce((Oe,Ue,Ae)=>(Oe.push(Ue),Ae{const{classes:e}=t;return e},PR={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>pi(t)&&t!=="variant",slot:"Root"},Ree=Ze(TR,PR)(""),Aee=Ze(AR,PR)(""),Pee=Ze(CR,PR)(""),NR=A.forwardRef(function(e,n){const r=At({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=BK,id:f,input:h,inputProps:m,label:v,labelId:x,MenuProps:y,multiple:g=!1,native:b=!1,onClose:_,onOpen:S,open:P,renderValue:N,SelectDisplayProps:R,variant:L="outlined"}=r,U=Qe(r,Eee),M=b?aee:Mee,T=gu(),D=qd({props:r,muiFormControl:T,states:["variant","error"]}),O=D.variant||L,j=W({},r,{variant:O,classes:s}),X=Tee(j),H=Qe(X,Cee),Z=h||{standard:C.jsx(Ree,{ownerState:j}),outlined:C.jsx(Aee,{label:v,ownerState:j}),filled:C.jsx(Pee,{ownerState:j})}[O],F=_r(n,Z.ref);return C.jsx(A.Fragment,{children:A.cloneElement(Z,W({inputComponent:M,inputProps:W({children:o,error:D.error,IconComponent:u,variant:O,type:void 0,multiple:g},b?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:x,MenuProps:y,onClose:_,onOpen:S,open:P,renderValue:N,SelectDisplayProps:W({id:f},R)},m,{classes:m?ui(H,m.classes):H},h?h.props.inputProps:{})},(g&&b||c)&&O==="outlined"?{notched:!0}:{},{ref:F,className:st(Z.props.className,a,X.root)},!h&&{variant:O},U))})});NR.muiName="Select";function Nee(t){return Tt("MuiTab",t)}const Ka=Ct("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),Iee=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],Lee=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:i,icon:o,label:s,selected:a,disabled:l}=t,c={root:["root",o&&s&&"labelIcon",`textColor${bt(n)}`,r&&"fullWidth",i&&"wrapped",a&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return Rt(c,Nee,e)},kee=Ze(mu,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${bt(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped,{[`& .${Ka.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>W({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${Ka.iconWrapper}`]:W({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${Ka.selected}`]:{opacity:1},[`&.${Ka.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Ka.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Ka.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Ka.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Ka.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),x4=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:s=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:h,onClick:m,onFocus:v,selected:x,selectionFollowsFocus:y,textColor:g="inherit",value:b,wrapped:_=!1}=r,S=Qe(r,Iee),P=W({},r,{disabled:o,disableFocusRipple:s,selected:x,icon:!!l,iconPosition:c,label:!!f,fullWidth:a,textColor:g,wrapped:_}),N=Lee(P),R=l&&f&&A.isValidElement(l)?A.cloneElement(l,{className:st(N.iconWrapper,l.props.className)}):l,L=M=>{!x&&h&&h(M,b),m&&m(M)},U=M=>{y&&!x&&h&&h(M,b),v&&v(M)};return C.jsxs(kee,W({focusRipple:!s,className:st(N.root,i),ref:n,role:"tab","aria-selected":x,disabled:o,onClick:L,onFocus:U,ownerState:P,tabIndex:x?0:-1},S,{children:[c==="top"||c==="start"?C.jsxs(A.Fragment,{children:[R,f]}):C.jsxs(A.Fragment,{children:[f,R]}),u]}))}),b6=A.createContext();function Oee(t){return Tt("MuiTable",t)}Ct("MuiTable",["root","stickyHeader"]);const Dee=["className","component","padding","size","stickyHeader"],Fee=t=>{const{classes:e,stickyHeader:n}=t;return Rt({root:["root",n&&"stickyHeader"]},Oee,e)},zee=Ze("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>W({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":W({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),b4="table",Uee=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTable"}),{className:i,component:o=b4,padding:s="normal",size:a="medium",stickyHeader:l=!1}=r,c=Qe(r,Dee),u=W({},r,{component:o,padding:s,size:a,stickyHeader:l}),f=Fee(u),h=A.useMemo(()=>({padding:s,size:a,stickyHeader:l}),[s,a,l]);return C.jsx(b6.Provider,{value:h,children:C.jsx(zee,W({as:o,role:o===b4?null:"table",ref:n,className:st(f.root,i),ownerState:u},c))})}),Yb=A.createContext();function Bee(t){return Tt("MuiTableBody",t)}Ct("MuiTableBody",["root"]);const jee=["className","component"],Vee=t=>{const{classes:e}=t;return Rt({root:["root"]},Bee,e)},$ee=Ze("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),Wee={variant:"body"},_4="tbody",Hee=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableBody"}),{className:i,component:o=_4}=r,s=Qe(r,jee),a=W({},r,{component:o}),l=Vee(a);return C.jsx(Yb.Provider,{value:Wee,children:C.jsx($ee,W({className:st(l.root,i),as:o,ref:n,role:o===_4?null:"rowgroup",ownerState:a},s))})});function Gee(t){return Tt("MuiTableCell",t)}const q2=Ct("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Xee=["align","className","component","padding","scope","size","sortDirection","variant"],qee=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:s}=t,a={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${bt(r)}`,i!=="normal"&&`padding${bt(i)}`,`size${bt(o)}`]};return Rt(a,Gee,e)},Yee=Ze("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${bt(n.size)}`],n.padding!=="normal"&&e[`padding${bt(n.padding)}`],n.align!=="inherit"&&e[`align${bt(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>W({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid - ${t.palette.mode==="light"?Zz(Rn(t.palette.divider,1),.88):Kz(Rn(t.palette.divider,1),.68)}`,textAlign:"left",padding:16},e.variant==="head"&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},e.variant==="body"&&{color:(t.vars||t).palette.text.primary},e.variant==="footer"&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},e.size==="small"&&{padding:"6px 16px",[`&.${q2.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},e.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},e.padding==="none"&&{padding:0},e.align==="left"&&{textAlign:"left"},e.align==="center"&&{textAlign:"center"},e.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},e.align==="justify"&&{textAlign:"justify"},e.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),Sf=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:c,sortDirection:u,variant:f}=r,h=Qe(r,Xee),m=A.useContext(b6),v=A.useContext(Yb),x=v&&v.variant==="head";let y;s?y=s:y=x?"th":"td";let g=l;y==="td"?g=void 0:!g&&x&&(g="col");const b=f||v&&v.variant,_=W({},r,{align:i,component:y,padding:a||(m&&m.padding?m.padding:"normal"),size:c||(m&&m.size?m.size:"medium"),sortDirection:u,stickyHeader:b==="head"&&m&&m.stickyHeader,variant:b}),S=qee(_);let P=null;return u&&(P=u==="asc"?"ascending":"descending"),C.jsx(Yee,W({as:y,ref:n,className:st(S.root,o),"aria-sort":P,scope:g,ownerState:_},h))});function Kee(t){return Tt("MuiTableContainer",t)}Ct("MuiTableContainer",["root"]);const Zee=["className","component"],Jee=t=>{const{classes:e}=t;return Rt({root:["root"]},Kee,e)},Qee=Ze("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),ete=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,s=Qe(r,Zee),a=W({},r,{component:o}),l=Jee(a);return C.jsx(Qee,W({ref:n,as:o,className:st(l.root,i),ownerState:a},s))});function tte(t){return Tt("MuiTableHead",t)}Ct("MuiTableHead",["root"]);const nte=["className","component"],rte=t=>{const{classes:e}=t;return Rt({root:["root"]},tte,e)},ite=Ze("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),ote={variant:"head"},w4="thead",ste=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableHead"}),{className:i,component:o=w4}=r,s=Qe(r,nte),a=W({},r,{component:o}),l=rte(a);return C.jsx(Yb.Provider,{value:ote,children:C.jsx(ite,W({as:o,className:st(l.root,i),ref:n,role:o===w4?null:"rowgroup",ownerState:a},s))})});function ate(t){return Tt("MuiToolbar",t)}Ct("MuiToolbar",["root","gutters","regular","dense"]);const lte=["className","component","disableGutters","variant"],cte=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Rt({root:["root",!n&&"gutters",r]},ate,e)},ute=Ze("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(({theme:t,ownerState:e})=>W({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),fte=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular"}=r,l=Qe(r,lte),c=W({},r,{component:o,disableGutters:s,variant:a}),u=cte(c);return C.jsx(ute,W({as:o,className:st(u.root,i),ref:n,ownerState:c},l))}),dte=Gd(C.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),hte=Gd(C.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function pte(t){return Tt("MuiTableRow",t)}const S4=Ct("MuiTableRow",["root","selected","hover","head","footer"]),mte=["className","component","hover","selected"],gte=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return Rt({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},pte,e)},vte=Ze("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${S4.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${S4.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Rn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),M4="tr",_6=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTableRow"}),{className:i,component:o=M4,hover:s=!1,selected:a=!1}=r,l=Qe(r,mte),c=A.useContext(Yb),u=W({},r,{component:o,hover:s,selected:a,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),f=gte(u);return C.jsx(vte,W({as:o,ref:n,className:st(f.root,i),role:o===M4?null:"row",ownerState:u},l))});function yte(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function xte(t,e,n,r={},i=()=>{}){const{ease:o=yte,duration:s=300}=r;let a=null;const l=e[t];let c=!1;const u=()=>{c=!0},f=h=>{if(c){i(new Error("Animation cancelled"));return}a===null&&(a=h);const m=Math.min(1,(h-a)/s);if(e[t]=o(m)*(n-l)+l,m>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(f)};return l===n?(i(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const bte=["onChange"],_te={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function wte(t){const{onChange:e}=t,n=Qe(t,bte),r=A.useRef(),i=A.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return ko(()=>{const s=jb(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),a=Ca(i.current);return a.addEventListener("resize",s),()=>{s.clear(),a.removeEventListener("resize",s)}},[e]),A.useEffect(()=>{o(),e(r.current)},[e]),C.jsx("div",W({style:_te,ref:i},n))}function Ste(t){return Tt("MuiTabScrollButton",t)}const Mte=Ct("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Ete=["className","slots","slotProps","direction","orientation","disabled"],Cte=t=>{const{classes:e,orientation:n,disabled:r}=t;return Rt({root:["root",n,r&&"disabled"]},Ste,e)},Tte=Ze(mu,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})(({ownerState:t})=>W({width:40,flexShrink:0,opacity:.8,[`&.${Mte.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),Rte=A.forwardRef(function(e,n){var r,i;const o=At({props:e,name:"MuiTabScrollButton"}),{className:s,slots:a={},slotProps:l={},direction:c}=o,u=Qe(o,Ete),f=mR(),h=W({isRtl:f},o),m=Cte(h),v=(r=a.StartScrollButtonIcon)!=null?r:dte,x=(i=a.EndScrollButtonIcon)!=null?i:hte,y=zs({elementType:v,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h}),g=zs({elementType:x,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h});return C.jsx(Tte,W({component:"div",className:st(m.root,s),ref:n,role:null,ownerState:h,tabIndex:null},u,{children:c==="left"?C.jsx(v,W({},y)):C.jsx(x,W({},g))}))});function Ate(t){return Tt("MuiTabs",t)}const tM=Ct("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Pte=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],E4=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,C4=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,sv=(t,e,n)=>{let r=!1,i=n(t,e);for(;i;){if(i===t.firstChild){if(r)return;r=!0}const o=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||o)i=n(t,i);else{i.focus();return}}},Nte=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:s,scrollButtonsHideMobile:a,classes:l}=t;return Rt({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",a&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},Ate,l)},Ite=Ze("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${tM.scrollButtons}`]:e.scrollButtons},{[`& .${tM.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>W({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${tM.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Lte=Ze("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.scroller,n.fixed&&e.fixed,n.hideScrollbar&&e.hideScrollbar,n.scrollableX&&e.scrollableX,n.scrollableY&&e.scrollableY]}})(({ownerState:t})=>W({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),kte=Ze("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})(({ownerState:t})=>W({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),Ote=Ze("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>W({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Dte=Ze(wte)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),T4={},Fte=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTabs"}),i=pu(),o=mR(),{"aria-label":s,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:f,component:h="div",allowScrollButtonsMobile:m=!1,indicatorColor:v="primary",onChange:x,orientation:y="horizontal",ScrollButtonComponent:g=Rte,scrollButtons:b="auto",selectionFollowsFocus:_,slots:S={},slotProps:P={},TabIndicatorProps:N={},TabScrollButtonProps:R={},textColor:L="primary",value:U,variant:M="standard",visibleScrollbar:T=!1}=r,D=Qe(r,Pte),O=M==="scrollable",j=y==="vertical",X=j?"scrollTop":"scrollLeft",H=j?"top":"left",Z=j?"bottom":"right",F=j?"clientHeight":"clientWidth",q=j?"height":"width",K=W({},r,{component:h,allowScrollButtonsMobile:m,indicatorColor:v,orientation:y,vertical:j,scrollButtons:b,textColor:L,variant:M,visibleScrollbar:T,fixed:!O,hideScrollbar:O&&!T,scrollableX:O&&!j,scrollableY:O&&j,centered:c&&!O,scrollButtonsHideMobile:!m}),J=Nte(K),he=zs({elementType:S.StartScrollButtonIcon,externalSlotProps:P.startScrollButtonIcon,ownerState:K}),le=zs({elementType:S.EndScrollButtonIcon,externalSlotProps:P.endScrollButtonIcon,ownerState:K}),[ee,ae]=A.useState(!1),[ge,Me]=A.useState(T4),[tt,He]=A.useState(!1),[rt,Ve]=A.useState(!1),[se,B]=A.useState(!1),[ye,xe]=A.useState({overflow:"hidden",scrollbarWidth:0}),Re=new Map,Pe=A.useRef(null),Ee=A.useRef(null),De=()=>{const Ae=Pe.current;let ke;if(Ae){const Q=Ae.getBoundingClientRect();ke={clientWidth:Ae.clientWidth,scrollLeft:Ae.scrollLeft,scrollTop:Ae.scrollTop,scrollLeftNormalized:oq(Ae,o?"rtl":"ltr"),scrollWidth:Ae.scrollWidth,top:Q.top,bottom:Q.bottom,left:Q.left,right:Q.right}}let dt;if(Ae&&U!==!1){const Q=Ee.current.children;if(Q.length>0){const je=Q[Re.get(U)];dt=je?je.getBoundingClientRect():null}}return{tabsMeta:ke,tabMeta:dt}},$=ma(()=>{const{tabsMeta:Ae,tabMeta:ke}=De();let dt=0,Q;if(j)Q="top",ke&&Ae&&(dt=ke.top-Ae.top+Ae.scrollTop);else if(Q=o?"right":"left",ke&&Ae){const fe=o?Ae.scrollLeftNormalized+Ae.clientWidth-Ae.scrollWidth:Ae.scrollLeft;dt=(o?-1:1)*(ke[Q]-Ae[Q]+fe)}const je={[Q]:dt,[q]:ke?ke[q]:0};if(isNaN(ge[Q])||isNaN(ge[q]))Me(je);else{const fe=Math.abs(ge[Q]-je[Q]),Te=Math.abs(ge[q]-je[q]);(fe>=1||Te>=1)&&Me(je)}}),z=(Ae,{animation:ke=!0}={})=>{ke?xte(X,Pe.current,Ae,{duration:i.transitions.duration.standard}):Pe.current[X]=Ae},re=Ae=>{let ke=Pe.current[X];j?ke+=Ae:(ke+=Ae*(o?-1:1),ke*=o&&jz()==="reverse"?-1:1),z(ke)},pe=()=>{const Ae=Pe.current[F];let ke=0;const dt=Array.from(Ee.current.children);for(let Q=0;QAe){Q===0&&(ke=Ae);break}ke+=je[F]}return ke},me=()=>{re(-1*pe())},be=()=>{re(pe())},Ge=A.useCallback(Ae=>{xe({overflow:null,scrollbarWidth:Ae})},[]),Fe=()=>{const Ae={};Ae.scrollbarSizeListener=O?C.jsx(Dte,{onChange:Ge,className:st(J.scrollableX,J.hideScrollbar)}):null;const dt=O&&(b==="auto"&&(tt||rt)||b===!0);return Ae.scrollButtonStart=dt?C.jsx(g,W({slots:{StartScrollButtonIcon:S.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:he},orientation:y,direction:o?"right":"left",onClick:me,disabled:!tt},R,{className:st(J.scrollButtons,R.className)})):null,Ae.scrollButtonEnd=dt?C.jsx(g,W({slots:{EndScrollButtonIcon:S.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:le},orientation:y,direction:o?"left":"right",onClick:be,disabled:!rt},R,{className:st(J.scrollButtons,R.className)})):null,Ae},Ne=ma(Ae=>{const{tabsMeta:ke,tabMeta:dt}=De();if(!(!dt||!ke)){if(dt[H]ke[Z]){const Q=ke[X]+(dt[Z]-ke[Z]);z(Q,{animation:Ae})}}}),ze=ma(()=>{O&&b!==!1&&B(!se)});A.useEffect(()=>{const Ae=jb(()=>{Pe.current&&$()});let ke;const dt=fe=>{fe.forEach(Te=>{Te.removedNodes.forEach(Ye=>{var qe;(qe=ke)==null||qe.unobserve(Ye)}),Te.addedNodes.forEach(Ye=>{var qe;(qe=ke)==null||qe.observe(Ye)})}),Ae(),ze()},Q=Ca(Pe.current);Q.addEventListener("resize",Ae);let je;return typeof ResizeObserver<"u"&&(ke=new ResizeObserver(Ae),Array.from(Ee.current.children).forEach(fe=>{ke.observe(fe)})),typeof MutationObserver<"u"&&(je=new MutationObserver(dt),je.observe(Ee.current,{childList:!0})),()=>{var fe,Te;Ae.clear(),Q.removeEventListener("resize",Ae),(fe=je)==null||fe.disconnect(),(Te=ke)==null||Te.disconnect()}},[$,ze]),A.useEffect(()=>{const Ae=Array.from(Ee.current.children),ke=Ae.length;if(typeof IntersectionObserver<"u"&&ke>0&&O&&b!==!1){const dt=Ae[0],Q=Ae[ke-1],je={root:Pe.current,threshold:.99},fe=jt=>{He(!jt[0].isIntersecting)},Te=new IntersectionObserver(fe,je);Te.observe(dt);const Ye=jt=>{Ve(!jt[0].isIntersecting)},qe=new IntersectionObserver(Ye,je);return qe.observe(Q),()=>{Te.disconnect(),qe.disconnect()}}},[O,b,se,u==null?void 0:u.length]),A.useEffect(()=>{ae(!0)},[]),A.useEffect(()=>{$()}),A.useEffect(()=>{Ne(T4!==ge)},[Ne,ge]),A.useImperativeHandle(l,()=>({updateIndicator:$,updateScrollButtons:ze}),[$,ze]);const Le=C.jsx(Ote,W({},N,{className:st(J.indicator,N.className),ownerState:K,style:W({},ge,N.style)}));let Xe=0;const xt=A.Children.map(u,Ae=>{if(!A.isValidElement(Ae))return null;const ke=Ae.props.value===void 0?Xe:Ae.props.value;Re.set(ke,Xe);const dt=ke===U;return Xe+=1,A.cloneElement(Ae,W({fullWidth:M==="fullWidth",indicator:dt&&!ee&&Le,selected:dt,selectionFollowsFocus:_,onChange:x,textColor:L,value:ke},Xe===1&&U===!1&&!Ae.props.tabIndex?{tabIndex:0}:{}))}),Oe=Ae=>{const ke=Ee.current,dt=Li(ke).activeElement;if(dt.getAttribute("role")!=="tab")return;let je=y==="horizontal"?"ArrowLeft":"ArrowUp",fe=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&o&&(je="ArrowRight",fe="ArrowLeft"),Ae.key){case je:Ae.preventDefault(),sv(ke,dt,C4);break;case fe:Ae.preventDefault(),sv(ke,dt,E4);break;case"Home":Ae.preventDefault(),sv(ke,null,E4);break;case"End":Ae.preventDefault(),sv(ke,null,C4);break}},Ue=Fe();return C.jsxs(Ite,W({className:st(J.root,f),ownerState:K,ref:n,as:h},D,{children:[Ue.scrollButtonStart,Ue.scrollbarSizeListener,C.jsxs(Lte,{className:J.scroller,ownerState:K,style:{overflow:ye.overflow,[j?`margin${o?"Left":"Right"}`:"marginBottom"]:T?void 0:-ye.scrollbarWidth},ref:Pe,children:[C.jsx(kte,{"aria-label":s,"aria-labelledby":a,"aria-orientation":y==="vertical"?"vertical":null,className:J.flexContainer,ownerState:K,onKeyDown:Oe,ref:Ee,role:"tablist",children:xt}),ee&&Le]}),Ue.scrollButtonEnd]}))});function zte(t){return Tt("MuiTextField",t)}Ct("MuiTextField",["root"]);const Ute=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Bte={standard:TR,filled:CR,outlined:AR},jte=t=>{const{classes:e}=t;return Rt({root:["root"]},zte,e)},Vte=Ze(l6,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),$te=A.forwardRef(function(e,n){const r=At({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:h,fullWidth:m=!1,helperText:v,id:x,InputLabelProps:y,inputProps:g,InputProps:b,inputRef:_,label:S,maxRows:P,minRows:N,multiline:R=!1,name:L,onBlur:U,onChange:M,onFocus:T,placeholder:D,required:O=!1,rows:j,select:X=!1,SelectProps:H,type:Z,value:F,variant:q="outlined"}=r,K=Qe(r,Ute),J=W({},r,{autoFocus:o,color:l,disabled:u,error:f,fullWidth:m,multiline:R,required:O,select:X,variant:q}),he=jte(J),le={};q==="outlined"&&(y&&typeof y.shrink<"u"&&(le.notched=y.shrink),le.label=S),X&&((!H||!H.native)&&(le.id=void 0),le["aria-describedby"]=void 0);const ee=Fz(x),ae=v&&ee?`${ee}-helper-text`:void 0,ge=S&&ee?`${ee}-label`:void 0,Me=Bte[q],tt=C.jsx(Me,W({"aria-describedby":ae,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:m,multiline:R,name:L,rows:j,maxRows:P,minRows:N,type:Z,value:F,id:ee,inputRef:_,onBlur:U,onChange:M,onFocus:T,placeholder:D,inputProps:g},le,b));return C.jsxs(Vte,W({className:st(he.root,a),disabled:u,error:f,fullWidth:m,ref:n,required:O,color:l,variant:q,ownerState:J},K,{children:[S!=null&&S!==""&&C.jsx(f6,W({htmlFor:ee,id:ge},y,{children:S})),X?C.jsx(NR,W({"aria-describedby":ae,id:ee,labelId:ge,value:F,input:tt},H,{children:s})):tt,v&&C.jsx(wJ,W({id:ae},h,{children:v}))]}))});function Wte(t){var n;const e=t.standard;return C.jsxs(cZ,{variant:"outlined",children:[C.jsxs(xZ,{children:[C.jsx(sr,{sx:{fontSize:14},color:"text.secondary",gutterBottom:!0,children:"XAS Metadata"}),C.jsx(sr,{variant:"h5",component:"div",children:e.sample.name}),C.jsx(sr,{variant:"h6",component:"div",children:e.sample.formula}),C.jsx(sr,{sx:{mb:1.5},color:"text.secondary",children:e.sample.prep}),C.jsxs(sr,{sx:{mb:1.5},children:["Measured at ",(n=e.facility)==null?void 0:n.name," on beamline"," ",e.beamline.name]}),C.jsx(sr,{sx:{mb:1.5},children:e.start_time})]}),t.showDownload&&C.jsx(pZ,{children:C.jsx(oQ,{href:"/webxdiviewer/xdidata/"+String(e.location),download:String(e.id)+".xdi",children:"Download"})})]})}const Kb=A.createContext({xdiFile:null,setXDIFile:()=>{}});function IR(t){const{children:e}=t;return C.jsx(Kb.Provider,{value:t.value,children:e})}function Hte(){const t=A.useContext(Kb);return C.jsx(Ta,{children:C.jsx(sr,{sx:{whiteSpace:"pre-line",overflow:"scroll",maxHeight:"20em"},children:t.xdiFile===null?"":t.xdiFile.rawText()})})}function R4(t){const{children:e,value:n,index:r,...i}=t;return C.jsx("div",{role:"tabpanel",hidden:n!==r,id:`simple-tabpanel-${r}`,"aria-labelledby":`simple-tab-${r}`,...i,children:n===r&&C.jsx(Ta,{sx:{p:1},children:e})})}function A4(t){return{id:`simple-tab-${t}`,"aria-controls":`simple-tabpanel-${t}`}}function LR(t){const[e,n]=A.useState(0),r=(i,o)=>{n(o)};return C.jsxs(Ta,{sx:{width:"100%"},children:[C.jsx(Ta,{sx:{borderBottom:1,borderColor:"divider"},children:C.jsxs(Fte,{value:e,onChange:r,"aria-label":"basic tabs example",children:[C.jsx(x4,{label:"Metadata",...A4(0)}),C.jsx(x4,{label:"Raw File",...A4(1)})]})}),C.jsx(R4,{value:e,index:0,children:C.jsx(Wte,{standard:t.standard,showDownload:t.showDownload})}),C.jsx(R4,{value:e,index:1,children:C.jsx(Hte,{})})]})}const w6=[{Number:"1",Type:"nonmetal","Atomic Weight":"1.008",Name:"Hydrogen",Symbol:"H","Melting Point":"-259","Boiling Point":"-253",Density:"0.09",Earth:"0.14",Group:"1","Electron Configuration":"1s1"},{Number:"2",Type:"noble gas","Atomic Weight":"4.003",Name:"Helium",Symbol:"He","Melting Point":"-272","Boiling Point":"-269",Density:"0.18",Earth:"",Group:"18","Electron Configuration":"1s2"},{Number:"3",Type:"alkali metal","Atomic Weight":"6.941",Name:"Lithium",Symbol:"Li","Melting Point":"180","Boiling Point":"1347",Density:"0.53",Earth:"",Group:"1","Electron Configuration":"[He] 2s1"},{Number:"4",Type:"alkaline earth metal","Atomic Weight":"9.012",Name:"Beryllium",Symbol:"Be","Melting Point":"1278","Boiling Point":"2970",Density:"1.85",Earth:"",Group:"2","Electron Configuration":"[He] 2s2"},{Number:"5",Type:"metalloid","Atomic Weight":"10.811",Name:"Boron",Symbol:"B","Melting Point":"2300","Boiling Point":"2550",Density:"2.34",Earth:"",Group:"13","Electron Configuration":"[He] 2s2 2p1"},{Number:"6",Type:"nonmetal","Atomic Weight":"12.011",Name:"Carbon",Symbol:"C","Melting Point":"3500","Boiling Point":"4827",Density:"2.26",Earth:"0.09",Group:"14","Electron Configuration":"[He] 2s2 2p2"},{Number:"7",Type:"nonmetal","Atomic Weight":"14.007",Name:"Nitrogen",Symbol:"N","Melting Point":"-210","Boiling Point":"-196",Density:"1.25",Earth:"",Group:"15","Electron Configuration":"[He] 2s2 2p3"},{Number:"8",Type:"nonmetal","Atomic Weight":"15.999",Name:"Oxygen",Symbol:"O","Melting Point":"-218","Boiling Point":"-183",Density:"1.43",Earth:"46.71",Group:"16","Electron Configuration":"[He] 2s2 2p4"},{Number:"9",Type:"halogen","Atomic Weight":"18.998",Name:"Fluorine",Symbol:"F","Melting Point":"-220","Boiling Point":"-188",Density:"1.7",Earth:"0.03",Group:"17","Electron Configuration":"[He] 2s2 2p5"},{Number:"10",Type:"noble gas","Atomic Weight":"20.18",Name:"Neon",Symbol:"Ne","Melting Point":"-249","Boiling Point":"-246",Density:"0.9",Earth:"",Group:"18","Electron Configuration":"[He] 2s2 2p6"},{Number:"11",Type:"alkali metal","Atomic Weight":"22.99",Name:"Sodium",Symbol:"Na","Melting Point":"98","Boiling Point":"883",Density:"0.97",Earth:"2.75",Group:"1","Electron Configuration":"[Ne] 3s1"},{Number:"12",Type:"alkaline earth metal","Atomic Weight":"24.305",Name:"Magnesium",Symbol:"Mg","Melting Point":"639","Boiling Point":"1090",Density:"1.74",Earth:"2.08",Group:"2","Electron Configuration":"[Ne] 3s2"},{Number:"13",Type:"post transition metal","Atomic Weight":"26.982",Name:"Aluminum",Symbol:"Al","Melting Point":"660","Boiling Point":"2467",Density:"2.7",Earth:"8.07",Group:"13","Electron Configuration":"[Ne] 3s2 3p1"},{Number:"14",Type:"metalloid","Atomic Weight":"28.086",Name:"Silicon",Symbol:"Si","Melting Point":"1410","Boiling Point":"2355",Density:"2.33",Earth:"27.69",Group:"14","Electron Configuration":"[Ne] 3s2 3p2"},{Number:"15",Type:"nonmetal","Atomic Weight":"30.974",Name:"Phosphorus",Symbol:"P","Melting Point":"44","Boiling Point":"280",Density:"1.82",Earth:"0.13",Group:"15","Electron Configuration":"[Ne] 3s2 3p3"},{Number:"16",Type:"nonmetal","Atomic Weight":"32.065",Name:"Sulfur",Symbol:"S","Melting Point":"113","Boiling Point":"445",Density:"2.07",Earth:"0.05",Group:"16","Electron Configuration":"[Ne] 3s2 3p4"},{Number:"17",Type:"halogen","Atomic Weight":"35.453",Name:"Chlorine",Symbol:"Cl","Melting Point":"-101","Boiling Point":"-35",Density:"3.21",Earth:"0.05",Group:"17","Electron Configuration":"[Ne] 3s2 3p5"},{Number:"18",Type:"noble gas","Atomic Weight":"39.948",Name:"Argon",Symbol:"Ar","Melting Point":"-189","Boiling Point":"-186",Density:"1.78",Earth:"",Group:"18","Electron Configuration":"[Ne] 3s2 3p6"},{Number:"19",Type:"alkali metal","Atomic Weight":"39.098",Name:"Potassium",Symbol:"K","Melting Point":"64","Boiling Point":"774",Density:"0.86",Earth:"2.58",Group:"1","Electron Configuration":"[Ar] 4s1"},{Number:"20",Type:"alkaline earth metal","Atomic Weight":"40.078",Name:"Calcium",Symbol:"Ca","Melting Point":"839","Boiling Point":"1484",Density:"1.55",Earth:"3.65",Group:"2","Electron Configuration":"[Ar] 4s2"},{Number:"21",Type:"transition metal","Atomic Weight":"44.956",Name:"Scandium",Symbol:"Sc","Melting Point":"1539","Boiling Point":"2832",Density:"2.99",Earth:"",Group:"3","Electron Configuration":"[Ar] 3d1 4s2"},{Number:"22",Type:"transition metal","Atomic Weight":"47.867",Name:"Titanium",Symbol:"Ti","Melting Point":"1660","Boiling Point":"3287",Density:"4.54",Earth:"0.62",Group:"4","Electron Configuration":"[Ar] 3d2 4s2"},{Number:"23",Type:"transition metal","Atomic Weight":"50.942",Name:"Vanadium",Symbol:"V","Melting Point":"1890","Boiling Point":"3380",Density:"6.11",Earth:"",Group:"5","Electron Configuration":"[Ar] 3d3 4s2"},{Number:"24",Type:"transition metal","Atomic Weight":"51.996",Name:"Chromium",Symbol:"Cr","Melting Point":"1857","Boiling Point":"2672",Density:"7.19",Earth:"0.04",Group:"6","Electron Configuration":"[Ar] 3d5 4s1"},{Number:"25",Type:"transition metal","Atomic Weight":"54.938",Name:"Manganese",Symbol:"Mn","Melting Point":"1245","Boiling Point":"1962",Density:"7.43",Earth:"0.09",Group:"7","Electron Configuration":"[Ar] 3d5 4s2"},{Number:"26",Type:"transition metal","Atomic Weight":"55.845",Name:"Iron",Symbol:"Fe","Melting Point":"1535","Boiling Point":"2750",Density:"7.87",Earth:"5.05",Group:"8","Electron Configuration":"[Ar] 3d6 4s2"},{Number:"27",Type:"transition metal","Atomic Weight":"58.933",Name:"Cobalt",Symbol:"Co","Melting Point":"1495","Boiling Point":"2870",Density:"8.9",Earth:"",Group:"9","Electron Configuration":"[Ar] 3d7 4s2"},{Number:"28",Type:"transition metal","Atomic Weight":"58.693",Name:"Nickel",Symbol:"Ni","Melting Point":"1453","Boiling Point":"2732",Density:"8.9",Earth:"0.02",Group:"10","Electron Configuration":"[Ar] 3d8 4s2"},{Number:"29",Type:"transition metal","Atomic Weight":"63.546",Name:"Copper",Symbol:"Cu","Melting Point":"1083","Boiling Point":"2567",Density:"8.96",Earth:"",Group:"11","Electron Configuration":"[Ar] 3d10 4s1"},{Number:"30",Type:"transition metal","Atomic Weight":"65.39",Name:"Zinc",Symbol:"Zn","Melting Point":"420","Boiling Point":"907",Density:"7.13",Earth:"",Group:"12","Electron Configuration":"[Ar] 3d10 4s2"},{Number:"31",Type:"post transition metal","Atomic Weight":"69.723",Name:"Gallium",Symbol:"Ga","Melting Point":"30","Boiling Point":"2403",Density:"5.91",Earth:"",Group:"13","Electron Configuration":"[Ar] 3d10 4s2 4p1"},{Number:"32",Type:"metalloid","Atomic Weight":"72.64",Name:"Germanium",Symbol:"Ge","Melting Point":"937","Boiling Point":"2830",Density:"5.32",Earth:"",Group:"14","Electron Configuration":"[Ar] 3d10 4s2 4p2"},{Number:"33",Type:"metalloid","Atomic Weight":"74.922",Name:"Arsenic",Symbol:"As","Melting Point":"81","Boiling Point":"613",Density:"5.72",Earth:"",Group:"15","Electron Configuration":"[Ar] 3d10 4s2 4p3"},{Number:"34",Type:"nonmetal","Atomic Weight":"78.96",Name:"Selenium",Symbol:"Se","Melting Point":"217","Boiling Point":"685",Density:"4.79",Earth:"",Group:"16","Electron Configuration":"[Ar] 3d10 4s2 4p4"},{Number:"35",Type:"halogen","Atomic Weight":"79.904",Name:"Bromine",Symbol:"Br","Melting Point":"-7","Boiling Point":"59",Density:"3.12",Earth:"",Group:"17","Electron Configuration":"[Ar] 3d10 4s2 4p5"},{Number:"36",Type:"noble gas","Atomic Weight":"83.8",Name:"Krypton",Symbol:"Kr","Melting Point":"-157","Boiling Point":"-153",Density:"3.75",Earth:"",Group:"18","Electron Configuration":"[Ar] 3d10 4s2 4p6"},{Number:"37",Type:"alkali metal","Atomic Weight":"85.468",Name:"Rubidium",Symbol:"Rb","Melting Point":"39","Boiling Point":"688",Density:"1.63",Earth:"",Group:"1","Electron Configuration":"[Kr] 5s1"},{Number:"38",Type:"alkaline earth metal","Atomic Weight":"87.62",Name:"Strontium",Symbol:"Sr","Melting Point":"769","Boiling Point":"1384",Density:"2.54",Earth:"",Group:"2","Electron Configuration":"[Kr] 5s2"},{Number:"39",Type:"transition metal","Atomic Weight":"88.906",Name:"Yttrium",Symbol:"Y","Melting Point":"1523","Boiling Point":"3337",Density:"4.47",Earth:"",Group:"3","Electron Configuration":"[Kr] 4d1 5s2"},{Number:"40",Type:"transition metal","Atomic Weight":"91.224",Name:"Zirconium",Symbol:"Zr","Melting Point":"1852","Boiling Point":"4377",Density:"6.51",Earth:"0.03",Group:"4","Electron Configuration":"[Kr] 4d2 5s2"},{Number:"41",Type:"transition metal","Atomic Weight":"92.906",Name:"Niobium",Symbol:"Nb","Melting Point":"2468","Boiling Point":"4927",Density:"8.57",Earth:"",Group:"5","Electron Configuration":"[Kr] 4d4 5s1"},{Number:"42",Type:"transition metal","Atomic Weight":"95.94",Name:"Molybdenum",Symbol:"Mo","Melting Point":"2617","Boiling Point":"4612",Density:"10.22",Earth:"",Group:"6","Electron Configuration":"[Kr] 4d5 5s1"},{Number:"43",Type:"transition metal","Atomic Weight":"98",Name:"Technetium",Symbol:"Tc","Melting Point":"2200","Boiling Point":"4877",Density:"11.5",Earth:"",Group:"7","Electron Configuration":"[Kr] 4d5 5s2"},{Number:"44",Type:"transition metal","Atomic Weight":"101.07",Name:"Ruthenium",Symbol:"Ru","Melting Point":"2250","Boiling Point":"3900",Density:"12.37",Earth:"",Group:"8","Electron Configuration":"[Kr] 4d7 5s1"},{Number:"45",Type:"transition metal","Atomic Weight":"102.906",Name:"Rhodium",Symbol:"Rh","Melting Point":"1966","Boiling Point":"3727",Density:"12.41",Earth:"",Group:"9","Electron Configuration":"[Kr] 4d8 5s1"},{Number:"46",Type:"transition metal","Atomic Weight":"106.42",Name:"Palladium",Symbol:"Pd","Melting Point":"1552","Boiling Point":"2927",Density:"12.02",Earth:"",Group:"10","Electron Configuration":"[Kr] 4d10"},{Number:"47",Type:"transition metal","Atomic Weight":"107.868",Name:"Silver",Symbol:"Ag","Melting Point":"962","Boiling Point":"2212",Density:"10.5",Earth:"",Group:"11","Electron Configuration":"[Kr] 4d10 5s1"},{Number:"48",Type:"transition metal","Atomic Weight":"112.411",Name:"Cadmium",Symbol:"Cd","Melting Point":"321","Boiling Point":"765",Density:"8.65",Earth:"",Group:"12","Electron Configuration":"[Kr] 4d10 5s2"},{Number:"49",Type:"post transition metal","Atomic Weight":"114.818",Name:"Indium",Symbol:"In","Melting Point":"157","Boiling Point":"2000",Density:"7.31",Earth:"",Group:"13","Electron Configuration":"[Kr] 4d10 5s2 5p1"},{Number:"50",Type:"post transition metal","Atomic Weight":"118.71",Name:"Tin",Symbol:"Sn","Melting Point":"232","Boiling Point":"2270",Density:"7.31",Earth:"",Group:"14","Electron Configuration":"[Kr] 4d10 5s2 5p2"},{Number:"51",Type:"metalloid","Atomic Weight":"121.76",Name:"Antimony",Symbol:"Sb","Melting Point":"630","Boiling Point":"1750",Density:"6.68",Earth:"",Group:"15","Electron Configuration":"[Kr] 4d10 5s2 5p3"},{Number:"52",Type:"metalloid","Atomic Weight":"127.6",Name:"Tellurium",Symbol:"Te","Melting Point":"449","Boiling Point":"990",Density:"6.24",Earth:"",Group:"16","Electron Configuration":"[Kr] 4d10 5s2 5p4"},{Number:"53",Type:"halogen","Atomic Weight":"126.905",Name:"Iodine",Symbol:"I","Melting Point":"114","Boiling Point":"184",Density:"4.93",Earth:"",Group:"17","Electron Configuration":"[Kr] 4d10 5s2 5p5"},{Number:"54",Type:"noble gas","Atomic Weight":"131.293",Name:"Xenon",Symbol:"Xe","Melting Point":"-112","Boiling Point":"-108",Density:"5.9",Earth:"",Group:"18","Electron Configuration":"[Kr] 4d10 5s2 5p6"},{Number:"55",Type:"alkali metal","Atomic Weight":"132.906",Name:"Cesium",Symbol:"Cs","Melting Point":"29","Boiling Point":"678",Density:"1.87",Earth:"",Group:"1","Electron Configuration":"[Xe] 6s1"},{Number:"56",Type:"alkaline earth metal","Atomic Weight":"137.327",Name:"Barium",Symbol:"Ba","Melting Point":"725","Boiling Point":"1140",Density:"3.59",Earth:"0.05",Group:"2","Electron Configuration":"[Xe] 6s2"},{Number:"57",Type:"lanthanide","Atomic Weight":"138.906",Name:"Lanthanum",Symbol:"La","Melting Point":"920","Boiling Point":"3469",Density:"6.15",Earth:"",Group:"3","Electron Configuration":"[Xe] 5d1 6s2"},{Number:"58",Type:"lanthanide","Atomic Weight":"140.116",Name:"Cerium",Symbol:"Ce","Melting Point":"795","Boiling Point":"3257",Density:"6.77",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f1 5d1 6s2"},{Number:"59",Type:"lanthanide","Atomic Weight":"140.908",Name:"Praseodymium",Symbol:"Pr","Melting Point":"935","Boiling Point":"3127",Density:"6.77",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f3 6s2"},{Number:"60",Type:"lanthanide","Atomic Weight":"144.24",Name:"Neodymium",Symbol:"Nd","Melting Point":"1010","Boiling Point":"3127",Density:"7.01",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f4 6s2"},{Number:"61",Type:"lanthanide","Atomic Weight":"145",Name:"Promethium",Symbol:"Pm","Melting Point":"1100","Boiling Point":"3000",Density:"7.3",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f5 6s2"},{Number:"62",Type:"lanthanide","Atomic Weight":"150.36",Name:"Samarium",Symbol:"Sm","Melting Point":"1072","Boiling Point":"1900",Density:"7.52",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f6 6s2"},{Number:"63",Type:"lanthanide","Atomic Weight":"151.964",Name:"Europium",Symbol:"Eu","Melting Point":"822","Boiling Point":"1597",Density:"5.24",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f7 6s2"},{Number:"64",Type:"lanthanide","Atomic Weight":"157.25",Name:"Gadolinium",Symbol:"Gd","Melting Point":"1311","Boiling Point":"3233",Density:"7.9",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f7 5d1 6s2"},{Number:"65",Type:"lanthanide","Atomic Weight":"158.925",Name:"Terbium",Symbol:"Tb","Melting Point":"1360","Boiling Point":"3041",Density:"8.23",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f9 6s2"},{Number:"66",Type:"lanthanide","Atomic Weight":"162.5",Name:"Dysprosium",Symbol:"Dy","Melting Point":"1412","Boiling Point":"2562",Density:"8.55",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f10 6s2"},{Number:"67",Type:"lanthanide","Atomic Weight":"164.93",Name:"Holmium",Symbol:"Ho","Melting Point":"1470","Boiling Point":"2720",Density:"8.8",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f11 6s2"},{Number:"68",Type:"lanthanide","Atomic Weight":"167.259",Name:"Erbium",Symbol:"Er","Melting Point":"1522","Boiling Point":"2510",Density:"9.07",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f12 6s2"},{Number:"69",Type:"lanthanide","Atomic Weight":"168.934",Name:"Thulium",Symbol:"Tm","Melting Point":"1545","Boiling Point":"1727",Density:"9.32",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f13 6s2"},{Number:"70",Type:"lanthanide","Atomic Weight":"173.04",Name:"Ytterbium",Symbol:"Yb","Melting Point":"824","Boiling Point":"1466",Density:"6.9",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f14 6s2"},{Number:"71",Type:"lanthanide","Atomic Weight":"174.967",Name:"Lutetium",Symbol:"Lu","Melting Point":"1656","Boiling Point":"3315",Density:"9.84",Earth:"",Group:"101","Electron Configuration":"[Xe] 4f14 5d1 6s2"},{Number:"72",Type:"transition metal","Atomic Weight":"178.49",Name:"Hafnium",Symbol:"Hf","Melting Point":"2150","Boiling Point":"5400",Density:"13.31",Earth:"",Group:"4","Electron Configuration":"[Xe] 4f14 5d2 6s2"},{Number:"73",Type:"transition metal","Atomic Weight":"180.948",Name:"Tantalum",Symbol:"Ta","Melting Point":"2996","Boiling Point":"5425",Density:"16.65",Earth:"",Group:"5","Electron Configuration":"[Xe] 4f14 5d3 6s2"},{Number:"74",Type:"transition metal","Atomic Weight":"183.84",Name:"Tungsten",Symbol:"W","Melting Point":"3410","Boiling Point":"5660",Density:"19.35",Earth:"",Group:"6","Electron Configuration":"[Xe] 4f14 5d4 6s2"},{Number:"75",Type:"transition metal","Atomic Weight":"186.207",Name:"Rhenium",Symbol:"Re","Melting Point":"3180","Boiling Point":"5627",Density:"21.04",Earth:"",Group:"7","Electron Configuration":"[Xe] 4f14 5d5 6s2"},{Number:"76",Type:"transition metal","Atomic Weight":"190.23",Name:"Osmium",Symbol:"Os","Melting Point":"3045","Boiling Point":"5027",Density:"22.6",Earth:"",Group:"8","Electron Configuration":"[Xe] 4f14 5d6 6s2"},{Number:"77",Type:"transition metal","Atomic Weight":"192.217",Name:"Iridium",Symbol:"Ir","Melting Point":"2410","Boiling Point":"4527",Density:"22.4",Earth:"",Group:"9","Electron Configuration":"[Xe] 4f14 5d7 6s2"},{Number:"78",Type:"transition metal","Atomic Weight":"195.078",Name:"Platinum",Symbol:"Pt","Melting Point":"1772","Boiling Point":"3827",Density:"21.45",Earth:"",Group:"10","Electron Configuration":"[Xe] 4f14 5d9 6s1"},{Number:"79",Type:"transition metal","Atomic Weight":"196.967",Name:"Gold",Symbol:"Au","Melting Point":"1064","Boiling Point":"2807",Density:"19.32",Earth:"",Group:"11","Electron Configuration":"[Xe] 4f14 5d10 6s1"},{Number:"80",Type:"transition metal","Atomic Weight":"200.59",Name:"Mercury",Symbol:"Hg","Melting Point":"-39","Boiling Point":"357",Density:"13.55",Earth:"",Group:"12","Electron Configuration":"[Xe] 4f14 5d10 6s2"},{Number:"81",Type:"post transition metal","Atomic Weight":"204.383",Name:"Thallium",Symbol:"Tl","Melting Point":"303","Boiling Point":"1457",Density:"11.85",Earth:"",Group:"13","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p1"},{Number:"82",Type:"post transition metal","Atomic Weight":"207.2",Name:"Lead",Symbol:"Pb","Melting Point":"327","Boiling Point":"1740",Density:"11.35",Earth:"",Group:"14","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p2"},{Number:"83",Type:"post transition metal","Atomic Weight":"208.98",Name:"Bismuth",Symbol:"Bi","Melting Point":"271","Boiling Point":"1560",Density:"9.75",Earth:"",Group:"15","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p3"},{Number:"84",Type:"metalloid","Atomic Weight":"209",Name:"Polonium",Symbol:"Po","Melting Point":"254","Boiling Point":"962",Density:"9.3",Earth:"",Group:"16","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p4"},{Number:"85",Type:"halogen","Atomic Weight":"210",Name:"Astatine",Symbol:"At","Melting Point":"302","Boiling Point":"337",Density:"0",Earth:"",Group:"17","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p5"},{Number:"86",Type:"noble gas","Atomic Weight":"222",Name:"Radon",Symbol:"Rn","Melting Point":"-71","Boiling Point":"-62",Density:"9.73",Earth:"",Group:"18","Electron Configuration":"[Xe] 4f14 5d10 6s2 6p6"},{Number:"87",Type:"alkali metal","Atomic Weight":"223",Name:"Francium",Symbol:"Fr","Melting Point":"27","Boiling Point":"677",Density:"0",Earth:"",Group:"1","Electron Configuration":"[Rn] 7s1"},{Number:"88",Type:"alkaline earth metal","Atomic Weight":"226",Name:"Radium",Symbol:"Ra","Melting Point":"700","Boiling Point":"1737",Density:"5.5",Earth:"",Group:"2","Electron Configuration":"[Rn] 7s2"},{Number:"89",Type:"actinide","Atomic Weight":"227",Name:"Actinium",Symbol:"Ac","Melting Point":"1050","Boiling Point":"3200",Density:"10.07",Earth:"",Group:"3","Electron Configuration":"[Rn] 6d1 7s2"},{Number:"90",Type:"actinide","Atomic Weight":"232.038",Name:"Thorium",Symbol:"Th","Melting Point":"1750","Boiling Point":"4790",Density:"11.72",Earth:"",Group:"102","Electron Configuration":"[Rn] 6d2 7s2"},{Number:"91",Type:"actinide","Atomic Weight":"231.036",Name:"Protactinium",Symbol:"Pa","Melting Point":"1568","Boiling Point":"0",Density:"15.4",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f2 6d1 7s2"},{Number:"92",Type:"actinide","Atomic Weight":"238.029",Name:"Uranium",Symbol:"U","Melting Point":"1132","Boiling Point":"3818",Density:"18.95",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f3 6d1 7s2"},{Number:"93",Type:"actinide","Atomic Weight":"237",Name:"Neptunium",Symbol:"Np","Melting Point":"640","Boiling Point":"3902",Density:"20.2",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f4 6d1 7s2"},{Number:"94",Type:"actinide","Atomic Weight":"244",Name:"Plutonium",Symbol:"Pu","Melting Point":"640","Boiling Point":"3235",Density:"19.84",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f6 7s2"},{Number:"95",Type:"actinide","Atomic Weight":"243",Name:"Americium",Symbol:"Am","Melting Point":"994","Boiling Point":"2607",Density:"13.67",Earth:"",Group:"102","Electron Configuration":"[Rn] 5f7 7s2"},{Number:"96",Type:"actinide","Atomic Weight":"247",Name:"Curium",Symbol:"Cm","Melting Point":"1340","Boiling Point":"0",Density:"13.5",Earth:"",Group:"102","Electron Configuration":""},{Number:"97",Type:"actinide","Atomic Weight":"247",Name:"Berkelium",Symbol:"Bk","Melting Point":"986","Boiling Point":"0",Density:"14.78",Earth:"",Group:"102","Electron Configuration":""},{Number:"98",Type:"actinide","Atomic Weight":"251",Name:"Californium",Symbol:"Cf","Melting Point":"900","Boiling Point":"0",Density:"15.1",Earth:"",Group:"102","Electron Configuration":""},{Number:"99",Type:"actinide","Atomic Weight":"252",Name:"Einsteinium",Symbol:"Es","Melting Point":"860","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"100",Type:"actinide","Atomic Weight":"257",Name:"Fermium",Symbol:"Fm","Melting Point":"1527","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"101",Type:"actinide","Atomic Weight":"258",Name:"Mendelevium",Symbol:"Md","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"102",Type:"actinide","Atomic Weight":"259",Name:"Nobelium",Symbol:"No","Melting Point":"827","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"103",Type:"actinide","Atomic Weight":"262",Name:"Lawrencium",Symbol:"Lr","Melting Point":"1627","Boiling Point":"0",Density:"0",Earth:"",Group:"102","Electron Configuration":""},{Number:"104",Type:"transition metal","Atomic Weight":"261",Name:"Rutherfordium",Symbol:"Rf","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"4","Electron Configuration":""},{Number:"105",Type:"transition metal","Atomic Weight":"262",Name:"Dubnium",Symbol:"Db","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"5","Electron Configuration":""},{Number:"106",Type:"transition metal","Atomic Weight":"266",Name:"Seaborgium",Symbol:"Sg","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"6","Electron Configuration":""},{Number:"107",Type:"transition metal","Atomic Weight":"264",Name:"Bohrium",Symbol:"Bh","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"7","Electron Configuration":""},{Number:"108",Type:"transition metal","Atomic Weight":"277",Name:"Hassium",Symbol:"Hs","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"8","Electron Configuration":""},{Number:"109",Type:"transition metal","Atomic Weight":"268",Name:"Meitnerium",Symbol:"Mt","Melting Point":"0","Boiling Point":"0",Density:"0",Earth:"",Group:"9","Electron Configuration":""}];var _c=function(){return _c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{s==null||s.apply(null,[l,a])},style:{backgroundColor:t.has(a.Symbol)?e:r,textAlign:"center",position:"relative",display:"flex",flexDirection:"column",border:"1px solid black",borderRadius:3,height:"100%",justifyContent:"center",alignItems:"center"},children:C.jsx("div",{className:"symbol",style:{color:t.has(a.Symbol)?n:e,fontSize:"small",width:"100%",overflow:"hidden",textOverflow:"ellipsis"},children:a.Symbol})}):C.jsx("div",{})}}function one(t){const e=(a,l)=>{t.onClickElement(l.Symbol)},n=pu(),r=n.palette.background.default,i=n.palette.primary.main,o=n.palette.primary.contrastText,s=n.palette.primary.dark;return C.jsx(Ta,{sx:{bgcolor:r},children:C.jsx(qte,{onClick:e,Element:ine({availableElements:t.availableElements,backgroundColor:i,textColor:o,disabledColor:s}),squareSize:t.elementSize,margin:0})})}function sne(t){const e=t.availableElements,[n,r]=A.useState(null),i=pu(),o=Dz(i.breakpoints.down("lg")),s=f=>{r(f.currentTarget)},a=()=>{r(null)},l=!!n,c=l?"simple-popover":void 0,u=o?30:55;return C.jsxs(Is,{direction:"row",spacing:2,children:[C.jsxs(l6,{children:[C.jsx(f6,{id:"Element",children:"Element"}),C.jsxs(NR,{sx:{minWidth:150},labelId:"Element",id:"Element",value:t.selectedElement,label:"Element",onChange:f=>t.setSelectedElement(f.target.value),children:[C.jsx(m4,{value:"all",children:"All Elements"}),[...e].map((f,h)=>C.jsx(m4,{value:f,children:f},h))]})]}),C.jsx(ym,{"aria-describedby":c,variant:"outlined",sx:{textTransform:"none"},onClick:s,children:"Periodic Table"}),C.jsx(v6,{id:c,open:l,anchorEl:n,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:C.jsx(one,{availableElements:t.availableElements,onClickElement:f=>{t.availableElements.has(f)&&t.setSelectedElement(f),r(null)},elementSize:u})})]})}const Za=7,Wh=Ze(Sf)(({theme:t})=>({[`&.${q2.head}`]:{backgroundColor:t.palette.common.black,color:t.palette.common.white},[`&.${q2.body}`]:{fontSize:14,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}})),ane=Ze(_6)(({theme:t})=>({"&:nth-of-type(odd):not(:hover):not(.activeclicked)":{backgroundColor:t.palette.action.selected},"&:last-child td, &:last-child th":{border:0}}));function lne(t){var n,r,i,o,s;const e=t.xasstandard===t.selected?"activeclicked":"";return C.jsxs(ane,{onClick:()=>{t.setSelectedRow(t.key),t.updatePlot(t.xasstandard)},className:e,hover:!0,selected:t.selectedRow===t.key,sx:{"&:last-child td, &:last-child th":{border:0}},children:[C.jsx(Wh,{align:"left",children:((n=t.xasstandard)==null?void 0:n.element.symbol)??" "}),C.jsx(Wh,{align:"center",children:((r=t.xasstandard)==null?void 0:r.edge.name)??""}),C.jsx(Wh,{align:"center",children:((i=t.xasstandard)==null?void 0:i.sample.name)??""}),C.jsx(Wh,{align:"center",children:((o=t.xasstandard)==null?void 0:o.sample.prep)??""}),C.jsx(Wh,{align:"right",children:((s=t.xasstandard)==null?void 0:s.beamline.name)??""})]},t.key)}function cne(t){const[e,n]=A.useState(-1),r=()=>{t.setOffset(t.offset+Za)},i=()=>{t.setOffset(t.offset-Za)},o=a=>{t.updatePlot(a.location),t.setSelectedStandard(a)};let s=[...t.standards];if(s.length<=Za)for(;s.lengthlne({key:l,xasstandard:a,selected:t.selectedStandard,updatePlot:o,selectedRow:e,setSelectedRow:n}))})]})}),C.jsxs(Is,{direction:"row",spacing:2,children:[C.jsx(ym,{variant:"contained",disabled:t.offset===0,onClick:i,children:"<"}),C.jsx(ym,{variant:"contained",disabled:t.standards.length"})]})]})}function une(t){const[e,n]=A.useState(),[r,i]=A.useState("all"),[o,s]=A.useState(0),a=t.standards.map(f=>f.element.symbol),l=new Set(a);let c=[];r!="all"?c=t.standards.filter(f=>f.element.symbol==r):c=t.standards;const u=f=>{i(f),s(0)};return C.jsxs(Is,{spacing:2,children:[C.jsx(sne,{availableElements:l,selectedElement:r,setSelectedElement:u}),C.jsx(cne,{standards:c,updatePlot:t.updatePlot,selectedStandard:e,setSelectedStandard:n,offset:o,setOffset:s}),e&&C.jsx(LR,{standard:e,showDownload:!0})]})}class fne{constructor(e,n,r,i){Ht(this,"namespace");Ht(this,"tag");Ht(this,"value");Ht(this,"unit");this.namespace=e,this.tag=n,this.value=r,this.unit=i}}const ht=class ht{constructor(e,n,r,i,o,s,a,l,c){Ht(this,"element");Ht(this,"edge");Ht(this,"sample");Ht(this,"beamline");Ht(this,"date");Ht(this,"columns");Ht(this,"comments");Ht(this,"data");Ht(this,"raw");this.element=e,this.edge=n,this.sample=r,this.beamline=i,this.date=o,this.columns=s,this.comments=a,this.data=l,this.raw=c}static parseFile(e){const n=e.split(` -`),r={},i=[];let o=null,s=null,a=null,l=null;const c=[];let u=!1,f="";for(let m=0;mMath.log2(m/h.itrans[v]))),!("murefer"in h)&&"irefer"in h&&"i0"in h&&(h.murefer=h.i0.map((m,v)=>Math.log2(m/h.irefer[v]))),!("mufluor"in h)&&"ifluor"in h&&"i0"in h&&(h.mufluor=h.i0.map((m,v)=>h.ifluor[v]/m)),new ht(s,a,r,o,l,i,f,h,e)}static checkHeaderLine(e){const n=e.slice(1).trim();if(n.slice(0,3)!="XDI")throw new Error("XDI header not matched by: "+n)}muTrans(){return ht.MUSPEC[0]in this.data?this.data[ht.MUSPEC[0]]:null}muFluor(){return ht.MUSPEC[1]in this.data?this.data[ht.MUSPEC[1]]:null}energy(){return this.data[ht.ENERGY]}build_sample(){return this.sample?{name:"name"in this.sample?this.sample.name:"Unknown name",prep:"prep"in this.sample?this.sample.prep:"Unknown prep",formula:"formula"in this.sample?this.sample.formula:"Unknown formula"}:null}muRefer(){return ht.MUREFER in this.data?this.data[ht.MUREFER]:null}rawText(){return this.raw}checkValid(){if(!this.columns.includes(ht.ENERGY))throw new Error("Required column energy is missing!");const e=this.columns.includes(ht.I0);if(!(this.columns.includes(ht.IREFER)&&e)||!this.columns.includes(ht.MUREFER))throw new Error("Required reference data is missing!");const n=(o,s)=>s.some(a=>o.includes(a));return!!(n(this.columns,ht.MUSPEC)||n(this.columns,ht.ISPEC)&&e)}static parseMetadataLine(e){const n=e.slice(1).trim(),r=n.indexOf(ht.HEADER_SPLIT_TOKEN),i=n.slice(0,r).trim(),o=n.slice(r+1).trim(),s=i.indexOf("."),a=i.slice(0,s),l=i.slice(s+1).toLowerCase(),c=a===ht.COLUMN;let u=o,f=null;if(c){const h=o.split(" ");u=h[0].trim(),f=c&&h.length>1?h[1].trim():null}return new fne(a,l,u,f)}};Ht(ht,"COMMENT_TOKEN","#"),Ht(ht,"HEADER_SPLIT_TOKEN",":"),Ht(ht,"NAMESPACE_SEPARATOR","."),Ht(ht,"SAMPLE","Sample"),Ht(ht,"ELEMENT","Element"),Ht(ht,"BEAMLINE","Beamline"),Ht(ht,"SCAN","Scan"),Ht(ht,"SYMBOL","symbol"),Ht(ht,"EDGE","edge"),Ht(ht,"PREP","prep"),Ht(ht,"STOICHIOMETRY","stoichiometry"),Ht(ht,"COLUMN","Column"),Ht(ht,"START_TIME","start_time"),Ht(ht,"NAME","name"),Ht(ht,"ENERGY","energy"),Ht(ht,"IREFER","irefer"),Ht(ht,"MUREFER","murefer"),Ht(ht,"TRANS","trans"),Ht(ht,"FLUOR","fluor"),Ht(ht,"MU","mu"),Ht(ht,"I","i"),Ht(ht,"I0","i0"),Ht(ht,"MUSPEC",[ht.MU+ht.TRANS,ht.MU+ht.FLUOR]),Ht(ht,"ISPEC",[ht.I+ht.TRANS,ht.I+ht.FLUOR]);let _d=ht;const dne="/webxdiviewer/xdidata/db.json";function hne(){const[t,e]=A.useState([]);return A.useEffect(()=>{Dn.get(dne).then(n=>{e(n.data)})},[]),t}const kR=A.createContext([]);function pne(t){const{children:e}=t,n=hne();return C.jsx(kR.Provider,{value:n,children:e})}function gr(t){const e=A.useRef(t);return e.current=t,A.useMemo(()=>Object.freeze({get current(){return e.current}}),[])}function OR(t){const e=gr(t);A.useEffect(()=>()=>{e.current()},[])}const T1=typeof window<"u"&&typeof navigator<"u"&&typeof document<"u";function E6(t){const e=gr(t),n=A.useRef(0),r=A.useCallback(()=>{T1&&n.current&&(cancelAnimationFrame(n.current),n.current=0)},[]);return OR(r),[A.useMemo(()=>{const i=(...o)=>{T1&&(r(),n.current=requestAnimationFrame(()=>{e.current(...o),n.current=0}))};return Object.defineProperties(i,{length:{value:t.length},name:{value:`${t.name||"anonymous"}__raf`}}),i},[]),r]}function mne(t,e,n,r=!1){const i=A.useRef(),o=A.useRef();return OR(()=>{i.current&&(clearTimeout(i.current),i.current=void 0)}),A.useMemo(()=>{const s=(l,c)=>{o.current=void 0,t.apply(l,c),i.current=setTimeout(()=>{i.current=void 0,!r&&o.current&&(s(o.current.this,o.current.args),o.current=void 0)},n)},a=function(...l){if(i.current){o.current={args:l,this:this};return}s(this,l)};return Object.defineProperties(a,{length:{value:t.length},name:{value:`${t.name||"anonymous"}__throttled__${n}`}}),a},[n,r,...e])}function C6(t,...e){var n;(n=t==null?void 0:t.addEventListener)==null||n.call(t,...e)}function T6(t,...e){var n;(n=t==null?void 0:t.removeEventListener)==null||n.call(t,...e)}const gne=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function vne(t=!1){const e=A.useRef(t),n=A.useCallback(()=>e.current,[]);return A.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),n}const yne=t=>(t+1)%Number.MAX_SAFE_INTEGER;function R6(){const[,t]=A.useState(0);return A.useCallback(()=>{t(yne)},[])}function xne(t,e){return typeof t=="function"?t(e):t}const nM=Map.prototype;function bne(t){const e=A.useRef(),n=R6();if(!e.current){const r=new Map(t);e.current=r,r.set=(...i)=>(nM.set.apply(r,i),n(),r),r.clear=(...i)=>{nM.clear.apply(r,i),n()},r.delete=(...i)=>{const o=nM.delete.apply(r,i);return n(),o}}return e.current}function P4(t){const e=A.useRef();return A.useEffect(()=>{e.current=t}),e.current}function _ne(t){const[e,n]=A.useState(t),[r,i]=E6(n);return OR(i),[e,r]}function Zb(t=!1,e=!0){const[n,r]=A.useState(t),i=gr(e);return[n,A.useCallback(o=>{r(s=>o===void 0||i.current&&typeof o=="object"&&(o.constructor.name==="SyntheticBaseEvent"||typeof o._reactName=="string")?!s:!!xne(o,s))},[])]}function wne(t,e,n){const r=gr(e),i=gr(n);return A.useMemo(()=>{let o=t;return{get current(){return i.current===void 0?o:i.current(o)},set current(s){o=r.current===void 0?s:r.current(s)}}},[])}let av;function Sne(){if(!T1)return;if(av)return av;const t=new Map,e=new ResizeObserver(n=>{var r;for(const i of n)(r=t.get(i.target))==null||r.forEach(o=>setTimeout(()=>{o(i)},0))});return av={observer:e,subscribe(n,r){let i=t.get(n);i||(i=new Set,t.set(n,i),e.observe(n)),i.add(r)},unsubscribe(n,r){const i=t.get(n);i&&(i.delete(r),i.size===0&&(t.delete(n),e.unobserve(n)))}},av}function Mne(t,e,n=!0){const r=n&&Sne(),i=gr(e),o=t&&"current"in t?t.current:t;A.useEffect(()=>{const s=t&&"current"in t?t.current:t;if(!r||!s)return;let a=!0;const l=(...c)=>{a&&i.current(...c)};return r.subscribe(s,l),()=>{a=!1,r.unsubscribe(s,l)}},[o,r])}function Ene(t=!0){const[e,n]=A.useState(null),r=wne(null,a=>(n(a),a)),[i,o]=A.useState(),[s]=E6(a=>{o({width:a.contentRect.width,height:a.contentRect.height})});return Mne(e,s,t),[i,r]}function Uc(t,...e){const n=vne(),r=gr(e[1]),i=A.useMemo(()=>function(...o){n()&&(typeof r.current=="function"?r.current.apply(this,o):typeof r.current.handleEvent=="function"&&r.current.handleEvent.apply(this,o))},[]);A.useEffect(()=>{const o=Cne(t)?t.current:t;if(!o)return;const s=e.slice(2);return C6(o,e[0],i,...s),()=>{T6(o,e[0],i,...s)}},[t,e[0]])}function Cne(t){return t!==null&&typeof t=="object"&&gne(t,"current")}const Tne=t=>e=>e.key===t,Rne=T1?window:null;function A6(t,e,n=[],r={}){const{event:i="keydown",target:o=Rne,eventOptions:s}=r,a=gr(e),l=A.useMemo(()=>{const c=Tne(t);return function(u){c(u)&&a.current.call(this,u)}},n);Uc(o,i,l,s)}const Ane=["mousedown","touchstart"];function Pne(t,e,n=Ane){const r=gr(e),i=gr(t);A.useEffect(()=>{function o(s){if(!i.current.current)return;const{target:a}=s,l=r.current;(!a||a&&!i.current.current.contains(a))&&l.call(this,s)}for(const s of n)C6(document,s,o,{passive:!0});return()=>{for(const s of n)T6(document,s,o,{passive:!0})}},[...n])}function Fy(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Nne(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function P6(t){let e,n,r;t.length!==2?(e=Fy,n=(a,l)=>Fy(t(a),l),r=(a,l)=>t(a)-l):(e=t===Fy||t===Nne?t:Ine,n=t,r=t);function i(a,l,c=0,u=a.length){if(c>>1;n(a[f],l)<0?c=f+1:u=f}while(c>>1;n(a[f],l)<=0?c=f+1:u=f}while(cc&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function Ine(){return 0}function Lne(t){return t===null?NaN:+t}const kne=P6(Fy),N6=kne.right;P6(Lne).center;const One=Math.sqrt(50),Dne=Math.sqrt(10),Fne=Math.sqrt(2);function R1(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=One?10:o>=Dne?5:o>=Fne?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(t*c),l=Math.round(e*c),a/ce&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(t/c),l=Math.round(e/c),a*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function A1(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function wd(t){return t=A1(Math.abs(t)),t?t[1]:NaN}function Une(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function Bne(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var jne=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bm(t){if(!(e=jne.exec(t)))throw new Error("invalid format: "+t);var e;return new DR({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}bm.prototype=DR.prototype;function DR(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}DR.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Vne(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var L6;function $ne(t,e){var n=A1(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(L6=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+A1(t,Math.max(0,e+o-1))[0]}function N4(t,e){var n=A1(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const I4={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:zne,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>N4(t*100,e),r:N4,s:$ne,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function L4(t){return t}var k4=Array.prototype.map,O4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Wne(t){var e=t.grouping===void 0||t.thousands===void 0?L4:Une(k4.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?L4:Bne(k4.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=bm(f);var h=f.fill,m=f.align,v=f.sign,x=f.symbol,y=f.zero,g=f.width,b=f.comma,_=f.precision,S=f.trim,P=f.type;P==="n"?(b=!0,P="g"):I4[P]||(_===void 0&&(_=12),S=!0,P="g"),(y||h==="0"&&m==="=")&&(y=!0,h="0",m="=");var N=x==="$"?n:x==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():"",R=x==="$"?r:/[%p]/.test(P)?s:"",L=I4[P],U=/[defgprs%]/.test(P);_=_===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function M(T){var D=N,O=R,j,X,H;if(P==="c")O=L(T)+O,T="";else{T=+T;var Z=T<0||1/T<0;if(T=isNaN(T)?l:L(Math.abs(T),_),S&&(T=Vne(T)),Z&&+T==0&&v!=="+"&&(Z=!1),D=(Z?v==="("?v:a:v==="-"||v==="("?"":v)+D,O=(P==="s"?O4[8+L6/3]:"")+O+(Z&&v==="("?")":""),U){for(j=-1,X=T.length;++jH||H>57){O=(H===46?i+T.slice(j+1):T.slice(j))+O,T=T.slice(0,j);break}}}b&&!y&&(T=e(T,1/0));var F=D.length+T.length+O.length,q=F>1)+D+T+O+q.slice(F);break;default:T=q+D+T+O;break}return o(T)}return M.toString=function(){return f+""},M}function u(f,h){var m=c((f=bm(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(wd(h)/3)))*3,x=Math.pow(10,-v),y=O4[8+v/3];return function(g){return m(x*g)+y}}return{format:c,formatPrefix:u}}var lv,Ws,k6;Hne({thousands:",",grouping:[3],currency:["$",""]});function Hne(t){return lv=Wne(t),Ws=lv.format,k6=lv.formatPrefix,lv}function Gne(t){return Math.max(0,-wd(Math.abs(t)))}function Xne(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(wd(e)/3)))*3-wd(Math.abs(t)))}function qne(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,wd(e)-wd(t))+1}function Yne(t){for(var e=new Array(t),n=0;n - * @license MIT - */var Zne=function(t){return t!=null&&(O6(t)||Jne(t)||!!t._isBuffer)};function O6(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Jne(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&O6(t.slice(0,0))}var Qne=Kne,ere=Zne,tre=typeof Float64Array<"u";function nre(t,e){return t[0]-e[0]}function rre(){var t=this.stride,e=new Array(t.length),n;for(n=0;nMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):e===3&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+n+"_set("+s.join(",")+",v){"),r?i.push("return this.data.set("+a+",v)}"):i.push("return this.data["+a+"]=v}"),i.push("proto.get=function "+n+"_get("+s.join(",")+"){"),r?i.push("return this.data.get("+a+")}"):i.push("return this.data["+a+"]}"),i.push("proto.index=function "+n+"_index(",s.join(),"){return "+a+"}"),i.push("proto.hi=function "+n+"_hi("+s.join(",")+"){return new "+n+"(this.data,"+o.map(function(y){return["(typeof i",y,"!=='number'||i",y,"<0)?this.shape[",y,"]:i",y,"|0"].join("")}).join(",")+","+o.map(function(y){return"this.stride["+y+"]"}).join(",")+",this.offset)}");var u=o.map(function(y){return"a"+y+"=this.shape["+y+"]"}),f=o.map(function(y){return"c"+y+"=this.stride["+y+"]"});i.push("proto.lo=function "+n+"_lo("+s.join(",")+"){var b=this.offset,d=0,"+u.join(",")+","+f.join(","));for(var h=0;h=0){d=i"+h+"|0;b+=c"+h+"*d;a"+h+"-=d}");i.push("return new "+n+"(this.data,"+o.map(function(y){return"a"+y}).join(",")+","+o.map(function(y){return"c"+y}).join(",")+",b)}"),i.push("proto.step=function "+n+"_step("+s.join(",")+"){var "+o.map(function(y){return"a"+y+"=this.shape["+y+"]"}).join(",")+","+o.map(function(y){return"b"+y+"=this.stride["+y+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var h=0;h=0){c=(c+this.stride["+h+"]*i"+h+")|0}else{a.push(this.shape["+h+"]);b.push(this.stride["+h+"])}");i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+o.map(function(y){return"shape["+y+"]"}).join(",")+","+o.map(function(y){return"stride["+y+"]"}).join(",")+",offset)}");var x=new Function("CTOR_LIST","ORDER",i.join(` -`));return x(P1[t],rre)}function ore(t){if(ere(t))return"buffer";if(tre)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(t)?"array":"generic"}var P1={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function sre(t,e,n,r){if(t===void 0){var c=P1.array[0];return c([])}else typeof t=="number"&&(t=[t]);e===void 0&&(e=[t.length]);var i=e.length;if(n===void 0){n=new Array(i);for(var o=i-1,s=1;o>=0;--o)n[o]=s,s*=e[o]}if(r===void 0){r=0;for(var o=0;o0,s=[],a=[],l=0,c=0,u,f;for(u=0;u0&&s.push("var "+a.join(",")),u=r-1;u>=0;--u)l=t[u],s.push(["for(i",u,"=0;i",u,"0&&s.push(["index[",c,"]-=s",c].join("")),s.push(["++index[",l,"]"].join(""))),s.push("}")}return s.join(` -`)}function pre(t,e,n,r){for(var i=e.length,o=n.arrayArgs.length,s=n.blockSize,a=n.indexArgs.length>0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",e[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",e[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),a&&l.push(["index[",e[c],"]=j",c].join(""));for(var c=0;c0&&(n=n&&e[r]===e[r-1])}return n?e[0]:e.join("")}function vre(t,e){for(var n=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,r=new Array(t.arrayArgs.length),i=new Array(t.arrayArgs.length),o=0;o0&&x.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var y=new Array(n),o=0;o0&&v.push("var "+x.join(","));for(var o=0;o3&&v.push(rM(t.pre,t,i));var S=rM(t.body,t,i),P=mre(u);P3&&v.push(rM(t.post,t,i)),t.debug&&console.log("-----Generated cwise routine for ",e,`: -`+v.join(` -`)+` -----------`);var N=[t.funcName||"unnamed","_cwise_loop_",r[0].join("s"),"m",P,gre(i)].join(""),R=new Function(["function ",N,"(",m.join(","),"){",v.join(` -`),"} return ",N].join(""));return R()}var yre=vre,xre=yre;function bre(t){var e=["'use strict'","var CACHED={}"],n=[],r=t.funcName+"_cwise_thunk";e.push(["return function ",r,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],a=[],l=[],c=0;c0&&(a.push("array"+t.arrayArgs[0]+".shape.length===array"+u+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),l.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+u+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+a.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;c0)throw new Error("cwise: pre() block may not reference array args");if(r0)throw new Error("cwise: post() block may not reference array args")}else if(i==="scalar")e.scalarArgs.push(r),e.shimArgs.push("scalar"+r);else if(i==="index"){if(e.indexArgs.push(r),r0)throw new Error("cwise: pre() block may not reference array index");if(r0)throw new Error("cwise: post() block may not reference array index")}else if(i==="shape"){if(e.shapeArgs.push(r),rn.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,wre(e)}var Ere=Mre;(function(t){var e=Ere,n={body:"",args:[],thisVars:[],localVars:[]};function r(h){if(!h)return n;for(var m=0;m>",rrshift:">>>"};(function(){for(var h in s){var m=s[h];t[h]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+m+"c"},funcName:h}),t[h+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+m+"=b"},rvalue:!0,funcName:h+"eq"}),t[h+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+m+"s"},funcName:h+"s"}),t[h+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+m+"=s"},rvalue:!0,funcName:h+"seq"})}})();var a={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var h in a){var m=a[h];t[h]=o({args:["array","array"],body:{args:["a","b"],body:"a="+m+"b"},funcName:h}),t[h+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+m+"a"},rvalue:!0,count:2,funcName:h+"eq"})}})();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var h in l){var m=l[h];t[h]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+m+"c"},funcName:h}),t[h+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+m+"s"},funcName:h+"s"}),t[h+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+m+"b"},rvalue:!0,count:2,funcName:h+"eq"}),t[h+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+m+"s"},rvalue:!0,count:2,funcName:h+"seq"})}})();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var h=0;hthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),t.norm1=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),t.sup=e({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),t.inf=e({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),t.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),t.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),t.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),t.equals=e({args:["array","array"],pre:n,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})})(lre);/** - * @license - * Copyright 2010-2024 Three.js Authors - * SPDX-License-Identifier: MIT - */const Qb="169",Cre={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Tre={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},F6=0,J2=1,z6=2,Rre=3,U6=0,e_=1,Ip=2,Yo=3,Ra=0,fi=1,Qo=2,ba=0,Bc=1,Q2=2,eC=3,tC=4,B6=5,fl=100,j6=101,V6=102,$6=103,W6=104,H6=200,G6=201,X6=202,q6=203,N1=204,I1=205,Y6=206,K6=207,Z6=208,J6=209,Q6=210,eU=211,tU=212,nU=213,rU=214,L1=0,k1=1,O1=2,ou=3,D1=4,F1=5,z1=6,U1=7,fg=0,iU=1,oU=2,ks=0,sU=1,aU=2,lU=3,FR=4,cU=5,uU=6,fU=7,nC="attached",dU="detached",dg=300,Aa=301,Al=302,_m=303,wm=304,Yd=306,Sm=1e3,Ti=1001,Mm=1002,lr=1003,zR=1004,Are=1004,Bf=1005,Pre=1005,tr=1006,Lp=1007,Nre=1007,Cs=1008,Ire=1008,Fi=1009,UR=1010,BR=1011,Sd=1012,t_=1013,Pa=1014,ai=1015,vu=1016,n_=1017,r_=1018,su=1020,jR=35902,VR=1021,$R=1022,Rr=1023,WR=1024,HR=1025,jc=1026,au=1027,hg=1028,pg=1029,GR=1030,i_=1031,Lre=1032,o_=1033,kp=33776,Op=33777,Dp=33778,Fp=33779,B1=35840,j1=35841,V1=35842,$1=35843,W1=36196,H1=37492,G1=37496,X1=37808,q1=37809,Y1=37810,K1=37811,Z1=37812,J1=37813,Q1=37814,ex=37815,tx=37816,nx=37817,rx=37818,ix=37819,ox=37820,sx=37821,zp=36492,ax=36494,lx=36495,XR=36283,cx=36284,ux=36285,fx=36286,hU=2200,pU=2201,mU=2202,Em=2300,dx=2301,zy=2302,Pc=2400,Nc=2401,Cm=2402,s_=2500,qR=2501,kre=0,Ore=1,Dre=2,gU=3200,vU=3201,Fre=3202,zre=3203,Ul=0,yU=1,fa="",Eo="srgb",Oa="srgb-linear",a_="display-p3",mg="display-p3-linear",Tm="linear",xn="srgb",Rm="rec709",Am="p3",Ure=0,yc=7680,Bre=7681,jre=7682,Vre=7683,$re=34055,Wre=34056,Hre=5386,Gre=512,Xre=513,qre=514,Yre=515,Kre=516,Zre=517,Jre=518,rC=519,xU=512,bU=513,_U=514,YR=515,wU=516,SU=517,MU=518,EU=519,Pm=35044,Qre=35048,eie=35040,tie=35045,nie=35049,rie=35041,iie=35046,oie=35050,sie=35042,aie="100",iC="300 es",Ts=2e3,Nm=2001;class Hs{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let o=0,s=i.length;o>8&255]+jr[t>>16&255]+jr[t>>24&255]+"-"+jr[e&255]+jr[e>>8&255]+"-"+jr[e>>16&15|64]+jr[e>>24&255]+"-"+jr[n&63|128]+jr[n>>8&255]+"-"+jr[n>>16&255]+jr[n>>24&255]+jr[r&255]+jr[r>>8&255]+jr[r>>16&255]+jr[r>>24&255]).toLowerCase()}function $n(t,e,n){return Math.max(e,Math.min(n,t))}function KR(t,e){return(t%e+e)%e}function lie(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function cie(t,e,n){return t!==e?(n-t)/(e-t):0}function Up(t,e,n){return(1-n)*t+n*e}function uie(t,e,n,r){return Up(t,e,1-Math.exp(-n*r))}function fie(t,e=1){return e-Math.abs(KR(t,e*2)-e)}function die(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function hie(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function pie(t,e){return t+Math.floor(Math.random()*(e-t+1))}function mie(t,e){return t+Math.random()*(e-t)}function gie(t){return t*(.5-Math.random())}function vie(t){t!==void 0&&(D4=t);let e=D4+=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 yie(t){return t*Vc}function xie(t){return t*Md}function bie(t){return(t&t-1)===0&&t!==0}function _ie(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function wie(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Sie(t,e,n,r,i){const o=Math.cos,s=Math.sin,a=o(n/2),l=s(n/2),c=o((e+r)/2),u=s((e+r)/2),f=o((e-r)/2),h=s((e-r)/2),m=o((r-e)/2),v=s((r-e)/2);switch(i){case"XYX":t.set(a*u,l*f,l*h,a*c);break;case"YZY":t.set(l*h,a*u,l*f,a*c);break;case"ZXZ":t.set(l*f,l*h,a*u,a*c);break;case"XZX":t.set(a*u,l*v,l*m,a*c);break;case"YXY":t.set(l*m,a*u,l*v,a*c);break;case"ZYZ":t.set(l*v,l*m,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function si(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Ft(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const CU={DEG2RAD:Vc,RAD2DEG:Md,generateUUID:eo,clamp:$n,euclideanModulo:KR,mapLinear:lie,inverseLerp:cie,lerp:Up,damp:uie,pingpong:fie,smoothstep:die,smootherstep:hie,randInt:pie,randFloat:mie,randFloatSpread:gie,seededRandom:vie,degToRad:yie,radToDeg:xie,isPowerOfTwo:bie,ceilPowerOfTwo:_ie,floorPowerOfTwo:wie,setQuaternionFromProperEuler:Sie,normalize:Ft,denormalize:si};class Ie{constructor(e=0,n=0){Ie.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.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 n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos($n(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,s=this.y-e.y;return this.x=o*r-s*i+e.x,this.y=o*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Dt{constructor(e,n,r,i,o,s,a,l,c){Dt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,s,a,l,c)}set(e,n,r,i,o,s,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[3],l=r[6],c=r[1],u=r[4],f=r[7],h=r[2],m=r[5],v=r[8],x=i[0],y=i[3],g=i[6],b=i[1],_=i[4],S=i[7],P=i[2],N=i[5],R=i[8];return o[0]=s*x+a*b+l*P,o[3]=s*y+a*_+l*N,o[6]=s*g+a*S+l*R,o[1]=c*x+u*b+f*P,o[4]=c*y+u*_+f*N,o[7]=c*g+u*S+f*R,o[2]=h*x+m*b+v*P,o[5]=h*y+m*_+v*N,o[8]=h*g+m*S+v*R,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*s*u-n*a*c-r*o*u+r*a*l+i*o*c-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*s-a*c,h=a*l-u*o,m=c*o-s*l,v=n*f+r*h+i*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/v;return e[0]=f*x,e[1]=(i*c-u*r)*x,e[2]=(a*r-i*s)*x,e[3]=h*x,e[4]=(u*n-i*l)*x,e[5]=(i*o-a*n)*x,e[6]=m*x,e[7]=(r*l-c*n)*x,e[8]=(s*n-r*o)*x,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,s,a){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*s+c*a)+s+e,-i*c,i*l,-i*(-c*s+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(iM.makeScale(e,n)),this}rotate(e){return this.premultiply(iM.makeRotation(-e)),this}translate(e,n){return this.premultiply(iM.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const iM=new Dt;function TU(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Mie={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function jf(t,e){return new Mie[t](e)}function Im(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function RU(){const t=Im("canvas");return t.style.display="block",t}const F4={};function Uy(t){t in F4||(F4[t]=!0,console.warn(t))}function Eie(t,e,n){return new Promise(function(r,i){function o(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:r()}}setTimeout(o,n)})}function Cie(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function Tie(t){const e=t.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const z4=new Dt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),U4=new Dt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Hh={[Oa]:{transfer:Tm,primaries:Rm,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t,fromReference:t=>t},[Eo]:{transfer:xn,primaries:Rm,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[mg]:{transfer:Tm,primaries:Am,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.applyMatrix3(U4),fromReference:t=>t.applyMatrix3(z4)},[a_]:{transfer:xn,primaries:Am,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.convertSRGBToLinear().applyMatrix3(U4),fromReference:t=>t.applyMatrix3(z4).convertLinearToSRGB()}},Rie=new Set([Oa,mg]),an={enabled:!0,_workingColorSpace:Oa,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Rie.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const r=Hh[e].toReference,i=Hh[n].fromReference;return i(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Hh[t].primaries},getTransfer:function(t){return t===fa?Tm:Hh[t].transfer},getLuminanceCoefficients:function(t,e=this._workingColorSpace){return t.fromArray(Hh[e].luminanceCoefficients)}};function id(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function oM(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Yu;class AU{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Yu===void 0&&(Yu=Im("canvas")),Yu.width=e.width,Yu.height=e.height;const r=Yu.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=Yu}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.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 n=Im("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let s=0;s0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==dg)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Sm:e.x=e.x-Math.floor(e.x);break;case Ti:e.x=e.x<0?0:1;break;case Mm: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 Sm:e.y=e.y-Math.floor(e.y);break;case Ti:e.y=e.y<0?0:1;break;case Mm:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}kn.DEFAULT_IMAGE=null;kn.DEFAULT_MAPPING=dg;kn.DEFAULT_ANISOTROPY=1;class Zt{constructor(e=0,n=0,r=0,i=1){Zt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.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 n=this.x,r=this.y,i=this.z,o=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],f=l[8],h=l[1],m=l[5],v=l[9],x=l[2],y=l[6],g=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-x)<.01&&Math.abs(v-y)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+x)<.1&&Math.abs(v+y)<.1&&Math.abs(c+m+g-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const _=(c+1)/2,S=(m+1)/2,P=(g+1)/2,N=(u+h)/4,R=(f+x)/4,L=(v+y)/4;return _>S&&_>P?_<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(_),i=N/r,o=R/r):S>P?S<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(S),r=N/i,o=L/i):P<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(P),r=R/o,i=L/o),this.set(r,i,o,n),this}let b=Math.sqrt((y-v)*(y-v)+(f-x)*(f-x)+(h-u)*(h-u));return Math.abs(b)<.001&&(b=1),this.x=(y-v)/b,this.y=(f-x)/b,this.z=(h-u)/b,this.w=Math.acos((c+m+g-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 PU extends Hs{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Zt(0,0,e,n),this.scissorTest=!1,this.viewport=new Zt(0,0,e,n);const i={width:e,height:n,depth:1};r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},r);const o=new kn(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace);o.flipY=!1,o.generateMipmaps=r.generateMipmaps,o.internalFormat=r.internalFormat,this.textures=[];const s=r.count;for(let a=0;a=0?1:-1,_=1-g*g;if(_>Number.EPSILON){const P=Math.sqrt(_),N=Math.atan2(P,g*b);y=Math.sin(y*N)/P,a=Math.sin(a*N)/P}const S=a*b;if(l=l*y+h*S,c=c*y+m*S,u=u*y+v*S,f=f*y+x*S,y===1-a){const P=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=P,c*=P,u*=P,f*=P}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[s],h=o[s+1],m=o[s+2],v=o[s+3];return e[n]=a*v+u*f+l*m-c*h,e[n+1]=l*v+u*h+c*f-a*m,e[n+2]=c*v+u*m+a*h-l*f,e[n+3]=u*v-a*f-l*h-c*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,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),f=a(o/2),h=l(r/2),m=l(i/2),v=l(o/2);switch(s){case"XYZ":this._x=h*u*f+c*m*v,this._y=c*m*f-h*u*v,this._z=c*u*v+h*m*f,this._w=c*u*f-h*m*v;break;case"YXZ":this._x=h*u*f+c*m*v,this._y=c*m*f-h*u*v,this._z=c*u*v-h*m*f,this._w=c*u*f+h*m*v;break;case"ZXY":this._x=h*u*f-c*m*v,this._y=c*m*f+h*u*v,this._z=c*u*v+h*m*f,this._w=c*u*f-h*m*v;break;case"ZYX":this._x=h*u*f-c*m*v,this._y=c*m*f+h*u*v,this._z=c*u*v-h*m*f,this._w=c*u*f+h*m*v;break;case"YZX":this._x=h*u*f+c*m*v,this._y=c*m*f+h*u*v,this._z=c*u*v-h*m*f,this._w=c*u*f-h*m*v;break;case"XZY":this._x=h*u*f-c*m*v,this._y=c*m*f-h*u*v,this._z=c*u*v+h*m*f,this._w=c*u*f+h*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],f=n[10],h=r+a+f;if(h>0){const m=.5/Math.sqrt(h+1);this._w=.25/m,this._x=(u-l)*m,this._y=(o-c)*m,this._z=(s-i)*m}else if(r>a&&r>f){const m=2*Math.sqrt(1+r-a-f);this._w=(u-l)/m,this._x=.25*m,this._y=(i+s)/m,this._z=(o+c)/m}else if(a>f){const m=2*Math.sqrt(1+a-r-f);this._w=(o-c)/m,this._x=(i+s)/m,this._y=.25*m,this._z=(l+u)/m}else{const m=2*Math.sqrt(1+f-r-a);this._w=(s-i)/m,this._x=(o+c)/m,this._y=(l+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs($n(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,s=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,s=this._w;let a=s*e._w+r*e._x+i*e._y+o*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=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-n;return this._w=m*s+n*this._w,this._x=m*r+n*this._x,this._y=m*i+n*this._y,this._z=m*o+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-n)*u)/c,h=Math.sin(n*u)/c;return this._w=s*f+this._w*h,this._x=r*f+this._x*h,this._y=i*f+this._y*h,this._z=o*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(n),o*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,n=0,r=0){G.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.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,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(B4.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(B4.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,c=2*(s*i-a*r),u=2*(a*n-o*i),f=2*(o*r-s*n);return this.x=n+l*c+s*f-a*u,this.y=r+l*u+a*c-o*f,this.z=i+l*f+o*u-s*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return aM.copy(this).projectOnVector(e),this.sub(aM)}reflect(e){return this.sub(aM.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos($n(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const aM=new G,B4=new ki;class Pr{constructor(e=new G(1/0,1/0,1/0),n=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,r=e.length;n=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,n){return n.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,Wo),Wo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gh),uv.subVectors(this.max,Gh),Ku.subVectors(e.a,Gh),Zu.subVectors(e.b,Gh),Ju.subVectors(e.c,Gh),Ja.subVectors(Zu,Ku),Qa.subVectors(Ju,Zu),tc.subVectors(Ku,Ju);let n=[0,-Ja.z,Ja.y,0,-Qa.z,Qa.y,0,-tc.z,tc.y,Ja.z,0,-Ja.x,Qa.z,0,-Qa.x,tc.z,0,-tc.x,-Ja.y,Ja.x,0,-Qa.y,Qa.x,0,-tc.y,tc.x,0];return!lM(n,Ku,Zu,Ju,uv)||(n=[1,0,0,0,1,0,0,0,1],!lM(n,Ku,Zu,Ju,uv))?!1:(fv.crossVectors(Ja,Qa),n=[fv.x,fv.y,fv.z],lM(n,Ku,Zu,Ju,uv))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Wo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Wo).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:(ta[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ta[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ta[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ta[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ta[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ta[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ta[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ta[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ta),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 ta=[new G,new G,new G,new G,new G,new G,new G,new G],Wo=new G,cv=new Pr,Ku=new G,Zu=new G,Ju=new G,Ja=new G,Qa=new G,tc=new G,Gh=new G,uv=new G,fv=new G,nc=new G;function lM(t,e,n,r,i){for(let o=0,s=t.length-3;o<=s;o+=3){nc.fromArray(t,o);const a=i.x*Math.abs(nc.x)+i.y*Math.abs(nc.y)+i.z*Math.abs(nc.z),l=e.dot(nc),c=n.dot(nc),u=r.dot(nc);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const Lie=new Pr,Xh=new G,cM=new G;class qr{constructor(e=new G,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):Lie.setFromPoints(e).getCenter(r);let i=0;for(let o=0,s=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}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;Xh.subVectors(e,this.center);const n=Xh.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(Xh,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(cM.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Xh.copy(e.center).add(cM)),this.expandByPoint(Xh.copy(e.center).sub(cM))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const na=new G,uM=new G,dv=new G,el=new G,fM=new G,hv=new G,dM=new G;class Kd{constructor(e=new G,n=new G(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.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,na)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=na.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(na.copy(this.origin).addScaledVector(this.direction,n),na.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){uM.copy(e).add(n).multiplyScalar(.5),dv.copy(n).sub(e).normalize(),el.copy(this.origin).sub(uM);const o=e.distanceTo(n)*.5,s=-this.direction.dot(dv),a=el.dot(this.direction),l=-el.dot(dv),c=el.lengthSq(),u=Math.abs(1-s*s);let f,h,m,v;if(u>0)if(f=s*l-a,h=s*a-l,v=o*u,f>=0)if(h>=-v)if(h<=v){const x=1/u;f*=x,h*=x,m=f*(f+s*h+2*a)+h*(s*f+h+2*l)+c}else h=o,f=Math.max(0,-(s*h+a)),m=-f*f+h*(h+2*l)+c;else h=-o,f=Math.max(0,-(s*h+a)),m=-f*f+h*(h+2*l)+c;else h<=-v?(f=Math.max(0,-(-s*o+a)),h=f>0?-o:Math.min(Math.max(-o,-l),o),m=-f*f+h*(h+2*l)+c):h<=v?(f=0,h=Math.min(Math.max(-o,-l),o),m=h*(h+2*l)+c):(f=Math.max(0,-(s*o+a)),h=f>0?o:Math.min(Math.max(-o,-l),o),m=-f*f+h*(h+2*l)+c);else h=s>0?-o:o,f=Math.max(0,-(s*h+a)),m=-f*f+h*(h+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(uM).addScaledVector(dv,h),m}intersectSphere(e,n){na.subVectors(e.center,this.origin);const r=na.dot(this.direction),i=na.dot(na)-r*r,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,s,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(r=(e.min.x-h.x)*c,i=(e.max.x-h.x)*c):(r=(e.max.x-h.x)*c,i=(e.min.x-h.x)*c),u>=0?(o=(e.min.y-h.y)*u,s=(e.max.y-h.y)*u):(o=(e.max.y-h.y)*u,s=(e.min.y-h.y)*u),r>s||o>i||((o>r||isNaN(r))&&(r=o),(s=0?(a=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(a=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,na)!==null}intersectTriangle(e,n,r,i,o){fM.subVectors(n,e),hv.subVectors(r,e),dM.crossVectors(fM,hv);let s=this.direction.dot(dM),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;el.subVectors(this.origin,e);const l=a*this.direction.dot(hv.crossVectors(el,hv));if(l<0)return null;const c=a*this.direction.dot(fM.cross(el));if(c<0||l+c>s)return null;const u=-a*el.dot(dM);return u<0?null:this.at(u/s,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class wt{constructor(e,n,r,i,o,s,a,l,c,u,f,h,m,v,x,y){wt.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,n,r,i,o,s,a,l,c,u,f,h,m,v,x,y)}set(e,n,r,i,o,s,a,l,c,u,f,h,m,v,x,y){const g=this.elements;return g[0]=e,g[4]=n,g[8]=r,g[12]=i,g[1]=o,g[5]=s,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=f,g[14]=h,g[3]=m,g[7]=v,g[11]=x,g[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new wt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/Qu.setFromMatrixColumn(e,0).length(),o=1/Qu.setFromMatrixColumn(e,1).length(),s=1/Qu.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,s=Math.cos(r),a=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),f=Math.sin(o);if(e.order==="XYZ"){const h=s*u,m=s*f,v=a*u,x=a*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=m+v*c,n[5]=h-x*c,n[9]=-a*l,n[2]=x-h*c,n[6]=v+m*c,n[10]=s*l}else if(e.order==="YXZ"){const h=l*u,m=l*f,v=c*u,x=c*f;n[0]=h+x*a,n[4]=v*a-m,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-a,n[2]=m*a-v,n[6]=x+h*a,n[10]=s*l}else if(e.order==="ZXY"){const h=l*u,m=l*f,v=c*u,x=c*f;n[0]=h-x*a,n[4]=-s*f,n[8]=v+m*a,n[1]=m+v*a,n[5]=s*u,n[9]=x-h*a,n[2]=-s*c,n[6]=a,n[10]=s*l}else if(e.order==="ZYX"){const h=s*u,m=s*f,v=a*u,x=a*f;n[0]=l*u,n[4]=v*c-m,n[8]=h*c+x,n[1]=l*f,n[5]=x*c+h,n[9]=m*c-v,n[2]=-c,n[6]=a*l,n[10]=s*l}else if(e.order==="YZX"){const h=s*l,m=s*c,v=a*l,x=a*c;n[0]=l*u,n[4]=x-h*f,n[8]=v*f+m,n[1]=f,n[5]=s*u,n[9]=-a*u,n[2]=-c*u,n[6]=m*f+v,n[10]=h-x*f}else if(e.order==="XZY"){const h=s*l,m=s*c,v=a*l,x=a*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=h*f+x,n[5]=s*u,n[9]=m*f-v,n[2]=v*f-m,n[6]=a*u,n[10]=x*f+h}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(kie,e,Oie)}lookAt(e,n,r){const i=this.elements;return Wi.subVectors(e,n),Wi.lengthSq()===0&&(Wi.z=1),Wi.normalize(),tl.crossVectors(r,Wi),tl.lengthSq()===0&&(Math.abs(r.z)===1?Wi.x+=1e-4:Wi.z+=1e-4,Wi.normalize(),tl.crossVectors(r,Wi)),tl.normalize(),pv.crossVectors(Wi,tl),i[0]=tl.x,i[4]=pv.x,i[8]=Wi.x,i[1]=tl.y,i[5]=pv.y,i[9]=Wi.y,i[2]=tl.z,i[6]=pv.z,i[10]=Wi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[4],l=r[8],c=r[12],u=r[1],f=r[5],h=r[9],m=r[13],v=r[2],x=r[6],y=r[10],g=r[14],b=r[3],_=r[7],S=r[11],P=r[15],N=i[0],R=i[4],L=i[8],U=i[12],M=i[1],T=i[5],D=i[9],O=i[13],j=i[2],X=i[6],H=i[10],Z=i[14],F=i[3],q=i[7],K=i[11],J=i[15];return o[0]=s*N+a*M+l*j+c*F,o[4]=s*R+a*T+l*X+c*q,o[8]=s*L+a*D+l*H+c*K,o[12]=s*U+a*O+l*Z+c*J,o[1]=u*N+f*M+h*j+m*F,o[5]=u*R+f*T+h*X+m*q,o[9]=u*L+f*D+h*H+m*K,o[13]=u*U+f*O+h*Z+m*J,o[2]=v*N+x*M+y*j+g*F,o[6]=v*R+x*T+y*X+g*q,o[10]=v*L+x*D+y*H+g*K,o[14]=v*U+x*O+y*Z+g*J,o[3]=b*N+_*M+S*j+P*F,o[7]=b*R+_*T+S*X+P*q,o[11]=b*L+_*D+S*H+P*K,o[15]=b*U+_*O+S*Z+P*J,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],h=e[10],m=e[14],v=e[3],x=e[7],y=e[11],g=e[15];return v*(+o*l*f-i*c*f-o*a*h+r*c*h+i*a*m-r*l*m)+x*(+n*l*m-n*c*h+o*s*h-i*s*m+i*c*u-o*l*u)+y*(+n*c*f-n*a*m-o*s*f+r*s*m+o*a*u-r*c*u)+g*(-i*a*u-n*l*f+n*a*h+i*s*f-r*s*h+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],m=e[11],v=e[12],x=e[13],y=e[14],g=e[15],b=f*y*c-x*h*c+x*l*m-a*y*m-f*l*g+a*h*g,_=v*h*c-u*y*c-v*l*m+s*y*m+u*l*g-s*h*g,S=u*x*c-v*f*c+v*a*m-s*x*m-u*a*g+s*f*g,P=v*f*l-u*x*l-v*a*h+s*x*h+u*a*y-s*f*y,N=n*b+r*_+i*S+o*P;if(N===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/N;return e[0]=b*R,e[1]=(x*h*o-f*y*o-x*i*m+r*y*m+f*i*g-r*h*g)*R,e[2]=(a*y*o-x*l*o+x*i*c-r*y*c-a*i*g+r*l*g)*R,e[3]=(f*l*o-a*h*o-f*i*c+r*h*c+a*i*m-r*l*m)*R,e[4]=_*R,e[5]=(u*y*o-v*h*o+v*i*m-n*y*m-u*i*g+n*h*g)*R,e[6]=(v*l*o-s*y*o-v*i*c+n*y*c+s*i*g-n*l*g)*R,e[7]=(s*h*o-u*l*o+u*i*c-n*h*c-s*i*m+n*l*m)*R,e[8]=S*R,e[9]=(v*f*o-u*x*o-v*r*m+n*x*m+u*r*g-n*f*g)*R,e[10]=(s*x*o-v*a*o+v*r*c-n*x*c-s*r*g+n*a*g)*R,e[11]=(u*a*o-s*f*o-u*r*c+n*f*c+s*r*m-n*a*m)*R,e[12]=P*R,e[13]=(u*x*i-v*f*i+v*r*h-n*x*h-u*r*y+n*f*y)*R,e[14]=(v*a*i-s*x*i-v*r*l+n*x*l+s*r*y-n*a*y)*R,e[15]=(s*f*i-u*a*i+u*r*l-n*f*l-s*r*h+n*a*h)*R,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){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,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,s=e.x,a=e.y,l=e.z,c=o*s,u=o*a;return this.set(c*s+r,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+r,u*l-i*s,0,c*l-i*a,u*l+i*s,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,s){return this.set(1,r,o,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,c=o+o,u=s+s,f=a+a,h=o*c,m=o*u,v=o*f,x=s*u,y=s*f,g=a*f,b=l*c,_=l*u,S=l*f,P=r.x,N=r.y,R=r.z;return i[0]=(1-(x+g))*P,i[1]=(m+S)*P,i[2]=(v-_)*P,i[3]=0,i[4]=(m-S)*N,i[5]=(1-(h+g))*N,i[6]=(y+b)*N,i[7]=0,i[8]=(v+_)*R,i[9]=(y-b)*R,i[10]=(1-(h+x))*R,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=Qu.set(i[0],i[1],i[2]).length();const s=Qu.set(i[4],i[5],i[6]).length(),a=Qu.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],Ho.copy(this);const c=1/o,u=1/s,f=1/a;return Ho.elements[0]*=c,Ho.elements[1]*=c,Ho.elements[2]*=c,Ho.elements[4]*=u,Ho.elements[5]*=u,Ho.elements[6]*=u,Ho.elements[8]*=f,Ho.elements[9]*=f,Ho.elements[10]*=f,n.setFromRotationMatrix(Ho),r.x=o,r.y=s,r.z=a,this}makePerspective(e,n,r,i,o,s,a=Ts){const l=this.elements,c=2*o/(n-e),u=2*o/(r-i),f=(n+e)/(n-e),h=(r+i)/(r-i);let m,v;if(a===Ts)m=-(s+o)/(s-o),v=-2*s*o/(s-o);else if(a===Nm)m=-s/(s-o),v=-s*o/(s-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,s,a=Ts){const l=this.elements,c=1/(n-e),u=1/(r-i),f=1/(s-o),h=(n+e)*c,m=(r+i)*u;let v,x;if(a===Ts)v=(s+o)*f,x=-2*f;else if(a===Nm)v=o*f,x=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=x,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const Qu=new G,Ho=new wt,kie=new G(0,0,0),Oie=new G(1,1,1),tl=new G,pv=new G,Wi=new G,j4=new wt,V4=new ki;class ro{constructor(e=0,n=0,r=0,i=ro.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],s=i[4],a=i[8],l=i[1],c=i[5],u=i[9],f=i[2],h=i[6],m=i[10];switch(n){case"XYZ":this._y=Math.asin($n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-$n(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin($n(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-$n(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,m),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin($n(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-$n(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return j4.makeRotationFromQuaternion(e),this.setFromRotationMatrix(j4,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return V4.setFromEuler(this),this.setFromQuaternion(V4,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=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+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}}ro.DEFAULT_ORDER="XYZ";class $c{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(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 c=0,u=l.length;c0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),h.length>0&&(r.skeletons=h),m.length>0&&(r.animations=m),v.length>0&&(r.nodes=v)}return r.object=i,r;function s(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){Go.subVectors(i,n),ia.subVectors(r,n),pM.subVectors(e,n);const s=Go.dot(Go),a=Go.dot(ia),l=Go.dot(pM),c=ia.dot(ia),u=ia.dot(pM),f=s*c-a*a;if(f===0)return o.set(0,0,0),null;const h=1/f,m=(c*l-a*u)*h,v=(s*u-a*l)*h;return o.set(1-m-v,v,m)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,oa)===null?!1:oa.x>=0&&oa.y>=0&&oa.x+oa.y<=1}static getInterpolation(e,n,r,i,o,s,a,l){return this.getBarycoord(e,n,r,i,oa)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,oa.x),l.addScaledVector(s,oa.y),l.addScaledVector(a,oa.z),l)}static getInterpolatedAttribute(e,n,r,i,o,s){return yM.setScalar(0),xM.setScalar(0),bM.setScalar(0),yM.fromBufferAttribute(e,n),xM.fromBufferAttribute(e,r),bM.fromBufferAttribute(e,i),s.setScalar(0),s.addScaledVector(yM,o.x),s.addScaledVector(xM,o.y),s.addScaledVector(bM,o.z),s}static isFrontFacing(e,n,r,i){return Go.subVectors(r,n),ia.subVectors(e,n),Go.cross(ia).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Go.subVectors(this.c,this.b),ia.subVectors(this.a,this.b),Go.cross(ia).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Mi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Mi.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,o){return Mi.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Mi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Mi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let s,a;nf.subVectors(i,r),rf.subVectors(o,r),mM.subVectors(e,r);const l=nf.dot(mM),c=rf.dot(mM);if(l<=0&&c<=0)return n.copy(r);gM.subVectors(e,i);const u=nf.dot(gM),f=rf.dot(gM);if(u>=0&&f<=u)return n.copy(i);const h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(r).addScaledVector(nf,s);vM.subVectors(e,o);const m=nf.dot(vM),v=rf.dot(vM);if(v>=0&&m<=v)return n.copy(o);const x=m*c-l*v;if(x<=0&&c>=0&&v<=0)return a=c/(c-v),n.copy(r).addScaledVector(rf,a);const y=u*v-m*f;if(y<=0&&f-u>=0&&m-v>=0)return q4.subVectors(o,i),a=(f-u)/(f-u+(m-v)),n.copy(i).addScaledVector(q4,a);const g=1/(y+x+h);return s=x*g,a=h*g,n.copy(r).addScaledVector(nf,s).addScaledVector(rf,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const NU={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},nl={h:0,s:0,l:0},gv={h:0,s:0,l:0};function _M(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let ot=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Eo){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,an.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=an.workingColorSpace){return this.r=e,this.g=n,this.b=r,an.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=an.workingColorSpace){if(e=KR(e,1),n=$n(n,0,1),r=$n(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=_M(s,o,e+1/3),this.g=_M(s,o,e),this.b=_M(s,o,e-1/3)}return an.toWorkingColorSpace(this,i),this}setStyle(e,n=Eo){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],s=o.length;if(s===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Eo){const r=NU[e.toLowerCase()];return r!==void 0?this.setHex(r,n):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=id(e.r),this.g=id(e.g),this.b=id(e.b),this}copyLinearToSRGB(e){return this.r=oM(e.r),this.g=oM(e.g),this.b=oM(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Eo){return an.fromWorkingColorSpace(Vr.copy(this),e),Math.round($n(Vr.r*255,0,255))*65536+Math.round($n(Vr.g*255,0,255))*256+Math.round($n(Vr.b*255,0,255))}getHexString(e=Eo){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=an.workingColorSpace){an.fromWorkingColorSpace(Vr.copy(this),n);const r=Vr.r,i=Vr.g,o=Vr.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,c;const u=(a+s)/2;if(a===s)l=0,c=0;else{const f=s-a;switch(c=u<=.5?f/(s+a):f/(2-s-a),s){case r:l=(i-o)/f+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Bc&&(r.blending=this.blending),this.side!==Ra&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==N1&&(r.blendSrc=this.blendSrc),this.blendDst!==I1&&(r.blendDst=this.blendDst),this.blendEquation!==fl&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==ou&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==rC&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==yc&&(r.stencilFail=this.stencilFail),this.stencilZFail!==yc&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==yc&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(e.textures),s=i(e.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Bl extends Ir{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ot(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.combine=fg,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const da=jie();function jie(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):c<-14?(r[l]=1024>>-c-14,r[l|256]=1024>>-c-14|32768,i[l]=-c-1,i[l|256]=-c-1):c<=15?(r[l]=c+15<<10,r[l|256]=c+15<<10|32768,i[l]=13,i[l|256]=13):c<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,o[l]=c|u}for(let l=1024;l<2048;++l)o[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:o,exponentTable:s,offsetTable:a}}function xi(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=$n(t,-65504,65504),da.floatView[0]=t;const e=da.uint32View[0],n=e>>23&511;return da.baseTable[n]+((e&8388607)>>da.shiftTable[n])}function gp(t){const e=t>>10;return da.uint32View[0]=da.mantissaTable[da.offsetTable[e]+(t&1023)]+da.exponentTable[e],da.floatView[0]}const Vie={toHalfFloat:xi,fromHalfFloat:gp},Jn=new G,vv=new Ie;class hn{constructor(e,n,r=!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=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=Pm,this.updateRanges=[],this.gpuType=ai,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));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 n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],f=o[c];for(let h=0,m=f.length;h0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o(e.far-e.near)**2))&&(Y4.copy(o).invert(),rc.copy(e.ray).applyMatrix4(Y4),!(r.boundingBox!==null&&rc.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,rc)))}_computeIntersections(e,n,r){let i;const o=this.geometry,s=this.material,a=o.index,l=o.attributes.position,c=o.attributes.uv,u=o.attributes.uv1,f=o.attributes.normal,h=o.groups,m=o.drawRange;if(a!==null)if(Array.isArray(s))for(let v=0,x=h.length;vn.far?null:{distance:c,point:Sv.clone(),object:t}}function Mv(t,e,n,r,i,o,s,a,l,c){t.getVertexPosition(a,xv),t.getVertexPosition(l,bv),t.getVertexPosition(c,_v);const u=Kie(t,e,n,r,xv,bv,_v,Z4);if(u){const f=new G;Mi.getBarycoord(Z4,xv,bv,_v,f),i&&(u.uv=Mi.getInterpolatedAttribute(i,a,l,c,f,new Ie)),o&&(u.uv1=Mi.getInterpolatedAttribute(o,a,l,c,f,new Ie)),s&&(u.normal=Mi.getInterpolatedAttribute(s,a,l,c,f,new G),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new G,materialIndex:0};Mi.getNormal(xv,bv,_v,h.normal),u.face=h,u.barycoord=f}return u}class yu extends Ut{constructor(e=1,n=1,r=1,i=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:s};const a=this;i=Math.floor(i),o=Math.floor(o),s=Math.floor(s);const l=[],c=[],u=[],f=[];let h=0,m=0;v("z","y","x",-1,-1,r,n,e,s,o,0),v("z","y","x",1,-1,r,n,-e,s,o,1),v("x","z","y",1,1,e,r,n,i,s,2),v("x","z","y",1,-1,e,r,-n,i,s,3),v("x","y","z",1,-1,e,n,r,i,o,4),v("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new pt(c,3)),this.setAttribute("normal",new pt(u,3)),this.setAttribute("uv",new pt(f,2));function v(x,y,g,b,_,S,P,N,R,L,U){const M=S/R,T=P/L,D=S/2,O=P/2,j=N/2,X=R+1,H=L+1;let Z=0,F=0;const q=new G;for(let K=0;K0?1:-1,u.push(q.x,q.y,q.z),f.push(he/R),f.push(1-K/L),Z+=1}}for(let K=0;K0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class gg extends tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new wt,this.projectionMatrix=new wt,this.projectionMatrixInverse=new wt,this.coordinateSystem=Ts}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const rl=new G,J4=new Ie,Q4=new Ie;class vr extends gg{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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 n=.5*this.getFilmHeight()/e;this.fov=Md*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Vc*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Md*2*Math.atan(Math.tan(Vc*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){rl.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(rl.x,rl.y).multiplyScalar(-e/rl.z),rl.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(rl.x,rl.y).multiplyScalar(-e/rl.z)}getViewSize(e,n){return this.getViewBounds(e,J4,Q4),n.subVectors(Q4,J4)}setViewOffset(e,n,r,i,o,s){this.aspect=e/n,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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Vc*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,c=s.fullHeight;o+=s.offsetX*i/l,n-=s.offsetY*r/c,i*=s.width/l,r*=s.height/c}const a=this.filmOffset;a!==0&&(o+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const sf=-90,af=1;class kU extends tn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new vr(sf,af,e,n);i.layers=this.layers,this.add(i);const o=new vr(sf,af,e,n);o.layers=this.layers,this.add(o);const s=new vr(sf,af,e,n);s.layers=this.layers,this.add(s);const a=new vr(sf,af,e,n);a.layers=this.layers,this.add(a);const l=new vr(sf,af,e,n);l.layers=this.layers,this.add(l);const c=new vr(sf,af,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,s,a,l]=n;for(const c of n)this.remove(c);if(e===Ts)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),s.up.set(0,0,1),s.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===Nm)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),s.up.set(0,0,-1),s.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 c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,s,a,l,c,u]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const x=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,s),e.setRenderTarget(r,2,i),e.render(n,a),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,c),r.texture.generateMipmaps=x,e.setRenderTarget(r,5,i),e.render(n,u),e.setRenderTarget(f,h,m),e.xr.enabled=v,r.texture.needsPMREMUpdate=!0}}class vg extends kn{constructor(e,n,r,i,o,s,a,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:Aa,super(e,n,r,i,o,s,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class OU extends is{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new vg(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:tr}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new yu(5,5,5),o=new os({name:"CubemapFromEquirect",uniforms:Ed(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:fi,blending:ba});o.uniforms.tEquirect.value=n;const s=new nr(i,o),a=n.minFilter;return n.minFilter===Cs&&(n.minFilter=tr),new kU(1,10,this).update(e,s),n.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,n,r,i){const o=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(n,r,i);e.setRenderTarget(o)}}const MM=new G,eoe=new G,toe=new Dt;class ll{constructor(e=new G(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=MM.subVectors(r,n).cross(eoe.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const r=e.delta(MM),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:n.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>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,n){const r=n||toe.getNormalMatrix(e),i=this.coplanarPoint(MM).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ic=new qr,Ev=new G;class yg{constructor(e=new ll,n=new ll,r=new ll,i=new ll,o=new ll,s=new ll){this.planes=[e,n,r,i,o,s]}set(e,n,r,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=Ts){const r=this.planes,i=e.elements,o=i[0],s=i[1],a=i[2],l=i[3],c=i[4],u=i[5],f=i[6],h=i[7],m=i[8],v=i[9],x=i[10],y=i[11],g=i[12],b=i[13],_=i[14],S=i[15];if(r[0].setComponents(l-o,h-c,y-m,S-g).normalize(),r[1].setComponents(l+o,h+c,y+m,S+g).normalize(),r[2].setComponents(l+s,h+u,y+v,S+b).normalize(),r[3].setComponents(l-s,h-u,y-v,S-b).normalize(),r[4].setComponents(l-a,h-f,y-x,S-_).normalize(),n===Ts)r[5].setComponents(l+a,h+f,y+x,S+_).normalize();else if(n===Nm)r[5].setComponents(a,f,x,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ic.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),ic.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ic)}intersectsSprite(e){return ic.center.set(0,0,0),ic.radius=.7071067811865476,ic.applyMatrix4(e.matrixWorld),this.intersectsSphere(ic)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,Ev.y=i.normal.y>0?e.max.y:e.min.y,Ev.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ev)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function DU(){let t=null,e=!1,n=null,r=null;function i(o,s){n(o,s),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function noe(t){const e=new WeakMap;function n(a,l){const c=a.array,u=a.usage,f=c.byteLength,h=t.createBuffer();t.bindBuffer(l,h),t.bufferData(l,c,u),a.onUploadCallback();let m;if(c instanceof Float32Array)m=t.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?m=t.HALF_FLOAT:m=t.UNSIGNED_SHORT;else if(c instanceof Int16Array)m=t.SHORT;else if(c instanceof Uint32Array)m=t.UNSIGNED_INT;else if(c instanceof Int32Array)m=t.INT;else if(c instanceof Int8Array)m=t.BYTE;else if(c instanceof Uint8Array)m=t.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)m=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function r(a,l,c){const u=l.array,f=l.updateRanges;if(t.bindBuffer(c,a),f.length===0)t.bufferSubData(c,0,u);else{f.sort((m,v)=>m.start-v.start);let h=0;for(let m=1;m 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,xoe=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,boe=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,_oe=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,woe=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,Soe=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,Moe=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - varying vec3 vColor; -#endif`,Eoe=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif -#ifdef USE_BATCHING_COLOR - vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); - vColor.xyz *= batchingColor.xyz; -#endif`,Coe=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,Toe=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,Roe=`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,Aoe=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,Poe=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,Noe=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,Ioe=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,Loe="gl_FragColor = linearToOutputTexel( gl_FragColor );",koe=` -const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( - vec3( 0.8224621, 0.177538, 0.0 ), - vec3( 0.0331941, 0.9668058, 0.0 ), - vec3( 0.0170827, 0.0723974, 0.9105199 ) -); -const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( - vec3( 1.2249401, - 0.2249404, 0.0 ), - vec3( - 0.0420569, 1.0420571, 0.0 ), - vec3( - 0.0196376, - 0.0786361, 1.0982735 ) -); -vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { - return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); -} -vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { - return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); -} -vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,Ooe=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,Doe=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform mat3 envMapRotation; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,Foe=`#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`,zoe=`#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`,Uoe=`#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`,Boe=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,joe=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,Voe=`#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`,$oe=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Woe=`#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 -}`,Hoe=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,Goe=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,Xoe=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,qoe=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,Yoe=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,Koe=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,Zoe=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Joe=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,Qoe=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,ese=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_DISPERSION - material.dispersion = dispersion; -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,tse=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - float dispersion; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return saturate(v); - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColor; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,nse=` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,rse=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,ise=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,ose=`#if defined( USE_LOGDEPTHBUF ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,sse=`#if defined( USE_LOGDEPTHBUF ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,ase=`#ifdef USE_LOGDEPTHBUF - varying float vFragDepth; - varying float vIsPerspective; -#endif`,lse=`#ifdef USE_LOGDEPTHBUF - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,cse=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); - - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,use=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,fse=`#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`,dse=`#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`,hse=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,pse=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,mse=`#ifdef USE_INSTANCING_MORPH - float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; - } -#endif`,gse=`#if defined( USE_MORPHCOLORS ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,vse=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,yse=`#ifdef USE_MORPHTARGETS - #ifndef USE_INSTANCING_MORPH - uniform float morphTargetBaseInfluence; - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - #endif - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } -#endif`,xse=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,bse=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,_se=`#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`,wse=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,Sse=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,Mse=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,Ese=`#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`,Cse=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,Tse=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Rse=`#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`,Ase=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,Pse=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Nse=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; -const float Inv255 = 1. / 255.; -const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); -const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); -const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); -const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); -vec4 packDepthToRGBA( const in float v ) { - if( v <= 0.0 ) - return vec4( 0., 0., 0., 0. ); - if( v >= 1.0 ) - return vec4( 1., 1., 1., 1. ); - float vuf; - float af = modf( v * PackFactors.a, vuf ); - float bf = modf( vuf * ShiftRight8, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); -} -vec3 packDepthToRGB( const in float v ) { - if( v <= 0.0 ) - return vec3( 0., 0., 0. ); - if( v >= 1.0 ) - return vec3( 1., 1., 1. ); - float vuf; - float bf = modf( v * PackFactors.b, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec3( vuf * Inv255, gf * PackUpscale, bf ); -} -vec2 packDepthToRG( const in float v ) { - if( v <= 0.0 ) - return vec2( 0., 0. ); - if( v >= 1.0 ) - return vec2( 1., 1. ); - float vuf; - float gf = modf( v * 256., vuf ); - return vec2( vuf * Inv255, gf ); -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors4 ); -} -float unpackRGBToDepth( const in vec3 v ) { - return dot( v, UnpackFactors3 ); -} -float unpackRGToDepth( const in vec2 v ) { - return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; -} -vec4 pack2HalfToRGBA( const in vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( const in vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,Ise=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,Lse=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,kse=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,Ose=`#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`,Dse=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,Fse=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,zse=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - - float lightToPositionLength = length( lightToPosition ); - if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { - float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - shadow = ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } -#endif`,Use=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,Bse=`#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`,jse=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,Vse=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,$se=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,Wse=`#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`,Hse=`#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`,Gse=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,Xse=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,qse=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,Yse=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 CineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 NeutralToneMapping( vec3 color ) { - const float StartCompression = 0.8 - 0.04; - const float Desaturation = 0.15; - color *= toneMappingExposure; - float x = min( color.r, min( color.g, color.b ) ); - float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; - color -= offset; - float peak = max( color.r, max( color.g, color.b ) ); - if ( peak < StartCompression ) return color; - float d = 1. - StartCompression; - float newPeak = 1. - d * d / ( peak + d - StartCompression ); - color *= newPeak / peak; - float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); - return mix( color, vec3( newPeak ), g ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,Kse=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,Zse=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec4 transmittedLight; - vec3 transmittance; - #ifdef USE_DISPERSION - float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; - vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); - for ( int i = 0; i < 3; i ++ ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); - transmittedLight[ i ] = transmissionSample[ i ]; - transmittedLight.a += transmissionSample.a; - transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; - } - transmittedLight.a /= 3.0; - - #else - - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - - #endif - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,Jse=`#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`,Qse=`#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`,eae=`#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`,tae=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_BATCHING - worldPosition = batchingMatrix * worldPosition; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const nae=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,rae=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,iae=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,oae=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -uniform mat3 backgroundRotation; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,sae=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,aae=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,lae=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,cae=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #elif DEPTH_PACKING == 3202 - gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); - #elif DEPTH_PACKING == 3203 - gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); - #endif -}`,uae=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,fae=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,dae=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,hae=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,pae=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,mae=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,gae=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,vae=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,yae=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,xae=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,bae=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,_ae=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,wae=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,Sae=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,Mae=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,Eae=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,Cae=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,Tae=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_DISPERSION - uniform float dispersion; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,Rae=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,Aae=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,Pae=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#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 - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,Nae=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,Iae=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,Lae=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,kae=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix[ 3 ]; - vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,Oae=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,Bt={alphahash_fragment:roe,alphahash_pars_fragment:ioe,alphamap_fragment:ooe,alphamap_pars_fragment:soe,alphatest_fragment:aoe,alphatest_pars_fragment:loe,aomap_fragment:coe,aomap_pars_fragment:uoe,batching_pars_vertex:foe,batching_vertex:doe,begin_vertex:hoe,beginnormal_vertex:poe,bsdfs:moe,iridescence_fragment:goe,bumpmap_pars_fragment:voe,clipping_planes_fragment:yoe,clipping_planes_pars_fragment:xoe,clipping_planes_pars_vertex:boe,clipping_planes_vertex:_oe,color_fragment:woe,color_pars_fragment:Soe,color_pars_vertex:Moe,color_vertex:Eoe,common:Coe,cube_uv_reflection_fragment:Toe,defaultnormal_vertex:Roe,displacementmap_pars_vertex:Aoe,displacementmap_vertex:Poe,emissivemap_fragment:Noe,emissivemap_pars_fragment:Ioe,colorspace_fragment:Loe,colorspace_pars_fragment:koe,envmap_fragment:Ooe,envmap_common_pars_fragment:Doe,envmap_pars_fragment:Foe,envmap_pars_vertex:zoe,envmap_physical_pars_fragment:Yoe,envmap_vertex:Uoe,fog_vertex:Boe,fog_pars_vertex:joe,fog_fragment:Voe,fog_pars_fragment:$oe,gradientmap_pars_fragment:Woe,lightmap_pars_fragment:Hoe,lights_lambert_fragment:Goe,lights_lambert_pars_fragment:Xoe,lights_pars_begin:qoe,lights_toon_fragment:Koe,lights_toon_pars_fragment:Zoe,lights_phong_fragment:Joe,lights_phong_pars_fragment:Qoe,lights_physical_fragment:ese,lights_physical_pars_fragment:tse,lights_fragment_begin:nse,lights_fragment_maps:rse,lights_fragment_end:ise,logdepthbuf_fragment:ose,logdepthbuf_pars_fragment:sse,logdepthbuf_pars_vertex:ase,logdepthbuf_vertex:lse,map_fragment:cse,map_pars_fragment:use,map_particle_fragment:fse,map_particle_pars_fragment:dse,metalnessmap_fragment:hse,metalnessmap_pars_fragment:pse,morphinstance_vertex:mse,morphcolor_vertex:gse,morphnormal_vertex:vse,morphtarget_pars_vertex:yse,morphtarget_vertex:xse,normal_fragment_begin:bse,normal_fragment_maps:_se,normal_pars_fragment:wse,normal_pars_vertex:Sse,normal_vertex:Mse,normalmap_pars_fragment:Ese,clearcoat_normal_fragment_begin:Cse,clearcoat_normal_fragment_maps:Tse,clearcoat_pars_fragment:Rse,iridescence_pars_fragment:Ase,opaque_fragment:Pse,packing:Nse,premultiplied_alpha_fragment:Ise,project_vertex:Lse,dithering_fragment:kse,dithering_pars_fragment:Ose,roughnessmap_fragment:Dse,roughnessmap_pars_fragment:Fse,shadowmap_pars_fragment:zse,shadowmap_pars_vertex:Use,shadowmap_vertex:Bse,shadowmask_pars_fragment:jse,skinbase_vertex:Vse,skinning_pars_vertex:$se,skinning_vertex:Wse,skinnormal_vertex:Hse,specularmap_fragment:Gse,specularmap_pars_fragment:Xse,tonemapping_fragment:qse,tonemapping_pars_fragment:Yse,transmission_fragment:Kse,transmission_pars_fragment:Zse,uv_pars_fragment:Jse,uv_pars_vertex:Qse,uv_vertex:eae,worldpos_vertex:tae,background_vert:nae,background_frag:rae,backgroundCube_vert:iae,backgroundCube_frag:oae,cube_vert:sae,cube_frag:aae,depth_vert:lae,depth_frag:cae,distanceRGBA_vert:uae,distanceRGBA_frag:fae,equirect_vert:dae,equirect_frag:hae,linedashed_vert:pae,linedashed_frag:mae,meshbasic_vert:gae,meshbasic_frag:vae,meshlambert_vert:yae,meshlambert_frag:xae,meshmatcap_vert:bae,meshmatcap_frag:_ae,meshnormal_vert:wae,meshnormal_frag:Sae,meshphong_vert:Mae,meshphong_frag:Eae,meshphysical_vert:Cae,meshphysical_frag:Tae,meshtoon_vert:Rae,meshtoon_frag:Aae,points_vert:Pae,points_frag:Nae,shadow_vert:Iae,shadow_frag:Lae,sprite_vert:kae,sprite_frag:Oae},Je={common:{diffuse:{value:new ot(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},envMapRotation:{value:new Dt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new Ie(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ot(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ot(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new ot(16777215)},opacity:{value:1},center:{value:new Ie(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},Jo={basic:{uniforms:ni([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.fog]),vertexShader:Bt.meshbasic_vert,fragmentShader:Bt.meshbasic_frag},lambert:{uniforms:ni([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new ot(0)}}]),vertexShader:Bt.meshlambert_vert,fragmentShader:Bt.meshlambert_frag},phong:{uniforms:ni([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new ot(0)},specular:{value:new ot(1118481)},shininess:{value:30}}]),vertexShader:Bt.meshphong_vert,fragmentShader:Bt.meshphong_frag},standard:{uniforms:ni([Je.common,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.roughnessmap,Je.metalnessmap,Je.fog,Je.lights,{emissive:{value:new ot(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Bt.meshphysical_vert,fragmentShader:Bt.meshphysical_frag},toon:{uniforms:ni([Je.common,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.gradientmap,Je.fog,Je.lights,{emissive:{value:new ot(0)}}]),vertexShader:Bt.meshtoon_vert,fragmentShader:Bt.meshtoon_frag},matcap:{uniforms:ni([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,{matcap:{value:null}}]),vertexShader:Bt.meshmatcap_vert,fragmentShader:Bt.meshmatcap_frag},points:{uniforms:ni([Je.points,Je.fog]),vertexShader:Bt.points_vert,fragmentShader:Bt.points_frag},dashed:{uniforms:ni([Je.common,Je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Bt.linedashed_vert,fragmentShader:Bt.linedashed_frag},depth:{uniforms:ni([Je.common,Je.displacementmap]),vertexShader:Bt.depth_vert,fragmentShader:Bt.depth_frag},normal:{uniforms:ni([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,{opacity:{value:1}}]),vertexShader:Bt.meshnormal_vert,fragmentShader:Bt.meshnormal_frag},sprite:{uniforms:ni([Je.sprite,Je.fog]),vertexShader:Bt.sprite_vert,fragmentShader:Bt.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Bt.background_vert,fragmentShader:Bt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Dt}},vertexShader:Bt.backgroundCube_vert,fragmentShader:Bt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Bt.cube_vert,fragmentShader:Bt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Bt.equirect_vert,fragmentShader:Bt.equirect_frag},distanceRGBA:{uniforms:ni([Je.common,Je.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Bt.distanceRGBA_vert,fragmentShader:Bt.distanceRGBA_frag},shadow:{uniforms:ni([Je.lights,Je.fog,{color:{value:new ot(0)},opacity:{value:1}}]),vertexShader:Bt.shadow_vert,fragmentShader:Bt.shadow_frag}};Jo.physical={uniforms:ni([Jo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new Ie(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new ot(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new Ie},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new ot(0)},specularColor:{value:new ot(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new Ie},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:Bt.meshphysical_vert,fragmentShader:Bt.meshphysical_frag};const Cv={r:0,b:0,g:0},oc=new ro,Dae=new wt;function Fae(t,e,n,r,i,o,s){const a=new ot(0);let l=o===!0?0:1,c,u,f=null,h=0,m=null;function v(b){let _=b.isScene===!0?b.background:null;return _&&_.isTexture&&(_=(b.backgroundBlurriness>0?n:e).get(_)),_}function x(b){let _=!1;const S=v(b);S===null?g(a,l):S&&S.isColor&&(g(S,1),_=!0);const P=t.xr.getEnvironmentBlendMode();P==="additive"?r.buffers.color.setClear(0,0,0,1,s):P==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(t.autoClear||_)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function y(b,_){const S=v(_);S&&(S.isCubeTexture||S.mapping===Yd)?(u===void 0&&(u=new nr(new yu(1,1,1),new os({name:"BackgroundCubeMaterial",uniforms:Ed(Jo.backgroundCube.uniforms),vertexShader:Jo.backgroundCube.vertexShader,fragmentShader:Jo.backgroundCube.fragmentShader,side:fi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(P,N,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),oc.copy(_.backgroundRotation),oc.x*=-1,oc.y*=-1,oc.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(oc.y*=-1,oc.z*=-1),u.material.uniforms.envMap.value=S,u.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Dae.makeRotationFromEuler(oc)),u.material.toneMapped=an.getTransfer(S.colorSpace)!==xn,(f!==S||h!==S.version||m!==t.toneMapping)&&(u.material.needsUpdate=!0,f=S,h=S.version,m=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new nr(new Zd(2,2),new os({name:"BackgroundMaterial",uniforms:Ed(Jo.background.uniforms),vertexShader:Jo.background.vertexShader,fragmentShader:Jo.background.fragmentShader,side:Ra,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,c.material.toneMapped=an.getTransfer(S.colorSpace)!==xn,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(f!==S||h!==S.version||m!==t.toneMapping)&&(c.material.needsUpdate=!0,f=S,h=S.version,m=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function g(b,_){b.getRGB(Cv,IU(t)),r.buffers.color.setClear(Cv.r,Cv.g,Cv.b,_,s)}return{getClearColor:function(){return a},setClearColor:function(b,_=1){a.set(b),l=_,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,g(a,l)},render:x,addToRenderList:y}}function zae(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=h(null);let o=i,s=!1;function a(M,T,D,O,j){let X=!1;const H=f(O,D,T);o!==H&&(o=H,c(o.object)),X=m(M,O,D,j),X&&v(M,O,D,j),j!==null&&e.update(j,t.ELEMENT_ARRAY_BUFFER),(X||s)&&(s=!1,S(M,T,D,O),j!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(j).buffer))}function l(){return t.createVertexArray()}function c(M){return t.bindVertexArray(M)}function u(M){return t.deleteVertexArray(M)}function f(M,T,D){const O=D.wireframe===!0;let j=r[M.id];j===void 0&&(j={},r[M.id]=j);let X=j[T.id];X===void 0&&(X={},j[T.id]=X);let H=X[O];return H===void 0&&(H=h(l()),X[O]=H),H}function h(M){const T=[],D=[],O=[];for(let j=0;j=0){const K=j[F];let J=X[F];if(J===void 0&&(F==="instanceMatrix"&&M.instanceMatrix&&(J=M.instanceMatrix),F==="instanceColor"&&M.instanceColor&&(J=M.instanceColor)),K===void 0||K.attribute!==J||J&&K.data!==J.data)return!0;H++}return o.attributesNum!==H||o.index!==O}function v(M,T,D,O){const j={},X=T.attributes;let H=0;const Z=D.getAttributes();for(const F in Z)if(Z[F].location>=0){let K=X[F];K===void 0&&(F==="instanceMatrix"&&M.instanceMatrix&&(K=M.instanceMatrix),F==="instanceColor"&&M.instanceColor&&(K=M.instanceColor));const J={};J.attribute=K,K&&K.data&&(J.data=K.data),j[F]=J,H++}o.attributes=j,o.attributesNum=H,o.index=O}function x(){const M=o.newAttributes;for(let T=0,D=M.length;T=0){let q=j[Z];if(q===void 0&&(Z==="instanceMatrix"&&M.instanceMatrix&&(q=M.instanceMatrix),Z==="instanceColor"&&M.instanceColor&&(q=M.instanceColor)),q!==void 0){const K=q.normalized,J=q.itemSize,he=e.get(q);if(he===void 0)continue;const le=he.buffer,ee=he.type,ae=he.bytesPerElement,ge=ee===t.INT||ee===t.UNSIGNED_INT||q.gpuType===t_;if(q.isInterleavedBufferAttribute){const Me=q.data,tt=Me.stride,He=q.offset;if(Me.isInstancedInterleavedBuffer){for(let rt=0;rt0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=n.logarithmicDepthBuffer===!0,h=n.reverseDepthBuffer===!0&&e.has("EXT_clip_control");if(h===!0){const R=e.get("EXT_clip_control");R.clipControlEXT(R.LOWER_LEFT_EXT,R.ZERO_TO_ONE_EXT)}const m=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),x=t.getParameter(t.MAX_TEXTURE_SIZE),y=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),g=t.getParameter(t.MAX_VERTEX_ATTRIBS),b=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),_=t.getParameter(t.MAX_VARYING_VECTORS),S=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),P=v>0,N=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:l,textureFormatReadable:s,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:h,maxTextures:m,maxVertexTextures:v,maxTextureSize:x,maxCubemapSize:y,maxAttributes:g,maxVertexUniforms:b,maxVaryings:_,maxFragmentUniforms:S,vertexTextures:P,maxSamples:N}}function jae(t){const e=this;let n=null,r=0,i=!1,o=!1;const s=new ll,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){const m=f.length!==0||h||r!==0||i;return i=h,r=f.length,m},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(f,h){n=u(f,h,0)},this.setState=function(f,h,m){const v=f.clippingPlanes,x=f.clipIntersection,y=f.clipShadows,g=t.get(f);if(!i||v===null||v.length===0||o&&!y)o?u(null):c();else{const b=o?0:r,_=b*4;let S=g.clippingState||null;l.value=S,S=u(v,h,_,m);for(let P=0;P!==_;++P)S[P]=n[P];g.clippingState=S,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(f,h,m,v){const x=f!==null?f.length:0;let y=null;if(x!==0){if(y=l.value,v!==!0||y===null){const g=m+x*4,b=h.matrixWorldInverse;a.getNormalMatrix(b),(y===null||y.length0){const c=new OU(l.height);return c.fromEquirectangularTexture(t,s),e.set(s,c),s.addEventListener("dispose",i),n(c.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class xg extends gg{constructor(e=-1,n=1,r=1,i=-1,o=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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,n,r,i,o,s){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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,s=r+e,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,s=o+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const Vf=4,eL=[.125,.215,.35,.446,.526,.582],wc=20,EM=new xg,tL=new ot;let CM=null,TM=0,RM=0,AM=!1;const xc=(1+Math.sqrt(5))/2,lf=1/xc,nL=[new G(-xc,lf,0),new G(xc,lf,0),new G(-lf,0,xc),new G(lf,0,xc),new G(0,xc,-lf),new G(0,xc,lf),new G(-1,1,-1),new G(1,1,-1),new G(-1,1,1),new G(1,1,1)];class oC{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,n=0,r=.1,i=100){CM=this._renderer.getRenderTarget(),TM=this._renderer.getActiveCubeFace(),RM=this._renderer.getActiveMipmapLevel(),AM=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=oL(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=iL(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?_:0,_,_),u.setRenderTarget(i),x&&u.render(v,a),u.render(e,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=h,u.autoClear=f,e.background=y}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Aa||e.mapping===Al;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=oL()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=iL());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new nr(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=e;const l=this._cubeSize;Tv(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,EM)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let o=1;owc&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${wc}`);const g=[];let b=0;for(let R=0;R_-Vf?i-_+Vf:0),N=4*(this._cubeSize-S);Tv(n,P,N,3*S,2*S),l.setRenderTarget(n),l.render(f,EM)}}function $ae(t){const e=[],n=[],r=[];let i=t;const o=t-Vf+1+eL.length;for(let s=0;st-Vf?l=eL[s-t+Vf-1]:s===0&&(l=0),r.push(l);const c=1/(a-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],m=6,v=6,x=3,y=2,g=1,b=new Float32Array(x*v*m),_=new Float32Array(y*v*m),S=new Float32Array(g*v*m);for(let N=0;N2?0:-1,U=[R,L,0,R+2/3,L,0,R+2/3,L+1,0,R,L,0,R+2/3,L+1,0,R,L+1,0];b.set(U,x*v*N),_.set(h,y*v*N);const M=[N,N,N,N,N,N];S.set(M,g*v*N)}const P=new Ut;P.setAttribute("position",new hn(b,x)),P.setAttribute("uv",new hn(_,y)),P.setAttribute("faceIndex",new hn(S,g)),e.push(P),i>Vf&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function rL(t,e,n){const r=new is(t,e,n);return r.texture.mapping=Yd,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Tv(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Wae(t,e,n){const r=new Float32Array(wc),i=new G(0,1,0);return new os({name:"SphericalGaussianBlur",defines:{n:wc,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:eA(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:ba,depthTest:!1,depthWrite:!1})}function iL(){return new os({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:eA(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:ba,depthTest:!1,depthWrite:!1})}function oL(){return new os({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:eA(),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:ba,depthTest:!1,depthWrite:!1})}function eA(){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 Hae(t){let e=new WeakMap,n=null;function r(a){if(a&&a.isTexture){const l=a.mapping,c=l===_m||l===wm,u=l===Aa||l===Al;if(c||u){let f=e.get(a);const h=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==h)return n===null&&(n=new oC(t)),f=c?n.fromEquirectangular(a,f):n.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const m=a.image;return c&&m&&m.height>0||u&&m&&i(m)?(n===null&&(n=new oC(t)),f=c?n.fromEquirectangular(a):n.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",o),f.texture):null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(N=Math.ceil(P/e.maxTextureSize),P=e.maxTextureSize);const R=new Float32Array(P*N*4*f),L=new l_(R,P,N,f);L.type=ai,L.needsUpdate=!0;const U=S*4;for(let T=0;T0)return t;const i=e*n;let o=aL[i];if(o===void 0&&(o=new Float32Array(i),aL[i]=o),e!==0){r.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=n,t[s].toArray(o,a)}return o}function cr(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${a}: ${n[s]}`)}return r.join(` -`)}function Hle(t){const e=an.getPrimaries(an.workingColorSpace),n=an.getPrimaries(t);let r;switch(e===n?r="":e===Am&&n===Rm?r="LinearDisplayP3ToLinearSRGB":e===Rm&&n===Am&&(r="LinearSRGBToLinearDisplayP3"),t){case Oa:case mg:return[r,"LinearTransferOETF"];case Eo:case a_:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}function pL(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const s=parseInt(o[1]);return n.toUpperCase()+` - -`+i+` - -`+Wle(t.getShaderSource(e),s)}else return i}function Gle(t,e){const n=Hle(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function Xle(t,e){let n;switch(e){case sU:n="Linear";break;case aU:n="Reinhard";break;case lU:n="Cineon";break;case FR:n="ACESFilmic";break;case uU:n="AgX";break;case fU:n="Neutral";break;case cU:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const Rv=new G;function qle(){an.getLuminanceCoefficients(Rv);const t=Rv.x.toFixed(4),e=Rv.y.toFixed(4),n=Rv.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` -`)}function Yle(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(vp).join(` -`)}function Kle(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` -`)}function Zle(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function sC(t){return t.replace(Jle,ece)}const Qle=new Map;function ece(t,e){let n=Bt[e];if(n===void 0){const r=Qle.get(e);if(r!==void 0)n=Bt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return sC(n)}const tce=/#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 vL(t){return t.replace(tce,nce)}function nce(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(y+=` -`),g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(vp).join(` -`),g.length>0&&(g+=` -`)):(y=[yL(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(vp).join(` -`),g=[yL(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==ks?"#define TONE_MAPPING":"",n.toneMapping!==ks?Bt.tonemapping_pars_fragment:"",n.toneMapping!==ks?Xle("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Bt.colorspace_pars_fragment,Gle("linearToOutputTexel",n.outputColorSpace),qle(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` -`].filter(vp).join(` -`)),s=sC(s),s=mL(s,n),s=gL(s,n),a=sC(a),a=mL(a,n),a=gL(a,n),s=vL(s),a=vL(a),n.isRawShaderMaterial!==!0&&(b=`#version 300 es -`,y=[m,"#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+y,g=["#define varying in",n.glslVersion===iC?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===iC?"":"#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 _=b+y+s,S=b+g+a,P=hL(i,i.VERTEX_SHADER,_),N=hL(i,i.FRAGMENT_SHADER,S);i.attachShader(x,P),i.attachShader(x,N),n.index0AttributeName!==void 0?i.bindAttribLocation(x,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(x,0,"position"),i.linkProgram(x);function R(T){if(t.debug.checkShaderErrors){const D=i.getProgramInfoLog(x).trim(),O=i.getShaderInfoLog(P).trim(),j=i.getShaderInfoLog(N).trim();let X=!0,H=!0;if(i.getProgramParameter(x,i.LINK_STATUS)===!1)if(X=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,x,P,N);else{const Z=pL(i,P,"vertex"),F=pL(i,N,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(x,i.VALIDATE_STATUS)+` - -Material Name: `+T.name+` -Material Type: `+T.type+` - -Program Info Log: `+D+` -`+Z+` -`+F)}else D!==""?console.warn("THREE.WebGLProgram: Program Info Log:",D):(O===""||j==="")&&(H=!1);H&&(T.diagnostics={runnable:X,programLog:D,vertexShader:{log:O,prefix:y},fragmentShader:{log:j,prefix:g}})}i.deleteShader(P),i.deleteShader(N),L=new By(i,x),U=Zle(i,x)}let L;this.getUniforms=function(){return L===void 0&&R(this),L};let U;this.getAttributes=function(){return U===void 0&&R(this),U};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(x,Vle)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(x),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=$le++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=P,this.fragmentShader=N,this}let cce=0;class uce{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(o)===!1&&(s.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new fce(e),n.set(e,r)),r}}class fce{constructor(e){this.id=cce++,this.code=e,this.usedTimes=0}}function dce(t,e,n,r,i,o,s){const a=new $c,l=new uce,c=new Set,u=[],f=i.logarithmicDepthBuffer,h=i.reverseDepthBuffer,m=i.vertexTextures;let v=i.precision;const x={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 y(M){return c.add(M),M===0?"uv":`uv${M}`}function g(M,T,D,O,j){const X=O.fog,H=j.geometry,Z=M.isMeshStandardMaterial?O.environment:null,F=(M.isMeshStandardMaterial?n:e).get(M.envMap||Z),q=F&&F.mapping===Yd?F.image.height:null,K=x[M.type];M.precision!==null&&(v=i.getMaxPrecision(M.precision),v!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",v,"instead."));const J=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,he=J!==void 0?J.length:0;let le=0;H.morphAttributes.position!==void 0&&(le=1),H.morphAttributes.normal!==void 0&&(le=2),H.morphAttributes.color!==void 0&&(le=3);let ee,ae,ge,Me;if(K){const Mr=Jo[K];ee=Mr.vertexShader,ae=Mr.fragmentShader}else ee=M.vertexShader,ae=M.fragmentShader,l.update(M),ge=l.getVertexShaderID(M),Me=l.getFragmentShaderID(M);const tt=t.getRenderTarget(),He=j.isInstancedMesh===!0,rt=j.isBatchedMesh===!0,Ve=!!M.map,se=!!M.matcap,B=!!F,ye=!!M.aoMap,xe=!!M.lightMap,Re=!!M.bumpMap,Pe=!!M.normalMap,Ee=!!M.displacementMap,De=!!M.emissiveMap,$=!!M.metalnessMap,z=!!M.roughnessMap,re=M.anisotropy>0,pe=M.clearcoat>0,me=M.dispersion>0,be=M.iridescence>0,Ge=M.sheen>0,Fe=M.transmission>0,Ne=re&&!!M.anisotropyMap,ze=pe&&!!M.clearcoatMap,Le=pe&&!!M.clearcoatNormalMap,Xe=pe&&!!M.clearcoatRoughnessMap,xt=be&&!!M.iridescenceMap,Oe=be&&!!M.iridescenceThicknessMap,Ue=Ge&&!!M.sheenColorMap,Ae=Ge&&!!M.sheenRoughnessMap,ke=!!M.specularMap,dt=!!M.specularColorMap,Q=!!M.specularIntensityMap,je=Fe&&!!M.transmissionMap,fe=Fe&&!!M.thicknessMap,Te=!!M.gradientMap,Ye=!!M.alphaMap,qe=M.alphaTest>0,jt=!!M.alphaHash,An=!!M.extensions;let kr=ks;M.toneMapped&&(tt===null||tt.isXRRenderTarget===!0)&&(kr=t.toneMapping);const Yt={shaderID:K,shaderType:M.type,shaderName:M.name,vertexShader:ee,fragmentShader:ae,defines:M.defines,customVertexShaderID:ge,customFragmentShaderID:Me,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:v,batching:rt,batchingColor:rt&&j._colorsTexture!==null,instancing:He,instancingColor:He&&j.instanceColor!==null,instancingMorph:He&&j.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:tt===null?t.outputColorSpace:tt.isXRRenderTarget===!0?tt.texture.colorSpace:Oa,alphaToCoverage:!!M.alphaToCoverage,map:Ve,matcap:se,envMap:B,envMapMode:B&&F.mapping,envMapCubeUVHeight:q,aoMap:ye,lightMap:xe,bumpMap:Re,normalMap:Pe,displacementMap:m&&Ee,emissiveMap:De,normalMapObjectSpace:Pe&&M.normalMapType===yU,normalMapTangentSpace:Pe&&M.normalMapType===Ul,metalnessMap:$,roughnessMap:z,anisotropy:re,anisotropyMap:Ne,clearcoat:pe,clearcoatMap:ze,clearcoatNormalMap:Le,clearcoatRoughnessMap:Xe,dispersion:me,iridescence:be,iridescenceMap:xt,iridescenceThicknessMap:Oe,sheen:Ge,sheenColorMap:Ue,sheenRoughnessMap:Ae,specularMap:ke,specularColorMap:dt,specularIntensityMap:Q,transmission:Fe,transmissionMap:je,thicknessMap:fe,gradientMap:Te,opaque:M.transparent===!1&&M.blending===Bc&&M.alphaToCoverage===!1,alphaMap:Ye,alphaTest:qe,alphaHash:jt,combine:M.combine,mapUv:Ve&&y(M.map.channel),aoMapUv:ye&&y(M.aoMap.channel),lightMapUv:xe&&y(M.lightMap.channel),bumpMapUv:Re&&y(M.bumpMap.channel),normalMapUv:Pe&&y(M.normalMap.channel),displacementMapUv:Ee&&y(M.displacementMap.channel),emissiveMapUv:De&&y(M.emissiveMap.channel),metalnessMapUv:$&&y(M.metalnessMap.channel),roughnessMapUv:z&&y(M.roughnessMap.channel),anisotropyMapUv:Ne&&y(M.anisotropyMap.channel),clearcoatMapUv:ze&&y(M.clearcoatMap.channel),clearcoatNormalMapUv:Le&&y(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Xe&&y(M.clearcoatRoughnessMap.channel),iridescenceMapUv:xt&&y(M.iridescenceMap.channel),iridescenceThicknessMapUv:Oe&&y(M.iridescenceThicknessMap.channel),sheenColorMapUv:Ue&&y(M.sheenColorMap.channel),sheenRoughnessMapUv:Ae&&y(M.sheenRoughnessMap.channel),specularMapUv:ke&&y(M.specularMap.channel),specularColorMapUv:dt&&y(M.specularColorMap.channel),specularIntensityMapUv:Q&&y(M.specularIntensityMap.channel),transmissionMapUv:je&&y(M.transmissionMap.channel),thicknessMapUv:fe&&y(M.thicknessMap.channel),alphaMapUv:Ye&&y(M.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(Pe||re),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,pointsUvs:j.isPoints===!0&&!!H.attributes.uv&&(Ve||Ye),fog:!!X,useFog:M.fog===!0,fogExp2:!!X&&X.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:h,skinning:j.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:he,morphTextureStride:le,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numSpotLightMaps:T.spotLightMap.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numSpotLightShadowsWithMaps:T.numSpotLightShadowsWithMaps,numLightProbes:T.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:M.dithering,shadowMapEnabled:t.shadowMap.enabled&&D.length>0,shadowMapType:t.shadowMap.type,toneMapping:kr,decodeVideoTexture:Ve&&M.map.isVideoTexture===!0&&an.getTransfer(M.map.colorSpace)===xn,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Qo,flipSided:M.side===fi,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:An&&M.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(An&&M.extensions.multiDraw===!0||rt)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return Yt.vertexUv1s=c.has(1),Yt.vertexUv2s=c.has(2),Yt.vertexUv3s=c.has(3),c.clear(),Yt}function b(M){const T=[];if(M.shaderID?T.push(M.shaderID):(T.push(M.customVertexShaderID),T.push(M.customFragmentShaderID)),M.defines!==void 0)for(const D in M.defines)T.push(D),T.push(M.defines[D]);return M.isRawShaderMaterial===!1&&(_(T,M),S(T,M),T.push(t.outputColorSpace)),T.push(M.customProgramCacheKey),T.join()}function _(M,T){M.push(T.precision),M.push(T.outputColorSpace),M.push(T.envMapMode),M.push(T.envMapCubeUVHeight),M.push(T.mapUv),M.push(T.alphaMapUv),M.push(T.lightMapUv),M.push(T.aoMapUv),M.push(T.bumpMapUv),M.push(T.normalMapUv),M.push(T.displacementMapUv),M.push(T.emissiveMapUv),M.push(T.metalnessMapUv),M.push(T.roughnessMapUv),M.push(T.anisotropyMapUv),M.push(T.clearcoatMapUv),M.push(T.clearcoatNormalMapUv),M.push(T.clearcoatRoughnessMapUv),M.push(T.iridescenceMapUv),M.push(T.iridescenceThicknessMapUv),M.push(T.sheenColorMapUv),M.push(T.sheenRoughnessMapUv),M.push(T.specularMapUv),M.push(T.specularColorMapUv),M.push(T.specularIntensityMapUv),M.push(T.transmissionMapUv),M.push(T.thicknessMapUv),M.push(T.combine),M.push(T.fogExp2),M.push(T.sizeAttenuation),M.push(T.morphTargetsCount),M.push(T.morphAttributeCount),M.push(T.numDirLights),M.push(T.numPointLights),M.push(T.numSpotLights),M.push(T.numSpotLightMaps),M.push(T.numHemiLights),M.push(T.numRectAreaLights),M.push(T.numDirLightShadows),M.push(T.numPointLightShadows),M.push(T.numSpotLightShadows),M.push(T.numSpotLightShadowsWithMaps),M.push(T.numLightProbes),M.push(T.shadowMapType),M.push(T.toneMapping),M.push(T.numClippingPlanes),M.push(T.numClipIntersection),M.push(T.depthPacking)}function S(M,T){a.disableAll(),T.supportsVertexTextures&&a.enable(0),T.instancing&&a.enable(1),T.instancingColor&&a.enable(2),T.instancingMorph&&a.enable(3),T.matcap&&a.enable(4),T.envMap&&a.enable(5),T.normalMapObjectSpace&&a.enable(6),T.normalMapTangentSpace&&a.enable(7),T.clearcoat&&a.enable(8),T.iridescence&&a.enable(9),T.alphaTest&&a.enable(10),T.vertexColors&&a.enable(11),T.vertexAlphas&&a.enable(12),T.vertexUv1s&&a.enable(13),T.vertexUv2s&&a.enable(14),T.vertexUv3s&&a.enable(15),T.vertexTangents&&a.enable(16),T.anisotropy&&a.enable(17),T.alphaHash&&a.enable(18),T.batching&&a.enable(19),T.dispersion&&a.enable(20),T.batchingColor&&a.enable(21),M.push(a.mask),a.disableAll(),T.fog&&a.enable(0),T.useFog&&a.enable(1),T.flatShading&&a.enable(2),T.logarithmicDepthBuffer&&a.enable(3),T.reverseDepthBuffer&&a.enable(4),T.skinning&&a.enable(5),T.morphTargets&&a.enable(6),T.morphNormals&&a.enable(7),T.morphColors&&a.enable(8),T.premultipliedAlpha&&a.enable(9),T.shadowMapEnabled&&a.enable(10),T.doubleSided&&a.enable(11),T.flipSided&&a.enable(12),T.useDepthPacking&&a.enable(13),T.dithering&&a.enable(14),T.transmission&&a.enable(15),T.sheen&&a.enable(16),T.opaque&&a.enable(17),T.pointsUvs&&a.enable(18),T.decodeVideoTexture&&a.enable(19),T.alphaToCoverage&&a.enable(20),M.push(a.mask)}function P(M){const T=x[M.type];let D;if(T){const O=Jo[T];D=LU.clone(O.uniforms)}else D=M.uniforms;return D}function N(M,T){let D;for(let O=0,j=u.length;O0?r.push(g):m.transparent===!0?i.push(g):n.push(g)}function l(f,h,m,v,x,y){const g=s(f,h,m,v,x,y);m.transmission>0?r.unshift(g):m.transparent===!0?i.unshift(g):n.unshift(g)}function c(f,h){n.length>1&&n.sort(f||pce),r.length>1&&r.sort(h||xL),i.length>1&&i.sort(h||xL)}function u(){for(let f=e,h=t.length;f=o.length?(s=new bL,o.push(s)):s=o[i],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function gce(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new G,color:new ot};break;case"SpotLight":n={position:new G,direction:new G,color:new ot,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new G,color:new ot,distance:0,decay:0};break;case"HemisphereLight":n={direction:new G,skyColor:new ot,groundColor:new ot};break;case"RectAreaLight":n={color:new ot,position:new G,halfWidth:new G,halfHeight:new G};break}return t[e.id]=n,n}}}function vce(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ie};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ie};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ie,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let yce=0;function xce(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function bce(t){const e=new gce,n=vce(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new G);const i=new G,o=new wt,s=new wt;function a(c){let u=0,f=0,h=0;for(let U=0;U<9;U++)r.probe[U].set(0,0,0);let m=0,v=0,x=0,y=0,g=0,b=0,_=0,S=0,P=0,N=0,R=0;c.sort(xce);for(let U=0,M=c.length;U0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Je.LTC_FLOAT_1,r.rectAreaLTC2=Je.LTC_FLOAT_2):(r.rectAreaLTC1=Je.LTC_HALF_1,r.rectAreaLTC2=Je.LTC_HALF_2)),r.ambient[0]=u,r.ambient[1]=f,r.ambient[2]=h;const L=r.hash;(L.directionalLength!==m||L.pointLength!==v||L.spotLength!==x||L.rectAreaLength!==y||L.hemiLength!==g||L.numDirectionalShadows!==b||L.numPointShadows!==_||L.numSpotShadows!==S||L.numSpotMaps!==P||L.numLightProbes!==R)&&(r.directional.length=m,r.spot.length=x,r.rectArea.length=y,r.point.length=v,r.hemi.length=g,r.directionalShadow.length=b,r.directionalShadowMap.length=b,r.pointShadow.length=_,r.pointShadowMap.length=_,r.spotShadow.length=S,r.spotShadowMap.length=S,r.directionalShadowMatrix.length=b,r.pointShadowMatrix.length=_,r.spotLightMatrix.length=S+P-N,r.spotLightMap.length=P,r.numSpotLightShadowsWithMaps=N,r.numLightProbes=R,L.directionalLength=m,L.pointLength=v,L.spotLength=x,L.rectAreaLength=y,L.hemiLength=g,L.numDirectionalShadows=b,L.numPointShadows=_,L.numSpotShadows=S,L.numSpotMaps=P,L.numLightProbes=R,r.version=yce++)}function l(c,u){let f=0,h=0,m=0,v=0,x=0;const y=u.matrixWorldInverse;for(let g=0,b=c.length;g=s.length?(a=new _L(t),s.push(a)):a=s[o],a}function r(){e=new WeakMap}return{get:n,dispose:r}}class nA extends Ir{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=gU,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 rA extends Ir{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 wce=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,Sce=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function Mce(t,e,n){let r=new yg;const i=new Ie,o=new Ie,s=new Zt,a=new nA({depthPacking:vU}),l=new rA,c={},u=n.maxTextureSize,f={[Ra]:fi,[fi]:Ra,[Qo]:Qo},h=new os({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ie},radius:{value:4}},vertexShader:wce,fragmentShader:Sce}),m=h.clone();m.defines.HORIZONTAL_PASS=1;const v=new Ut;v.setAttribute("position",new hn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new nr(v,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=e_;let g=this.type;this.render=function(N,R,L){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||N.length===0)return;const U=t.getRenderTarget(),M=t.getActiveCubeFace(),T=t.getActiveMipmapLevel(),D=t.state;D.setBlending(ba),D.buffers.color.setClear(1,1,1,1),D.buffers.depth.setTest(!0),D.setScissorTest(!1);const O=g!==Yo&&this.type===Yo,j=g===Yo&&this.type!==Yo;for(let X=0,H=N.length;Xu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/q.x),i.x=o.x*q.x,F.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/q.y),i.y=o.y*q.y,F.mapSize.y=o.y)),F.map===null||O===!0||j===!0){const J=this.type!==Yo?{minFilter:lr,magFilter:lr}:{};F.map!==null&&F.map.dispose(),F.map=new is(i.x,i.y,J),F.map.texture.name=Z.name+".shadowMap",F.camera.updateProjectionMatrix()}t.setRenderTarget(F.map),t.clear();const K=F.getViewportCount();for(let J=0;J0||R.map&&R.alphaTest>0){const D=M.uuid,O=R.uuid;let j=c[D];j===void 0&&(j={},c[D]=j);let X=j[O];X===void 0&&(X=M.clone(),j[O]=X,R.addEventListener("dispose",P)),M=X}if(M.visible=R.visible,M.wireframe=R.wireframe,U===Yo?M.side=R.shadowSide!==null?R.shadowSide:R.side:M.side=R.shadowSide!==null?R.shadowSide:f[R.side],M.alphaMap=R.alphaMap,M.alphaTest=R.alphaTest,M.map=R.map,M.clipShadows=R.clipShadows,M.clippingPlanes=R.clippingPlanes,M.clipIntersection=R.clipIntersection,M.displacementMap=R.displacementMap,M.displacementScale=R.displacementScale,M.displacementBias=R.displacementBias,M.wireframeLinewidth=R.wireframeLinewidth,M.linewidth=R.linewidth,L.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const D=t.properties.get(M);D.light=L}return M}function S(N,R,L,U,M){if(N.visible===!1)return;if(N.layers.test(R.layers)&&(N.isMesh||N.isLine||N.isPoints)&&(N.castShadow||N.receiveShadow&&M===Yo)&&(!N.frustumCulled||r.intersectsObject(N))){N.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,N.matrixWorld);const O=e.update(N),j=N.material;if(Array.isArray(j)){const X=O.groups;for(let H=0,Z=X.length;H=1):Z.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),X=H>=2);let F=null,q={};const K=t.getParameter(t.SCISSOR_BOX),J=t.getParameter(t.VIEWPORT),he=new Zt().fromArray(K),le=new Zt().fromArray(J);function ee(Q,je,fe,Te){const Ye=new Uint8Array(4),qe=t.createTexture();t.bindTexture(Q,qe),t.texParameteri(Q,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(Q,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let jt=0;jte?(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}function Rce(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}function Ace(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}function aC(t,e,n,r){const i=Pce(r);switch(n){case VR:return t*e;case WR:return t*e;case HR:return t*e*2;case hg:return t*e/i.components*i.byteLength;case pg:return t*e/i.components*i.byteLength;case GR:return t*e*2/i.components*i.byteLength;case i_:return t*e*2/i.components*i.byteLength;case $R:return t*e*3/i.components*i.byteLength;case Rr:return t*e*4/i.components*i.byteLength;case o_:return t*e*4/i.components*i.byteLength;case kp:case Op:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case Dp:case Fp:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case j1:case $1:return Math.max(t,16)*Math.max(e,8)/4;case B1:case V1:return Math.max(t,8)*Math.max(e,8)/2;case W1:case H1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case G1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case X1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case q1:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case Y1:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case K1:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case Z1:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case J1:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case Q1:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case ex:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case tx:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case nx:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case rx:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case ix:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case ox:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case sx:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case zp:case ax:case lx:return Math.ceil(t/4)*Math.ceil(e/4)*16;case XR:case cx:return Math.ceil(t/4)*Math.ceil(e/4)*8;case ux:case fx:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function Pce(t){switch(t){case Fi:case UR:return{byteLength:1,components:1};case Sd:case BR:case vu:return{byteLength:2,components:1};case n_:case r_:return{byteLength:2,components:4};case Pa:case t_:case ai:return{byteLength:4,components:1};case jR:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}const Nce={contain:Tce,cover:Rce,fill:Ace,getByteLength:aC};function Ice(t,e,n,r,i,o,s){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Ie,u=new WeakMap;let f;const h=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v($,z){return m?new OffscreenCanvas($,z):Im("canvas")}function x($,z,re){let pe=1;const me=De($);if((me.width>re||me.height>re)&&(pe=re/Math.max(me.width,me.height)),pe<1)if(typeof HTMLImageElement<"u"&&$ instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&$ instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&$ instanceof ImageBitmap||typeof VideoFrame<"u"&&$ instanceof VideoFrame){const be=Math.floor(pe*me.width),Ge=Math.floor(pe*me.height);f===void 0&&(f=v(be,Ge));const Fe=z?v(be,Ge):f;return Fe.width=be,Fe.height=Ge,Fe.getContext("2d").drawImage($,0,0,be,Ge),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+be+"x"+Ge+")."),Fe}else return"data"in $&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),$;return $}function y($){return $.generateMipmaps&&$.minFilter!==lr&&$.minFilter!==tr}function g($){t.generateMipmap($)}function b($,z,re,pe,me=!1){if($!==null){if(t[$]!==void 0)return t[$];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+$+"'")}let be=z;if(z===t.RED&&(re===t.FLOAT&&(be=t.R32F),re===t.HALF_FLOAT&&(be=t.R16F),re===t.UNSIGNED_BYTE&&(be=t.R8)),z===t.RED_INTEGER&&(re===t.UNSIGNED_BYTE&&(be=t.R8UI),re===t.UNSIGNED_SHORT&&(be=t.R16UI),re===t.UNSIGNED_INT&&(be=t.R32UI),re===t.BYTE&&(be=t.R8I),re===t.SHORT&&(be=t.R16I),re===t.INT&&(be=t.R32I)),z===t.RG&&(re===t.FLOAT&&(be=t.RG32F),re===t.HALF_FLOAT&&(be=t.RG16F),re===t.UNSIGNED_BYTE&&(be=t.RG8)),z===t.RG_INTEGER&&(re===t.UNSIGNED_BYTE&&(be=t.RG8UI),re===t.UNSIGNED_SHORT&&(be=t.RG16UI),re===t.UNSIGNED_INT&&(be=t.RG32UI),re===t.BYTE&&(be=t.RG8I),re===t.SHORT&&(be=t.RG16I),re===t.INT&&(be=t.RG32I)),z===t.RGB_INTEGER&&(re===t.UNSIGNED_BYTE&&(be=t.RGB8UI),re===t.UNSIGNED_SHORT&&(be=t.RGB16UI),re===t.UNSIGNED_INT&&(be=t.RGB32UI),re===t.BYTE&&(be=t.RGB8I),re===t.SHORT&&(be=t.RGB16I),re===t.INT&&(be=t.RGB32I)),z===t.RGBA_INTEGER&&(re===t.UNSIGNED_BYTE&&(be=t.RGBA8UI),re===t.UNSIGNED_SHORT&&(be=t.RGBA16UI),re===t.UNSIGNED_INT&&(be=t.RGBA32UI),re===t.BYTE&&(be=t.RGBA8I),re===t.SHORT&&(be=t.RGBA16I),re===t.INT&&(be=t.RGBA32I)),z===t.RGB&&re===t.UNSIGNED_INT_5_9_9_9_REV&&(be=t.RGB9_E5),z===t.RGBA){const Ge=me?Tm:an.getTransfer(pe);re===t.FLOAT&&(be=t.RGBA32F),re===t.HALF_FLOAT&&(be=t.RGBA16F),re===t.UNSIGNED_BYTE&&(be=Ge===xn?t.SRGB8_ALPHA8:t.RGBA8),re===t.UNSIGNED_SHORT_4_4_4_4&&(be=t.RGBA4),re===t.UNSIGNED_SHORT_5_5_5_1&&(be=t.RGB5_A1)}return(be===t.R16F||be===t.R32F||be===t.RG16F||be===t.RG32F||be===t.RGBA16F||be===t.RGBA32F)&&e.get("EXT_color_buffer_float"),be}function _($,z){let re;return $?z===null||z===Pa||z===su?re=t.DEPTH24_STENCIL8:z===ai?re=t.DEPTH32F_STENCIL8:z===Sd&&(re=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):z===null||z===Pa||z===su?re=t.DEPTH_COMPONENT24:z===ai?re=t.DEPTH_COMPONENT32F:z===Sd&&(re=t.DEPTH_COMPONENT16),re}function S($,z){return y($)===!0||$.isFramebufferTexture&&$.minFilter!==lr&&$.minFilter!==tr?Math.log2(Math.max(z.width,z.height))+1:$.mipmaps!==void 0&&$.mipmaps.length>0?$.mipmaps.length:$.isCompressedTexture&&Array.isArray($.image)?z.mipmaps.length:1}function P($){const z=$.target;z.removeEventListener("dispose",P),R(z),z.isVideoTexture&&u.delete(z)}function N($){const z=$.target;z.removeEventListener("dispose",N),U(z)}function R($){const z=r.get($);if(z.__webglInit===void 0)return;const re=$.source,pe=h.get(re);if(pe){const me=pe[z.__cacheKey];me.usedTimes--,me.usedTimes===0&&L($),Object.keys(pe).length===0&&h.delete(re)}r.remove($)}function L($){const z=r.get($);t.deleteTexture(z.__webglTexture);const re=$.source,pe=h.get(re);delete pe[z.__cacheKey],s.memory.textures--}function U($){const z=r.get($);if($.depthTexture&&$.depthTexture.dispose(),$.isWebGLCubeRenderTarget)for(let pe=0;pe<6;pe++){if(Array.isArray(z.__webglFramebuffer[pe]))for(let me=0;me=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+$+" texture units while this GPU supports only "+i.maxTextures),M+=1,$}function O($){const z=[];return z.push($.wrapS),z.push($.wrapT),z.push($.wrapR||0),z.push($.magFilter),z.push($.minFilter),z.push($.anisotropy),z.push($.internalFormat),z.push($.format),z.push($.type),z.push($.generateMipmaps),z.push($.premultiplyAlpha),z.push($.flipY),z.push($.unpackAlignment),z.push($.colorSpace),z.join()}function j($,z){const re=r.get($);if($.isVideoTexture&&Pe($),$.isRenderTargetTexture===!1&&$.version>0&&re.__version!==$.version){const pe=$.image;if(pe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(pe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{le(re,$,z);return}}n.bindTexture(t.TEXTURE_2D,re.__webglTexture,t.TEXTURE0+z)}function X($,z){const re=r.get($);if($.version>0&&re.__version!==$.version){le(re,$,z);return}n.bindTexture(t.TEXTURE_2D_ARRAY,re.__webglTexture,t.TEXTURE0+z)}function H($,z){const re=r.get($);if($.version>0&&re.__version!==$.version){le(re,$,z);return}n.bindTexture(t.TEXTURE_3D,re.__webglTexture,t.TEXTURE0+z)}function Z($,z){const re=r.get($);if($.version>0&&re.__version!==$.version){ee(re,$,z);return}n.bindTexture(t.TEXTURE_CUBE_MAP,re.__webglTexture,t.TEXTURE0+z)}const F={[Sm]:t.REPEAT,[Ti]:t.CLAMP_TO_EDGE,[Mm]:t.MIRRORED_REPEAT},q={[lr]:t.NEAREST,[zR]:t.NEAREST_MIPMAP_NEAREST,[Bf]:t.NEAREST_MIPMAP_LINEAR,[tr]:t.LINEAR,[Lp]:t.LINEAR_MIPMAP_NEAREST,[Cs]:t.LINEAR_MIPMAP_LINEAR},K={[xU]:t.NEVER,[EU]:t.ALWAYS,[bU]:t.LESS,[YR]:t.LEQUAL,[_U]:t.EQUAL,[MU]:t.GEQUAL,[wU]:t.GREATER,[SU]:t.NOTEQUAL};function J($,z){if(z.type===ai&&e.has("OES_texture_float_linear")===!1&&(z.magFilter===tr||z.magFilter===Lp||z.magFilter===Bf||z.magFilter===Cs||z.minFilter===tr||z.minFilter===Lp||z.minFilter===Bf||z.minFilter===Cs)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri($,t.TEXTURE_WRAP_S,F[z.wrapS]),t.texParameteri($,t.TEXTURE_WRAP_T,F[z.wrapT]),($===t.TEXTURE_3D||$===t.TEXTURE_2D_ARRAY)&&t.texParameteri($,t.TEXTURE_WRAP_R,F[z.wrapR]),t.texParameteri($,t.TEXTURE_MAG_FILTER,q[z.magFilter]),t.texParameteri($,t.TEXTURE_MIN_FILTER,q[z.minFilter]),z.compareFunction&&(t.texParameteri($,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri($,t.TEXTURE_COMPARE_FUNC,K[z.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(z.magFilter===lr||z.minFilter!==Bf&&z.minFilter!==Cs||z.type===ai&&e.has("OES_texture_float_linear")===!1)return;if(z.anisotropy>1||r.get(z).__currentAnisotropy){const re=e.get("EXT_texture_filter_anisotropic");t.texParameterf($,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(z.anisotropy,i.getMaxAnisotropy())),r.get(z).__currentAnisotropy=z.anisotropy}}}function he($,z){let re=!1;$.__webglInit===void 0&&($.__webglInit=!0,z.addEventListener("dispose",P));const pe=z.source;let me=h.get(pe);me===void 0&&(me={},h.set(pe,me));const be=O(z);if(be!==$.__cacheKey){me[be]===void 0&&(me[be]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,re=!0),me[be].usedTimes++;const Ge=me[$.__cacheKey];Ge!==void 0&&(me[$.__cacheKey].usedTimes--,Ge.usedTimes===0&&L(z)),$.__cacheKey=be,$.__webglTexture=me[be].texture}return re}function le($,z,re){let pe=t.TEXTURE_2D;(z.isDataArrayTexture||z.isCompressedArrayTexture)&&(pe=t.TEXTURE_2D_ARRAY),z.isData3DTexture&&(pe=t.TEXTURE_3D);const me=he($,z),be=z.source;n.bindTexture(pe,$.__webglTexture,t.TEXTURE0+re);const Ge=r.get(be);if(be.version!==Ge.__version||me===!0){n.activeTexture(t.TEXTURE0+re);const Fe=an.getPrimaries(an.workingColorSpace),Ne=z.colorSpace===fa?null:an.getPrimaries(z.colorSpace),ze=z.colorSpace===fa||Fe===Ne?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,z.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,z.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,z.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,ze);let Le=x(z.image,!1,i.maxTextureSize);Le=Ee(z,Le);const Xe=o.convert(z.format,z.colorSpace),xt=o.convert(z.type);let Oe=b(z.internalFormat,Xe,xt,z.colorSpace,z.isVideoTexture);J(pe,z);let Ue;const Ae=z.mipmaps,ke=z.isVideoTexture!==!0,dt=Ge.__version===void 0||me===!0,Q=be.dataReady,je=S(z,Le);if(z.isDepthTexture)Oe=_(z.format===au,z.type),dt&&(ke?n.texStorage2D(t.TEXTURE_2D,1,Oe,Le.width,Le.height):n.texImage2D(t.TEXTURE_2D,0,Oe,Le.width,Le.height,0,Xe,xt,null));else if(z.isDataTexture)if(Ae.length>0){ke&&dt&&n.texStorage2D(t.TEXTURE_2D,je,Oe,Ae[0].width,Ae[0].height);for(let fe=0,Te=Ae.length;fe0){const Ye=aC(Ue.width,Ue.height,z.format,z.type);for(const qe of z.layerUpdates){const jt=Ue.data.subarray(qe*Ye/Ue.data.BYTES_PER_ELEMENT,(qe+1)*Ye/Ue.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,fe,0,0,qe,Ue.width,Ue.height,1,Xe,jt,0,0)}z.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,fe,0,0,0,Ue.width,Ue.height,Le.depth,Xe,Ue.data,0,0)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,fe,Oe,Ue.width,Ue.height,Le.depth,0,Ue.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ke?Q&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,fe,0,0,0,Ue.width,Ue.height,Le.depth,Xe,xt,Ue.data):n.texImage3D(t.TEXTURE_2D_ARRAY,fe,Oe,Ue.width,Ue.height,Le.depth,0,Xe,xt,Ue.data)}else{ke&&dt&&n.texStorage2D(t.TEXTURE_2D,je,Oe,Ae[0].width,Ae[0].height);for(let fe=0,Te=Ae.length;fe0){const fe=aC(Le.width,Le.height,z.format,z.type);for(const Te of z.layerUpdates){const Ye=Le.data.subarray(Te*fe/Le.data.BYTES_PER_ELEMENT,(Te+1)*fe/Le.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,Te,Le.width,Le.height,1,Xe,xt,Ye)}z.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Le.width,Le.height,Le.depth,Xe,xt,Le.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Oe,Le.width,Le.height,Le.depth,0,Xe,xt,Le.data);else if(z.isData3DTexture)ke?(dt&&n.texStorage3D(t.TEXTURE_3D,je,Oe,Le.width,Le.height,Le.depth),Q&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Le.width,Le.height,Le.depth,Xe,xt,Le.data)):n.texImage3D(t.TEXTURE_3D,0,Oe,Le.width,Le.height,Le.depth,0,Xe,xt,Le.data);else if(z.isFramebufferTexture){if(dt)if(ke)n.texStorage2D(t.TEXTURE_2D,je,Oe,Le.width,Le.height);else{let fe=Le.width,Te=Le.height;for(let Ye=0;Ye>=1,Te>>=1}}else if(Ae.length>0){if(ke&&dt){const fe=De(Ae[0]);n.texStorage2D(t.TEXTURE_2D,je,Oe,fe.width,fe.height)}for(let fe=0,Te=Ae.length;fe0&&je++;const Te=De(Xe[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,je,Ae,Te.width,Te.height)}for(let Te=0;Te<6;Te++)if(Le){ke?Q&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,0,0,Xe[Te].width,Xe[Te].height,Oe,Ue,Xe[Te].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Te,0,Ae,Xe[Te].width,Xe[Te].height,0,Oe,Ue,Xe[Te].data);for(let Ye=0;Ye>be),Xe=Math.max(1,z.height>>be);me===t.TEXTURE_3D||me===t.TEXTURE_2D_ARRAY?n.texImage3D(me,be,Ne,Le,Xe,z.depth,0,Ge,Fe,null):n.texImage2D(me,be,Ne,Le,Xe,0,Ge,Fe,null)}n.bindFramebuffer(t.FRAMEBUFFER,$),Re(z)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,pe,me,r.get(re).__webglTexture,0,xe(z)):(me===t.TEXTURE_2D||me>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,pe,me,r.get(re).__webglTexture,be),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ge($,z,re){if(t.bindRenderbuffer(t.RENDERBUFFER,$),z.depthBuffer){const pe=z.depthTexture,me=pe&&pe.isDepthTexture?pe.type:null,be=_(z.stencilBuffer,me),Ge=z.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Fe=xe(z);Re(z)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Fe,be,z.width,z.height):re?t.renderbufferStorageMultisample(t.RENDERBUFFER,Fe,be,z.width,z.height):t.renderbufferStorage(t.RENDERBUFFER,be,z.width,z.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ge,t.RENDERBUFFER,$)}else{const pe=z.textures;for(let me=0;me{delete z.__boundDepthTexture,delete z.__depthDisposeCallback,pe.removeEventListener("dispose",me)};pe.addEventListener("dispose",me),z.__depthDisposeCallback=me}z.__boundDepthTexture=pe}if($.depthTexture&&!z.__autoAllocateDepthBuffer){if(re)throw new Error("target.depthTexture not supported in Cube render targets");Me(z.__webglFramebuffer,$)}else if(re){z.__webglDepthbuffer=[];for(let pe=0;pe<6;pe++)if(n.bindFramebuffer(t.FRAMEBUFFER,z.__webglFramebuffer[pe]),z.__webglDepthbuffer[pe]===void 0)z.__webglDepthbuffer[pe]=t.createRenderbuffer(),ge(z.__webglDepthbuffer[pe],$,!1);else{const me=$.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,be=z.__webglDepthbuffer[pe];t.bindRenderbuffer(t.RENDERBUFFER,be),t.framebufferRenderbuffer(t.FRAMEBUFFER,me,t.RENDERBUFFER,be)}}else if(n.bindFramebuffer(t.FRAMEBUFFER,z.__webglFramebuffer),z.__webglDepthbuffer===void 0)z.__webglDepthbuffer=t.createRenderbuffer(),ge(z.__webglDepthbuffer,$,!1);else{const pe=$.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,me=z.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,me),t.framebufferRenderbuffer(t.FRAMEBUFFER,pe,t.RENDERBUFFER,me)}n.bindFramebuffer(t.FRAMEBUFFER,null)}function He($,z,re){const pe=r.get($);z!==void 0&&ae(pe.__webglFramebuffer,$,$.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),re!==void 0&&tt($)}function rt($){const z=$.texture,re=r.get($),pe=r.get(z);$.addEventListener("dispose",N);const me=$.textures,be=$.isWebGLCubeRenderTarget===!0,Ge=me.length>1;if(Ge||(pe.__webglTexture===void 0&&(pe.__webglTexture=t.createTexture()),pe.__version=z.version,s.memory.textures++),be){re.__webglFramebuffer=[];for(let Fe=0;Fe<6;Fe++)if(z.mipmaps&&z.mipmaps.length>0){re.__webglFramebuffer[Fe]=[];for(let Ne=0;Ne0){re.__webglFramebuffer=[];for(let Fe=0;Fe0&&Re($)===!1){re.__webglMultisampledFramebuffer=t.createFramebuffer(),re.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,re.__webglMultisampledFramebuffer);for(let Fe=0;Fe0)for(let Ne=0;Ne0)for(let Ne=0;Ne0){if(Re($)===!1){const z=$.textures,re=$.width,pe=$.height;let me=t.COLOR_BUFFER_BIT;const be=$.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ge=r.get($),Fe=z.length>1;if(Fe)for(let Ne=0;Ne0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&z.__useRenderToTexture!==!1}function Pe($){const z=s.render.frame;u.get($)!==z&&(u.set($,z),$.update())}function Ee($,z){const re=$.colorSpace,pe=$.format,me=$.type;return $.isCompressedTexture===!0||$.isVideoTexture===!0||re!==Oa&&re!==fa&&(an.getTransfer(re)===xn?(pe!==Rr||me!==Fi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",re)),z}function De($){return typeof HTMLImageElement<"u"&&$ instanceof HTMLImageElement?(c.width=$.naturalWidth||$.width,c.height=$.naturalHeight||$.height):typeof VideoFrame<"u"&&$ instanceof VideoFrame?(c.width=$.displayWidth,c.height=$.displayHeight):(c.width=$.width,c.height=$.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=T,this.setTexture2D=j,this.setTexture2DArray=X,this.setTexture3D=H,this.setTextureCube=Z,this.rebindTextures=He,this.setupRenderTarget=rt,this.updateRenderTargetMipmap=Ve,this.updateMultisampleRenderTarget=ye,this.setupDepthRenderbuffer=tt,this.setupFrameBufferTexture=ae,this.useMultisampledRTT=Re}function jU(t,e){function n(r,i=fa){let o;const s=an.getTransfer(i);if(r===Fi)return t.UNSIGNED_BYTE;if(r===n_)return t.UNSIGNED_SHORT_4_4_4_4;if(r===r_)return t.UNSIGNED_SHORT_5_5_5_1;if(r===jR)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===UR)return t.BYTE;if(r===BR)return t.SHORT;if(r===Sd)return t.UNSIGNED_SHORT;if(r===t_)return t.INT;if(r===Pa)return t.UNSIGNED_INT;if(r===ai)return t.FLOAT;if(r===vu)return t.HALF_FLOAT;if(r===VR)return t.ALPHA;if(r===$R)return t.RGB;if(r===Rr)return t.RGBA;if(r===WR)return t.LUMINANCE;if(r===HR)return t.LUMINANCE_ALPHA;if(r===jc)return t.DEPTH_COMPONENT;if(r===au)return t.DEPTH_STENCIL;if(r===hg)return t.RED;if(r===pg)return t.RED_INTEGER;if(r===GR)return t.RG;if(r===i_)return t.RG_INTEGER;if(r===o_)return t.RGBA_INTEGER;if(r===kp||r===Op||r===Dp||r===Fp)if(s===xn)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(r===kp)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Op)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Dp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Fp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===kp)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Op)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Dp)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Fp)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===B1||r===j1||r===V1||r===$1)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===B1)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===j1)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===V1)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===$1)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===W1||r===H1||r===G1)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(r===W1||r===H1)return s===xn?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===G1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===X1||r===q1||r===Y1||r===K1||r===Z1||r===J1||r===Q1||r===ex||r===tx||r===nx||r===rx||r===ix||r===ox||r===sx)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(r===X1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===q1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===Y1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===K1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===Z1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===J1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===Q1)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===ex)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===tx)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===nx)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===rx)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===ix)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===ox)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===sx)return s===xn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===zp||r===ax||r===lx)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(r===zp)return s===xn?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===ax)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===lx)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===XR||r===cx||r===ux||r===fx)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(r===zp)return o.COMPRESSED_RED_RGTC1_EXT;if(r===cx)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===ux)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===fx)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===su?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}class VU extends vr{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let $f=class extends tn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const Lce={type:"move"};class NM{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new $f,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 $f,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new $f,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),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 n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){s=!0;for(const x of e.hand.values()){const y=n.getJointPose(x,r),g=this._getHandJoint(c,x);y!==null&&(g.matrix.fromArray(y.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=y.radius),g.visible=y!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),m=.02,v=.005;c.inputState.pinching&&h>m+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=m-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Lce)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new $f;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}const kce=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,Oce=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class Dce{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,r){if(this.texture===null){const i=new kn,o=e.properties.get(i);o.__webglTexture=n.texture,(n.depthNear!=r.depthNear||n.depthFar!=r.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new os({vertexShader:kce,fragmentShader:Oce,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new nr(new Zd(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Fce extends Hs{constructor(e,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=1,c=null,u=null,f=null,h=null,m=null,v=null;const x=new Dce,y=n.getContextAttributes();let g=null,b=null;const _=[],S=[],P=new Ie;let N=null;const R=new vr;R.layers.enable(1),R.viewport=new Zt;const L=new vr;L.layers.enable(2),L.viewport=new Zt;const U=[R,L],M=new VU;M.layers.enable(1),M.layers.enable(2);let T=null,D=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ee){let ae=_[ee];return ae===void 0&&(ae=new NM,_[ee]=ae),ae.getTargetRaySpace()},this.getControllerGrip=function(ee){let ae=_[ee];return ae===void 0&&(ae=new NM,_[ee]=ae),ae.getGripSpace()},this.getHand=function(ee){let ae=_[ee];return ae===void 0&&(ae=new NM,_[ee]=ae),ae.getHandSpace()};function O(ee){const ae=S.indexOf(ee.inputSource);if(ae===-1)return;const ge=_[ae];ge!==void 0&&(ge.update(ee.inputSource,ee.frame,c||s),ge.dispatchEvent({type:ee.type,data:ee.inputSource}))}function j(){i.removeEventListener("select",O),i.removeEventListener("selectstart",O),i.removeEventListener("selectend",O),i.removeEventListener("squeeze",O),i.removeEventListener("squeezestart",O),i.removeEventListener("squeezeend",O),i.removeEventListener("end",j),i.removeEventListener("inputsourceschange",X);for(let ee=0;ee<_.length;ee++){const ae=S[ee];ae!==null&&(S[ee]=null,_[ee].disconnect(ae))}T=null,D=null,x.reset(),e.setRenderTarget(g),m=null,h=null,f=null,i=null,b=null,le.stop(),r.isPresenting=!1,e.setPixelRatio(N),e.setSize(P.width,P.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ee){o=ee,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ee){a=ee,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||s},this.setReferenceSpace=function(ee){c=ee},this.getBaseLayer=function(){return h!==null?h:m},this.getBinding=function(){return f},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(ee){if(i=ee,i!==null){if(g=e.getRenderTarget(),i.addEventListener("select",O),i.addEventListener("selectstart",O),i.addEventListener("selectend",O),i.addEventListener("squeeze",O),i.addEventListener("squeezestart",O),i.addEventListener("squeezeend",O),i.addEventListener("end",j),i.addEventListener("inputsourceschange",X),y.xrCompatible!==!0&&await n.makeXRCompatible(),N=e.getPixelRatio(),e.getSize(P),i.renderState.layers===void 0){const ae={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:o};m=new XRWebGLLayer(i,n,ae),i.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),b=new is(m.framebufferWidth,m.framebufferHeight,{format:Rr,type:Fi,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil})}else{let ae=null,ge=null,Me=null;y.depth&&(Me=y.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,ae=y.stencil?au:jc,ge=y.stencil?su:Pa);const tt={colorFormat:n.RGBA8,depthFormat:Me,scaleFactor:o};f=new XRWebGLBinding(i,n),h=f.createProjectionLayer(tt),i.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),b=new is(h.textureWidth,h.textureHeight,{format:Rr,type:Fi,depthTexture:new tA(h.textureWidth,h.textureHeight,ge,void 0,void 0,void 0,void 0,void 0,void 0,ae),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:h.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(l),c=null,s=await i.requestReferenceSpace(a),le.setContext(i),le.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return x.getDepthTexture()};function X(ee){for(let ae=0;ae=0&&(S[Me]=null,_[Me].disconnect(ge))}for(let ae=0;ae=S.length){S.push(ge),Me=He;break}else if(S[He]===null){S[He]=ge,Me=He;break}if(Me===-1)break}const tt=_[Me];tt&&tt.connect(ge)}}const H=new G,Z=new G;function F(ee,ae,ge){H.setFromMatrixPosition(ae.matrixWorld),Z.setFromMatrixPosition(ge.matrixWorld);const Me=H.distanceTo(Z),tt=ae.projectionMatrix.elements,He=ge.projectionMatrix.elements,rt=tt[14]/(tt[10]-1),Ve=tt[14]/(tt[10]+1),se=(tt[9]+1)/tt[5],B=(tt[9]-1)/tt[5],ye=(tt[8]-1)/tt[0],xe=(He[8]+1)/He[0],Re=rt*ye,Pe=rt*xe,Ee=Me/(-ye+xe),De=Ee*-ye;if(ae.matrixWorld.decompose(ee.position,ee.quaternion,ee.scale),ee.translateX(De),ee.translateZ(Ee),ee.matrixWorld.compose(ee.position,ee.quaternion,ee.scale),ee.matrixWorldInverse.copy(ee.matrixWorld).invert(),tt[10]===-1)ee.projectionMatrix.copy(ae.projectionMatrix),ee.projectionMatrixInverse.copy(ae.projectionMatrixInverse);else{const $=rt+Ee,z=Ve+Ee,re=Re-De,pe=Pe+(Me-De),me=se*Ve/z*$,be=B*Ve/z*$;ee.projectionMatrix.makePerspective(re,pe,me,be,$,z),ee.projectionMatrixInverse.copy(ee.projectionMatrix).invert()}}function q(ee,ae){ae===null?ee.matrixWorld.copy(ee.matrix):ee.matrixWorld.multiplyMatrices(ae.matrixWorld,ee.matrix),ee.matrixWorldInverse.copy(ee.matrixWorld).invert()}this.updateCamera=function(ee){if(i===null)return;let ae=ee.near,ge=ee.far;x.texture!==null&&(x.depthNear>0&&(ae=x.depthNear),x.depthFar>0&&(ge=x.depthFar)),M.near=L.near=R.near=ae,M.far=L.far=R.far=ge,(T!==M.near||D!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),T=M.near,D=M.far);const Me=ee.parent,tt=M.cameras;q(M,Me);for(let He=0;He0&&(y.alphaTest.value=g.alphaTest);const b=e.get(g),_=b.envMap,S=b.envMapRotation;_&&(y.envMap.value=_,sc.copy(S),sc.x*=-1,sc.y*=-1,sc.z*=-1,_.isCubeTexture&&_.isRenderTargetTexture===!1&&(sc.y*=-1,sc.z*=-1),y.envMapRotation.value.setFromMatrix4(zce.makeRotationFromEuler(sc)),y.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=g.reflectivity,y.ior.value=g.ior,y.refractionRatio.value=g.refractionRatio),g.lightMap&&(y.lightMap.value=g.lightMap,y.lightMapIntensity.value=g.lightMapIntensity,n(g.lightMap,y.lightMapTransform)),g.aoMap&&(y.aoMap.value=g.aoMap,y.aoMapIntensity.value=g.aoMapIntensity,n(g.aoMap,y.aoMapTransform))}function s(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,g.map&&(y.map.value=g.map,n(g.map,y.mapTransform))}function a(y,g){y.dashSize.value=g.dashSize,y.totalSize.value=g.dashSize+g.gapSize,y.scale.value=g.scale}function l(y,g,b,_){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.size.value=g.size*b,y.scale.value=_*.5,g.map&&(y.map.value=g.map,n(g.map,y.uvTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,n(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function c(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.rotation.value=g.rotation,g.map&&(y.map.value=g.map,n(g.map,y.mapTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,n(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function u(y,g){y.specular.value.copy(g.specular),y.shininess.value=Math.max(g.shininess,1e-4)}function f(y,g){g.gradientMap&&(y.gradientMap.value=g.gradientMap)}function h(y,g){y.metalness.value=g.metalness,g.metalnessMap&&(y.metalnessMap.value=g.metalnessMap,n(g.metalnessMap,y.metalnessMapTransform)),y.roughness.value=g.roughness,g.roughnessMap&&(y.roughnessMap.value=g.roughnessMap,n(g.roughnessMap,y.roughnessMapTransform)),g.envMap&&(y.envMapIntensity.value=g.envMapIntensity)}function m(y,g,b){y.ior.value=g.ior,g.sheen>0&&(y.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),y.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(y.sheenColorMap.value=g.sheenColorMap,n(g.sheenColorMap,y.sheenColorMapTransform)),g.sheenRoughnessMap&&(y.sheenRoughnessMap.value=g.sheenRoughnessMap,n(g.sheenRoughnessMap,y.sheenRoughnessMapTransform))),g.clearcoat>0&&(y.clearcoat.value=g.clearcoat,y.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(y.clearcoatMap.value=g.clearcoatMap,n(g.clearcoatMap,y.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,n(g.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(y.clearcoatNormalMap.value=g.clearcoatNormalMap,n(g.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===fi&&y.clearcoatNormalScale.value.negate())),g.dispersion>0&&(y.dispersion.value=g.dispersion),g.iridescence>0&&(y.iridescence.value=g.iridescence,y.iridescenceIOR.value=g.iridescenceIOR,y.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(y.iridescenceMap.value=g.iridescenceMap,n(g.iridescenceMap,y.iridescenceMapTransform)),g.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=g.iridescenceThicknessMap,n(g.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),g.transmission>0&&(y.transmission.value=g.transmission,y.transmissionSamplerMap.value=b.texture,y.transmissionSamplerSize.value.set(b.width,b.height),g.transmissionMap&&(y.transmissionMap.value=g.transmissionMap,n(g.transmissionMap,y.transmissionMapTransform)),y.thickness.value=g.thickness,g.thicknessMap&&(y.thicknessMap.value=g.thicknessMap,n(g.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=g.attenuationDistance,y.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(y.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(y.anisotropyMap.value=g.anisotropyMap,n(g.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=g.specularIntensity,y.specularColor.value.copy(g.specularColor),g.specularColorMap&&(y.specularColorMap.value=g.specularColorMap,n(g.specularColorMap,y.specularColorMapTransform)),g.specularIntensityMap&&(y.specularIntensityMap.value=g.specularIntensityMap,n(g.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,g){g.matcap&&(y.matcap.value=g.matcap)}function x(y,g){const b=e.get(g).light;y.referencePosition.value.setFromMatrixPosition(b.matrixWorld),y.nearDistance.value=b.shadow.camera.near,y.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function Bce(t,e,n,r){let i={},o={},s=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,_){const S=_.program;r.uniformBlockBinding(b,S)}function c(b,_){let S=i[b.id];S===void 0&&(v(b),S=u(b),i[b.id]=S,b.addEventListener("dispose",y));const P=_.program;r.updateUBOMapping(b,P);const N=e.render.frame;o[b.id]!==N&&(h(b),o[b.id]=N)}function u(b){const _=f();b.__bindingPointIndex=_;const S=t.createBuffer(),P=b.__size,N=b.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,P,N),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,_,S),S}function f(){for(let b=0;b0&&(S+=P-N),b.__size=S,b.__cache={},this}function x(b){const _={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(_.boundary=4,_.storage=4):b.isVector2?(_.boundary=8,_.storage=8):b.isVector3||b.isColor?(_.boundary=16,_.storage=12):b.isVector4?(_.boundary=16,_.storage=16):b.isMatrix3?(_.boundary=48,_.storage=48):b.isMatrix4?(_.boundary=64,_.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),_}function y(b){const _=b.target;_.removeEventListener("dispose",y);const S=s.indexOf(_.__bindingPointIndex);s.splice(S,1),t.deleteBuffer(i[_.id]),delete i[_.id],delete o[_.id]}function g(){for(const b in i)t.deleteBuffer(i[b]);s=[],i={},o={}}return{bind:l,update:c,dispose:g}}class $U{constructor(e={}){const{canvas:n=RU(),context:r=null,depth:i=!0,stencil:o=!1,alpha:s=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let h;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=r.getContextAttributes().alpha}else h=s;const m=new Uint32Array(4),v=new Int32Array(4);let x=null,y=null;const g=[],b=[];this.domElement=n,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=Eo,this.toneMapping=ks,this.toneMappingExposure=1;const _=this;let S=!1,P=0,N=0,R=null,L=-1,U=null;const M=new Zt,T=new Zt;let D=null;const O=new ot(0);let j=0,X=n.width,H=n.height,Z=1,F=null,q=null;const K=new Zt(0,0,X,H),J=new Zt(0,0,X,H);let he=!1;const le=new yg;let ee=!1,ae=!1;const ge=new wt,Me=new wt,tt=new G,He=new Zt,rt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ve=!1;function se(){return R===null?Z:1}let B=r;function ye(V,ne){return n.getContext(V,ne)}try{const V={alpha:!0,depth:i,stencil:o,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Qb}`),n.addEventListener("webglcontextlost",Te,!1),n.addEventListener("webglcontextrestored",Ye,!1),n.addEventListener("webglcontextcreationerror",qe,!1),B===null){const ne="webgl2";if(B=ye(ne,V),B===null)throw ye(ne)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(V){throw console.error("THREE.WebGLRenderer: "+V.message),V}let xe,Re,Pe,Ee,De,$,z,re,pe,me,be,Ge,Fe,Ne,ze,Le,Xe,xt,Oe,Ue,Ae,ke,dt,Q;function je(){xe=new Gae(B),xe.init(),ke=new jU(B,xe),Re=new Bae(B,xe,e,ke),Pe=new Cce(B),Re.reverseDepthBuffer&&Pe.buffers.depth.setReversed(!0),Ee=new Yae(B),De=new hce,$=new Ice(B,xe,Pe,De,Re,ke,Ee),z=new Vae(_),re=new Hae(_),pe=new noe(B),dt=new zae(B,pe),me=new Xae(B,pe,Ee,dt),be=new Zae(B,me,pe,Ee),Oe=new Kae(B,Re,$),Le=new jae(De),Ge=new dce(_,z,re,xe,Re,dt,Le),Fe=new Uce(_,De),Ne=new mce,ze=new _ce(xe),xt=new Fae(_,z,re,Pe,be,h,l),Xe=new Mce(_,be,Re),Q=new Bce(B,Ee,Re,Pe),Ue=new Uae(B,xe,Ee),Ae=new qae(B,xe,Ee),Ee.programs=Ge.programs,_.capabilities=Re,_.extensions=xe,_.properties=De,_.renderLists=Ne,_.shadowMap=Xe,_.state=Pe,_.info=Ee}je();const fe=new Fce(_,B);this.xr=fe,this.getContext=function(){return B},this.getContextAttributes=function(){return B.getContextAttributes()},this.forceContextLoss=function(){const V=xe.get("WEBGL_lose_context");V&&V.loseContext()},this.forceContextRestore=function(){const V=xe.get("WEBGL_lose_context");V&&V.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(V){V!==void 0&&(Z=V,this.setSize(X,H,!1))},this.getSize=function(V){return V.set(X,H)},this.setSize=function(V,ne,ue=!0){if(fe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=V,H=ne,n.width=Math.floor(V*Z),n.height=Math.floor(ne*Z),ue===!0&&(n.style.width=V+"px",n.style.height=ne+"px"),this.setViewport(0,0,V,ne)},this.getDrawingBufferSize=function(V){return V.set(X*Z,H*Z).floor()},this.setDrawingBufferSize=function(V,ne,ue){X=V,H=ne,Z=ue,n.width=Math.floor(V*ue),n.height=Math.floor(ne*ue),this.setViewport(0,0,V,ne)},this.getCurrentViewport=function(V){return V.copy(M)},this.getViewport=function(V){return V.copy(K)},this.setViewport=function(V,ne,ue,de){V.isVector4?K.set(V.x,V.y,V.z,V.w):K.set(V,ne,ue,de),Pe.viewport(M.copy(K).multiplyScalar(Z).round())},this.getScissor=function(V){return V.copy(J)},this.setScissor=function(V,ne,ue,de){V.isVector4?J.set(V.x,V.y,V.z,V.w):J.set(V,ne,ue,de),Pe.scissor(T.copy(J).multiplyScalar(Z).round())},this.getScissorTest=function(){return he},this.setScissorTest=function(V){Pe.setScissorTest(he=V)},this.setOpaqueSort=function(V){F=V},this.setTransparentSort=function(V){q=V},this.getClearColor=function(V){return V.copy(xt.getClearColor())},this.setClearColor=function(){xt.setClearColor.apply(xt,arguments)},this.getClearAlpha=function(){return xt.getClearAlpha()},this.setClearAlpha=function(){xt.setClearAlpha.apply(xt,arguments)},this.clear=function(V=!0,ne=!0,ue=!0){let de=0;if(V){let oe=!1;if(R!==null){const We=R.texture.format;oe=We===o_||We===i_||We===pg}if(oe){const We=R.texture.type,it=We===Fi||We===Pa||We===Sd||We===su||We===n_||We===r_,lt=xt.getClearColor(),ct=xt.getClearAlpha(),St=lt.r,Et=lt.g,mt=lt.b;it?(m[0]=St,m[1]=Et,m[2]=mt,m[3]=ct,B.clearBufferuiv(B.COLOR,0,m)):(v[0]=St,v[1]=Et,v[2]=mt,v[3]=ct,B.clearBufferiv(B.COLOR,0,v))}else de|=B.COLOR_BUFFER_BIT}ne&&(de|=B.DEPTH_BUFFER_BIT,B.clearDepth(this.capabilities.reverseDepthBuffer?0:1)),ue&&(de|=B.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),B.clear(de)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Te,!1),n.removeEventListener("webglcontextrestored",Ye,!1),n.removeEventListener("webglcontextcreationerror",qe,!1),Ne.dispose(),ze.dispose(),De.dispose(),z.dispose(),re.dispose(),be.dispose(),dt.dispose(),Q.dispose(),Ge.dispose(),fe.dispose(),fe.removeEventListener("sessionstart",Dg),fe.removeEventListener("sessionend",Fg),qs.stop()};function Te(V){V.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function Ye(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;const V=Ee.autoReset,ne=Xe.enabled,ue=Xe.autoUpdate,de=Xe.needsUpdate,oe=Xe.type;je(),Ee.autoReset=V,Xe.enabled=ne,Xe.autoUpdate=ue,Xe.needsUpdate=de,Xe.type=oe}function qe(V){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",V.statusMessage)}function jt(V){const ne=V.target;ne.removeEventListener("dispose",jt),An(ne)}function An(V){kr(V),De.remove(V)}function kr(V){const ne=De.get(V).programs;ne!==void 0&&(ne.forEach(function(ue){Ge.releaseProgram(ue)}),V.isShaderMaterial&&Ge.releaseShaderCache(V))}this.renderBufferDirect=function(V,ne,ue,de,oe,We){ne===null&&(ne=rt);const it=oe.isMesh&&oe.matrixWorld.determinant()<0,lt=rw(V,ne,ue,de,oe);Pe.setMaterial(de,it);let ct=ue.index,St=1;if(de.wireframe===!0){if(ct=me.getWireframeAttribute(ue),ct===void 0)return;St=2}const Et=ue.drawRange,mt=ue.attributes.position;let Jt=Et.start*St,nn=(Et.start+Et.count)*St;We!==null&&(Jt=Math.max(Jt,We.start*St),nn=Math.min(nn,(We.start+We.count)*St)),ct!==null?(Jt=Math.max(Jt,0),nn=Math.min(nn,ct.count)):mt!=null&&(Jt=Math.max(Jt,0),nn=Math.min(nn,mt.count));const ln=nn-Jt;if(ln<0||ln===1/0)return;dt.setup(oe,de,lt,ue,ct);let $t,vt=Ue;if(ct!==null&&($t=pe.get(ct),vt=Ae,vt.setIndex($t)),oe.isMesh)de.wireframe===!0?(Pe.setLineWidth(de.wireframeLinewidth*se()),vt.setMode(B.LINES)):vt.setMode(B.TRIANGLES);else if(oe.isLine){let ft=de.linewidth;ft===void 0&&(ft=1),Pe.setLineWidth(ft*se()),oe.isLineSegments?vt.setMode(B.LINES):oe.isLineLoop?vt.setMode(B.LINE_LOOP):vt.setMode(B.LINE_STRIP)}else oe.isPoints?vt.setMode(B.POINTS):oe.isSprite&&vt.setMode(B.TRIANGLES);if(oe.isBatchedMesh)if(oe._multiDrawInstances!==null)vt.renderMultiDrawInstances(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount,oe._multiDrawInstances);else if(xe.get("WEBGL_multi_draw"))vt.renderMultiDraw(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount);else{const ft=oe._multiDrawStarts,Kt=oe._multiDrawCounts,Pt=oe._multiDrawCount,rr=ct?pe.get(ct).bytesPerElement:1,Ui=De.get(de).currentProgram.getUniforms();for(let gn=0;gn{function We(){if(de.forEach(function(it){De.get(it).currentProgram.isReady()&&de.delete(it)}),de.size===0){oe(V);return}setTimeout(We,10)}xe.get("KHR_parallel_shader_compile")!==null?We():setTimeout(We,10)})};let Mr=null;function co(V){Mr&&Mr(V)}function Dg(){qs.stop()}function Fg(){qs.start()}const qs=new DU;qs.setAnimationLoop(co),typeof self<"u"&&qs.setContext(self),this.setAnimationLoop=function(V){Mr=V,fe.setAnimationLoop(V),V===null?qs.stop():qs.start()},fe.addEventListener("sessionstart",Dg),fe.addEventListener("sessionend",Fg),this.render=function(V,ne){if(ne!==void 0&&ne.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;if(V.matrixWorldAutoUpdate===!0&&V.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),fe.enabled===!0&&fe.isPresenting===!0&&(fe.cameraAutoUpdate===!0&&fe.updateCamera(ne),ne=fe.getCamera()),V.isScene===!0&&V.onBeforeRender(_,V,ne,R),y=ze.get(V,b.length),y.init(ne),b.push(y),Me.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),le.setFromProjectionMatrix(Me),ae=this.localClippingEnabled,ee=Le.init(this.clippingPlanes,ae),x=Ne.get(V,g.length),x.init(),g.push(x),fe.enabled===!0&&fe.isPresenting===!0){const We=_.xr.getDepthSensingMesh();We!==null&&Cu(We,ne,-1/0,_.sortObjects)}Cu(V,ne,0,_.sortObjects),x.finish(),_.sortObjects===!0&&x.sort(F,q),Ve=fe.enabled===!1||fe.isPresenting===!1||fe.hasDepthSensing()===!1,Ve&&xt.addToRenderList(x,V),this.info.render.frame++,ee===!0&&Le.beginShadows();const ue=y.state.shadowsArray;Xe.render(ue,V,ne),ee===!0&&Le.endShadows(),this.info.autoReset===!0&&this.info.reset();const de=x.opaque,oe=x.transmissive;if(y.setupLights(),ne.isArrayCamera){const We=ne.cameras;if(oe.length>0)for(let it=0,lt=We.length;it0&&zg(de,oe,V,ne),Ve&&xt.render(V),Tu(x,V,ne);R!==null&&($.updateMultisampleRenderTarget(R),$.updateRenderTargetMipmap(R)),V.isScene===!0&&V.onAfterRender(_,V,ne),dt.resetDefaultState(),L=-1,U=null,b.pop(),b.length>0?(y=b[b.length-1],ee===!0&&Le.setGlobalState(_.clippingPlanes,y.state.camera)):y=null,g.pop(),g.length>0?x=g[g.length-1]:x=null};function Cu(V,ne,ue,de){if(V.visible===!1)return;if(V.layers.test(ne.layers)){if(V.isGroup)ue=V.renderOrder;else if(V.isLOD)V.autoUpdate===!0&&V.update(ne);else if(V.isLight)y.pushLight(V),V.castShadow&&y.pushShadow(V);else if(V.isSprite){if(!V.frustumCulled||le.intersectsSprite(V)){de&&He.setFromMatrixPosition(V.matrixWorld).applyMatrix4(Me);const it=be.update(V),lt=V.material;lt.visible&&x.push(V,it,lt,ue,He.z,null)}}else if((V.isMesh||V.isLine||V.isPoints)&&(!V.frustumCulled||le.intersectsObject(V))){const it=be.update(V),lt=V.material;if(de&&(V.boundingSphere!==void 0?(V.boundingSphere===null&&V.computeBoundingSphere(),He.copy(V.boundingSphere.center)):(it.boundingSphere===null&&it.computeBoundingSphere(),He.copy(it.boundingSphere.center)),He.applyMatrix4(V.matrixWorld).applyMatrix4(Me)),Array.isArray(lt)){const ct=it.groups;for(let St=0,Et=ct.length;St0&&ds(oe,ne,ue),We.length>0&&ds(We,ne,ue),it.length>0&&ds(it,ne,ue),Pe.buffers.depth.setTest(!0),Pe.buffers.depth.setMask(!0),Pe.buffers.color.setMask(!0),Pe.setPolygonOffset(!1)}function zg(V,ne,ue,de){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;y.state.transmissionRenderTarget[de.id]===void 0&&(y.state.transmissionRenderTarget[de.id]=new is(1,1,{generateMipmaps:!0,type:xe.has("EXT_color_buffer_half_float")||xe.has("EXT_color_buffer_float")?vu:Fi,minFilter:Cs,samples:4,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:an.workingColorSpace}));const We=y.state.transmissionRenderTarget[de.id],it=de.viewport||M;We.setSize(it.z,it.w);const lt=_.getRenderTarget();_.setRenderTarget(We),_.getClearColor(O),j=_.getClearAlpha(),j<1&&_.setClearColor(16777215,.5),_.clear(),Ve&&xt.render(ue);const ct=_.toneMapping;_.toneMapping=ks;const St=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),y.setupLightsView(de),ee===!0&&Le.setGlobalState(_.clippingPlanes,de),ds(V,ue,de),$.updateMultisampleRenderTarget(We),$.updateRenderTargetMipmap(We),xe.has("WEBGL_multisampled_render_to_texture")===!1){let Et=!1;for(let mt=0,Jt=ne.length;mt0),mt=!!ue.morphAttributes.position,Jt=!!ue.morphAttributes.normal,nn=!!ue.morphAttributes.color;let ln=ks;de.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(ln=_.toneMapping);const $t=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,vt=$t!==void 0?$t.length:0,ft=De.get(de),Kt=y.state.lights;if(ee===!0&&(ae===!0||V!==U)){const Kr=V===U&&de.id===L;Le.setState(de,V,Kr)}let Pt=!1;de.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==Kt.state.version||ft.outputColorSpace!==lt||oe.isBatchedMesh&&ft.batching===!1||!oe.isBatchedMesh&&ft.batching===!0||oe.isBatchedMesh&&ft.batchingColor===!0&&oe.colorTexture===null||oe.isBatchedMesh&&ft.batchingColor===!1&&oe.colorTexture!==null||oe.isInstancedMesh&&ft.instancing===!1||!oe.isInstancedMesh&&ft.instancing===!0||oe.isSkinnedMesh&&ft.skinning===!1||!oe.isSkinnedMesh&&ft.skinning===!0||oe.isInstancedMesh&&ft.instancingColor===!0&&oe.instanceColor===null||oe.isInstancedMesh&&ft.instancingColor===!1&&oe.instanceColor!==null||oe.isInstancedMesh&&ft.instancingMorph===!0&&oe.morphTexture===null||oe.isInstancedMesh&&ft.instancingMorph===!1&&oe.morphTexture!==null||ft.envMap!==ct||de.fog===!0&&ft.fog!==We||ft.numClippingPlanes!==void 0&&(ft.numClippingPlanes!==Le.numPlanes||ft.numIntersection!==Le.numIntersection)||ft.vertexAlphas!==St||ft.vertexTangents!==Et||ft.morphTargets!==mt||ft.morphNormals!==Jt||ft.morphColors!==nn||ft.toneMapping!==ln||ft.morphTargetsCount!==vt)&&(Pt=!0):(Pt=!0,ft.__version=de.version);let rr=ft.currentProgram;Pt===!0&&(rr=Ru(de,ne,oe));let Ui=!1,gn=!1,Fa=!1;const Mn=rr.getUniforms(),Uo=ft.uniforms;if(Pe.useProgram(rr.program)&&(Ui=!0,gn=!0,Fa=!0),de.id!==L&&(L=de.id,gn=!0),Ui||U!==V){Re.reverseDepthBuffer?(ge.copy(V.projectionMatrix),Cie(ge),Tie(ge),Mn.setValue(B,"projectionMatrix",ge)):Mn.setValue(B,"projectionMatrix",V.projectionMatrix),Mn.setValue(B,"viewMatrix",V.matrixWorldInverse);const Kr=Mn.map.cameraPosition;Kr!==void 0&&Kr.setValue(B,tt.setFromMatrixPosition(V.matrixWorld)),Re.logarithmicDepthBuffer&&Mn.setValue(B,"logDepthBufFC",2/(Math.log(V.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&Mn.setValue(B,"isOrthographic",V.isOrthographicCamera===!0),U!==V&&(U=V,gn=!0,Fa=!0)}if(oe.isSkinnedMesh){Mn.setOptional(B,oe,"bindMatrix"),Mn.setOptional(B,oe,"bindMatrixInverse");const Kr=oe.skeleton;Kr&&(Kr.boneTexture===null&&Kr.computeBoneTexture(),Mn.setValue(B,"boneTexture",Kr.boneTexture,$))}oe.isBatchedMesh&&(Mn.setOptional(B,oe,"batchingTexture"),Mn.setValue(B,"batchingTexture",oe._matricesTexture,$),Mn.setOptional(B,oe,"batchingIdTexture"),Mn.setValue(B,"batchingIdTexture",oe._indirectTexture,$),Mn.setOptional(B,oe,"batchingColorTexture"),oe._colorsTexture!==null&&Mn.setValue(B,"batchingColorTexture",oe._colorsTexture,$));const za=ue.morphAttributes;if((za.position!==void 0||za.normal!==void 0||za.color!==void 0)&&Oe.update(oe,ue,rr),(gn||ft.receiveShadow!==oe.receiveShadow)&&(ft.receiveShadow=oe.receiveShadow,Mn.setValue(B,"receiveShadow",oe.receiveShadow)),de.isMeshGouraudMaterial&&de.envMap!==null&&(Uo.envMap.value=ct,Uo.flipEnvMap.value=ct.isCubeTexture&&ct.isRenderTargetTexture===!1?-1:1),de.isMeshStandardMaterial&&de.envMap===null&&ne.environment!==null&&(Uo.envMapIntensity.value=ne.environmentIntensity),gn&&(Mn.setValue(B,"toneMappingExposure",_.toneMappingExposure),ft.needsLights&&iw(Uo,Fa),We&&de.fog===!0&&Fe.refreshFogUniforms(Uo,We),Fe.refreshMaterialUniforms(Uo,de,Z,H,y.state.transmissionRenderTarget[V.id]),By.upload(B,Bg(ft),Uo,$)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(By.upload(B,Bg(ft),Uo,$),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&Mn.setValue(B,"center",oe.center),Mn.setValue(B,"modelViewMatrix",oe.modelViewMatrix),Mn.setValue(B,"normalMatrix",oe.normalMatrix),Mn.setValue(B,"modelMatrix",oe.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const Kr=de.uniformsGroups;for(let Zr=0,sw=Kr.length;Zr0&&$.useMultisampledRTT(V)===!1?oe=De.get(V).__webglMultisampledFramebuffer:Array.isArray(Et)?oe=Et[ue]:oe=Et,M.copy(V.viewport),T.copy(V.scissor),D=V.scissorTest}else M.copy(K).multiplyScalar(Z).floor(),T.copy(J).multiplyScalar(Z).floor(),D=he;if(Pe.bindFramebuffer(B.FRAMEBUFFER,oe)&&de&&Pe.drawBuffers(V,oe),Pe.viewport(M),Pe.scissor(T),Pe.setScissorTest(D),We){const ct=De.get(V.texture);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_CUBE_MAP_POSITIVE_X+ne,ct.__webglTexture,ue)}else if(it){const ct=De.get(V.texture),St=ne||0;B.framebufferTextureLayer(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,ct.__webglTexture,ue||0,St)}L=-1},this.readRenderTargetPixels=function(V,ne,ue,de,oe,We,it){if(!(V&&V.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let lt=De.get(V).__webglFramebuffer;if(V.isWebGLCubeRenderTarget&&it!==void 0&&(lt=lt[it]),lt){Pe.bindFramebuffer(B.FRAMEBUFFER,lt);try{const ct=V.texture,St=ct.format,Et=ct.type;if(!Re.textureFormatReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Re.textureTypeReadable(Et)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=V.width-de&&ue>=0&&ue<=V.height-oe&&B.readPixels(ne,ue,de,oe,ke.convert(St),ke.convert(Et),We)}finally{const ct=R!==null?De.get(R).__webglFramebuffer:null;Pe.bindFramebuffer(B.FRAMEBUFFER,ct)}}},this.readRenderTargetPixelsAsync=async function(V,ne,ue,de,oe,We,it){if(!(V&&V.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let lt=De.get(V).__webglFramebuffer;if(V.isWebGLCubeRenderTarget&&it!==void 0&&(lt=lt[it]),lt){const ct=V.texture,St=ct.format,Et=ct.type;if(!Re.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Re.textureTypeReadable(Et))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(ne>=0&&ne<=V.width-de&&ue>=0&&ue<=V.height-oe){Pe.bindFramebuffer(B.FRAMEBUFFER,lt);const mt=B.createBuffer();B.bindBuffer(B.PIXEL_PACK_BUFFER,mt),B.bufferData(B.PIXEL_PACK_BUFFER,We.byteLength,B.STREAM_READ),B.readPixels(ne,ue,de,oe,ke.convert(St),ke.convert(Et),0);const Jt=R!==null?De.get(R).__webglFramebuffer:null;Pe.bindFramebuffer(B.FRAMEBUFFER,Jt);const nn=B.fenceSync(B.SYNC_GPU_COMMANDS_COMPLETE,0);return B.flush(),await Eie(B,nn,4),B.bindBuffer(B.PIXEL_PACK_BUFFER,mt),B.getBufferSubData(B.PIXEL_PACK_BUFFER,0,We),B.deleteBuffer(mt),B.deleteSync(nn),We}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(V,ne=null,ue=0){V.isTexture!==!0&&(Uy("WebGLRenderer: copyFramebufferToTexture function signature has changed."),ne=arguments[0]||null,V=arguments[1]);const de=Math.pow(2,-ue),oe=Math.floor(V.image.width*de),We=Math.floor(V.image.height*de),it=ne!==null?ne.x:0,lt=ne!==null?ne.y:0;$.setTexture2D(V,0),B.copyTexSubImage2D(B.TEXTURE_2D,ue,0,0,it,lt,oe,We),Pe.unbindTexture()},this.copyTextureToTexture=function(V,ne,ue=null,de=null,oe=0){V.isTexture!==!0&&(Uy("WebGLRenderer: copyTextureToTexture function signature has changed."),de=arguments[0]||null,V=arguments[1],ne=arguments[2],oe=arguments[3]||0,ue=null);let We,it,lt,ct,St,Et;ue!==null?(We=ue.max.x-ue.min.x,it=ue.max.y-ue.min.y,lt=ue.min.x,ct=ue.min.y):(We=V.image.width,it=V.image.height,lt=0,ct=0),de!==null?(St=de.x,Et=de.y):(St=0,Et=0);const mt=ke.convert(ne.format),Jt=ke.convert(ne.type);$.setTexture2D(ne,0),B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,ne.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ne.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,ne.unpackAlignment);const nn=B.getParameter(B.UNPACK_ROW_LENGTH),ln=B.getParameter(B.UNPACK_IMAGE_HEIGHT),$t=B.getParameter(B.UNPACK_SKIP_PIXELS),vt=B.getParameter(B.UNPACK_SKIP_ROWS),ft=B.getParameter(B.UNPACK_SKIP_IMAGES),Kt=V.isCompressedTexture?V.mipmaps[oe]:V.image;B.pixelStorei(B.UNPACK_ROW_LENGTH,Kt.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Kt.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,lt),B.pixelStorei(B.UNPACK_SKIP_ROWS,ct),V.isDataTexture?B.texSubImage2D(B.TEXTURE_2D,oe,St,Et,We,it,mt,Jt,Kt.data):V.isCompressedTexture?B.compressedTexSubImage2D(B.TEXTURE_2D,oe,St,Et,Kt.width,Kt.height,mt,Kt.data):B.texSubImage2D(B.TEXTURE_2D,oe,St,Et,We,it,mt,Jt,Kt),B.pixelStorei(B.UNPACK_ROW_LENGTH,nn),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,ln),B.pixelStorei(B.UNPACK_SKIP_PIXELS,$t),B.pixelStorei(B.UNPACK_SKIP_ROWS,vt),B.pixelStorei(B.UNPACK_SKIP_IMAGES,ft),oe===0&&ne.generateMipmaps&&B.generateMipmap(B.TEXTURE_2D),Pe.unbindTexture()},this.copyTextureToTexture3D=function(V,ne,ue=null,de=null,oe=0){V.isTexture!==!0&&(Uy("WebGLRenderer: copyTextureToTexture3D function signature has changed."),ue=arguments[0]||null,de=arguments[1]||null,V=arguments[2],ne=arguments[3],oe=arguments[4]||0);let We,it,lt,ct,St,Et,mt,Jt,nn;const ln=V.isCompressedTexture?V.mipmaps[oe]:V.image;ue!==null?(We=ue.max.x-ue.min.x,it=ue.max.y-ue.min.y,lt=ue.max.z-ue.min.z,ct=ue.min.x,St=ue.min.y,Et=ue.min.z):(We=ln.width,it=ln.height,lt=ln.depth,ct=0,St=0,Et=0),de!==null?(mt=de.x,Jt=de.y,nn=de.z):(mt=0,Jt=0,nn=0);const $t=ke.convert(ne.format),vt=ke.convert(ne.type);let ft;if(ne.isData3DTexture)$.setTexture3D(ne,0),ft=B.TEXTURE_3D;else if(ne.isDataArrayTexture||ne.isCompressedArrayTexture)$.setTexture2DArray(ne,0),ft=B.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,ne.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ne.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,ne.unpackAlignment);const Kt=B.getParameter(B.UNPACK_ROW_LENGTH),Pt=B.getParameter(B.UNPACK_IMAGE_HEIGHT),rr=B.getParameter(B.UNPACK_SKIP_PIXELS),Ui=B.getParameter(B.UNPACK_SKIP_ROWS),gn=B.getParameter(B.UNPACK_SKIP_IMAGES);B.pixelStorei(B.UNPACK_ROW_LENGTH,ln.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,ln.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,ct),B.pixelStorei(B.UNPACK_SKIP_ROWS,St),B.pixelStorei(B.UNPACK_SKIP_IMAGES,Et),V.isDataTexture||V.isData3DTexture?B.texSubImage3D(ft,oe,mt,Jt,nn,We,it,lt,$t,vt,ln.data):ne.isCompressedArrayTexture?B.compressedTexSubImage3D(ft,oe,mt,Jt,nn,We,it,lt,$t,ln.data):B.texSubImage3D(ft,oe,mt,Jt,nn,We,it,lt,$t,vt,ln),B.pixelStorei(B.UNPACK_ROW_LENGTH,Kt),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Pt),B.pixelStorei(B.UNPACK_SKIP_PIXELS,rr),B.pixelStorei(B.UNPACK_SKIP_ROWS,Ui),B.pixelStorei(B.UNPACK_SKIP_IMAGES,gn),oe===0&&ne.generateMipmaps&&B.generateMipmap(ft),Pe.unbindTexture()},this.initRenderTarget=function(V){De.get(V).__webglFramebuffer===void 0&&$.setupRenderTarget(V)},this.initTexture=function(V){V.isCubeTexture?$.setTextureCube(V,0):V.isData3DTexture?$.setTexture3D(V,0):V.isDataArrayTexture||V.isCompressedArrayTexture?$.setTexture2DArray(V,0):$.setTexture2D(V,0),Pe.unbindTexture()},this.resetState=function(){P=0,N=0,R=null,Pe.reset(),dt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ts}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===a_?"display-p3":"srgb",n.unpackColorSpace=an.workingColorSpace===mg?"display-p3":"srgb"}}class u_{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new ot(e),this.density=n}clone(){return new u_(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class f_{constructor(e,n=1,r=1e3){this.isFog=!0,this.name="",this.color=new ot(e),this.near=n,this.far=r}clone(){return new f_(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class hx extends tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ro,this.environmentIntensity=1,this.environmentRotation=new ro,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class d_{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=Pm,this.updateRanges=[],this.version=0,this.uuid=eo()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;ie.far||n.push({distance:l,point:Kh.clone(),uv:Mi.getInterpolation(Kh,Av,Jh,Pv,wL,IM,SL,new Ie),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Nv(t,e,n,r,i,o){df.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(Zh.x=o*df.x-i*df.y,Zh.y=i*df.x+o*df.y):Zh.copy(df),t.copy(e),t.x+=Zh.x,t.y+=Zh.y,t.applyMatrix4(WU)}const Iv=new G,ML=new G;class GU extends tn{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 n=e.levels;for(let r=0,i=n.length;r0){let r,i;for(r=1,i=n.length;r0){Iv.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Iv);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){Iv.setFromMatrixPosition(e.matrixWorld),ML.setFromMatrixPosition(this.matrixWorld);const r=Iv.distanceTo(ML)/e.zoom;n[0].object.visible=!0;let i,o;for(i=1,o=n.length;i=s)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;i=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});const s=i[this.index];o.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=n,s.index=r}reset(){this.list.length=0,this.index=0}}const il=new wt,OM=new wt,Xce=new wt,qce=new ot(1,1,1),LL=new wt,DM=new yg,Ov=new Pr,ac=new qr,tp=new G,kL=new G,Yce=new G,FM=new Gce,$r=new nr,Dv=[];function Kce(t,e,n=0){const r=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const i=t.count;for(let o=0;o65535?new Uint32Array(i):new Uint16Array(i);n.setIndex(new hn(o,1))}this._geometryInitialized=!0}}_validateGeometry(e){const n=this.geometry;if(!!e.getIndex()!=!!n.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in n.attributes){if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),o=n.getAttribute(r);if(i.itemSize!==o.itemSize||i.normalized!==o.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Pr);const e=this.boundingBox,n=this._drawInfo;e.makeEmpty();for(let r=0,i=n.length;r=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("BatchedMesh: Maximum item count reached.");const r={visible:!0,active:!0,geometryIndex:e};let i=null;this._availableInstanceIds.length>0?(i=this._availableInstanceIds.pop(),this._drawInfo[i]=r):(i=this._drawInfo.length,this._drawInfo.push(r));const o=this._matricesTexture,s=o.image.data;Xce.toArray(s,i*16),o.needsUpdate=!0;const a=this._colorsTexture;return a&&(qce.toArray(a.image.data,i*4),a.needsUpdate=!0),i}addGeometry(e,n=-1,r=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let o=null;const s=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(o=s[s.length-1]),n===-1?i.vertexCount=e.getAttribute("position").count:i.vertexCount=n,o===null?i.vertexStart=0:i.vertexStart=o.vertexStart+o.vertexCount;const c=e.getIndex(),u=c!==null;if(u&&(r===-1?i.indexCount=c.count:i.indexCount=r,o===null?i.indexStart=0:i.indexStart=o.indexStart+o.indexCount),i.indexStart!==-1&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const f=this._geometryCount;return this._geometryCount++,s.push(i),a.push({start:u?i.indexStart:i.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Pr,sphereInitialized:!1,sphere:new qr}),this.setGeometryAt(f,e),f}setGeometryAt(e,n){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(n);const r=this.geometry,i=r.getIndex()!==null,o=r.getIndex(),s=n.getIndex(),a=this._reservedRanges[e];if(i&&s.count>a.indexCount||n.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const m in r.attributes){const v=n.getAttribute(m),x=r.getAttribute(m);Kce(v,x,l);const y=v.itemSize;for(let g=v.count,b=c;g=n.length||n[e].active===!1?this:(n[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this)}getBoundingBoxAt(e,n){if(e>=this._geometryCount)return null;const r=this._bounds[e],i=r.box,o=this.geometry;if(r.boxInitialized===!1){i.makeEmpty();const s=o.index,a=o.attributes.position,l=this._drawRanges[e];for(let c=l.start,u=l.start+l.count;c=this._geometryCount)return null;const r=this._bounds[e],i=r.sphere,o=this.geometry;if(r.sphereInitialized===!1){i.makeEmpty(),this.getBoundingBoxAt(e,Ov),Ov.getCenter(i.center);const s=o.index,a=o.attributes.position,l=this._drawRanges[e];let c=0;for(let u=l.start,f=l.start+l.count;u=r.length||r[e].active===!1?this:(n.toArray(o,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,n){const r=this._drawInfo,i=this._matricesTexture.image.data;return e>=r.length||r[e].active===!1?null:n.fromArray(i,e*16)}setColorAt(e,n){this._colorsTexture===null&&this._initColorsTexture();const r=this._colorsTexture,i=this._colorsTexture.image.data,o=this._drawInfo;return e>=o.length||o[e].active===!1?this:(n.toArray(i,e*4),r.needsUpdate=!0,this)}getColorAt(e,n){const r=this._colorsTexture.image.data,i=this._drawInfo;return e>=i.length||i[e].active===!1?null:n.fromArray(r,e*4)}setVisibleAt(e,n){const r=this._drawInfo;return e>=r.length||r[e].active===!1||r[e].visible===n?this:(r[e].visible=n,this._visibilityChanged=!0,this)}getVisibleAt(e){const n=this._drawInfo;return e>=n.length||n[e].active===!1?!1:n[e].visible}setGeometryIdAt(e,n){const r=this._drawInfo;return e>=r.length||r[e].active===!1||n<0||n>=this._geometryCount?null:(r[e].geometryIndex=n,this)}getGeometryIdAt(e){const n=this._drawInfo;return e>=n.length||n[e].active===!1?-1:n[e].geometryIndex}getGeometryRangeAt(e,n={}){if(e<0||e>=this._geometryCount)return null;const r=this._drawRanges[e];return n.start=r.start,n.count=r.count,n}raycast(e,n){const r=this._drawInfo,i=this._drawRanges,o=this.matrixWorld,s=this.geometry;$r.material=this.material,$r.geometry.index=s.index,$r.geometry.attributes=s.attributes,$r.geometry.boundingBox===null&&($r.geometry.boundingBox=new Pr),$r.geometry.boundingSphere===null&&($r.geometry.boundingSphere=new qr);for(let a=0,l=r.length;a({...n})),this._reservedRanges=e._reservedRanges.map(n=>({...n})),this._drawInfo=e._drawInfo.map(n=>({...n})),this._bounds=e._bounds.map(n=>({boxInitialized:n.boxInitialized,box:n.box.clone(),sphereInitialized:n.sphereInitialized,sphere:n.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,n,r,i,o){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=i.getIndex(),a=s===null?1:s.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._drawRanges,h=this.perObjectFrustumCulled,m=this._indirectTexture,v=m.image.data;h&&(LL.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),DM.setFromProjectionMatrix(LL,e.coordinateSystem));let x=0;if(this.sortObjects){OM.copy(this.matrixWorld).invert(),tp.setFromMatrixPosition(r.matrixWorld).applyMatrix4(OM),kL.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(OM);for(let b=0,_=l.length;b<_;b++)if(l[b].visible&&l[b].active){const S=l[b].geometryIndex;this.getMatrixAt(b,il),this.getBoundingSphereAt(S,ac).applyMatrix4(il);let P=!1;if(h&&(P=!DM.intersectsSphere(ac)),!P){const N=Yce.subVectors(ac.center,tp).dot(kL);FM.push(f[S],N,b)}}const y=FM.list,g=this.customSort;g===null?y.sort(o.transparent?Hce:Wce):g.call(this,y,r);for(let b=0,_=y.length;b<_;b++){const S=y[b];c[x]=S.start*a,u[x]=S.count,v[x]=S.index,x++}FM.reset()}else for(let y=0,g=l.length;y0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;or)return;zM.applyMatrix4(t.matrixWorld);const l=e.ray.origin.distanceTo(zM);if(!(le.far))return{distance:l,point:DL.clone().applyMatrix4(t.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:t}}const FL=new G,zL=new G;class Gs extends Na{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;oi.far)return;o.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class Zce extends kn{constructor(e,n,r,i,o,s,a,l,c){super(e,n,r,i,o,s,a,l,c),this.isVideoTexture=!0,this.minFilter=s!==void 0?s:tr,this.magFilter=o!==void 0?o:tr,this.generateMipmaps=!1;const u=this;function f(){u.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Jce extends kn{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=lr,this.minFilter=lr,this.generateMipmaps=!1,this.needsUpdate=!0}}class p_ extends kn{constructor(e,n,r,i,o,s,a,l,c,u,f,h){super(null,s,a,l,c,u,i,o,f,h),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Qce extends p_{constructor(e,n,r,i,o,s){super(e,n,r,o,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ti,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class eue extends p_{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,Aa),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class tue extends kn{constructor(e,n,r,i,o,s,a,l,c){super(e,n,r,i,o,s,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class cs{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,n){const r=this.getUtoTmapping(e);return this.getPoint(r,n)}getPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return n}getSpacedPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n}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 n=[];let r,i=this.getPoint(0),o=0;n.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),o+=r.distanceTo(i),n.push(o),i=r;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n){const r=this.getLengths();let i=0;const o=r.length;let s;n?s=n:s=e*r[o-1];let a=0,l=o-1,c;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),c=r[i]-s,c<0)a=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,r[i]===s)return i/(o-1);const u=r[i],h=r[i+1]-u,m=(s-u)/h;return(i+m)/(o-1)}getTangent(e,n){let i=e-1e-4,o=e+1e-4;i<0&&(i=0),o>1&&(o=1);const s=this.getPoint(i),a=this.getPoint(o),l=n||(s.isVector2?new Ie:new G);return l.copy(a).sub(s).normalize(),l}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n){const r=new G,i=[],o=[],s=[],a=new G,l=new wt;for(let m=0;m<=e;m++){const v=m/e;i[m]=this.getTangentAt(v,new G)}o[0]=new G,s[0]=new G;let c=Number.MAX_VALUE;const u=Math.abs(i[0].x),f=Math.abs(i[0].y),h=Math.abs(i[0].z);u<=c&&(c=u,r.set(1,0,0)),f<=c&&(c=f,r.set(0,1,0)),h<=c&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),o[0].crossVectors(i[0],a),s[0].crossVectors(i[0],o[0]);for(let m=1;m<=e;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(i[m-1],i[m]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos($n(i[m-1].dot(i[m]),-1,1));o[m].applyMatrix4(l.makeRotationAxis(a,v))}s[m].crossVectors(i[m],o[m])}if(n===!0){let m=Math.acos($n(o[0].dot(o[e]),-1,1));m/=e,i[0].dot(a.crossVectors(o[0],o[e]))>0&&(m=-m);for(let v=1;v<=e;v++)o[v].applyMatrix4(l.makeRotationAxis(i[v],m*v)),s[v].crossVectors(i[v],o[v])}return{tangents:i,normals:o,binormals:s}}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 m_ extends cs{constructor(e=0,n=0,r=1,i=1,o=0,s=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=r,this.yRadius=i,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(e,n=new Ie){const r=n,i=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)i;)o-=i;o0?0:(Math.floor(Math.abs(a)/o)+1)*o:l===0&&a===o-1&&(a=o-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%o]:(jv.subVectors(i[0],i[1]).add(i[0]),c=jv);const f=i[a%o],h=i[(a+1)%o];if(this.closed||a+2i.length-2?i.length-1:s+1],f=i[s>i.length-3?i.length-1:s+2];return r.set(jL(a,l.x,c.x,u.x,f.x),jL(a,l.y,c.y,u.y,f.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n=r){const s=i[o]-r,a=this.curves[o],l=a.getLength(),c=l===0?0:1-s/l;return a.getPointAt(c,n)}o++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let r=0,i=this.curves.length;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,r=e.curves.length;n0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),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 bg extends Ut{constructor(e=[new Ie(0,-.5),new Ie(.5,0),new Ie(0,.5)],n=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:r,phiLength:i},n=Math.floor(n),i=$n(i,0,Math.PI*2);const o=[],s=[],a=[],l=[],c=[],u=1/n,f=new G,h=new Ie,m=new G,v=new G,x=new G;let y=0,g=0;for(let b=0;b<=e.length-1;b++)switch(b){case 0:y=e[b+1].x-e[b].x,g=e[b+1].y-e[b].y,m.x=g*1,m.y=-y,m.z=g*0,x.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(x.x,x.y,x.z);break;default:y=e[b+1].x-e[b].x,g=e[b+1].y-e[b].y,m.x=g*1,m.y=-y,m.z=g*0,v.copy(m),m.x+=x.x,m.y+=x.y,m.z+=x.z,m.normalize(),l.push(m.x,m.y,m.z),x.copy(v)}for(let b=0;b<=n;b++){const _=r+b*u*i,S=Math.sin(_),P=Math.cos(_);for(let N=0;N<=e.length-1;N++){f.x=e[N].x*S,f.y=e[N].y,f.z=e[N].x*P,s.push(f.x,f.y,f.z),h.x=b/n,h.y=N/(e.length-1),a.push(h.x,h.y);const R=l[3*N+0]*S,L=l[3*N+1],U=l[3*N+0]*P;c.push(R,L,U)}}for(let b=0;b0&&_(!0),n>0&&_(!1)),this.setIndex(u),this.setAttribute("position",new pt(f,3)),this.setAttribute("normal",new pt(h,3)),this.setAttribute("uv",new pt(m,2));function b(){const S=new G,P=new G;let N=0;const R=(n-e)/r;for(let L=0;L<=o;L++){const U=[],M=L/o,T=M*(n-e)+e;for(let D=0;D<=i;D++){const O=D/i,j=O*l+a,X=Math.sin(j),H=Math.cos(j);P.x=T*X,P.y=-M*r+y,P.z=T*H,f.push(P.x,P.y,P.z),S.set(X,R,H).normalize(),h.push(S.x,S.y,S.z),m.push(O,1-M),U.push(v++)}x.push(U)}for(let L=0;L0&&(u.push(M,T,O),N+=3),n>0&&(u.push(T,D,O),N+=3)}c.addGroup(g,N,0),g+=N}function _(S){const P=v,N=new Ie,R=new G;let L=0;const U=S===!0?e:n,M=S===!0?1:-1;for(let D=1;D<=i;D++)f.push(0,y*M,0),h.push(0,M,0),m.push(.5,.5),v++;const T=v;for(let D=0;D<=i;D++){const j=D/i*l+a,X=Math.cos(j),H=Math.sin(j);R.x=U*H,R.y=y*M,R.z=U*X,f.push(R.x,R.y,R.z),h.push(0,M,0),N.x=X*.5+.5,N.y=H*.5*M+.5,m.push(N.x,N.y),v++}for(let D=0;D.9&&R<.1&&(_<.2&&(s[b+0]+=1),S<.2&&(s[b+2]+=1),P<.2&&(s[b+4]+=1))}}function h(b){o.push(b.x,b.y,b.z)}function m(b,_){const S=b*3;_.x=e[S+0],_.y=e[S+1],_.z=e[S+2]}function v(){const b=new G,_=new G,S=new G,P=new G,N=new Ie,R=new Ie,L=new Ie;for(let U=0,M=0;U80*n){a=c=t[0],l=u=t[1];for(let v=n;vc&&(c=f),h>u&&(u=h);m=Math.max(c-a,u-l),m=m!==0?32767/m:0}return km(o,s,n,a,l,m,0),s}};function iB(t,e,n,r,i){let o,s;if(i===Eue(t,e,n,r)>0)for(o=e;o=e;o-=r)s=VL(o,t[o],t[o+1],s);return s&&b_(s,s.next)&&(Dm(s),s=s.next),s}function cu(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(b_(n,n.next)||In(n.prev,n,n.next)===0)){if(Dm(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function km(t,e,n,r,i,o,s){if(!t)return;!s&&o&&xue(t,r,i,o);let a=t,l,c;for(;t.prev!==t.next;){if(l=t.prev,c=t.next,o?fue(t,r,i,o):uue(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(c.i/n|0),Dm(t),t=c.next,a=c.next;continue}if(t=c,t===a){s?s===1?(t=due(cu(t),e,n),km(t,e,n,r,i,o,2)):s===2&&hue(t,e,n,r,i,o):km(cu(t),e,n,r,i,o,1);break}}}function uue(t){const e=t.prev,n=t,r=t.next;if(In(e,n,r)>=0)return!1;const i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,c=r.y,u=io?i>s?i:s:o>s?o:s,m=a>l?a>c?a:c:l>c?l:c;let v=r.next;for(;v!==e;){if(v.x>=u&&v.x<=h&&v.y>=f&&v.y<=m&&Wf(i,a,o,l,s,c,v.x,v.y)&&In(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function fue(t,e,n,r){const i=t.prev,o=t,s=t.next;if(In(i,o,s)>=0)return!1;const a=i.x,l=o.x,c=s.x,u=i.y,f=o.y,h=s.y,m=al?a>c?a:c:l>c?l:c,y=u>f?u>h?u:h:f>h?f:h,g=cC(m,v,e,n,r),b=cC(x,y,e,n,r);let _=t.prevZ,S=t.nextZ;for(;_&&_.z>=g&&S&&S.z<=b;){if(_.x>=m&&_.x<=x&&_.y>=v&&_.y<=y&&_!==i&&_!==s&&Wf(a,u,l,f,c,h,_.x,_.y)&&In(_.prev,_,_.next)>=0||(_=_.prevZ,S.x>=m&&S.x<=x&&S.y>=v&&S.y<=y&&S!==i&&S!==s&&Wf(a,u,l,f,c,h,S.x,S.y)&&In(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;_&&_.z>=g;){if(_.x>=m&&_.x<=x&&_.y>=v&&_.y<=y&&_!==i&&_!==s&&Wf(a,u,l,f,c,h,_.x,_.y)&&In(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;S&&S.z<=b;){if(S.x>=m&&S.x<=x&&S.y>=v&&S.y<=y&&S!==i&&S!==s&&Wf(a,u,l,f,c,h,S.x,S.y)&&In(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function due(t,e,n){let r=t;do{const i=r.prev,o=r.next.next;!b_(i,o)&&oB(i,r,r.next,o)&&Om(i,o)&&Om(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),Dm(r),Dm(r.next),r=t=o),r=r.next}while(r!==t);return cu(r)}function hue(t,e,n,r,i,o){let s=t;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&wue(s,a)){let l=sB(s,a);s=cu(s,s.next),l=cu(l,l.next),km(s,e,n,r,i,o,0),km(l,e,n,r,i,o,0);return}a=a.next}s=s.next}while(s!==t)}function pue(t,e,n,r){const i=[];let o,s,a,l,c;for(o=0,s=e.length;o=n.next.y&&n.next.y!==n.y){const h=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=o&&h>r&&(r=h,i=n.x=n.x&&n.x>=l&&o!==n.x&&Wf(si.x||n.x===i.x&&yue(i,n)))&&(i=n,u=f)),n=n.next;while(n!==a);return i}function yue(t,e){return In(t.prev,t,e.prev)<0&&In(e.next,t,t.next)<0}function xue(t,e,n,r){let i=t;do i.z===0&&(i.z=cC(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,bue(i)}function bue(t){let e,n,r,i,o,s,a,l,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||l>0&&r;)a!==0&&(l===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1);return t}function cC(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function _ue(t){let e=t,n=t;do(e.x=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function wue(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Sue(t,e)&&(Om(t,e)&&Om(e,t)&&Mue(t,e)&&(In(t.prev,t,e.prev)||In(t,e.prev,e))||b_(t,e)&&In(t.prev,t,t.next)>0&&In(e.prev,e,e.next)>0)}function In(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function b_(t,e){return t.x===e.x&&t.y===e.y}function oB(t,e,n,r){const i=Gv(In(t,e,n)),o=Gv(In(t,e,r)),s=Gv(In(n,r,t)),a=Gv(In(n,r,e));return!!(i!==o&&s!==a||i===0&&Hv(t,n,e)||o===0&&Hv(t,r,e)||s===0&&Hv(n,t,r)||a===0&&Hv(n,e,r))}function Hv(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Gv(t){return t>0?1:t<0?-1:0}function Sue(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&oB(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Om(t,e){return In(t.prev,t,t.next)<0?In(t,e,t.next)>=0&&In(t,t.prev,e)>=0:In(t,e,t.prev)<0||In(t,t.next,e)<0}function Mue(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}function sB(t,e){const n=new uC(t.i,t.x,t.y),r=new uC(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function VL(t,e,n,r){const i=new uC(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Dm(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function uC(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Eue(t,e,n,r){let i=0;for(let o=e,s=n-r;o2&&t[e-1].equals(t[0])&&t.pop()}function WL(t,e){for(let n=0;nNumber.EPSILON){const me=Math.sqrt(re),be=Math.sqrt($*$+z*z),Ge=B.x-De/me,Fe=B.y+Ee/me,Ne=ye.x-z/be,ze=ye.y+$/be,Le=((Ne-Ge)*z-(ze-Fe)*$)/(Ee*z-De*$);xe=Ge+Ee*Le-se.x,Re=Fe+De*Le-se.y;const Xe=xe*xe+Re*Re;if(Xe<=2)return new Ie(xe,Re);Pe=Math.sqrt(Xe/2)}else{let me=!1;Ee>Number.EPSILON?$>Number.EPSILON&&(me=!0):Ee<-Number.EPSILON?$<-Number.EPSILON&&(me=!0):Math.sign(De)===Math.sign(z)&&(me=!0),me?(xe=-De,Re=Ee,Pe=Math.sqrt(re)):(xe=Ee,Re=De,Pe=Math.sqrt(re/2))}return new Ie(xe/Pe,Re/Pe)}const q=[];for(let se=0,B=j.length,ye=B-1,xe=se+1;se=0;se--){const B=se/y,ye=m*Math.cos(B*Math.PI/2),xe=v*Math.sin(B*Math.PI/2)+x;for(let Re=0,Pe=j.length;Re=0;){const xe=ye;let Re=ye-1;Re<0&&(Re=se.length-1);for(let Pe=0,Ee=u+y*2;Pe0)&&m.push(_,S,N),(g!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class fB extends Ir{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ot(16777215),this.specular=new ot(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ot(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ul,this.normalScale=new Ie(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.combine=fg,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class dB extends Ir{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ot(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ot(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ul,this.normalScale=new Ie(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 hB extends Ir{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ul,this.normalScale=new Ie(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 pB extends Ir{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ot(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ot(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ul,this.normalScale=new Ie(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ro,this.combine=fg,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class mB extends Ir{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ot(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ul,this.normalScale=new Ie(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 gB extends mi{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 Lc(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function vB(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function yB(t){function e(i,o){return t[i]-t[o]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function fC(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,s=0;s!==r;++o){const a=n[o]*e;for(let l=0;l!==e;++l)i[s++]=t[a+l]}return i}function pA(t,e,n,r){let i=1,o=t[0];for(;o!==void 0&&o[r]===void 0;)o=t[i++];if(o===void 0)return;let s=o[r];if(s!==void 0)if(Array.isArray(s))do s=o[r],s!==void 0&&(e.push(o.time),n.push.apply(n,s)),o=t[i++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[r],s!==void 0&&(e.push(o.time),s.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do s=o[r],s!==void 0&&(e.push(o.time),n.push(s)),o=t[i++];while(o!==void 0)}function Aue(t,e,n,r,i=30){const o=t.clone();o.name=e;const s=[];for(let l=0;l=r)){f.push(c.times[m]);for(let x=0;xo.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l=a.times[v]){const g=v*f+u,b=g+f-u;x=a.values.slice(g,b)}else{const g=a.createInterpolant(),b=u,_=f-u;g.evaluate(o),x=g.resultBuffer.slice(b,_)}l==="quaternion"&&new ki().fromArray(x).normalize().conjugate().toArray(x);const y=c.times.length;for(let g=0;g=o)){const a=n[1];e=o)break t}s=r,r=0;break n}break e}for(;r>>1;en;)--s;if(++s,o!==0||s!==i){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=r.slice(o,s),this.values=this.values.slice(o*a,s*a)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let a=0;a!==o;a++){const l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,s),e=!1;break}s=l}if(i!==void 0&&vB(i))for(let a=0,l=i.length;a!==l;++a){const c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===zy,o=e.length-1;let s=1;for(let a=1;a0){e[s]=e[o];for(let a=o*r,l=s*r,c=0;c!==r;++c)n[l+c]=n[a+c];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=n.slice(0,s*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}us.prototype.TimeBufferType=Float32Array;us.prototype.ValueBufferType=Float32Array;us.prototype.DefaultInterpolation=dx;class xu extends us{constructor(e,n,r){super(e,n,r)}}xu.prototype.ValueTypeName="bool";xu.prototype.ValueBufferType=Array;xu.prototype.DefaultInterpolation=Em;xu.prototype.InterpolantFactoryMethodLinear=void 0;xu.prototype.InterpolantFactoryMethodSmooth=void 0;class gA extends us{}gA.prototype.ValueTypeName="color";class Fm extends us{}Fm.prototype.ValueTypeName="number";class _B extends Sg{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(r-n)/(i-n);let c=e*a;for(let u=c+a;c!==u;c+=4)ki.slerpFlat(o,0,s,c-a,s,c,l);return o}}class Mg extends us{InterpolantFactoryMethodLinear(e){return new _B(this.times,this.values,this.getValueSize(),e)}}Mg.prototype.ValueTypeName="quaternion";Mg.prototype.InterpolantFactoryMethodSmooth=void 0;class bu extends us{constructor(e,n,r){super(e,n,r)}}bu.prototype.ValueTypeName="string";bu.prototype.ValueBufferType=Array;bu.prototype.DefaultInterpolation=Em;bu.prototype.InterpolantFactoryMethodLinear=void 0;bu.prototype.InterpolantFactoryMethodSmooth=void 0;class zm extends us{}zm.prototype.ValueTypeName="vector";class Um{constructor(e="",n=-1,r=[],i=s_){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=eo(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let s=0,a=r.length;s!==a;++s)n.push(Lue(r[s]).scale(i));const o=new this(e.name,e.duration,n,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,s=r.length;o!==s;++o)n.push(us.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,s=[];for(let a=0;a1){const f=u[1];let h=i[f];h||(i[f]=h=[]),h.push(c)}}const s=[];for(const a in i)s.push(this.CreateFromMorphTargetSequence(a,i[a],n,r));return s}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(f,h,m,v,x){if(m.length!==0){const y=[],g=[];pA(m,y,g,v),y.length!==0&&x.push(new f(h,y,g))}},i=[],o=e.name||"default",s=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{n&&n(o),this.manager.itemEnd(e)},0),o;if(sa[e]!==void 0){sa[e].push({onLoad:n,onProgress:r,onError:i});return}sa[e]=[],sa[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=sa[e],f=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),m=h?parseInt(h):0,v=m!==0;let x=0;const y=new ReadableStream({start(g){b();function b(){f.read().then(({done:_,value:S})=>{if(_)g.close();else{x+=S.byteLength;const P=new ProgressEvent("progress",{lengthComputable:v,loaded:x,total:m});for(let N=0,R=u.length;N{g.error(_)})}}});return new Response(y)}else throw new kue(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),h=f&&f[1]?f[1].toLowerCase():void 0,m=new TextDecoder(h);return c.arrayBuffer().then(v=>m.decode(v))}}}).then(c=>{ga.add(e,c);const u=sa[e];delete sa[e];for(let f=0,h=u.length;f{const u=sa[e];if(u===void 0)throw this.manager.itemError(e),c;delete sa[e];for(let f=0,h=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Oue extends zi{constructor(e){super(e)}load(e,n,r,i){const o=this,s=new Ia(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{n(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},r,i)}parse(e){const n=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const s=e.uniforms[o];switch(i.uniforms[o]={},s.type){case"t":i.uniforms[o].value=r(s.value);break;case"c":i.uniforms[o].value=new ot().setHex(s.value);break;case"v2":i.uniforms[o].value=new Ie().fromArray(s.value);break;case"v3":i.uniforms[o].value=new G().fromArray(s.value);break;case"v4":i.uniforms[o].value=new Zt().fromArray(s.value);break;case"m3":i.uniforms[o].value=new Dt().fromArray(s.value);break;case"m4":i.uniforms[o].value=new wt().fromArray(s.value);break;default:i.uniforms[o].value=s.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const o in e.extensions)i.extensions[o]=e.extensions[o];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),i.normalScale=new Ie().fromArray(o)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Ie().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return A_.createMaterialFromType(e)}static createMaterialFromType(e){const n={ShadowMaterial:lB,SpriteMaterial:iA,RawShaderMaterial:cB,ShaderMaterial:os,PointsMaterial:sA,MeshPhysicalMaterial:uB,MeshStandardMaterial:hA,MeshPhongMaterial:fB,MeshToonMaterial:dB,MeshNormalMaterial:hB,MeshLambertMaterial:pB,MeshDepthMaterial:nA,MeshDistanceMaterial:rA,MeshBasicMaterial:Bl,MeshMatcapMaterial:mB,LineDashedMaterial:gB,LineBasicMaterial:mi,Material:Ir};return new n[e]}}class dC{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let r=0,i=e.length;r0){const l=new vA(n);o=new Bm(l),o.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new Bm(this.manager),i.setCrossOrigin(this.crossOrigin);for(let s=0,a=e.length;s{const y=new Pr;y.min.fromArray(x.boxMin),y.max.fromArray(x.boxMax);const g=new qr;return g.radius=x.sphereRadius,g.center.fromArray(x.sphereCenter),{boxInitialized:x.boxInitialized,box:y,sphereInitialized:x.sphereInitialized,sphere:g}}),s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._geometryCount=e.geometryCount,s._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(s._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":s=new GU;break;case"Line":s=new Na(a(e.geometry),l(e.material));break;case"LineLoop":s=new KU(a(e.geometry),l(e.material));break;case"LineSegments":s=new Gs(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":s=new ZU(a(e.geometry),l(e.material));break;case"Sprite":s=new HU(l(e.material));break;case"Group":s=new $f;break;case"Bone":s=new oA;break;default:s=new tn}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.up!==void 0&&s.up.fromArray(e.up),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(s.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const h=e.children;for(let m=0;m"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,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=ga.get(e);if(s!==void 0){if(o.manager.itemStart(e),s.then){s.then(c=>{n&&n(c),o.manager.itemEnd(e)}).catch(c=>{i&&i(c)});return}return setTimeout(function(){n&&n(s),o.manager.itemEnd(e)},0),s}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(c){return ga.add(e,c),n&&n(c),o.manager.itemEnd(e),c}).catch(function(c){i&&i(c),ga.remove(e),o.manager.itemError(e),o.manager.itemEnd(e)});ga.add(e,l),o.manager.itemStart(e)}}let Xv;class xA{static getContext(){return Xv===void 0&&(Xv=new(window.AudioContext||window.webkitAudioContext)),Xv}static setContext(e){Xv=e}}class Gue extends zi{constructor(e){super(e)}load(e,n,r,i){const o=this,s=new Ia(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(l){try{const c=l.slice(0);xA.getContext().decodeAudioData(c,function(f){n(f)}).catch(a)}catch(c){a(c)}},r,i);function a(l){i?i(l):console.error(l),o.manager.itemError(e)}}}const JL=new wt,QL=new wt,lc=new wt;class Xue{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new vr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new vr,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 n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,lc.copy(e.projectionMatrix);const i=n.eyeSep/2,o=i*n.near/n.focus,s=n.near*Math.tan(Vc*n.fov*.5)/n.zoom;let a,l;QL.elements[12]=-i,JL.elements[12]=i,a=-s*n.aspect+o,l=s*n.aspect+o,lc.elements[0]=2*n.near/(l-a),lc.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(lc),a=-s*n.aspect-o,l=s*n.aspect-o,lc.elements[0]=2*n.near/(l-a),lc.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(lc)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(QL),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(JL)}}class bA{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ek(),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 n=ek();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function ek(){return performance.now()}const cc=new G,tk=new ki,que=new G,uc=new G;class Yue extends tn{constructor(){super(),this.type="AudioListener",this.context=xA.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new bA}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 n=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(cc,tk,que),uc.set(0,0,-1).applyQuaternion(tk),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(cc.x,i),n.positionY.linearRampToValueAtTime(cc.y,i),n.positionZ.linearRampToValueAtTime(cc.z,i),n.forwardX.linearRampToValueAtTime(uc.x,i),n.forwardY.linearRampToValueAtTime(uc.y,i),n.forwardZ.linearRampToValueAtTime(uc.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(cc.x,cc.y,cc.z),n.setOrientation(uc.x,uc.y,uc.z,r.x,r.y,r.z)}}class LB extends tn{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 n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*n,1,n);for(let l=n,c=n+n;l!==c;++l)if(r[l]!==r[l+n]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,n=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(n,i);for(let o=r,s=i;o!==s;++o)n[o]=n[i+o%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,n=e+this.valueSize;for(let r=e;r=.5)for(let s=0;s!==o;++s)e[n+s]=e[r+s]}_slerp(e,n,r,i){ki.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,o){const s=this._workIndex*o;ki.multiplyQuaternionsFlat(e,s,e,n,e,r),ki.slerpFlat(e,n,e,n,e,s,i)}_lerp(e,n,r,i,o){const s=1-i;for(let a=0;a!==o;++a){const l=n+a;e[l]=e[l]*s+e[r+a]*i}}_lerpAdditive(e,n,r,i,o){for(let s=0;s!==o;++s){const a=n+s;e[a]=e[a]+e[r+s]*i}}}const _A="\\[\\]\\.:\\/",Que=new RegExp("["+_A+"]","g"),wA="[^"+_A+"]",efe="[^"+_A.replace("\\.","")+"]",tfe=/((?:WC+[\/:])*)/.source.replace("WC",wA),nfe=/(WCOD+)?/.source.replace("WCOD",efe),rfe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",wA),ife=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",wA),ofe=new RegExp("^"+tfe+nfe+rfe+ife+"$"),sfe=["material","materials","bones","map"];class afe{constructor(e,n,r){const i=r||Qt.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class Qt{constructor(e,n,r){this.path=n,this.parsedPath=r||Qt.parseTrackName(n),this.node=Qt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new Qt.Composite(e,n,r):new Qt(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Que,"")}static parseTrackName(e){const n=ofe.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=r.nodeName.substring(i+1);sfe.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(o){for(let s=0;s=o){const f=o++,h=e[f];n[h.uuid]=u,e[u]=h,n[c]=f,e[f]=l;for(let m=0,v=i;m!==v;++m){const x=r[m],y=x[f],g=x[u];x[u]=y,x[f]=g}}}this.nCachedObjects_=o}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let o=this.nCachedObjects_,s=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,f=n[u];if(f!==void 0)if(delete n[u],f0&&(n[m.uuid]=f),e[f]=m,e.pop();for(let v=0,x=i;v!==x;++v){const y=r[v];y[f]=y[h],y.pop()}}}this.nCachedObjects_=o}subscribe_(e,n){const r=this._bindingsIndicesByPath;let i=r[e];const o=this._bindings;if(i!==void 0)return o[i];const s=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);i=o.length,r[e]=i,s.push(e),a.push(n),o.push(f);for(let h=u,m=l.length;h!==m;++h){const v=l[h];f[h]=new Qt(v,e,n)}return f}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,o=this._parsedPaths,s=this._bindings,a=s.length-1,l=s[a],c=e[a];n[c]=r,s[r]=l,s.pop(),o[r]=o[a],o.pop(),i[r]=i[a],i.pop()}}}class OB{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const o=n.tracks,s=o.length,a=new Array(s),l={endingStart:Pc,endingEnd:Pc};for(let c=0;c!==s;++c){const u=o[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=pU,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,n){return this.loop=e,this.repetitions=n,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,n,r){if(e.fadeOut(n),this.fadeIn(n),r){const i=this._clip.duration,o=e._clip.duration,s=o/i,a=i/o;e.warp(1,s,n),this.warp(a,1,n)}return this}crossFadeTo(e,n,r){return e.crossFadeFrom(this,n,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,n,r){const i=this._mixer,o=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=o,l[1]=o+r,c[0]=e/s,c[1]=n/s,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,n,r,i){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const l=(e-o)*r;l<0||r===0?n=0:(this._startTime=null,n=r*l)}n*=this._updateTimeScale(e);const s=this._updateTime(n),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case qR:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(s),c[u].accumulateAdditive(a);break;case s_:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(s),c[u].accumulate(i,a)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,r=this.loop;let i=this.time+e,o=this._loopCount;const s=r===mU;if(e===0)return o===-1?i:s&&(o&1)===1?n-i:i;if(r===hU){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=n)i=n;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),i>=n||i<0){const a=Math.floor(i/n);i-=n*a,o+=Math.abs(a);const l=this.repetitions-o;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?n:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(s&&(o&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=Nc,i.endingEnd=Nc):(e?i.endingStart=this.zeroSlopeAtStart?Nc:Pc:i.endingStart=Cm,n?i.endingEnd=this.zeroSlopeAtEnd?Nc:Pc:i.endingEnd=Cm)}_scheduleFading(e,n,r){const i=this._mixer,o=i.time;let s=this._weightInterpolant;s===null&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=o,l[0]=n,a[1]=o+e,l[1]=r,this}}const cfe=new Float32Array(1);class ufe extends Hs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const r=e._localRoot||this._root,i=e._clip.tracks,o=i.length,s=e._propertyBindings,a=e._interpolants,l=r.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==o;++f){const h=i[f],m=h.name;let v=u[m];if(v!==void 0)++v.referenceCount,s[f]=v;else{if(v=s[f],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,m));continue}const x=n&&n._propertyBindings[f].binding.parsedPath;v=new kB(Qt.create(r,m,x),h.ValueTypeName,h.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,m),s[f]=v}a[f].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,o=this._actionsByClip[i];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,i,r)}const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const o=n[r];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const o=n[r];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const n=e._cacheIndex;return n!==null&&n=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const n=this._actions,r=this._nActiveActions,i=this.time+=e,o=Math.sign(e),s=this._accuIndex^=1;for(let c=0;c!==r;++c)n[c]._update(i,e,o,s);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(s);return this}setTime(e){this.time=0;for(let n=0;n=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,n){return n.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,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ok).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 sk=new G,qv=new G;class yfe{constructor(e=new G,n=new G){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),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,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){sk.subVectors(e,this.start),qv.subVectors(this.end,this.start);const r=qv.dot(qv);let o=qv.dot(sk)/r;return n&&(o=$n(o,0,1)),o}closestPointToPoint(e,n,r){const i=this.closestPointToPointParameter(e,n);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const ak=new G;class xfe extends tn{constructor(e,n){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new Ut,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,l=32;s1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{dk.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(dk,n)}}setLength(e,n=e*.2,r=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(r,n,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Ife extends Gs{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Ut;i.setAttribute("position",new pt(n,3)),i.setAttribute("color",new pt(r,3));const o=new mi({vertexColors:!0,toneMapped:!1});super(i,o),this.type="AxesHelper"}setColors(e,n,r){const i=new ot,o=this.geometry.attributes.color.array;return i.set(e),i.toArray(o,0),i.toArray(o,3),i.set(n),i.toArray(o,6),i.toArray(o,9),i.set(r),i.toArray(o,12),i.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Lfe{constructor(){this.type="ShapePath",this.color=new ot,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new Lm,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,r,i){return this.currentPath.quadraticCurveTo(e,n,r,i),this}bezierCurveTo(e,n,r,i,o,s){return this.currentPath.bezierCurveTo(e,n,r,i,o,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(g){const b=[];for(let _=0,S=g.length;_Number.EPSILON){if(M<0&&(R=b[N],U=-U,L=b[P],M=-M),g.yL.y)continue;if(g.y===R.y){if(g.x===R.x)return!0}else{const T=M*(g.x-R.x)-U*(g.y-R.y);if(T===0)return!0;if(T<0)continue;S=!S}}else{if(g.y!==R.y)continue;if(L.x<=g.x&&g.x<=R.x||R.x<=g.x&&g.x<=L.x)return!0}}return S}const i=Os.isClockWise,o=this.subPaths;if(o.length===0)return[];let s,a,l;const c=[];if(o.length===1)return a=o[0],l=new Wc,l.curves=a.curves,c.push(l),c;let u=!i(o[0].getPoints());u=e?!u:u;const f=[],h=[];let m=[],v=0,x;h[v]=void 0,m[v]=[];for(let g=0,b=o.length;g1){let g=!1,b=0;for(let _=0,S=h.length;_0&&g===!1&&(m=f)}let y;for(let g=0,b=h.length;g{const f=typeof c=="function"?c(e):c;if(f!==e){const h=e;e=u?f:Object.assign({},e,f),n.forEach(m=>m(e,h))}},i=()=>e,o=(c,u=i,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let h=u(e);function m(){const v=u(e);if(!f(h,v)){const x=h;c(h=v,x)}}return n.add(m),()=>n.delete(m)},l={setState:r,getState:i,subscribe:(c,u,f)=>u||f?o(c,u,f):(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return e=t(r,i,l),l}const zfe=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),hk=zfe?A.useEffect:A.useLayoutEffect;function Ufe(t){const e=typeof t=="function"?Ffe(t):t,n=(r=e.getState,i=Object.is)=>{const[,o]=A.useReducer(y=>y+1,0),s=e.getState(),a=A.useRef(s),l=A.useRef(r),c=A.useRef(i),u=A.useRef(!1),f=A.useRef();f.current===void 0&&(f.current=r(s));let h,m=!1;(a.current!==s||l.current!==r||c.current!==i||u.current)&&(h=r(s),m=!i(f.current,h)),hk(()=>{m&&(f.current=h),a.current=s,l.current=r,c.current=i,u.current=!1});const v=A.useRef(s);hk(()=>{const y=()=>{try{const b=e.getState(),_=l.current(b);c.current(f.current,_)||(a.current=b,f.current=_,o())}catch{u.current=!0,o()}},g=e.subscribe(y);return e.getState()!==v.current&&y(),g},[]);const x=m?h:f.current;return A.useDebugValue(x),x};return Object.assign(n,e),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[n,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},n}var UB={exports:{}},BB={exports:{}},jB={};/** - * @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(t){function e(F,q){var K=F.length;F.push(q);e:for(;0>>1,he=F[J];if(0>>1;Ji(ae,K))gei(Me,ae)?(F[J]=Me,F[ge]=K,J=ge):(F[J]=ae,F[ee]=K,J=ee);else if(gei(Me,K))F[J]=Me,F[ge]=K,J=ge;else break e}}return q}function i(F,q){var K=F.sortIndex-q.sortIndex;return K!==0?K:F.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,h=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(F){for(var q=n(c);q!==null;){if(q.callback===null)r(c);else if(q.startTime<=F)r(c),q.sortIndex=q.expirationTime,e(l,q);else break;q=n(c)}}function S(F){if(x=!1,_(F),!v)if(n(l)!==null)v=!0,H(P);else{var q=n(c);q!==null&&Z(S,q.startTime-F)}}function P(F,q){v=!1,x&&(x=!1,g(L),L=-1),m=!0;var K=h;try{for(_(q),f=n(l);f!==null&&(!(f.expirationTime>q)||F&&!T());){var J=f.callback;if(typeof J=="function"){f.callback=null,h=f.priorityLevel;var he=J(f.expirationTime<=q);q=t.unstable_now(),typeof he=="function"?f.callback=he:f===n(l)&&r(l),_(q)}else r(l);f=n(l)}if(f!==null)var le=!0;else{var ee=n(c);ee!==null&&Z(S,ee.startTime-q),le=!1}return le}finally{f=null,h=K,m=!1}}var N=!1,R=null,L=-1,U=5,M=-1;function T(){return!(t.unstable_now()-MF||125J?(F.sortIndex=K,e(c,F),n(l)===null&&F===n(c)&&(x?(g(L),L=-1):x=!0,Z(S,K-J))):(F.sortIndex=he,e(l,F),v||m||(v=!0,H(P))),F},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(F){var q=h;return function(){var K=h;h=q;try{return F.apply(this,arguments)}finally{h=K}}}})(jB);BB.exports=jB;var pC=BB.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 Bfe=function(e){var n={},r=A,i=pC,o=Object.assign;function s(d){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+d,w=1;wte||I[Y]!==k[te]){var Se=` -`+I[Y].replace(" at new "," at ");return d.displayName&&Se.includes("")&&(Se=Se.replace("",d.displayName)),Se}while(1<=Y&&0<=te);break}}}finally{St=!1,Error.prepareStackTrace=w}return(d=d?d.displayName||d.name:"")?ct(d):""}var mt=Object.prototype.hasOwnProperty,Jt=[],nn=-1;function ln(d){return{current:d}}function $t(d){0>nn||(d.current=Jt[nn],Jt[nn]=null,nn--)}function vt(d,p){nn++,Jt[nn]=d.current,d.current=p}var ft={},Kt=ln(ft),Pt=ln(!1),rr=ft;function Ui(d,p){var w=d.type.contextTypes;if(!w)return ft;var E=d.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===p)return E.__reactInternalMemoizedMaskedChildContext;var I={},k;for(k in w)I[k]=p[k];return E&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=p,d.__reactInternalMemoizedMaskedChildContext=I),I}function gn(d){return d=d.childContextTypes,d!=null}function Fa(){$t(Pt),$t(Kt)}function Mn(d,p,w){if(Kt.current!==ft)throw Error(s(168));vt(Kt,p),vt(Pt,w)}function Uo(d,p,w){var E=d.stateNode;if(p=p.childContextTypes,typeof E.getChildContext!="function")return w;E=E.getChildContext();for(var I in E)if(!(I in p))throw Error(s(108,L(d)||"Unknown",I));return o({},w,E)}function za(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||ft,rr=Kt.current,vt(Kt,d),vt(Pt,Pt.current),!0}function Kr(d,p,w){var E=d.stateNode;if(!E)throw Error(s(169));w?(d=Uo(d,p,rr),E.__reactInternalMemoizedMergedChildContext=d,$t(Pt),$t(Kt),vt(Kt,d)):$t(Pt),vt(Pt,w)}var Zr=Math.clz32?Math.clz32:b7,sw=Math.log,Vg=Math.LN2;function b7(d){return d>>>=0,d===0?32:31-(sw(d)/Vg|0)|0}var $g=64,Wg=4194304;function ch(d){switch(d&-d){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 d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function Hg(d,p){var w=d.pendingLanes;if(w===0)return 0;var E=0,I=d.suspendedLanes,k=d.pingedLanes,Y=w&268435455;if(Y!==0){var te=Y&~I;te!==0?E=ch(te):(k&=Y,k!==0&&(E=ch(k)))}else Y=w&~I,Y!==0?E=ch(Y):k!==0&&(E=ch(k));if(E===0)return 0;if(p!==0&&p!==E&&!(p&I)&&(I=E&-E,k=p&-p,I>=k||I===16&&(k&4194240)!==0))return p;if(E&4&&(E|=w&16),p=d.entangledLanes,p!==0)for(d=d.entanglements,p&=E;0w;w++)p.push(d);return p}function uh(d,p,w){d.pendingLanes|=p,p!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,p=31-Zr(p),d[p]=w}function S7(d,p){var w=d.pendingLanes&~p;d.pendingLanes=p,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=p,d.mutableReadLanes&=p,d.entangledLanes&=p,p=d.entanglements;var E=d.eventTimes;for(d=d.expirationTimes;0>=Y,I-=Y,Zs=1<<32-Zr(p)+I|w<on?(hr=Lt,Lt=null):hr=Lt.sibling;var sn=_t(ce,Lt,ve[on],nt);if(sn===null){Lt===null&&(Lt=hr);break}d&&Lt&&sn.alternate===null&&p(ce,Lt),ie=k(sn,ie,on),Vt===null?gt=sn:Vt.sibling=sn,Vt=sn,Lt=hr}if(on===ve.length)return w(ce,Lt),En&&Gl(ce,on),gt;if(Lt===null){for(;onon?(hr=Lt,Lt=null):hr=Lt.sibling;var Ga=_t(ce,Lt,sn.value,nt);if(Ga===null){Lt===null&&(Lt=hr);break}d&&Lt&&Ga.alternate===null&&p(ce,Lt),ie=k(Ga,ie,on),Vt===null?gt=Ga:Vt.sibling=Ga,Vt=Ga,Lt=hr}if(sn.done)return w(ce,Lt),En&&Gl(ce,on),gt;if(Lt===null){for(;!sn.done;on++,sn=ve.next())sn=It(ce,sn.value,nt),sn!==null&&(ie=k(sn,ie,on),Vt===null?gt=sn:Vt.sibling=sn,Vt=sn);return En&&Gl(ce,on),gt}for(Lt=E(ce,Lt);!sn.done;on++,sn=ve.next())sn=vn(Lt,ce,on,sn.value,nt),sn!==null&&(d&&sn.alternate!==null&&Lt.delete(sn.key===null?on:sn.key),ie=k(sn,ie,on),Vt===null?gt=sn:Vt.sibling=sn,Vt=sn);return d&&Lt.forEach(function(lj){return p(ce,lj)}),En&&Gl(ce,on),gt}function yo(ce,ie,ve,nt){if(typeof ve=="object"&&ve!==null&&ve.type===u&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case l:e:{for(var gt=ve.key,Vt=ie;Vt!==null;){if(Vt.key===gt){if(gt=ve.type,gt===u){if(Vt.tag===7){w(ce,Vt.sibling),ie=I(Vt,ve.props.children),ie.return=ce,ce=ie;break e}}else if(Vt.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===_&&OP(gt)===Vt.type){w(ce,Vt.sibling),ie=I(Vt,ve.props),ie.ref=hh(ce,Vt,ve),ie.return=ce,ce=ie;break e}w(ce,Vt);break}else p(ce,Vt);Vt=Vt.sibling}ve.type===u?(ie=Ql(ve.props.children,ce.mode,nt,ve.key),ie.return=ce,ce=ie):(nt=L0(ve.type,ve.key,ve.props,null,ce.mode,nt),nt.ref=hh(ce,ie,ve),nt.return=ce,ce=nt)}return Y(ce);case c:e:{for(Vt=ve.key;ie!==null;){if(ie.key===Vt)if(ie.tag===4&&ie.stateNode.containerInfo===ve.containerInfo&&ie.stateNode.implementation===ve.implementation){w(ce,ie.sibling),ie=I(ie,ve.children||[]),ie.return=ce,ce=ie;break e}else{w(ce,ie);break}else p(ce,ie);ie=ie.sibling}ie=cS(ve,ce.mode,nt),ie.return=ce,ce=ie}return Y(ce);case _:return Vt=ve._init,yo(ce,ie,Vt(ve._payload),nt)}if(X(ve))return yt(ce,ie,ve,nt);if(N(ve))return zr(ce,ie,ve,nt);n0(ce,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,ie!==null&&ie.tag===6?(w(ce,ie.sibling),ie=I(ie,ve),ie.return=ce,ce=ie):(w(ce,ie),ie=lS(ve,ce.mode,nt),ie.return=ce,ce=ie),Y(ce)):w(ce,ie)}return yo}var ku=DP(!0),FP=DP(!1),ph={},po=ln(ph),mh=ln(ph),Ou=ln(ph);function vs(d){if(d===ph)throw Error(s(174));return d}function Cw(d,p){vt(Ou,p),vt(mh,d),vt(po,ph),d=Z(p),$t(po),vt(po,d)}function Du(){$t(po),$t(mh),$t(Ou)}function zP(d){var p=vs(Ou.current),w=vs(po.current);p=F(w,d.type,p),w!==p&&(vt(mh,d),vt(po,p))}function Tw(d){mh.current===d&&($t(po),$t(mh))}var Pn=ln(0);function r0(d){for(var p=d;p!==null;){if(p.tag===13){var w=p.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||Cu(w)||Tu(w)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if(p.flags&128)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===d)break;for(;p.sibling===null;){if(p.return===null||p.return===d)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var Rw=[];function Aw(){for(var d=0;dw?w:4,d(!0);var E=mo.transition;mo.transition={};try{d(!1),p()}finally{rn=w,mo.transition=E}}function JP(){return ys().memoizedState}function O7(d,p,w){var E=$a(d);w={lane:E,action:w,hasEagerState:!1,eagerState:null,next:null},QP(d)?e3(p,w):(t3(d,p,w),w=Qr(),d=go(d,E,w),d!==null&&n3(d,p,E))}function D7(d,p,w){var E=$a(d),I={lane:E,action:w,hasEagerState:!1,eagerState:null,next:null};if(QP(d))e3(p,I);else{t3(d,p,I);var k=d.alternate;if(d.lanes===0&&(k===null||k.lanes===0)&&(k=p.lastRenderedReducer,k!==null))try{var Y=p.lastRenderedState,te=k(Y,w);if(I.hasEagerState=!0,I.eagerState=te,ps(te,Y))return}catch{}finally{}w=Qr(),d=go(d,E,w),d!==null&&n3(d,p,E)}}function QP(d){var p=d.alternate;return d===zn||p!==null&&p===zn}function e3(d,p){gh=o0=!0;var w=d.pending;w===null?p.next=p:(p.next=w.next,w.next=p),d.pending=p}function t3(d,p,w){Kn!==null&&d.mode&1&&!(Wt&2)?(d=p.interleaved,d===null?(w.next=w,gs===null?gs=[p]:gs.push(p)):(w.next=d.next,d.next=w),p.interleaved=w):(d=p.pending,d===null?w.next=w:(w.next=d.next,d.next=w),p.pending=w)}function n3(d,p,w){if(w&4194240){var E=p.lanes;E&=d.pendingLanes,w|=E,p.lanes=w,cw(d,w)}}var u0={readContext:uo,useCallback:Dr,useContext:Dr,useEffect:Dr,useImperativeHandle:Dr,useInsertionEffect:Dr,useLayoutEffect:Dr,useMemo:Dr,useReducer:Dr,useRef:Dr,useState:Dr,useDebugValue:Dr,useDeferredValue:Dr,useTransition:Dr,useMutableSource:Dr,useSyncExternalStore:Dr,useId:Dr,unstable_isNewReconciler:!1},F7={readContext:uo,useCallback:function(d,p){return Qs().memoizedState=[d,p===void 0?null:p],d},useContext:uo,useEffect:kw,useImperativeHandle:function(d,p,w){return w=w!=null?w.concat([d]):null,l0(4194308,4,qP.bind(null,p,d),w)},useLayoutEffect:function(d,p){return l0(4194308,4,d,p)},useInsertionEffect:function(d,p){return l0(4,2,d,p)},useMemo:function(d,p){var w=Qs();return p=p===void 0?null:p,d=d(),w.memoizedState=[d,p],d},useReducer:function(d,p,w){var E=Qs();return p=w!==void 0?w(p):p,E.memoizedState=E.baseState=p,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:p},E.queue=d,d=d.dispatch=O7.bind(null,zn,d),[E.memoizedState,d]},useRef:function(d){var p=Qs();return d={current:d},p.memoizedState=d},useState:Lw,useDebugValue:Ow,useDeferredValue:function(d){var p=Lw(d),w=p[0],E=p[1];return kw(function(){var I=mo.transition;mo.transition={};try{E(d)}finally{mo.transition=I}},[d]),w},useTransition:function(){var d=Lw(!1),p=d[0];return d=k7.bind(null,d[1]),Qs().memoizedState=d,[p,d]},useMutableSource:function(){},useSyncExternalStore:function(d,p,w){var E=zn,I=Qs();if(En){if(w===void 0)throw Error(s(407));w=w()}else{if(w=p(),Kn===null)throw Error(s(349));Fu&30||jP(E,p,w)}I.memoizedState=w;var k={value:w,getSnapshot:p};return I.queue=k,kw($P.bind(null,E,k,d),[d]),E.flags|=2048,yh(9,VP.bind(null,E,k,w,p),void 0,null),w},useId:function(){var d=Qs(),p=Kn.identifierPrefix;if(En){var w=Js,E=Zs;w=(E&~(1<<32-Zr(E)-1)).toString(32)+w,p=":"+p+"R"+w,w=vh++,0eS&&(p.flags|=128,E=!0,wh(I,!1),p.lanes=4194304)}else{if(!E)if(d=r0(k),d!==null){if(p.flags|=128,E=!0,d=d.updateQueue,d!==null&&(p.updateQueue=d,p.flags|=4),wh(I,!0),I.tail===null&&I.tailMode==="hidden"&&!k.alternate&&!En)return Fr(p),null}else 2*fr()-I.renderingStartTime>eS&&w!==1073741824&&(p.flags|=128,E=!0,wh(I,!1),p.lanes=4194304);I.isBackwards?(k.sibling=p.child,p.child=k):(d=I.last,d!==null?d.sibling=k:p.child=k,I.last=k)}return I.tail!==null?(p=I.tail,I.rendering=p,I.tail=p.sibling,I.renderingStartTime=fr(),p.sibling=null,d=Pn.current,vt(Pn,E?d&1|2:d&1),p):(Fr(p),null);case 22:case 23:return oS(),E=p.memoizedState!==null,d!==null&&d.memoizedState!==null!==E&&(p.flags|=8192),E&&p.mode&1?$i&1073741824&&(Fr(p),Ve&&p.subtreeFlags&6&&(p.flags|=8192)):Fr(p),null;case 24:return null;case 25:return null}throw Error(s(156,p.tag))}var V7=a.ReactCurrentOwner,Vi=!1;function Jr(d,p,w,E){p.child=d===null?FP(p,null,w,E):ku(p,d.child,w,E)}function u3(d,p,w,E,I){w=w.render;var k=p.ref;return Pu(p,I),E=Nw(d,p,w,E,k,I),w=Iw(),d!==null&&!Vi?(p.updateQueue=d.updateQueue,p.flags&=-2053,d.lanes&=~I,ea(d,p,I)):(En&&w&&_w(p),p.flags|=1,Jr(d,p,E,I),p.child)}function f3(d,p,w,E,I){if(d===null){var k=w.type;return typeof k=="function"&&!aS(k)&&k.defaultProps===void 0&&w.compare===null&&w.defaultProps===void 0?(p.tag=15,p.type=k,d3(d,p,k,E,I)):(d=L0(w.type,null,E,p,p.mode,I),d.ref=p.ref,d.return=p,p.child=d)}if(k=d.child,!(d.lanes&I)){var Y=k.memoizedProps;if(w=w.compare,w=w!==null?w:qg,w(Y,E)&&d.ref===p.ref)return ea(d,p,I)}return p.flags|=1,d=Ha(k,E),d.ref=p.ref,d.return=p,p.child=d}function d3(d,p,w,E,I){if(d!==null&&qg(d.memoizedProps,E)&&d.ref===p.ref)if(Vi=!1,(d.lanes&I)!==0)d.flags&131072&&(Vi=!0);else return p.lanes=d.lanes,ea(d,p,I);return zw(d,p,w,E,I)}function h3(d,p,w){var E=p.pendingProps,I=E.children,k=d!==null?d.memoizedState:null;if(E.mode==="hidden")if(!(p.mode&1))p.memoizedState={baseLanes:0,cachePool:null},vt(zu,$i),$i|=w;else if(w&1073741824)p.memoizedState={baseLanes:0,cachePool:null},E=k!==null?k.baseLanes:w,vt(zu,$i),$i|=E;else return d=k!==null?k.baseLanes|w:w,p.lanes=p.childLanes=1073741824,p.memoizedState={baseLanes:d,cachePool:null},p.updateQueue=null,vt(zu,$i),$i|=d,null;else k!==null?(E=k.baseLanes|w,p.memoizedState=null):E=w,vt(zu,$i),$i|=E;return Jr(d,p,I,w),p.child}function p3(d,p){var w=p.ref;(d===null&&w!==null||d!==null&&d.ref!==w)&&(p.flags|=512,p.flags|=2097152)}function zw(d,p,w,E,I){var k=gn(w)?rr:Kt.current;return k=Ui(p,k),Pu(p,I),w=Nw(d,p,w,E,k,I),E=Iw(),d!==null&&!Vi?(p.updateQueue=d.updateQueue,p.flags&=-2053,d.lanes&=~I,ea(d,p,I)):(En&&E&&_w(p),p.flags|=1,Jr(d,p,w,I),p.child)}function m3(d,p,w,E,I){if(gn(w)){var k=!0;za(p)}else k=!1;if(Pu(p,I),p.stateNode===null)d!==null&&(d.alternate=null,p.alternate=null,p.flags|=2),AP(p,w,E),bw(p,w,E,I),E=!0;else if(d===null){var Y=p.stateNode,te=p.memoizedProps;Y.props=te;var Se=Y.context,$e=w.contextType;typeof $e=="object"&&$e!==null?$e=uo($e):($e=gn(w)?rr:Kt.current,$e=Ui(p,$e));var ut=w.getDerivedStateFromProps,It=typeof ut=="function"||typeof Y.getSnapshotBeforeUpdate=="function";It||typeof Y.UNSAFE_componentWillReceiveProps!="function"&&typeof Y.componentWillReceiveProps!="function"||(te!==E||Se!==$e)&&PP(p,Y,E,$e),Ua=!1;var _t=p.memoizedState;Y.state=_t,Jg(p,E,Y,I),Se=p.memoizedState,te!==E||_t!==Se||Pt.current||Ua?(typeof ut=="function"&&(xw(p,w,ut,E),Se=p.memoizedState),(te=Ua||RP(p,w,te,E,_t,Se,$e))?(It||typeof Y.UNSAFE_componentWillMount!="function"&&typeof Y.componentWillMount!="function"||(typeof Y.componentWillMount=="function"&&Y.componentWillMount(),typeof Y.UNSAFE_componentWillMount=="function"&&Y.UNSAFE_componentWillMount()),typeof Y.componentDidMount=="function"&&(p.flags|=4194308)):(typeof Y.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=E,p.memoizedState=Se),Y.props=E,Y.state=Se,Y.context=$e,E=te):(typeof Y.componentDidMount=="function"&&(p.flags|=4194308),E=!1)}else{Y=p.stateNode,MP(d,p),te=p.memoizedProps,$e=p.type===p.elementType?te:Bo(p.type,te),Y.props=$e,It=p.pendingProps,_t=Y.context,Se=w.contextType,typeof Se=="object"&&Se!==null?Se=uo(Se):(Se=gn(w)?rr:Kt.current,Se=Ui(p,Se));var vn=w.getDerivedStateFromProps;(ut=typeof vn=="function"||typeof Y.getSnapshotBeforeUpdate=="function")||typeof Y.UNSAFE_componentWillReceiveProps!="function"&&typeof Y.componentWillReceiveProps!="function"||(te!==It||_t!==Se)&&PP(p,Y,E,Se),Ua=!1,_t=p.memoizedState,Y.state=_t,Jg(p,E,Y,I);var yt=p.memoizedState;te!==It||_t!==yt||Pt.current||Ua?(typeof vn=="function"&&(xw(p,w,vn,E),yt=p.memoizedState),($e=Ua||RP(p,w,$e,E,_t,yt,Se)||!1)?(ut||typeof Y.UNSAFE_componentWillUpdate!="function"&&typeof Y.componentWillUpdate!="function"||(typeof Y.componentWillUpdate=="function"&&Y.componentWillUpdate(E,yt,Se),typeof Y.UNSAFE_componentWillUpdate=="function"&&Y.UNSAFE_componentWillUpdate(E,yt,Se)),typeof Y.componentDidUpdate=="function"&&(p.flags|=4),typeof Y.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof Y.componentDidUpdate!="function"||te===d.memoizedProps&&_t===d.memoizedState||(p.flags|=4),typeof Y.getSnapshotBeforeUpdate!="function"||te===d.memoizedProps&&_t===d.memoizedState||(p.flags|=1024),p.memoizedProps=E,p.memoizedState=yt),Y.props=E,Y.state=yt,Y.context=Se,E=$e):(typeof Y.componentDidUpdate!="function"||te===d.memoizedProps&&_t===d.memoizedState||(p.flags|=4),typeof Y.getSnapshotBeforeUpdate!="function"||te===d.memoizedProps&&_t===d.memoizedState||(p.flags|=1024),E=!1)}return Uw(d,p,w,E,k,I)}function Uw(d,p,w,E,I,k){p3(d,p);var Y=(p.flags&128)!==0;if(!E&&!Y)return I&&Kr(p,w,!1),ea(d,p,k);E=p.stateNode,V7.current=p;var te=Y&&typeof w.getDerivedStateFromError!="function"?null:E.render();return p.flags|=1,d!==null&&Y?(p.child=ku(p,d.child,null,k),p.child=ku(p,null,te,k)):Jr(d,p,te,k),p.memoizedState=E.state,I&&Kr(p,w,!0),p.child}function g3(d){var p=d.stateNode;p.pendingContext?Mn(d,p.pendingContext,p.pendingContext!==p.context):p.context&&Mn(d,p.context,!1),Cw(d,p.containerInfo)}function v3(d,p,w,E,I){return Lu(),Ew(I),p.flags|=256,Jr(d,p,w,E),p.child}var h0={dehydrated:null,treeContext:null,retryLane:0};function p0(d){return{baseLanes:d,cachePool:null}}function y3(d,p,w){var E=p.pendingProps,I=Pn.current,k=!1,Y=(p.flags&128)!==0,te;if((te=Y)||(te=d!==null&&d.memoizedState===null?!1:(I&2)!==0),te?(k=!0,p.flags&=-129):(d===null||d.memoizedState!==null)&&(I|=1),vt(Pn,I&1),d===null)return Mw(p),d=p.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?(p.mode&1?Tu(d)?p.lanes=8:p.lanes=1073741824:p.lanes=1,null):(I=E.children,d=E.fallback,k?(E=p.mode,k=p.child,I={mode:"hidden",children:I},!(E&1)&&k!==null?(k.childLanes=0,k.pendingProps=I):k=k0(I,E,0,null),d=Ql(d,E,w,null),k.return=p,d.return=p,k.sibling=d,p.child=k,p.child.memoizedState=p0(w),p.memoizedState=h0,d):Bw(p,I));if(I=d.memoizedState,I!==null){if(te=I.dehydrated,te!==null){if(Y)return p.flags&256?(p.flags&=-257,m0(d,p,w,Error(s(422)))):p.memoizedState!==null?(p.child=d.child,p.flags|=128,null):(k=E.fallback,I=p.mode,E=k0({mode:"visible",children:E.children},I,0,null),k=Ql(k,I,w,null),k.flags|=2,E.return=p,k.return=p,E.sibling=k,p.child=E,p.mode&1&&ku(p,d.child,null,w),p.child.memoizedState=p0(w),p.memoizedState=h0,k);if(!(p.mode&1))p=m0(d,p,w,null);else if(Tu(te))p=m0(d,p,w,Error(s(419)));else if(E=(w&d.childLanes)!==0,Vi||E){if(E=Kn,E!==null){switch(w&-w){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}E=k&(E.suspendedLanes|w)?0:k,E!==0&&E!==I.retryLane&&(I.retryLane=E,go(d,E,-1))}sS(),p=m0(d,p,w,Error(s(421)))}else Cu(te)?(p.flags|=128,p.child=d.child,p=tj.bind(null,d),zg(te,p),p=null):(w=I.treeContext,B&&(ji=Bg(te),Bi=p,En=!0,jo=null,fh=!1,w!==null&&(fo[ho++]=Zs,fo[ho++]=Js,fo[ho++]=Hl,Zs=w.id,Js=w.overflow,Hl=p)),p=Bw(p,p.pendingProps.children),p.flags|=4096);return p}return k?(E=b3(d,p,E.children,E.fallback,w),k=p.child,I=d.child.memoizedState,k.memoizedState=I===null?p0(w):{baseLanes:I.baseLanes|w,cachePool:null},k.childLanes=d.childLanes&~w,p.memoizedState=h0,E):(w=x3(d,p,E.children,w),p.memoizedState=null,w)}return k?(E=b3(d,p,E.children,E.fallback,w),k=p.child,I=d.child.memoizedState,k.memoizedState=I===null?p0(w):{baseLanes:I.baseLanes|w,cachePool:null},k.childLanes=d.childLanes&~w,p.memoizedState=h0,E):(w=x3(d,p,E.children,w),p.memoizedState=null,w)}function Bw(d,p){return p=k0({mode:"visible",children:p},d.mode,0,null),p.return=d,d.child=p}function x3(d,p,w,E){var I=d.child;return d=I.sibling,w=Ha(I,{mode:"visible",children:w}),!(p.mode&1)&&(w.lanes=E),w.return=p,w.sibling=null,d!==null&&(E=p.deletions,E===null?(p.deletions=[d],p.flags|=16):E.push(d)),p.child=w}function b3(d,p,w,E,I){var k=p.mode;d=d.child;var Y=d.sibling,te={mode:"hidden",children:w};return!(k&1)&&p.child!==d?(w=p.child,w.childLanes=0,w.pendingProps=te,p.deletions=null):(w=Ha(d,te),w.subtreeFlags=d.subtreeFlags&14680064),Y!==null?E=Ha(Y,E):(E=Ql(E,k,I,null),E.flags|=2),E.return=p,w.return=p,w.sibling=E,p.child=w,E}function m0(d,p,w,E){return E!==null&&Ew(E),ku(p,d.child,null,w),d=Bw(p,p.pendingProps.children),d.flags|=2,p.memoizedState=null,d}function _3(d,p,w){d.lanes|=p;var E=d.alternate;E!==null&&(E.lanes|=p),vw(d.return,p,w)}function jw(d,p,w,E,I){var k=d.memoizedState;k===null?d.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:E,tail:w,tailMode:I}:(k.isBackwards=p,k.rendering=null,k.renderingStartTime=0,k.last=E,k.tail=w,k.tailMode=I)}function w3(d,p,w){var E=p.pendingProps,I=E.revealOrder,k=E.tail;if(Jr(d,p,E.children,w),E=Pn.current,E&2)E=E&1|2,p.flags|=128;else{if(d!==null&&d.flags&128)e:for(d=p.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&_3(d,w,p);else if(d.tag===19)_3(d,w,p);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===p)break e;for(;d.sibling===null;){if(d.return===null||d.return===p)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}E&=1}if(vt(Pn,E),!(p.mode&1))p.memoizedState=null;else switch(I){case"forwards":for(w=p.child,I=null;w!==null;)d=w.alternate,d!==null&&r0(d)===null&&(I=w),w=w.sibling;w=I,w===null?(I=p.child,p.child=null):(I=w.sibling,w.sibling=null),jw(p,!1,I,w,k);break;case"backwards":for(w=null,I=p.child,p.child=null;I!==null;){if(d=I.alternate,d!==null&&r0(d)===null){p.child=I;break}d=I.sibling,I.sibling=w,w=I,I=d}jw(p,!0,w,null,k);break;case"together":jw(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function ea(d,p,w){if(d!==null&&(p.dependencies=d.dependencies),Uu|=p.lanes,!(w&p.childLanes))return null;if(d!==null&&p.child!==d.child)throw Error(s(153));if(p.child!==null){for(d=p.child,w=Ha(d,d.pendingProps),p.child=w,w.return=p;d.sibling!==null;)d=d.sibling,w=w.sibling=Ha(d,d.pendingProps),w.return=p;w.sibling=null}return p.child}function $7(d,p,w){switch(p.tag){case 3:g3(p),Lu();break;case 5:zP(p);break;case 1:gn(p.type)&&za(p);break;case 4:Cw(p,p.stateNode.containerInfo);break;case 10:SP(p,p.type._context,p.memoizedProps.value);break;case 13:var E=p.memoizedState;if(E!==null)return E.dehydrated!==null?(vt(Pn,Pn.current&1),p.flags|=128,null):w&p.child.childLanes?y3(d,p,w):(vt(Pn,Pn.current&1),d=ea(d,p,w),d!==null?d.sibling:null);vt(Pn,Pn.current&1);break;case 19:if(E=(w&p.childLanes)!==0,d.flags&128){if(E)return w3(d,p,w);p.flags|=128}var I=p.memoizedState;if(I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),vt(Pn,Pn.current),E)break;return null;case 22:case 23:return p.lanes=0,h3(d,p,w)}return ea(d,p,w)}function W7(d,p){switch(ww(p),p.tag){case 1:return gn(p.type)&&Fa(),d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 3:return Du(),$t(Pt),$t(Kt),Aw(),d=p.flags,d&65536&&!(d&128)?(p.flags=d&-65537|128,p):null;case 5:return Tw(p),null;case 13:if($t(Pn),d=p.memoizedState,d!==null&&d.dehydrated!==null){if(p.alternate===null)throw Error(s(340));Lu()}return d=p.flags,d&65536?(p.flags=d&-65537|128,p):null;case 19:return $t(Pn),null;case 4:return Du(),null;case 10:return gw(p.type._context),null;case 22:case 23:return oS(),null;case 24:return null;default:return null}}var g0=!1,ql=!1,H7=typeof WeakSet=="function"?WeakSet:Set,et=null;function v0(d,p){var w=d.ref;if(w!==null)if(typeof w=="function")try{w(null)}catch(E){yi(d,p,E)}else w.current=null}function Vw(d,p,w){try{w()}catch(E){yi(d,p,E)}}var S3=!1;function G7(d,p){for(q(d.containerInfo),et=p;et!==null;)if(d=et,p=d.child,(d.subtreeFlags&1028)!==0&&p!==null)p.return=d,et=p;else for(;et!==null;){d=et;try{var w=d.alternate;if(d.flags&1024)switch(d.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var E=w.memoizedProps,I=w.memoizedState,k=d.stateNode,Y=k.getSnapshotBeforeUpdate(d.elementType===d.type?E:Bo(d.type,E),I);k.__reactInternalSnapshotBeforeUpdate=Y}break;case 3:Ve&&Ye(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(te){yi(d,d.return,te)}if(p=d.sibling,p!==null){p.return=d.return,et=p;break}et=d.return}return w=S3,S3=!1,w}function Yl(d,p,w){var E=p.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var I=E=E.next;do{if((I.tag&d)===d){var k=I.destroy;I.destroy=void 0,k!==void 0&&Vw(p,w,k)}I=I.next}while(I!==E)}}function Sh(d,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var w=p=p.next;do{if((w.tag&d)===d){var E=w.create;w.destroy=E()}w=w.next}while(w!==p)}}function $w(d){var p=d.ref;if(p!==null){var w=d.stateNode;switch(d.tag){case 5:d=H(w);break;default:d=w}typeof p=="function"?p(d):p.current=d}}function M3(d,p,w){if(hs&&typeof hs.onCommitFiberUnmount=="function")try{hs.onCommitFiberUnmount(Gg,p)}catch{}switch(p.tag){case 0:case 11:case 14:case 15:if(d=p.updateQueue,d!==null&&(d=d.lastEffect,d!==null)){var E=d=d.next;do{var I=E,k=I.destroy;I=I.tag,k!==void 0&&(I&2||I&4)&&Vw(p,w,k),E=E.next}while(E!==d)}break;case 1:if(v0(p,w),d=p.stateNode,typeof d.componentWillUnmount=="function")try{d.props=p.memoizedProps,d.state=p.memoizedState,d.componentWillUnmount()}catch(Y){yi(p,w,Y)}break;case 5:v0(p,w);break;case 4:Ve?P3(d,p,w):se&&se&&(p=p.stateNode.containerInfo,w=jt(p),Yt(p,w))}}function E3(d,p,w){for(var E=p;;)if(M3(d,E,w),E.child===null||Ve&&E.tag===4){if(E===p)break;for(;E.sibling===null;){if(E.return===null||E.return===p)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else E.child.return=E,E=E.child}function C3(d){var p=d.alternate;p!==null&&(d.alternate=null,C3(p)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(p=d.stateNode,p!==null&&Pe(p)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function T3(d){return d.tag===5||d.tag===3||d.tag===4}function R3(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||T3(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function A3(d){if(Ve){e:{for(var p=d.return;p!==null;){if(T3(p))break e;p=p.return}throw Error(s(160))}var w=p;switch(w.tag){case 5:p=w.stateNode,w.flags&32&&(dt(p),w.flags&=-33),w=R3(d),Hw(d,w,p);break;case 3:case 4:p=w.stateNode.containerInfo,w=R3(d),Ww(d,w,p);break;default:throw Error(s(161))}}}function Ww(d,p,w){var E=d.tag;if(E===5||E===6)d=d.stateNode,p?Ue(w,d,p):ze(w,d);else if(E!==4&&(d=d.child,d!==null))for(Ww(d,p,w),d=d.sibling;d!==null;)Ww(d,p,w),d=d.sibling}function Hw(d,p,w){var E=d.tag;if(E===5||E===6)d=d.stateNode,p?Oe(w,d,p):Ne(w,d);else if(E!==4&&(d=d.child,d!==null))for(Hw(d,p,w),d=d.sibling;d!==null;)Hw(d,p,w),d=d.sibling}function P3(d,p,w){for(var E=p,I=!1,k,Y;;){if(!I){I=E.return;e:for(;;){if(I===null)throw Error(s(160));switch(k=I.stateNode,I.tag){case 5:Y=!1;break e;case 3:k=k.containerInfo,Y=!0;break e;case 4:k=k.containerInfo,Y=!0;break e}I=I.return}I=!0}if(E.tag===5||E.tag===6)E3(d,E,w),Y?ke(k,E.stateNode):Ae(k,E.stateNode);else if(E.tag===18)Y?de(k,E.stateNode):ue(k,E.stateNode);else if(E.tag===4){if(E.child!==null){k=E.stateNode.containerInfo,Y=!0,E.child.return=E,E=E.child;continue}}else if(M3(d,E,w),E.child!==null){E.child.return=E,E=E.child;continue}if(E===p)break;for(;E.sibling===null;){if(E.return===null||E.return===p)return;E=E.return,E.tag===4&&(I=!1)}E.sibling.return=E.return,E=E.sibling}}function Gw(d,p){if(Ve){switch(p.tag){case 0:case 11:case 14:case 15:Yl(3,p,p.return),Sh(3,p),Yl(5,p,p.return);return;case 1:return;case 5:var w=p.stateNode;if(w!=null){var E=p.memoizedProps;d=d!==null?d.memoizedProps:E;var I=p.type,k=p.updateQueue;p.updateQueue=null,k!==null&&xt(w,k,I,d,E,p)}return;case 6:if(p.stateNode===null)throw Error(s(162));w=p.memoizedProps,Le(p.stateNode,d!==null?d.memoizedProps:w,w);return;case 3:B&&d!==null&&d.memoizedState.isDehydrated&&V(p.stateNode.containerInfo);return;case 12:return;case 13:y0(p);return;case 19:y0(p);return;case 17:return}throw Error(s(163))}switch(p.tag){case 0:case 11:case 14:case 15:Yl(3,p,p.return),Sh(3,p),Yl(5,p,p.return);return;case 12:return;case 13:y0(p);return;case 19:y0(p);return;case 3:B&&d!==null&&d.memoizedState.isDehydrated&&V(p.stateNode.containerInfo);break;case 22:case 23:return}e:if(se){switch(p.tag){case 1:case 5:case 6:break e;case 3:case 4:p=p.stateNode,Yt(p.containerInfo,p.pendingChildren);break e}throw Error(s(163))}}function y0(d){var p=d.updateQueue;if(p!==null){d.updateQueue=null;var w=d.stateNode;w===null&&(w=d.stateNode=new H7),p.forEach(function(E){var I=nj.bind(null,d,E);w.has(E)||(w.add(E),E.then(I,I))})}}function X7(d,p){for(et=p;et!==null;){p=et;var w=p.deletions;if(w!==null)for(var E=0;E";case b0:return":has("+(Yw(d)||"")+")";case _0:return'[role="'+d.value+'"]';case S0:return'"'+d.value+'"';case w0:return'[data-testname="'+d.value+'"]';default:throw Error(s(365))}}function O3(d,p){var w=[];d=[d,0];for(var E=0;EI&&(I=Y),E&=~k}if(E=I,E=fr()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*Y7(E/1960))-E,10d?16:d,Va===null)var E=!1;else{if(d=Va,Va=null,R0=0,Wt&6)throw Error(s(331));var I=Wt;for(Wt|=4,et=d.current;et!==null;){var k=et,Y=k.child;if(et.flags&16){var te=k.deletions;if(te!==null){for(var Se=0;Sefr()-Qw?Kl(d,0):Jw|=w),vi(d,p)}function W3(d,p){p===0&&(d.mode&1?(p=Wg,Wg<<=1,!(Wg&130023424)&&(Wg=4194304)):p=1);var w=Qr();d=N0(d,p),d!==null&&(uh(d,p,w),vi(d,w))}function tj(d){var p=d.memoizedState,w=0;p!==null&&(w=p.retryLane),W3(d,w)}function nj(d,p){var w=0;switch(d.tag){case 13:var E=d.stateNode,I=d.memoizedState;I!==null&&(w=I.retryLane);break;case 19:E=d.stateNode;break;default:throw Error(s(314))}E!==null&&E.delete(p),W3(d,w)}var H3;H3=function(d,p,w){if(d!==null)if(d.memoizedProps!==p.pendingProps||Pt.current)Vi=!0;else{if(!(d.lanes&w)&&!(p.flags&128))return Vi=!1,$7(d,p,w);Vi=!!(d.flags&131072)}else Vi=!1,En&&p.flags&1048576&&NP(p,t0,p.index);switch(p.lanes=0,p.tag){case 2:var E=p.type;d!==null&&(d.alternate=null,p.alternate=null,p.flags|=2),d=p.pendingProps;var I=Ui(p,Kt.current);Pu(p,w),I=Nw(null,p,E,d,I,w);var k=Iw();return p.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,gn(E)?(k=!0,za(p)):k=!1,p.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,yw(p),I.updater=Qg,p.stateNode=I,I._reactInternals=p,bw(p,E,d,w),p=Uw(null,p,E,!0,k,w)):(p.tag=0,En&&k&&_w(p),Jr(null,p,I,w),p=p.child),p;case 16:E=p.elementType;e:{switch(d!==null&&(d.alternate=null,p.alternate=null,p.flags|=2),d=p.pendingProps,I=E._init,E=I(E._payload),p.type=E,I=p.tag=ij(E),d=Bo(E,d),I){case 0:p=zw(null,p,E,d,w);break e;case 1:p=m3(null,p,E,d,w);break e;case 11:p=u3(null,p,E,d,w);break e;case 14:p=f3(null,p,E,Bo(E.type,d),w);break e}throw Error(s(306,E,""))}return p;case 0:return E=p.type,I=p.pendingProps,I=p.elementType===E?I:Bo(E,I),zw(d,p,E,I,w);case 1:return E=p.type,I=p.pendingProps,I=p.elementType===E?I:Bo(E,I),m3(d,p,E,I,w);case 3:e:{if(g3(p),d===null)throw Error(s(387));E=p.pendingProps,k=p.memoizedState,I=k.element,MP(d,p),Jg(p,E,null,w);var Y=p.memoizedState;if(E=Y.element,B&&k.isDehydrated)if(k={element:E,isDehydrated:!1,cache:Y.cache,transitions:Y.transitions},p.updateQueue.baseState=k,p.memoizedState=k,p.flags&256){I=Error(s(423)),p=v3(d,p,E,w,I);break e}else if(E!==I){I=Error(s(424)),p=v3(d,p,E,w,I);break e}else for(B&&(ji=Ru(p.stateNode.containerInfo),Bi=p,En=!0,jo=null,fh=!1),w=FP(p,null,E,w),p.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling;else{if(Lu(),E===I){p=ea(d,p,w);break e}Jr(d,p,E,w)}p=p.child}return p;case 5:return zP(p),d===null&&Mw(p),E=p.type,I=p.pendingProps,k=d!==null?d.memoizedProps:null,Y=I.children,ae(E,I)?Y=null:k!==null&&ae(E,k)&&(p.flags|=32),p3(d,p),Jr(d,p,Y,w),p.child;case 6:return d===null&&Mw(p),null;case 13:return y3(d,p,w);case 4:return Cw(p,p.stateNode.containerInfo),E=p.pendingProps,d===null?p.child=ku(p,null,E,w):Jr(d,p,E,w),p.child;case 11:return E=p.type,I=p.pendingProps,I=p.elementType===E?I:Bo(E,I),u3(d,p,E,I,w);case 7:return Jr(d,p,p.pendingProps,w),p.child;case 8:return Jr(d,p,p.pendingProps.children,w),p.child;case 12:return Jr(d,p,p.pendingProps.children,w),p.child;case 10:e:{if(E=p.type._context,I=p.pendingProps,k=p.memoizedProps,Y=I.value,SP(p,E,Y),k!==null)if(ps(k.value,Y)){if(k.children===I.children&&!Pt.current){p=ea(d,p,w);break e}}else for(k=p.child,k!==null&&(k.return=p);k!==null;){var te=k.dependencies;if(te!==null){Y=k.child;for(var Se=te.firstContext;Se!==null;){if(Se.context===E){if(k.tag===1){Se=Ks(-1,w&-w),Se.tag=2;var $e=k.updateQueue;if($e!==null){$e=$e.shared;var ut=$e.pending;ut===null?Se.next=Se:(Se.next=ut.next,ut.next=Se),$e.pending=Se}}k.lanes|=w,Se=k.alternate,Se!==null&&(Se.lanes|=w),vw(k.return,w,p),te.lanes|=w;break}Se=Se.next}}else if(k.tag===10)Y=k.type===p.type?null:k.child;else if(k.tag===18){if(Y=k.return,Y===null)throw Error(s(341));Y.lanes|=w,te=Y.alternate,te!==null&&(te.lanes|=w),vw(Y,w,p),Y=k.sibling}else Y=k.child;if(Y!==null)Y.return=k;else for(Y=k;Y!==null;){if(Y===p){Y=null;break}if(k=Y.sibling,k!==null){k.return=Y.return,Y=k;break}Y=Y.return}k=Y}Jr(d,p,I.children,w),p=p.child}return p;case 9:return I=p.type,E=p.pendingProps.children,Pu(p,w),I=uo(I),E=E(I),p.flags|=1,Jr(d,p,E,w),p.child;case 14:return E=p.type,I=Bo(E,p.pendingProps),I=Bo(E.type,I),f3(d,p,E,I,w);case 15:return d3(d,p,p.type,p.pendingProps,w);case 17:return E=p.type,I=p.pendingProps,I=p.elementType===E?I:Bo(E,I),d!==null&&(d.alternate=null,p.alternate=null,p.flags|=2),p.tag=1,gn(E)?(d=!0,za(p)):d=!1,Pu(p,w),AP(p,E,I),bw(p,E,I,w),Uw(null,p,E,!0,d,w);case 19:return w3(d,p,w);case 22:return h3(d,p,w)}throw Error(s(156,p.tag))};function G3(d,p){return uw(d,p)}function rj(d,p,w,E){this.tag=d,this.key=w,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vo(d,p,w,E){return new rj(d,p,w,E)}function aS(d){return d=d.prototype,!(!d||!d.isReactComponent)}function ij(d){if(typeof d=="function")return aS(d)?1:0;if(d!=null){if(d=d.$$typeof,d===x)return 11;if(d===b)return 14}return 2}function Ha(d,p){var w=d.alternate;return w===null?(w=vo(d.tag,p,d.key,d.mode),w.elementType=d.elementType,w.type=d.type,w.stateNode=d.stateNode,w.alternate=d,d.alternate=w):(w.pendingProps=p,w.type=d.type,w.flags=0,w.subtreeFlags=0,w.deletions=null),w.flags=d.flags&14680064,w.childLanes=d.childLanes,w.lanes=d.lanes,w.child=d.child,w.memoizedProps=d.memoizedProps,w.memoizedState=d.memoizedState,w.updateQueue=d.updateQueue,p=d.dependencies,w.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},w.sibling=d.sibling,w.index=d.index,w.ref=d.ref,w}function L0(d,p,w,E,I,k){var Y=2;if(E=d,typeof d=="function")aS(d)&&(Y=1);else if(typeof d=="string")Y=5;else e:switch(d){case u:return Ql(w.children,I,k,p);case f:Y=8,I|=8;break;case h:return d=vo(12,w,p,I|2),d.elementType=h,d.lanes=k,d;case y:return d=vo(13,w,p,I),d.elementType=y,d.lanes=k,d;case g:return d=vo(19,w,p,I),d.elementType=g,d.lanes=k,d;case S:return k0(w,I,k,p);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case m:Y=10;break e;case v:Y=9;break e;case x:Y=11;break e;case b:Y=14;break e;case _:Y=16,E=null;break e}throw Error(s(130,d==null?d:typeof d,""))}return p=vo(Y,w,p,I),p.elementType=d,p.type=E,p.lanes=k,p}function Ql(d,p,w,E){return d=vo(7,d,E,p),d.lanes=w,d}function k0(d,p,w,E){return d=vo(22,d,E,p),d.elementType=S,d.lanes=w,d.stateNode={},d}function lS(d,p,w){return d=vo(6,d,null,p),d.lanes=w,d}function cS(d,p,w){return p=vo(4,d.children!==null?d.children:[],d.key,p),p.lanes=w,p.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},p}function oj(d,p,w,E,I){this.tag=p,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=He,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lw(0),this.expirationTimes=lw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lw(0),this.identifierPrefix=E,this.onRecoverableError=I,B&&(this.mutableSourceEagerHydrationData=null)}function X3(d,p,w,E,I,k,Y,te,Se){return d=new oj(d,p,w,te,Se),p===1?(p=1,k===!0&&(p|=8)):p=0,k=vo(3,null,null,p),d.current=k,k.stateNode=d,k.memoizedState={element:E,isDehydrated:w,cache:null,transitions:null},yw(k),d}function q3(d){if(!d)return ft;d=d._reactInternals;e:{if(U(d)!==d||d.tag!==1)throw Error(s(170));var p=d;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(gn(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(s(171))}if(d.tag===1){var w=d.type;if(gn(w))return Uo(d,w,p)}return p}function Y3(d){var p=d._reactInternals;if(p===void 0)throw typeof d.render=="function"?Error(s(188)):(d=Object.keys(d).join(","),Error(s(268,d)));return d=D(p),d===null?null:d.stateNode}function K3(d,p){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var w=d.retryLane;d.retryLane=w!==0&&w=$e&&k>=It&&I<=ut&&Y<=_t){d.splice(p,1);break}else if(E!==$e||w.width!==Se.width||_tY){if(!(k!==It||w.height!==Se.height||utI)){$e>E&&(Se.width+=$e-E,Se.x=E),utk&&(Se.height+=It-k,Se.y=k),_tw&&(w=Y)),Y ")+` - -No matching component was found for: - `)+d.join(" > ")}return null},n.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return H(d.child.stateNode);default:return d.child.stateNode}},n.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:sj,findFiberByHostInstance:d.findFiberByHostInstance||aj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)d=!0;else{try{Gg=p.inject(d),hs=p}catch{}d=!!p.checkDCE}}return d},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(d,p,w,E){if(!$)throw Error(s(363));d=Kw(d,p);var I=Fe(d,w,E).disconnect;return{disconnect:function(){I()}}},n.registerMutableSourceForHydration=function(d,p){var w=p._getVersion;w=w(p._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[p,w]:d.mutableSourceEagerHydrationData.push(p,w)},n.runWithPriority=function(d,p){var w=rn;try{return rn=d,p()}finally{rn=w}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(d,p,w,E){var I=p.current,k=Qr(),Y=$a(I);return w=q3(w),p.context===null?p.context=w:p.pendingContext=w,p=Ks(k,Y),p.payload={element:d},E=E===void 0?null:E,E!==null&&(p.callback=E),Ba(I,p),d=go(I,Y,k),d!==null&&Zg(d,I,Y),Y},n};UB.exports=Bfe;var jfe=UB.exports;const Vfe=js(jfe),EA={},VB=t=>void Object.assign(EA,t);function $fe(t,e){function n(u,{args:f=[],attach:h,...m},v){let x=`${u[0].toUpperCase()}${u.slice(1)}`,y;if(u==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;y=Mf(g,{type:u,root:v,attach:h,primitive:!0})}else{const g=EA[x];if(!g)throw new Error(`R3F: ${x} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(f))throw new Error("R3F: The args prop must be an array!");y=Mf(new g(...f),{type:u,root:v,attach:h,memoizedProps:{args:f}})}return y.__r3f.attach===void 0&&(y instanceof Ut?y.__r3f.attach="geometry":y instanceof Ir&&(y.__r3f.attach="material")),x!=="inject"&&YM(y,m),y}function r(u,f){let h=!1;if(f){var m,v;(m=f.__r3f)!=null&&m.attach?qM(u,f,f.__r3f.attach):f.isObject3D&&u.isObject3D&&(u.add(f),h=!0),h||(v=u.__r3f)==null||v.objects.push(f),f.__r3f||Mf(f,{}),f.__r3f.parent=u,gC(f),Ef(f)}}function i(u,f,h){let m=!1;if(f){var v,x;if((v=f.__r3f)!=null&&v.attach)qM(u,f,f.__r3f.attach);else if(f.isObject3D&&u.isObject3D){f.parent=u,f.dispatchEvent({type:"added"}),u.dispatchEvent({type:"childadded",child:f});const y=u.children.filter(b=>b!==f),g=y.indexOf(h);u.children=[...y.slice(0,g),f,...y.slice(g)],m=!0}m||(x=u.__r3f)==null||x.objects.push(f),f.__r3f||Mf(f,{}),f.__r3f.parent=u,gC(f),Ef(f)}}function o(u,f,h=!1){u&&[...u].forEach(m=>s(f,m,h))}function s(u,f,h){if(f){var m,v,x;if(f.__r3f&&(f.__r3f.parent=null),(m=u.__r3f)!=null&&m.objects&&(u.__r3f.objects=u.__r3f.objects.filter(S=>S!==f)),(v=f.__r3f)!=null&&v.attach)yk(u,f,f.__r3f.attach);else if(f.isObject3D&&u.isObject3D){var y;u.remove(f),(y=f.__r3f)!=null&&y.root&&Zfe(jy(f),f)}const b=(x=f.__r3f)==null?void 0:x.primitive,_=!b&&(h===void 0?f.dispose!==null:h);if(!b){var g;o((g=f.__r3f)==null?void 0:g.objects,f,_),o(f.children,f,_)}if(delete f.__r3f,_&&f.dispose&&f.type!=="Scene"){const S=()=>{try{f.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?pC.unstable_scheduleCallback(pC.unstable_IdlePriority,S):S()}Ef(u)}}function a(u,f,h,m){var v;const x=(v=u.__r3f)==null?void 0:v.parent;if(!x)return;const y=n(f,h,u.__r3f.root);if(u.children){for(const g of u.children)g.__r3f&&r(y,g);u.children=u.children.filter(g=>!g.__r3f)}u.__r3f.objects.forEach(g=>r(y,g)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||s(x,u),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),r(x,y),y.raycast&&y.__r3f.eventCount&&jy(y).getState().internal.interaction.push(y),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=y,g.ref&&(typeof g.ref=="function"?g.ref(y):g.ref.current=y))})}const l=()=>{};return{reconciler:Vfe({createInstance:n,removeChild:s,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,f)=>{if(!f)return;const h=u.getState().scene;h.__r3f&&(h.__r3f.root=u,r(h,f))},removeChildFromContainer:(u,f)=>{f&&s(u.getState().scene,f)},insertInContainerBefore:(u,f,h)=>{if(!f||!h)return;const m=u.getState().scene;m.__r3f&&i(m,f,h)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var f;return!!((f=u==null?void 0:u.__r3f)!=null?f:{}).handlers},prepareUpdate(u,f,h,m){var v;if(((v=u==null?void 0:u.__r3f)!=null?v:{}).primitive&&m.object&&m.object!==u)return[!0];{const{args:y=[],children:g,...b}=m,{args:_=[],children:S,...P}=h;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((R,L)=>R!==_[L]))return[!0];const N=YB(u,b,P,!0);return N.changes.length?[!1,N]:null}},commitUpdate(u,[f,h],m,v,x,y){f?a(u,m,x,y):YM(u,h)},commitMount(u,f,h,m){var v;const x=(v=u.__r3f)!=null?v:{};u.raycast&&x.handlers&&x.eventCount&&jy(u).getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>Mf(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var f;const{attach:h,parent:m}=(f=u.__r3f)!=null?f:{};h&&m&&yk(m,u,h),u.isObject3D&&(u.visible=!1),Ef(u)},unhideInstance(u,f){var h;const{attach:m,parent:v}=(h=u.__r3f)!=null?h:{};m&&v&&qM(v,u,m),(u.isObject3D&&f.visible==null||f.visible)&&(u.visible=!0),Ef(u)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Hf.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&wn.fun(performance.now)?performance.now:wn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:wn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:wn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:YM}}var pk,mk;const XM=t=>"colorSpace"in t||"outputColorSpace"in t,$B=()=>{var t;return(t=EA.ColorManagement)!=null?t:null},WB=t=>t&&t.isOrthographicCamera,Wfe=t=>t&&t.hasOwnProperty("current"),Eg=typeof window<"u"&&((pk=window.document)!=null&&pk.createElement||((mk=window.navigator)==null?void 0:mk.product)==="ReactNative")?A.useLayoutEffect:A.useEffect;function HB(t){const e=A.useRef(t);return Eg(()=>void(e.current=t),[t]),e}function Hfe({set:t}){return Eg(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class GB extends A.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}GB.getDerivedStateFromError=()=>({error:!0});const XB="__default",gk=new Map,Gfe=t=>t&&!!t.memoized&&!!t.changes;function qB(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}const ip=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()};function jy(t){let e=t.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const wn={obj:t=>t===Object(t)&&!wn.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:r="reference",strict:i=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(wn.str(t)||wn.num(t)||wn.boo(t))return t===e;const o=wn.obj(t);if(o&&r==="reference")return t===e;const s=wn.arr(t);if(s&&n==="reference")return t===e;if((s||o)&&t===e)return!0;let a;for(a in t)if(!(a in e))return!1;if(o&&n==="shallow"&&r==="shallow"){for(a in i?e:t)if(!wn.equ(t[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:t)if(t[a]!==e[a])return!1;if(wn.und(a)){if(s&&t.length===0&&e.length===0||o&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function Xfe(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function Mf(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function mC(t,e){let n=t;if(e.includes("-")){const r=e.split("-"),i=r.pop();return n=r.reduce((o,s)=>o[s],t),{target:n,key:i}}else return{target:n,key:e}}const vk=/-\d+$/;function qM(t,e,n){if(wn.str(n)){if(vk.test(n)){const o=n.replace(vk,""),{target:s,key:a}=mC(t,o);Array.isArray(s[a])||(s[a]=[])}const{target:r,key:i}=mC(t,n);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=n(t,e)}function yk(t,e,n){var r,i;if(wn.str(n)){const{target:o,key:s}=mC(t,n),a=e.__r3f.previousAttach;a===void 0?delete o[s]:o[s]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(t,e);(i=e.__r3f)==null||delete i.previousAttach}function YB(t,{children:e,key:n,ref:r,...i},{children:o,key:s,ref:a,...l}={},c=!1){const u=t.__r3f,f=Object.entries(i),h=[];if(c){const v=Object.keys(l);for(let x=0;x{var y;if((y=t.__r3f)!=null&&y.primitive&&v==="object"||wn.equ(x,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return h.push([v,x,!0,[]]);let g=[];v.includes("-")&&(g=v.split("-")),h.push([v,x,!1,g]);for(const b in i){const _=i[b];b.startsWith(`${v}-`)&&h.push([b,_,!1,b.split("-")])}});const m={...i};return u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.args&&(m.args=u.memoizedProps.args),u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.attach&&(m.attach=u.memoizedProps.attach),{memoized:m,changes:h}}const qfe=typeof process<"u"&&!1;function YM(t,e){var n;const r=t.__r3f,i=r==null?void 0:r.root,o=i==null||i.getState==null?void 0:i.getState(),{memoized:s,changes:a}=Gfe(e)?e:YB(t,e),l=r==null?void 0:r.eventCount;t.__r3f&&(t.__r3f.memoizedProps=s);for(let u=0;ug[b],t),!(y&&y.set))){const[g,...b]=v.reverse();x=b.reverse().reduce((_,S)=>_[S],t),f=g}if(h===XB+"remove")if(x.constructor){let g=gk.get(x.constructor);g||(g=new x.constructor,gk.set(x.constructor,g)),h=g[f]}else h=0;if(m&&r)h?r.handlers[f]=h:delete r.handlers[f],r.eventCount=Object.keys(r.handlers).length;else if(y&&y.set&&(y.copy||y instanceof $c)){if(Array.isArray(h))y.fromArray?y.fromArray(h):y.set(...h);else if(y.copy&&h&&h.constructor&&(qfe?y.constructor.name===h.constructor.name:y.constructor===h.constructor))y.copy(h);else if(h!==void 0){const g=y instanceof ot;!g&&y.setScalar?y.setScalar(h):y instanceof $c&&h instanceof $c?y.mask=h.mask:y.set(h),!$B()&&o&&!o.linear&&g&&y.convertSRGBToLinear()}}else if(x[f]=h,x[f]instanceof kn&&x[f].format===Rr&&x[f].type===Fi&&o){const g=x[f];XM(g)&&XM(o.gl)?g.colorSpace=o.gl.outputColorSpace:g.encoding=o.gl.outputEncoding}Ef(t)}if(r&&r.parent&&t.raycast&&l!==r.eventCount){const u=jy(t).getState().internal,f=u.interaction.indexOf(t);f>-1&&u.interaction.splice(f,1),r.eventCount&&u.interaction.push(t)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(n=t.__r3f)!=null&&n.parent&&gC(t),t}function Ef(t){var e,n;const r=(e=t.__r3f)==null||(n=e.root)==null||n.getState==null?void 0:n.getState();r&&r.internal.frames===0&&r.invalidate()}function gC(t){t.onUpdate==null||t.onUpdate(t)}function Yfe(t,e){t.manual||(WB(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix(),t.updateMatrixWorld())}function ey(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function Kfe(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Hf.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Hf.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Hf.ContinuousEventPriority;default:return Hf.DefaultEventPriority}}function KB(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function Zfe(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(r=>r!==e),n.initialHits=n.initialHits.filter(r=>r!==e),n.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&n.hovered.delete(i)}),n.capturedMap.forEach((r,i)=>{KB(n.capturedMap,e,r,i)})}function Jfe(t){function e(l){const{internal:c}=t.getState(),u=l.offsetX-c.initialClick[0],f=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+f*f))}function n(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var f;return(f=c.__r3f)==null?void 0:f.handlers["onPointer"+u]}))}function r(l,c){const u=t.getState(),f=new Set,h=[],m=c?c(u.internal.interaction):u.internal.interaction;for(let g=0;g{const _=ip(g.object),S=ip(b.object);return!_||!S?g.distance-b.distance:S.events.priority-_.events.priority||g.distance-b.distance}).filter(g=>{const b=ey(g);return f.has(b)?!1:(f.add(b),!0)});u.events.filter&&(x=u.events.filter(x,u));for(const g of x){let b=g.object;for(;b;){var y;(y=b.__r3f)!=null&&y.eventCount&&h.push({...g,eventObject:b}),b=b.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let g of u.internal.capturedMap.get(l.pointerId).values())f.has(ey(g.intersection))||h.push(g.intersection);return h}function i(l,c,u,f){const h=t.getState();if(l.length){const m={stopped:!1};for(const v of l){const x=ip(v.object)||h,{raycaster:y,pointer:g,camera:b,internal:_}=x,S=new G(g.x,g.y,0).unproject(b),P=M=>{var T,D;return(T=(D=_.capturedMap.get(M))==null?void 0:D.has(v.eventObject))!=null?T:!1},N=M=>{const T={intersection:v,target:c.target};_.capturedMap.has(M)?_.capturedMap.get(M).set(v.eventObject,T):_.capturedMap.set(M,new Map([[v.eventObject,T]])),c.target.setPointerCapture(M)},R=M=>{const T=_.capturedMap.get(M);T&&KB(_.capturedMap,v.eventObject,T,M)};let L={};for(let M in c){let T=c[M];typeof T!="function"&&(L[M]=T)}let U={...v,...L,pointer:g,intersections:l,stopped:m.stopped,delta:u,unprojectedPoint:S,ray:y.ray,camera:b,stopPropagation(){const M="pointerId"in c&&_.capturedMap.get(c.pointerId);if((!M||M.has(v.eventObject))&&(U.stopped=m.stopped=!0,_.hovered.size&&Array.from(_.hovered.values()).find(T=>T.eventObject===v.eventObject))){const T=l.slice(0,l.indexOf(v));o([...T,v])}},target:{hasPointerCapture:P,setPointerCapture:N,releasePointerCapture:R},currentTarget:{hasPointerCapture:P,setPointerCapture:N,releasePointerCapture:R},nativeEvent:c};if(f(U),m.stopped===!0)break}}return l}function o(l){const{internal:c}=t.getState();for(const u of c.hovered.values())if(!l.length||!l.find(f=>f.object===u.object&&f.index===u.index&&f.instanceId===u.instanceId)){const h=u.eventObject.__r3f,m=h==null?void 0:h.handlers;if(c.hovered.delete(ey(u)),h!=null&&h.eventCount){const v={...u,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function s(l,c){for(let u=0;uo([]);case"onLostPointerCapture":return c=>{const{internal:u}=t.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),o([]))})}}return function(u){const{onPointerMissed:f,internal:h}=t.getState();h.lastEvent.current=u;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=r(u,m?n:void 0),g=v?e(u):0;l==="onPointerDown"&&(h.initialClick=[u.offsetX,u.offsetY],h.initialHits=y.map(_=>_.eventObject)),v&&!y.length&&g<=2&&(s(u,h.interaction),f&&f(u)),m&&o(y);function b(_){const S=_.eventObject,P=S.__r3f,N=P==null?void 0:P.handlers;if(P!=null&&P.eventCount)if(m){if(N.onPointerOver||N.onPointerEnter||N.onPointerOut||N.onPointerLeave){const R=ey(_),L=h.hovered.get(R);L?L.stopped&&_.stopPropagation():(h.hovered.set(R,_),N.onPointerOver==null||N.onPointerOver(_),N.onPointerEnter==null||N.onPointerEnter(_))}N.onPointerMove==null||N.onPointerMove(_)}else{const R=N[l];R?(!v||h.initialHits.includes(S))&&(s(u,h.interaction.filter(L=>!h.initialHits.includes(L))),R(_)):v&&h.initialHits.includes(S)&&s(u,h.interaction.filter(L=>!h.initialHits.includes(L)))}}i(y,u,g,b)}}return{handlePointer:a}}const ZB=t=>!!(t!=null&&t.render),JB=A.createContext(null),Qfe=(t,e)=>{const n=Ufe((a,l)=>{const c=new G,u=new G,f=new G;function h(g=l().camera,b=u,_=l().size){const{width:S,height:P,top:N,left:R}=_,L=S/P;b instanceof G?f.copy(b):f.set(...b);const U=g.getWorldPosition(c).distanceTo(f);if(WB(g))return{width:S/g.zoom,height:P/g.zoom,top:N,left:R,factor:1,distance:U,aspect:L};{const M=g.fov*Math.PI/180,T=2*Math.tan(M/2)*U,D=T*(S/P);return{width:D,height:T,top:N,left:R,factor:S/D,distance:U,aspect:L}}}let m;const v=g=>a(b=>({performance:{...b.performance,current:g}})),x=new Ie;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)=>t(l(),g),advance:(g,b)=>e(g,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new bA,pointer:x,mouse:x,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&&v(g.performance.min),m=setTimeout(()=>v(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:h},setEvents:g=>a(b=>({...b,events:{...b.events,...g}})),setSize:(g,b,_,S,P)=>{const N=l().camera,R={width:g,height:b,top:S||0,left:P||0,updateStyle:_};a(L=>({size:R,viewport:{...L.viewport,...h(N,u,R)}}))},setDpr:g=>a(b=>{const _=qB(g);return{viewport:{...b.viewport,dpr:_,initialDpr:b.viewport.initialDpr||_}}}),setFrameloop:(g="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,g!=="never"&&(b.start(),b.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:A.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,b,_)=>{const S=l().internal;return S.priority=S.priority+(b>0?1:0),S.subscribers.push({ref:g,priority:b,store:_}),S.subscribers=S.subscribers.sort((P,N)=>P.priority-N.priority),()=>{const P=l().internal;P!=null&&P.subscribers&&(P.priority=P.priority-(b>0?1:0),P.subscribers=P.subscribers.filter(N=>N.ref!==g))}}}}}),r=n.getState();let i=r.size,o=r.viewport.dpr,s=r.camera;return n.subscribe(()=>{const{camera:a,size:l,viewport:c,gl:u,set:f}=n.getState();if(l.width!==i.width||l.height!==i.height||c.dpr!==o){var h;i=l,o=c.dpr,Yfe(a,l),u.setPixelRatio(c.dpr);const m=(h=l.updateStyle)!=null?h:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,m)}a!==s&&(s=a,f(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),n.subscribe(a=>t(a)),n};let ty,ede=new Set,tde=new Set,nde=new Set;function KM(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function op(t,e){switch(t){case"before":return KM(ede,e);case"after":return KM(tde,e);case"tail":return KM(nde,e)}}let ZM,JM;function QM(t,e,n){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof t=="number"&&(r=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),ZM=e.internal.subscribers,ty=0;ty0)&&!((u=o.gl.xr)!=null&&u.isPresenting)&&(r+=QM(c,o))}if(n=!1,op("after",c),r===0)return op("tail",c),e=!1,cancelAnimationFrame(i)}function a(c,u=1){var f;if(!c)return t.forEach(h=>a(h.store.getState(),u));(f=c.gl.xr)!=null&&f.isPresenting||!c.internal.active||c.frameloop==="never"||(u>1?c.internal.frames=Math.min(60,c.internal.frames+u):n?c.internal.frames=2:c.internal.frames=1,e||(e=!0,requestAnimationFrame(s)))}function l(c,u=!0,f,h){if(u&&op("before",c),f)QM(c,f,h);else for(const m of t.values())QM(c,m.store.getState());u&&op("after",c)}return{loop:s,invalidate:a,advance:l}}function QB(){const t=A.useContext(JB);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function wr(t=n=>n,e){return QB()(t,e)}function CA(t,e=0){const n=QB(),r=n.getState().internal.subscribe,i=HB(t);return Eg(()=>r(i,e,n),[e,r,n]),null}const Td=new Map,{invalidate:xk,advance:bk}=rde(Td),{reconciler:vx,applyProps:pf}=$fe(Td,Kfe),mf={objects:"shallow",strict:!1},ide=(t,e)=>{const n=typeof t=="function"?t(e):t;return ZB(n)?n:new $U({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function ode(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:o,left:s,updateStyle:a=n}=e;return{width:r,height:i,top:o,left:s,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:r,height:i,top:o,left:s}=t.parentElement.getBoundingClientRect();return{width:r,height:i,top:o,left:s,updateStyle:n}}else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0,updateStyle:n};return{width:0,height:0,top:0,left:0}}function sde(t){const e=Td.get(t),n=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,o=r||Qfe(xk,bk),s=n||vx.createContainer(o,Hf.ConcurrentRoot,null,!1,null,"",i,null);e||Td.set(t,{fiber:s,store:o});let a,l=!1,c;return{configure(u={}){let{gl:f,size:h,scene:m,events:v,onCreated:x,shadows:y=!1,linear:g=!1,flat:b=!1,legacy:_=!1,orthographic:S=!1,frameloop:P="always",dpr:N=[1,2],performance:R,raycaster:L,camera:U,onPointerMissed:M}=u,T=o.getState(),D=T.gl;T.gl||T.set({gl:D=ide(f,t)});let O=T.raycaster;O||T.set({raycaster:O=new DB});const{params:j,...X}=L||{};if(wn.equ(X,O,mf)||pf(O,{...X}),wn.equ(j,O.params,mf)||pf(O,{params:{...O.params,...j}}),!T.camera||T.camera===c&&!wn.equ(c,U,mf)){c=U;const K=U instanceof gg,J=K?U:S?new xg(0,0,0,0,.1,1e3):new vr(75,0,.1,1e3);K||(J.position.z=5,U&&(pf(J,U),("aspect"in U||"left"in U||"right"in U||"bottom"in U||"top"in U)&&(J.manual=!0,J.updateProjectionMatrix())),!T.camera&&!(U!=null&&U.rotation)&&J.lookAt(0,0,0)),T.set({camera:J}),O.camera=J}if(!T.scene){let K;m instanceof hx?K=m:(K=new hx,m&&pf(K,m)),T.set({scene:Mf(K)})}if(!T.xr){var H;const K=(le,ee)=>{const ae=o.getState();ae.frameloop!=="never"&&bk(le,!0,ae,ee)},J=()=>{const le=o.getState();le.gl.xr.enabled=le.gl.xr.isPresenting,le.gl.xr.setAnimationLoop(le.gl.xr.isPresenting?K:null),le.gl.xr.isPresenting||xk(le)},he={connect(){const le=o.getState().gl;le.xr.addEventListener("sessionstart",J),le.xr.addEventListener("sessionend",J)},disconnect(){const le=o.getState().gl;le.xr.removeEventListener("sessionstart",J),le.xr.removeEventListener("sessionend",J)}};typeof((H=D.xr)==null?void 0:H.addEventListener)=="function"&&he.connect(),T.set({xr:he})}if(D.shadowMap){const K=D.shadowMap.enabled,J=D.shadowMap.type;if(D.shadowMap.enabled=!!y,wn.boo(y))D.shadowMap.type=Ip;else if(wn.str(y)){var Z;const he={basic:U6,percentage:e_,soft:Ip,variance:Yo};D.shadowMap.type=(Z=he[y])!=null?Z:Ip}else wn.obj(y)&&Object.assign(D.shadowMap,y);(K!==D.shadowMap.enabled||J!==D.shadowMap.type)&&(D.shadowMap.needsUpdate=!0)}const F=$B();F&&("enabled"in F?F.enabled=!_:"legacyMode"in F&&(F.legacyMode=_)),l||pf(D,{outputEncoding:g?3e3:3001,toneMapping:b?ks:FR}),T.legacy!==_&&T.set(()=>({legacy:_})),T.linear!==g&&T.set(()=>({linear:g})),T.flat!==b&&T.set(()=>({flat:b})),f&&!wn.fun(f)&&!ZB(f)&&!wn.equ(f,D,mf)&&pf(D,f),v&&!T.events.handlers&&T.set({events:v(o)});const q=ode(t,h);return wn.equ(q,T.size,mf)||T.setSize(q.width,q.height,q.updateStyle,q.top,q.left),N&&T.viewport.dpr!==qB(N)&&T.setDpr(N),T.frameloop!==P&&T.setFrameloop(P),T.onPointerMissed||T.set({onPointerMissed:M}),R&&!wn.equ(R,T.performance,mf)&&T.set(K=>({performance:{...K.performance,...R}})),a=x,l=!0,this},render(u){return l||this.configure(),vx.updateContainer(C.jsx(ade,{store:o,children:u,onCreated:a,rootElement:t}),s,null,()=>{}),o},unmount(){e8(t)}}}function ade({store:t,children:e,onCreated:n,rootElement:r}){return Eg(()=>{const i=t.getState();i.set(o=>({internal:{...o.internal,active:!0}})),n&&n(i),t.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),C.jsx(JB.Provider,{value:t,children:e})}function e8(t,e){const n=Td.get(t),r=n==null?void 0:n.fiber;if(r){const i=n==null?void 0:n.store.getState();i&&(i.internal.active=!1),vx.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var o,s,a,l;i.events.disconnect==null||i.events.disconnect(),(o=i.gl)==null||(s=o.renderLists)==null||s.dispose==null||s.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),Xfe(i),Td.delete(t)}catch{}},500)})}}vx.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:A.version});const eE={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 lde(t){const{handlePointer:e}=Jfe(t);return{priority:1,enabled:!0,compute(n,r,i){r.pointer.set(n.offsetX/r.size.width*2-1,-(n.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(eE).reduce((n,r)=>({...n,[r]:e(r)}),{}),update:()=>{var n;const{events:r,internal:i}=t.getState();(n=i.lastEvent)!=null&&n.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:n=>{var r;const{set:i,events:o}=t.getState();o.disconnect==null||o.disconnect(),i(s=>({events:{...s.events,connected:n}})),Object.entries((r=o.handlers)!=null?r:[]).forEach(([s,a])=>{const[l,c]=eE[s];n.addEventListener(l,a,{passive:c})})},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([o,s])=>{if(r&&r.connected instanceof HTMLElement){const[a]=eE[o];r.connected.removeEventListener(a,s)}}),n(o=>({events:{...o.events,connected:void 0}}))}}}}function vC(t,e,n){var r,i,o,s,a;e==null&&(e=100);function l(){var u=Date.now()-s;u=0?r=setTimeout(l,e-u):(r=null,n||(a=t.apply(o,i),o=i=null))}var c=function(){o=this,i=arguments,s=Date.now();var u=n&&!r;return r||(r=setTimeout(l,e)),u&&(a=t.apply(o,i),o=i=null),a};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(a=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},c}vC.debounce=vC;var cde=vC;const _k=js(cde);var ude=Object.defineProperty,fde=Object.defineProperties,dde=Object.getOwnPropertyDescriptors,wk=Object.getOwnPropertySymbols,hde=Object.prototype.hasOwnProperty,pde=Object.prototype.propertyIsEnumerable,Sk=(t,e,n)=>e in t?ude(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Mk=(t,e)=>{for(var n in e||(e={}))hde.call(e,n)&&Sk(t,n,e[n]);if(wk)for(var n of wk(e))pde.call(e,n)&&Sk(t,n,e[n]);return t},mde=(t,e)=>fde(t,dde(e)),Ek,Ck;typeof window<"u"&&((Ek=window.document)!=null&&Ek.createElement||((Ck=window.navigator)==null?void 0:Ck.product)==="ReactNative")?A.useLayoutEffect:A.useEffect;function t8(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=t8(r,e,n);if(i)return i;r=r.sibling}}function n8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const Tk=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=Tk;return}return Tk.apply(this,arguments)};const TA=n8(A.createContext(null));class r8 extends A.Component{render(){return A.createElement(TA.Provider,{value:this._reactInternals},this.props.children)}}function gde(){const t=A.useContext(TA);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=A.useId();return A.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=t8(r,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}function vde(){const t=gde(),[e]=A.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==TA&&!e.has(i)&&e.set(i,A.useContext(n8(i)))}n=n.return}return e}function yde(){const t=vde();return A.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>A.createElement(e,null,A.createElement(n.Provider,mde(Mk({},r),{value:t.get(n)}))),e=>A.createElement(r8,Mk({},e))),[t])}function xde({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||typeof window<"u"&&window.ResizeObserver,[o,s]=A.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!i)return o.width=1280,o.height=800,[()=>{},o,()=>{}];const a=A.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,c=t?typeof t=="number"?t:t.resize:null,u=A.useRef(!1);A.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[f,h,m]=A.useMemo(()=>{const g=()=>{if(!a.current.element)return;const{left:b,top:_,width:S,height:P,bottom:N,right:R,x:L,y:U}=a.current.element.getBoundingClientRect(),M={left:b,top:_,width:S,height:P,bottom:N,right:R,x:L,y:U};a.current.element instanceof HTMLElement&&r&&(M.height=a.current.element.offsetHeight,M.width=a.current.element.offsetWidth),Object.freeze(M),u.current&&!Sde(a.current.lastBounds,M)&&s(a.current.lastBounds=M)};return[g,c?_k(g,c):g,l?_k(g,l):g]},[s,r,l,c]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",m,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function x(){var g;a.current.element&&(a.current.resizeObserver=new i(h),(g=a.current.resizeObserver)==null||g.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(b=>b.addEventListener("scroll",m,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const y=g=>{!g||g===a.current.element||(v(),a.current.element=g,a.current.scrollContainers=i8(g),x())};return _de(m,!!e),bde(h),A.useEffect(()=>{v(),x()},[e,m,h]),A.useEffect(()=>v,[]),[y,o,f]}function bde(t){A.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function _de(t,e){A.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function i8(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(o=>o==="auto"||o==="scroll")&&e.push(t),[...e,...i8(t.parentElement)]}const wde=["x","y","top","bottom","left","right","width","height"],Sde=(t,e)=>wde.every(n=>t[n]===e[n]),Mde=A.forwardRef(function({children:e,fallback:n,resize:r,style:i,gl:o,events:s=lde,eventSource:a,eventPrefix:l,shadows:c,linear:u,flat:f,legacy:h,orthographic:m,frameloop:v,dpr:x,performance:y,raycaster:g,camera:b,scene:_,onPointerMissed:S,onCreated:P,...N},R){A.useMemo(()=>VB(Dfe),[]);const L=yde(),[U,M]=xde({scroll:!0,debounce:{scroll:50,resize:0},...r}),T=A.useRef(null),D=A.useRef(null);A.useImperativeHandle(R,()=>T.current);const O=HB(S),[j,X]=A.useState(!1),[H,Z]=A.useState(!1);if(j)throw j;if(H)throw H;const F=A.useRef(null);Eg(()=>{const K=T.current;M.width>0&&M.height>0&&K&&(F.current||(F.current=sde(K)),F.current.configure({gl:o,events:s,shadows:c,linear:u,flat:f,legacy:h,orthographic:m,frameloop:v,dpr:x,performance:y,raycaster:g,camera:b,scene:_,size:M,onPointerMissed:(...J)=>O.current==null?void 0:O.current(...J),onCreated:J=>{J.events.connect==null||J.events.connect(a?Wfe(a)?a.current:a:D.current),l&&J.setEvents({compute:(he,le)=>{const ee=he[l+"X"],ae=he[l+"Y"];le.pointer.set(ee/le.size.width*2-1,-(ae/le.size.height)*2+1),le.raycaster.setFromCamera(le.pointer,le.camera)}}),P==null||P(J)}}),F.current.render(C.jsx(L,{children:C.jsx(GB,{set:Z,children:C.jsx(A.Suspense,{fallback:C.jsx(Hfe,{set:X}),children:e})})})))}),A.useEffect(()=>{const K=T.current;if(K)return()=>e8(K)},[]);const q=a?"none":"auto";return C.jsx("div",{ref:D,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:q,...i},...N,children:C.jsx("div",{ref:U,style:{width:"100%",height:"100%"},children:C.jsx("canvas",{ref:T,style:{display:"block"},children:n})})})}),Ede=A.forwardRef(function(e,n){return C.jsx(r8,{children:C.jsx(Mde,{...e,ref:n})})});function Cg(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function eh(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Tg(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function $l(){}var uu=.7,Rd=1/uu,od="\\s*([+-]?\\d+)\\s*",jm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ds="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Cde=/^#([0-9a-f]{3,8})$/,Tde=new RegExp(`^rgb\\(${od},${od},${od}\\)$`),Rde=new RegExp(`^rgb\\(${Ds},${Ds},${Ds}\\)$`),Ade=new RegExp(`^rgba\\(${od},${od},${od},${jm}\\)$`),Pde=new RegExp(`^rgba\\(${Ds},${Ds},${Ds},${jm}\\)$`),Nde=new RegExp(`^hsl\\(${jm},${Ds},${Ds}\\)$`),Ide=new RegExp(`^hsla\\(${jm},${Ds},${Ds},${jm}\\)$`),Rk={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};eh($l,Vm,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ak,formatHex:Ak,formatHex8:Lde,formatHsl:kde,formatRgb:Pk,toString:Pk});function Ak(){return this.rgb().formatHex()}function Lde(){return this.rgb().formatHex8()}function kde(){return o8(this).formatHsl()}function Pk(){return this.rgb().formatRgb()}function Vm(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Cde.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Nk(e):n===3?new yr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ny(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ny(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Tde.exec(t))?new yr(e[1],e[2],e[3],1):(e=Rde.exec(t))?new yr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ade.exec(t))?ny(e[1],e[2],e[3],e[4]):(e=Pde.exec(t))?ny(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Nde.exec(t))?kk(e[1],e[2]/100,e[3]/100,1):(e=Ide.exec(t))?kk(e[1],e[2]/100,e[3]/100,e[4]):Rk.hasOwnProperty(t)?Nk(Rk[t]):t==="transparent"?new yr(NaN,NaN,NaN,0):null}function Nk(t){return new yr(t>>16&255,t>>8&255,t&255,1)}function ny(t,e,n,r){return r<=0&&(t=e=n=NaN),new yr(t,e,n,r)}function RA(t){return t instanceof $l||(t=Vm(t)),t?(t=t.rgb(),new yr(t.r,t.g,t.b,t.opacity)):new yr}function Pl(t,e,n,r){return arguments.length===1?RA(t):new yr(t,e,n,r??1)}function yr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}eh(yr,Pl,Tg($l,{brighter(t){return t=t==null?Rd:Math.pow(Rd,t),new yr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?uu:Math.pow(uu,t),new yr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new yr(Hc(this.r),Hc(this.g),Hc(this.b),yx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ik,formatHex:Ik,formatHex8:Ode,formatRgb:Lk,toString:Lk}));function Ik(){return`#${kc(this.r)}${kc(this.g)}${kc(this.b)}`}function Ode(){return`#${kc(this.r)}${kc(this.g)}${kc(this.b)}${kc((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lk(){const t=yx(this.opacity);return`${t===1?"rgb(":"rgba("}${Hc(this.r)}, ${Hc(this.g)}, ${Hc(this.b)}${t===1?")":`, ${t})`}`}function yx(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Hc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function kc(t){return t=Hc(t),(t<16?"0":"")+t.toString(16)}function kk(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new es(t,e,n,r)}function o8(t){if(t instanceof es)return new es(t.h,t.s,t.l,t.opacity);if(t instanceof $l||(t=Vm(t)),!t)return new es;if(t instanceof es)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(n-r)/a+(n0&&l<1?0:s,new es(s,a,l,t.opacity)}function xx(t,e,n,r){return arguments.length===1?o8(t):new es(t,e,n,r??1)}function es(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}eh(es,xx,Tg($l,{brighter(t){return t=t==null?Rd:Math.pow(Rd,t),new es(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?uu:Math.pow(uu,t),new es(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new yr(tE(t>=240?t-240:t+120,i,r),tE(t,i,r),tE(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new es(Ok(this.h),ry(this.s),ry(this.l),yx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=yx(this.opacity);return`${t===1?"hsl(":"hsla("}${Ok(this.h)}, ${ry(this.s)*100}%, ${ry(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ok(t){return t=(t||0)%360,t<0?t+360:t}function ry(t){return Math.max(0,Math.min(1,t||0))}function tE(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const s8=Math.PI/180,a8=180/Math.PI,bx=18,l8=.96422,c8=1,u8=.82521,f8=4/29,sd=6/29,d8=3*sd*sd,Dde=sd*sd*sd;function h8(t){if(t instanceof Fs)return new Fs(t.l,t.a,t.b,t.opacity);if(t instanceof va)return p8(t);t instanceof yr||(t=RA(t));var e=oE(t.r),n=oE(t.g),r=oE(t.b),i=nE((.2225045*e+.7168786*n+.0606169*r)/c8),o,s;return e===n&&n===r?o=s=i:(o=nE((.4360747*e+.3850649*n+.1430804*r)/l8),s=nE((.0139322*e+.0971045*n+.7141733*r)/u8)),new Fs(116*i-16,500*(o-i),200*(i-s),t.opacity)}function yC(t,e,n,r){return arguments.length===1?h8(t):new Fs(t,e,n,r??1)}function Fs(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}eh(Fs,yC,Tg($l,{brighter(t){return new Fs(this.l+bx*(t??1),this.a,this.b,this.opacity)},darker(t){return new Fs(this.l-bx*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=l8*rE(e),t=c8*rE(t),n=u8*rE(n),new yr(iE(3.1338561*e-1.6168667*t-.4906146*n),iE(-.9787684*e+1.9161415*t+.033454*n),iE(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function nE(t){return t>Dde?Math.pow(t,1/3):t/d8+f8}function rE(t){return t>sd?t*t*t:d8*(t-f8)}function iE(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function oE(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Fde(t){if(t instanceof va)return new va(t.h,t.c,t.l,t.opacity);if(t instanceof Fs||(t=h8(t)),t.a===0&&t.b===0)return new va(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=r()=>t;function g8(t,e){return function(n){return t+n*e}}function jde(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function NA(t,e){var n=e-t;return n?g8(t,n>180||n<-180?n-360*Math.round(n/360):n):N_(isNaN(t)?e:t)}function Vde(t){return(t=+t)==1?xr:function(e,n){return n-e?jde(e,n,t):N_(isNaN(e)?n:e)}}function xr(t,e){var n=e-t;return n?g8(t,n):N_(isNaN(t)?e:t)}const bC=function t(e){var n=Vde(e);function r(i,o){var s=n((i=Pl(i)).r,(o=Pl(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=xr(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function $de(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Ad(r,i)})),n=sE.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function lhe(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i2?che:lhe,l=c=null,f}function f(h){return h==null||isNaN(h=+h)?o:(l||(l=a(t.map(r),e,n)))(r(s(h)))}return f.invert=function(h){return s(i((c||(c=a(e,t.map(r),Ad)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,she),u()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),u()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=LA,u()},f.clamp=function(h){return arguments.length?(s=h?!0:Rs,u()):s!==Rs},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,m){return r=h,i=m,u()}}function uhe(){return k_()(Rs,Rs)}function fhe(t,e,n,r){var i=I6(t,e,n),o;switch(r=bm(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=Xne(i,s))&&(r.precision=o),k6(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=qne(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Gne(i))&&(r.precision=o-(r.type==="%")*2);break}}return Ws(r)}function kA(t){var e=t.domain;return t.ticks=function(n){var r=e();return K2(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return fhe(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,s=r[i],a=r[o],l,c,u=10;for(a0;){if(c=Z2(s,a,n),c===l)return r[i]=s,r[o]=a,e(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function b8(){var t=uhe();return t.copy=function(){return L_(t,b8())},Cg.apply(t,arguments),kA(t)}function dhe(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],s;return oMath.pow(t,e)}function vhe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function Vk(t){return(e,n)=>-t(-e,n)}function yhe(t){const e=t(Bk,jk),n=e.domain;let r=10,i,o;function s(){return i=vhe(r),o=ghe(r),n()[0]<0?(i=Vk(i),o=Vk(o),t(hhe,phe)):t(Bk,jk),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;h<=m;++h)for(v=1;vu)break;g.push(x)}}else for(;h<=m;++h)for(v=r-1;v>=1;--v)if(x=h>0?v/o(-h):v*o(h),!(xu)break;g.push(x)}g.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=bm(l)).precision==null&&(l.trim=!0),l=Ws(l)),a===1/0)return l;const c=Math.max(1,r*a/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(dhe(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),e}function _8(){const t=yhe(k_()).domain([1,10]);return t.copy=()=>L_(t,_8()).base(t.base()),Cg.apply(t,arguments),t}function $k(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Wk(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function xhe(t){var e=1,n=t($k(e),Wk(e));return n.constant=function(r){return arguments.length?t($k(e=+r),Wk(e)):e},kA(n)}function w8(){var t=xhe(k_());return t.copy=function(){return L_(t,w8()).constant(t.constant())},Cg.apply(t,arguments)}function Hk(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function bhe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function _he(t){return t<0?-t*t:t*t}function whe(t){var e=t(Rs,Rs),n=1;function r(){return n===1?t(Rs,Rs):n===.5?t(bhe,_he):t(Hk(n),Hk(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},kA(e)}function OA(){var t=whe(k_());return t.copy=function(){return L_(t,OA()).exponent(t.exponent())},Cg.apply(t,arguments),t}function She(){return OA.apply(null,arguments).exponent(.5)}function S8(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[N6(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var s=e.indexOf(o);return[t[s-1],t[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return S8().domain(t).range(e).unknown(n)},Cg.apply(i,arguments)}const aE=new Date,lE=new Date;function Lr(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,a),t(o);while(cLr(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(i.count=(o,s)=>(aE.setTime(+o),lE.setTime(+s),t(aE),t(lE),Math.floor(n(aE,lE))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Wm=1e3,Nl=Wm*60,Hm=Nl*60,Gm=Hm*24,M8=Gm*7,DA=Lr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Wm)},(t,e)=>(e-t)/Wm,t=>t.getUTCSeconds());DA.range;const E8=Lr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Wm)},(t,e)=>{t.setTime(+t+e*Nl)},(t,e)=>(e-t)/Nl,t=>t.getMinutes());E8.range;const C8=Lr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Nl)},(t,e)=>(e-t)/Nl,t=>t.getUTCMinutes());C8.range;const T8=Lr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Wm-t.getMinutes()*Nl)},(t,e)=>{t.setTime(+t+e*Hm)},(t,e)=>(e-t)/Hm,t=>t.getHours());T8.range;const R8=Lr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Hm)},(t,e)=>(e-t)/Hm,t=>t.getUTCHours());R8.range;const A8=Lr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Nl)/Gm,t=>t.getDate()-1);A8.range;const P8=Lr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Gm,t=>t.getUTCDate()-1);P8.range;const Mhe=Lr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Gm,t=>Math.floor(t/Gm));Mhe.range;function wu(t){return Lr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Nl)/M8)}const N8=wu(0),Ehe=wu(1),Che=wu(2),The=wu(3),Rhe=wu(4),Ahe=wu(5),Phe=wu(6);N8.range;Ehe.range;Che.range;The.range;Rhe.range;Ahe.range;Phe.range;function Su(t){return Lr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/M8)}const I8=Su(0),Nhe=Su(1),Ihe=Su(2),Lhe=Su(3),khe=Su(4),Ohe=Su(5),Dhe=Su(6);I8.range;Nhe.range;Ihe.range;Lhe.range;khe.range;Ohe.range;Dhe.range;const L8=Lr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());L8.range;const k8=Lr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());k8.range;const FA=Lr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());FA.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Lr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});FA.range;const zA=Lr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());zA.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Lr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});zA.range;function Fhe(t,e){e.domain&&("nice"in t||"quantiles"in t||"padding"in t,t.domain(e.domain))}function zhe(t,e){e.range&&("padding"in t,t.range(e.range))}function Uhe(t,e){"align"in t&&"align"in e&&typeof e.align<"u"&&t.align(e.align)}function Bhe(t,e){"base"in t&&"base"in e&&typeof e.base<"u"&&t.base(e.base)}function jhe(t,e){"clamp"in t&&"clamp"in e&&typeof e.clamp<"u"&&t.clamp(e.clamp)}function Vhe(t,e){"constant"in t&&"constant"in e&&typeof e.constant<"u"&&t.constant(e.constant)}function $he(t,e){"exponent"in t&&"exponent"in e&&typeof e.exponent<"u"&&t.exponent(e.exponent)}var Gk={lab:the,hcl:nhe,"hcl-long":rhe,hsl:Qde,"hsl-long":ehe,cubehelix:ihe,"cubehelix-long":I_,rgb:bC};function Whe(t){switch(t){case"lab":case"hcl":case"hcl-long":case"hsl":case"hsl-long":case"cubehelix":case"cubehelix-long":case"rgb":return Gk[t]}var e=t.type,n=t.gamma,r=Gk[e];return typeof n>"u"?r:r.gamma(n)}function Hhe(t,e){if("interpolate"in e&&"interpolate"in t&&typeof e.interpolate<"u"){var n=Whe(e.interpolate);t.interpolate(n)}}var Ghe=new Date(Date.UTC(2020,1,2,3,4,5)),Xhe="%Y-%m-%d %H:%M";function qhe(t){var e=t.tickFormat(1,Xhe)(Ghe);return e==="2020-02-02 03:04"}var Xk={day:A8,hour:T8,minute:E8,month:L8,second:DA,week:N8,year:FA},qk={day:P8,hour:R8,minute:C8,month:k8,second:DA,week:I8,year:zA};function Yhe(t,e){if("nice"in e&&typeof e.nice<"u"&&"nice"in t){var n=e.nice;if(typeof n=="boolean")n&&t.nice();else if(typeof n=="number")t.nice(n);else{var r=t,i=qhe(r);if(typeof n=="string")r.nice(i?qk[n]:Xk[n]);else{var o=n.interval,s=n.step,a=(i?qk[o]:Xk[o]).every(s);a!=null&&r.nice(a)}}}}function Khe(t,e){"padding"in t&&"padding"in e&&typeof e.padding<"u"&&t.padding(e.padding),"paddingInner"in t&&"paddingInner"in e&&typeof e.paddingInner<"u"&&t.paddingInner(e.paddingInner),"paddingOuter"in t&&"paddingOuter"in e&&typeof e.paddingOuter<"u"&&t.paddingOuter(e.paddingOuter)}function Zhe(t,e){if(e.reverse){var n=t.range().slice().reverse();"padding"in t,t.range(n)}}function Jhe(t,e){"round"in e&&typeof e.round<"u"&&(e.round&&"interpolate"in e&&typeof e.interpolate<"u"?console.warn("[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:",e):"round"in t?t.round(e.round):"interpolate"in t&&e.round&&t.interpolate(LA))}function Qhe(t,e){"unknown"in t&&"unknown"in e&&typeof e.unknown<"u"&&t.unknown(e.unknown)}function epe(t,e){if("zero"in e&&e.zero===!0){var n=t.domain(),r=n[0],i=n[1],o=i=0)&&(n[i]=t[i]);return n}function _x(){return _x=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var F8={position:"absolute",backgroundColor:"white",color:"#666666",padding:".3rem .5rem",borderRadius:"3px",fontSize:"14px",boxShadow:"0 1px 2px rgba(33,33,33,0.2)",lineHeight:"1em",pointerEvents:"none"},VA=Mt.forwardRef(function(t,e){var n=t.className,r=t.top,i=t.left,o=t.offsetLeft,s=o===void 0?10:o,a=t.offsetTop,l=a===void 0?10:a,c=t.style,u=c===void 0?F8:c,f=t.children,h=t.unstyled,m=h===void 0?!1:h,v=t.applyPositionStyle,x=v===void 0?!1:v,y=xpe(t,ype);return Mt.createElement("div",wx({ref:e,className:ss("visx-tooltip",n),style:wx({top:r==null||l==null?r:r+l,left:i==null||s==null?i:i+s},x&&{position:"absolute"},!m&&u)},y),f)});VA.propTypes={children:qt.node,className:qt.string,left:qt.number,offsetLeft:qt.number,offsetTop:qt.number,top:qt.number,applyPositionStyle:qt.bool,unstyled:qt.bool};VA.displayName="Tooltip";function SC(){return SC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function U8(t){var e=t.children;t.getRects;var n=t.left,r=n===void 0?0:n,i=t.offsetLeft,o=i===void 0?10:i,s=t.offsetTop,a=s===void 0?10:s,l=t.parentRect,c=t.rect,u=t.style,f=u===void 0?F8:u,h=t.top,m=h===void 0?0:h,v=t.unstyled,x=v===void 0?!1:v,y=t.nodeRef,g=Epe(t,Mpe),b,_=!1,S=!1;if(c&&l){var P=r,N=m;if(l.width){var R=P+o+c.width-l.width,L=c.width-P-o;_=R>0&&R>L}else{var U=P+o+c.width-window.innerWidth,M=c.width-P-o;_=U>0&&U>M}if(l.height){var T=N+a+c.height-l.height,D=c.height-N-a;S=T>0&&T>D}else S=N+a+c.height>window.innerHeight;P=_?P-c.width-o:P+o,N=S?N-c.height-a:N+a,P=Math.round(P),N=Math.round(N),b="translate("+P+"px, "+N+"px)"}return Mt.createElement(VA,Sx({ref:y,style:Sx({left:0,top:0,transform:b},!x&&f)},g),Mt.createElement(Spe,{value:{isFlippedVertically:!S,isFlippedHorizontally:!_}},e))}U8.propTypes={nodeRef:qt.oneOfType([qt.string,qt.func,qt.object])};const Cpe=wpe(U8);var Tpe=["top","left","transform","className","children","innerRef"];function EC(){return EC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function Rg(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.transform,s=t.className,a=t.children,l=t.innerRef,c=Rpe(t,Tpe);return Mt.createElement("g",EC({ref:l,className:ss("visx-group",s),transform:o||"translate("+i+", "+n+")"},c),a)}Rg.propTypes={top:qt.number,left:qt.number,transform:qt.string,className:qt.string,children:qt.node,innerRef:qt.oneOfType([qt.string,qt.func,qt.object])};var Ape=["from","to","fill","className","innerRef"];function CC(){return CC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function Mx(t){var e=t.from,n=e===void 0?{x:0,y:0}:e,r=t.to,i=r===void 0?{x:1,y:1}:r,o=t.fill,s=o===void 0?"transparent":o,a=t.className,l=t.innerRef,c=Ppe(t,Ape),u=n.x===i.x||n.y===i.y;return Mt.createElement("line",CC({ref:l,className:ss("visx-line",a),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:s,shapeRendering:u?"crispEdges":"auto"},c))}var Npe=B8;function B8(t,e,n){t instanceof RegExp&&(t=Kk(t,n)),e instanceof RegExp&&(e=Kk(e,n));var r=j8(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function Kk(t,e){var n=e.match(t);return n?n[0]:null}B8.range=j8;function j8(t,e,n){var r,i,o,s,a,l=n.indexOf(t),c=n.indexOf(e,l+1),u=l;if(l>=0&&c>0){for(r=[],o=n.length;u>=0&&!a;)u==l?(r.push(u),l=n.indexOf(t,u+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i=0?l:c;r.length&&(a=[o,s])}return a}var Ipe=V8;function V8(t,e,n){t instanceof RegExp&&(t=Zk(t,n)),e instanceof RegExp&&(e=Zk(e,n));var r=$8(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function Zk(t,e){var n=e.match(t);return n?n[0]:null}V8.range=$8;function $8(t,e,n){var r,i,o,s,a,l=n.indexOf(t),c=n.indexOf(e,l+1),u=l;if(l>=0&&c>0){if(t===e)return[l,c];for(r=[],o=n.length;u>=0&&!a;)u==l?(r.push(u),l=n.indexOf(t,u+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i=0?l:c;r.length&&(a=[o,s])}return a}var Lpe=Ipe,kpe=W8;function W8(t,e,n){var r=t;return Ope(t,e).reduce(function(i,o){return i.replace(o.functionIdentifier+"("+o.matches.body+")",Dpe(o.matches.body,o.functionIdentifier,n,r,e))},t)}function Ope(t,e){var n=[],r=typeof e=="string"?new RegExp("\\b("+e+")\\("):e;do{var i=r.exec(t);if(!i)return n;if(i[1]===void 0)throw new Error("Missing the first couple of parenthesis to get the function identifier in "+e);var o=i[1],s=i.index,a=Lpe("(",")",t.substring(s));if(!a||a.start!==i[0].length-1)throw new SyntaxError(o+"(): missing closing ')' in the value '"+t+"'");n.push({matches:a,functionIdentifier:o}),t=a.post}while(r.test(t));return n}function Dpe(t,e,n,r,i){return n(W8(t,i,n),e,r)}var ri=function(t){this.value=t};ri.math={isDegree:!0,acos:function(t){return ri.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,e){return t+e},asin:function(t){return ri.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return ri.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,e){var n=1,r=t-e,i=e;ioi.length-2?oi.length-1:t.length-s;i>0;i--)if(oi[i]!==void 0)for(o=0;o0&&cr)s.push(e);else{for(;r>=i&&!c||c&&i"u"?e[e.length-1].value.push(o[a]):e[e.length-1].value=o[a].value(e[e.length-1].value);else if(o[a].type===7)typeof e[e.length-1].type>"u"?e[e.length-1].value.push(o[a]):e[e.length-1].value=o[a].value(e[e.length-1].value);else if(o[a].type===8){for(var l=[],c=0;c"u"?(r.value=r.concat(n),r.value.push(o[a]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[a]),e.push(n)):e.push({type:1,value:o[a].value(r.value,n.value)})):o[a].type===2||o[a].type===9?(n=e.pop(),r=e.pop(),typeof r.type>"u"?(r=r.concat(n),r.push(o[a]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[a]),e.push(n)):e.push({type:1,value:o[a].value(r.value,n.value)})):o[a].type===12?(n=e.pop(),typeof n.type<"u"&&(n=[n]),r=e.pop(),i=e.pop(),e.push({type:1,value:o[a].value(i.value,r.value,new Vp(n))})):o[a].type===13&&(s?e.push({value:t[o[a].value],type:3}):e.push([o[a]]));if(e.length>1)throw new Vp.Exception("Uncaught Syntax error");return e[0].value>1e15?"Infinity":parseFloat(e[0].value.toFixed(15))};Vp.eval=function(t,e,n){return typeof e>"u"?this.lex(t).toPostfix().postfixEval():typeof n>"u"?typeof e.length<"u"?this.lex(t,e).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(e):this.lex(t,e).toPostfix().postfixEval(n)};var Hpe=Vp,G8=Hpe;G8.prototype.formulaEval=function(){for(var t,e,n,r=[],i=this.value,o=0;o"+e.value+""+i[o].show+""+t.value+"",type:10}):r.push({value:(e.type!=1?"(":"")+e.value+(e.type!=1?")":"")+""+t.value+"",type:1})):i[o].type===2||i[o].type===9?(t=r.pop(),e=r.pop(),r.push({value:(e.type!=1?"(":"")+e.value+(e.type!=1?")":"")+i[o].show+(t.type!=1?"(":"")+t.value+(t.type!=1?")":""),type:i[o].type})):i[o].type===12&&(t=r.pop(),e=r.pop(),n=r.pop(),r.push({value:i[o].show+"("+n.value+","+e.value+","+t.value+")",type:12}));return r[0].value};var Gpe=G8,Xpe=Npe,qpe=kpe,Ype=Gpe,Kpe=100,Zpe=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,cE,Jpe=Qpe;function Qpe(t,e){cE=0,e=Math.pow(10,e===void 0?5:e),t=t.replace(/\n+/g," ");function n(i,o,s){if(cE++>Kpe)throw cE=0,new Error("Call stack overflow for "+s);if(i==="")throw new Error(o+"(): '"+s+"' must contain a non-whitespace string");i=r(i,s);var a=eme(i);if(a.length>1||i.indexOf("var(")>-1)return o+"("+i+")";var l=a[0]||"";l==="%"&&(i=i.replace(/\b[0-9\.]+%/g,function(f){return parseFloat(f.slice(0,-1))*.01}));var c=i.replace(new RegExp(l,"gi"),""),u;try{u=Ype.eval(c)}catch{return o+"("+i+")"}return l==="%"&&(u*=100),(o.length||l==="%")&&(u=Math.round(u*e)/e),u+=l,u}function r(i,o){i=i.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var s="",a=i,l;l=Zpe.exec(a);){l[0].index>0&&(s+=a.substring(0,l[0].index));var c=Xpe("(",")",a.substring([0].index));if(c.body==="")throw new Error("'"+i+"' must contain a non-whitespace string");var u=n(c.body,"",o);s+=c.pre+u,a=c.post}return s+a}return qpe(t,/((?:\-[a-z]+\-)?calc)\(/,n)}function eme(t){for(var e=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(t);i;)!i||!i[1]||(n.indexOf(i[1].toLowerCase())===-1&&(e.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(t));return e}const uE=js(Jpe);var tme=typeof D0=="object"&&D0&&D0.Object===Object&&D0,nme=tme,rme=nme,ime=typeof self=="object"&&self&&self.Object===Object&&self,ome=rme||ime||Function("return this")(),$A=ome,sme=$A,ame=sme.Symbol,X8=ame,Jk=X8,q8=Object.prototype,lme=q8.hasOwnProperty,cme=q8.toString,lp=Jk?Jk.toStringTag:void 0;function ume(t){var e=lme.call(t,lp),n=t[lp];try{t[lp]=void 0;var r=!0}catch{}var i=cme.call(t);return r&&(e?t[lp]=n:delete t[lp]),i}var fme=ume,dme=Object.prototype,hme=dme.toString;function pme(t){return hme.call(t)}var mme=pme,Qk=X8,gme=fme,vme=mme,yme="[object Null]",xme="[object Undefined]",eO=Qk?Qk.toStringTag:void 0;function bme(t){return t==null?t===void 0?xme:yme:eO&&eO in Object(t)?gme(t):vme(t)}var _me=bme;function wme(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Y8=wme,Sme=_me,Mme=Y8,Eme="[object AsyncFunction]",Cme="[object Function]",Tme="[object GeneratorFunction]",Rme="[object Proxy]";function Ame(t){if(!Mme(t))return!1;var e=Sme(t);return e==Cme||e==Tme||e==Eme||e==Rme}var Pme=Ame,Nme=$A,Ime=Nme["__core-js_shared__"],Lme=Ime,fE=Lme,tO=function(){var t=/[^.]+$/.exec(fE&&fE.keys&&fE.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function kme(t){return!!tO&&tO in t}var Ome=kme,Dme=Function.prototype,Fme=Dme.toString;function zme(t){if(t!=null){try{return Fme.call(t)}catch{}try{return t+""}catch{}}return""}var Ume=zme,Bme=Pme,jme=Ome,Vme=Y8,$me=Ume,Wme=/[\\^$.*+?()[\]{}|]/g,Hme=/^\[object .+?Constructor\]$/,Gme=Function.prototype,Xme=Object.prototype,qme=Gme.toString,Yme=Xme.hasOwnProperty,Kme=RegExp("^"+qme.call(Yme).replace(Wme,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zme(t){if(!Vme(t)||jme(t))return!1;var e=Bme(t)?Kme:Hme;return e.test($me(t))}var Jme=Zme;function Qme(t,e){return t==null?void 0:t[e]}var ege=Qme,tge=Jme,nge=ege;function rge(t,e){var n=nge(t,e);return tge(n)?n:void 0}var K8=rge,ige=K8,oge=ige(Object,"create"),O_=oge,nO=O_;function sge(){this.__data__=nO?nO(null):{},this.size=0}var age=sge;function lge(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var cge=lge,uge=O_,fge="__lodash_hash_undefined__",dge=Object.prototype,hge=dge.hasOwnProperty;function pge(t){var e=this.__data__;if(uge){var n=e[t];return n===fge?void 0:n}return hge.call(e,t)?e[t]:void 0}var mge=pge,gge=O_,vge=Object.prototype,yge=vge.hasOwnProperty;function xge(t){var e=this.__data__;return gge?e[t]!==void 0:yge.call(e,t)}var bge=xge,_ge=O_,wge="__lodash_hash_undefined__";function Sge(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=_ge&&e===void 0?wge:e,this}var Mge=Sge,Ege=age,Cge=cge,Tge=mge,Rge=bge,Age=Mge;function nh(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Xge=Gge,qge=D_;function Yge(t,e){var n=this.__data__,r=qge(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Kge=Yge,Zge=Ige,Jge=jge,Qge=Wge,e0e=Xge,t0e=Kge;function rh(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e=0)&&(n[i]=t[i]);return n}function dE(t){return typeof t=="number"}function sO(t){return typeof t=="number"&&Number.isFinite(t)||typeof t=="string"}function U0e(t){var e=t.verticalAnchor,n=e===void 0?"end":e,r=t.scaleToFit,i=r===void 0?!1:r,o=t.angle,s=t.width,a=t.lineHeight,l=a===void 0?"1em":a,c=t.capHeight,u=c===void 0?"0.71em":c,f=t.children,h=t.style,m=z0e(t,F0e),v=m.x,x=v===void 0?0:v,y=m.y,g=y===void 0?0:y,b=!sO(x)||!sO(g),_=A.useMemo(function(){var U=f==null?[]:f.toString().split(/(?:(?!\u00A0+)\s+)/);return{wordsWithWidth:U.map(function(M){return{word:M,wordWidth:oO(M,h)||0}}),spaceWidth:oO(" ",h)||0}},[f,h]),S=_.wordsWithWidth,P=_.spaceWidth,N=A.useMemo(function(){return b?[]:s||i?S.reduce(function(U,M){var T=M.word,D=M.wordWidth,O=U[U.length-1];if(O&&(s==null||i||(O.width||0)+D+P0){var M=N[0].width||1,T=i==="shrink-only"?Math.min(s/M,1):s/M,D=T,O=x-T*x,j=g-D*g;U.push("matrix("+T+", 0, 0, "+D+", "+O+", "+j+")")}return o&&U.push("rotate("+o+", "+x+", "+g+")"),U.length>0?U.join(" "):""},[b,x,g,s,i,N,o]);return{wordsByLines:N,startDy:R,transform:L}}var B0e=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function AC(){return AC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var V0e={overflow:"visible"};function J8(t){var e=t.dx,n=e===void 0?0:e,r=t.dy,i=r===void 0?0:r,o=t.textAnchor,s=o===void 0?"start":o,a=t.innerRef,l=t.innerTextRef;t.verticalAnchor,t.angle;var c=t.lineHeight,u=c===void 0?"1em":c;t.scaleToFit,t.capHeight,t.width;var f=j0e(t,B0e),h=f.x,m=h===void 0?0:h,v=f.fontSize,x=U0e(t),y=x.wordsByLines,g=x.startDy,b=x.transform;return Mt.createElement("svg",{ref:a,x:n,y:i,fontSize:v,style:V0e},y.length>0?Mt.createElement("text",AC({ref:l,transform:b},f,{textAnchor:s}),y.map(function(_,S){return Mt.createElement("tspan",{key:S,x:m,dy:S===0?g:u},_.words.join(" "))})):null)}var Yi={top:"top",left:"left",right:"right",bottom:"bottom"};function $0e(t){var e=t.labelOffset,n=t.labelProps,r=t.orientation,i=t.range,o=t.tickLabelFontSize,s=t.tickLength,a=r===Yi.left||r===Yi.top?-1:1,l,c,u;if(r===Yi.top||r===Yi.bottom){var f=r===Yi.bottom&&typeof n.fontSize=="number"?n.fontSize:0;l=(Number(i[0])+Number(i[i.length-1]))/2,c=a*(s+e+o+f)}else l=a*((Number(i[0])+Number(i[i.length-1]))/2),c=-(s+e),u="rotate("+a*90+")";return{x:l,y:c,transform:u}}function $p(){return $p=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function Q8(t){var e=t.children,n=e===void 0?H0e:e,r=t.axisClassName,i=t.hideAxisLine,o=i===void 0?!1:i,s=t.hideTicks,a=s===void 0?!1:s,l=t.hideZero,c=l===void 0?!1:l,u=t.innerRef,f=t.left,h=f===void 0?0:f,m=t.numTicks,v=m===void 0?10:m,x=t.orientation,y=x===void 0?Yi.bottom:x,g=t.rangePadding,b=g===void 0?0:g,_=t.scale,S=t.tickFormat,P=t.tickLength,N=P===void 0?8:P,R=t.tickValues,L=t.top,U=L===void 0?0:L,M=K0e(t,Y0e),T=S??X0e(_),D=y===Yi.left,O=y===Yi.top,j=O||y===Yi.bottom,X=G0e(_),H=D||O?-1:1,Z=_.range(),F=q0e(b),q=sy({x:Number(Z[0])+.5-F.start,y:0},j),K=sy({x:Number(Z[Z.length-1])+.5+F.end,y:0},j),J=(R??jA(_,v)).filter(function(le){return!c||le!==0&&le!=="0"}).map(function(le,ee){return{value:le,index:ee}}),he=J.map(function(le){var ee=le.value,ae=le.index,ge=BA(X(ee));return{value:ee,index:ae,from:sy({x:ge,y:0},j),to:sy({x:ge,y:N*H},j),formattedValue:T(ee,ae,J)}});return Mt.createElement(Rg,{className:ss("visx-axis",r),innerRef:u,top:U,left:h},n(NC({},M,{axisFromPoint:q,axisToPoint:K,hideAxisLine:o,hideTicks:a,hideZero:c,horizontal:j,numTicks:v,orientation:y,rangePadding:b,scale:_,tickFormat:T,tickLength:N,tickPosition:X,tickSign:H,ticks:he})))}var Z0e=["axisClassName","labelOffset","tickLength","tickLabelProps"];function Ex(){return Ex=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var Q0e={dx:"-0.25em",dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"end"};function eve(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?36:n,i=t.tickLength,o=i===void 0?8:i,s=t.tickLabelProps,a=J0e(t,Z0e),l=typeof s=="function"?s:Ex({},Q0e,s);return Mt.createElement(Q8,Ex({axisClassName:ss("visx-axis-left",e),labelOffset:r,orientation:Yi.left,tickLabelProps:l,tickLength:o},a))}var tve=["axisClassName","labelOffset","tickLength","tickLabelProps"];function Cx(){return Cx=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var rve={dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"middle"};function ive(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?8:n,i=t.tickLength,o=i===void 0?8:i,s=t.tickLabelProps,a=nve(t,tve),l=typeof s=="function"?s:Cx({},rve,s);return Mt.createElement(Q8,Cx({axisClassName:ss("visx-axis-bottom",e),labelOffset:r,orientation:Yi.bottom,tickLabelProps:l,tickLength:o},a))}var e9=cve,ove=t9(A),sve=t9(D8),ave=["from","to","fill","className","innerRef"];function t9(t){return t&&t.__esModule?t:{default:t}}function IC(){return IC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function cve(t){var e=t.from,n=e===void 0?{x:0,y:0}:e,r=t.to,i=r===void 0?{x:1,y:1}:r,o=t.fill,s=o===void 0?"transparent":o,a=t.className,l=t.innerRef,c=lve(t,ave),u=n.x===i.x||n.y===i.y;return ove.default.createElement("line",IC({ref:l,className:(0,sve.default)("visx-line",a),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:s,shapeRendering:u?"crispEdges":"auto"},c))}function n9(t){return"bandwidth"in t?t.bandwidth():0}var uve=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function LC(){return LC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function r9(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,s=t.width,a=t.stroke,l=a===void 0?"#eaf0f6":a,c=t.strokeWidth,u=c===void 0?1:c,f=t.strokeDasharray,h=t.className,m=t.children,v=t.numTicks,x=v===void 0?10:v,y=t.lineStyle,g=t.offset,b=t.tickValues,_=fve(t,uve),S=b??jA(o,x),P=(g??0)+n9(o)/2,N=S.map(function(R,L){var U,M=((U=BA(o(R)))!=null?U:0)+P;return{index:L,from:new Xm({x:0,y:M}),to:new Xm({x:s,y:M})}});return Mt.createElement(Rg,{className:ss("visx-rows",h),top:n,left:i},m?m({lines:N}):N.map(function(R){var L=R.from,U=R.to,M=R.index;return Mt.createElement(e9,LC({key:"row-line-"+M,from:L,to:U,stroke:l,strokeWidth:u,strokeDasharray:f,style:y},_))}))}r9.propTypes={tickValues:qt.array,width:qt.number.isRequired};var dve=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function kC(){return kC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function i9(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,s=t.height,a=t.stroke,l=a===void 0?"#eaf0f6":a,c=t.strokeWidth,u=c===void 0?1:c,f=t.strokeDasharray,h=t.className,m=t.numTicks,v=m===void 0?10:m,x=t.lineStyle,y=t.offset,g=t.tickValues,b=t.children,_=hve(t,dve),S=g??jA(o,v),P=(y??0)+n9(o)/2,N=S.map(function(R,L){var U,M=((U=BA(o(R)))!=null?U:0)+P;return{index:L,from:new Xm({x:M,y:0}),to:new Xm({x:M,y:s})}});return Mt.createElement(Rg,{className:ss("visx-columns",h),top:n,left:i},b?b({lines:N}):N.map(function(R){var L=R.from,U=R.to,M=R.index;return Mt.createElement(e9,kC({key:"column-line-"+M,from:L,to:U,stroke:l,strokeWidth:u,strokeDasharray:f,style:x},_))}))}i9.propTypes={tickValues:qt.array,height:qt.number.isRequired};function fn(t){for(var e=t.length/6|0,n=new Array(e),r=0;rWde(t[t.length-1]);var pve=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(fn);const mve=yn(pve);var gve=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(fn);const vve=yn(gve);var yve=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(fn);const xve=yn(yve);var bve=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(fn);const _ve=yn(bve);var wve=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(fn);const Sve=yn(wve);var Mve=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(fn);const Eve=yn(Mve);var Cve=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(fn);const Tve=yn(Cve);var Rve=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(fn);const Ave=yn(Rve);var Pve=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(fn);const Nve=yn(Pve);var Ive=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(fn);const Lve=yn(Ive);var kve=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(fn);const Ove=yn(kve);var Dve=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(fn);const Fve=yn(Dve);var zve=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(fn);const Uve=yn(zve);var Bve=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(fn);const jve=yn(Bve);var Vve=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(fn);const $ve=yn(Vve);var Wve=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(fn);const Hve=yn(Wve);var Gve=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(fn);const Xve=yn(Gve);var qve=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(fn);const Yve=yn(qve);var Kve=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(fn);const Zve=yn(Kve);var Jve=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(fn);const Qve=yn(Jve);var eye=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(fn);const tye=yn(eye);var nye=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(fn);const rye=yn(nye);var iye=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(fn);const oye=yn(iye);var sye=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(fn);const aye=yn(sye);var lye=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(fn);const cye=yn(lye);var uye=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(fn);const fye=yn(uye);var dye=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(fn);const hye=yn(dye);function pye(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}const mye=I_(Us(300,.5,0),Us(-240,.5,1));var gye=I_(Us(-100,.75,.35),Us(80,1.5,.8)),vye=I_(Us(260,.75,.35),Us(80,1.5,.8)),ay=Us();function yye(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return ay.h=360*t-100,ay.s=1.5-1.5*e,ay.l=.8-.9*e,ay+""}var ly=Pl(),xye=Math.PI/3,bye=Math.PI*2/3;function _ye(t){var e;return t=(.5-t)*Math.PI,ly.r=255*(e=Math.sin(t))*e,ly.g=255*(e=Math.sin(t+xye))*e,ly.b=255*(e=Math.sin(t+bye))*e,ly+""}function wye(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function z_(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Sye=z_(fn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Mye=z_(fn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Eye=z_(fn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Cye=z_(fn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function HA(t,e=0,n=[]){return A.Children.toArray(t).reduce((r,i,o)=>(U2.isFragment(i)?r.push.apply(r,HA(i.props.children,e+1,n.concat(i.key||o))):A.isValidElement(i)?r.push(A.cloneElement(i,{key:n.concat(String(i.key)).join(".")})):(typeof i=="string"||typeof i=="number")&&r.push(i),r),[])}function U_(){return typeof window<"u"}function oh(t){return o9(t)?(t.nodeName||"").toLowerCase():"#document"}function to(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Xs(t){var e;return(e=(o9(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function o9(t){return U_()?t instanceof Node||t instanceof to(t).Node:!1}function li(t){return U_()?t instanceof Element||t instanceof to(t).Element:!1}function io(t){return U_()?t instanceof HTMLElement||t instanceof to(t).HTMLElement:!1}function OC(t){return!U_()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof to(t).ShadowRoot}function Ag(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=as(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Tye(t){return["table","td","th"].includes(oh(t))}function B_(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function GA(t){const e=XA(),n=li(t)?as(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Rye(t){let e=Il(t);for(;io(e)&&!Pd(e);){if(GA(e))return e;if(B_(e))return null;e=Il(e)}return null}function XA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pd(t){return["html","body","#document"].includes(oh(t))}function as(t){return to(t).getComputedStyle(t)}function j_(t){return li(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Il(t){if(oh(t)==="html")return t;const e=t.assignedSlot||t.parentNode||OC(t)&&t.host||Xs(t);return OC(e)?e.host:e}function s9(t){const e=Il(t);return Pd(e)?t.ownerDocument?t.ownerDocument.body:t.body:io(e)&&Ag(e)?e:s9(e)}function qm(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=s9(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=to(i);if(o){const a=DC(s);return e.concat(s,s.visualViewport||[],Ag(i)?i:[],a&&n?qm(a):[])}return e.concat(i,qm(i,[],n))}function DC(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function lO(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function Aye(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&OC(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function a9(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function l9(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}function Pye(t){return t.mozInputSource===0&&t.isTrusted?!0:FC()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Nye(t){return kye()?!1:!FC()&&t.width===0&&t.height===0||FC()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Iye(){return/apple/i.test(navigator.vendor)}function FC(){const t=/android/i;return t.test(a9())||t.test(l9())}function Lye(){return a9().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function kye(){return l9().includes("jsdom/")}function cO(t,e){return["mouse","pen"].includes(t)}function Oye(t){return(t==null?void 0:t.ownerDocument)||document}const Dye="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function c9(t){return io(t)&&t.matches(Dye)}function So(t){t.preventDefault(),t.stopPropagation()}function Fye(t){return t?t.getAttribute("role")==="combobox"&&c9(t):!1}const Nd=Math.min,Xi=Math.max,Tx=Math.round,Gf=Math.floor,Ll=t=>({x:t,y:t});function uO(t,e,n){return Xi(t,Nd(e,n))}function V_(t,e){return typeof t=="function"?t(e):t}function Pg(t){return t.split("-")[0]}function qA(t){return t.split("-")[1]}function u9(t){return t==="x"?"y":"x"}function zye(t){return t==="y"?"height":"width"}function Ng(t){return["top","bottom"].includes(Pg(t))?"y":"x"}function Uye(t){return u9(Ng(t))}function Bye(t){return{top:0,right:0,bottom:0,left:0,...t}}function jye(t){return typeof t!="number"?Bye(t):{top:t,right:t,bottom:t,left:t}}function Rx(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function fO(t,e,n){let{reference:r,floating:i}=t;const o=Ng(e),s=Uye(e),a=zye(s),l=Pg(e),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:u,y:r.y-i.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-i.width,y:f};break;default:m={x:r.x,y:r.y}}switch(qA(e)){case"start":m[s]-=h*(n&&c?-1:1);break;case"end":m[s]+=h*(n&&c?-1:1);break}return m}const Vye=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=fO(c,r,l),h=r,m={},v=0;for(let x=0;x{let{x:g,y:b}=y;return{x:g,y:b}}},...l}=V_(t,e),c={x:n,y:r},u=await f9(e,l),f=Ng(Pg(i)),h=u9(f);let m=c[h],v=c[f];if(o){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",b=m+u[y],_=m-u[g];m=uO(b,m,_)}if(s){const y=f==="y"?"top":"left",g=f==="y"?"bottom":"right",b=v+u[y],_=v-u[g];v=uO(b,v,_)}const x=a.fn({...e,[h]:m,[f]:v});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[h]:o,[f]:s}}}}}},Gye=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=V_(t,e),u=await f9(e,c),f=Pg(i),h=qA(i),m=Ng(i)==="y",{width:v,height:x}=o.floating;let y,g;f==="top"||f==="bottom"?(y=f,g=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,y=h==="end"?"top":"bottom");const b=x-u.top-u.bottom,_=v-u.left-u.right,S=Nd(x-u[y],b),P=Nd(v-u[g],_),N=!e.middlewareData.shift;let R=S,L=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(L=_),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(R=b),N&&!h){const M=Xi(u.left,0),T=Xi(u.right,0),D=Xi(u.top,0),O=Xi(u.bottom,0);m?L=v-2*(M!==0||T!==0?M+T:Xi(u.left,u.right)):R=x-2*(D!==0||O!==0?D+O:Xi(u.top,u.bottom))}await l({...e,availableWidth:L,availableHeight:R});const U=await s.getDimensions(a.floating);return v!==U.width||x!==U.height?{reset:{rects:!0}}:{}}}};function d9(t){const e=as(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=io(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Tx(n)!==o||Tx(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function YA(t){return li(t)?t:t.contextElement}function ad(t){const e=YA(t);if(!io(e))return Ll(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=d9(e);let s=(o?Tx(n.width):n.width)/r,a=(o?Tx(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Xye=Ll(0);function h9(t){const e=to(t);return!XA()||!e.visualViewport?Xye:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==to(t)?!1:e}function fu(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=YA(t);let s=Ll(1);e&&(r?li(r)&&(s=ad(r)):s=ad(t));const a=qye(o,n,r)?h9(o):Ll(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=to(o),m=r&&li(r)?to(r):r;let v=h,x=DC(v);for(;x&&r&&m!==v;){const y=ad(x),g=x.getBoundingClientRect(),b=as(x),_=g.left+(x.clientLeft+parseFloat(b.paddingLeft))*y.x,S=g.top+(x.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=_,c+=S,v=to(x),x=DC(v)}}return Rx({width:u,height:f,x:l,y:c})}function Yye(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Xs(r),a=e?B_(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Ll(1);const u=Ll(0),f=io(r);if((f||!f&&!o)&&((oh(r)!=="body"||Ag(s))&&(l=j_(r)),io(r))){const h=fu(r);c=ad(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function Kye(t){return Array.from(t.getClientRects())}function zC(t,e){const n=j_(t).scrollLeft;return e?e.left+n:fu(Xs(t)).left+n}function Zye(t){const e=Xs(t),n=j_(t),r=t.ownerDocument.body,i=Xi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Xi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+zC(t);const a=-n.scrollTop;return as(r).direction==="rtl"&&(s+=Xi(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Jye(t,e){const n=to(t),r=Xs(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=XA();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function Qye(t,e){const n=fu(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=io(t)?ad(t):Ll(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function dO(t,e,n){let r;if(e==="viewport")r=Jye(t,n);else if(e==="document")r=Zye(Xs(t));else if(li(e))r=Qye(e,n);else{const i=h9(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Rx(r)}function p9(t,e){const n=Il(t);return n===e||!li(n)||Pd(n)?!1:as(n).position==="fixed"||p9(n,e)}function e1e(t,e){const n=e.get(t);if(n)return n;let r=qm(t,[],!1).filter(a=>li(a)&&oh(a)!=="body"),i=null;const o=as(t).position==="fixed";let s=o?Il(t):t;for(;li(s)&&!Pd(s);){const a=as(s),l=GA(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ag(s)&&!l&&p9(t,s))?r=r.filter(u=>u!==s):i=a,s=Il(s)}return e.set(t,r),r}function t1e(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?B_(e)?[]:e1e(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=dO(e,u,i);return c.top=Xi(f.top,c.top),c.right=Nd(f.right,c.right),c.bottom=Nd(f.bottom,c.bottom),c.left=Xi(f.left,c.left),c},dO(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function n1e(t){const{width:e,height:n}=d9(t);return{width:e,height:n}}function r1e(t,e,n){const r=io(e),i=Xs(e),o=n==="fixed",s=fu(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Ll(0);if(r||!r&&!o)if((oh(e)!=="body"||Ag(i))&&(a=j_(e)),r){const m=fu(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&(l.x=zC(i));let c=0,u=0;if(i&&!r&&!o){const m=i.getBoundingClientRect();u=m.top+a.scrollTop,c=m.left+a.scrollLeft-zC(i,m)}const f=s.left+a.scrollLeft-l.x-c,h=s.top+a.scrollTop-l.y-u;return{x:f,y:h,width:s.width,height:s.height}}function pE(t){return as(t).position==="static"}function hO(t,e){if(!io(t)||as(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Xs(t)===n&&(n=n.ownerDocument.body),n}function m9(t,e){const n=to(t);if(B_(t))return n;if(!io(t)){let i=Il(t);for(;i&&!Pd(i);){if(li(i)&&!pE(i))return i;i=Il(i)}return n}let r=hO(t,e);for(;r&&Tye(r)&&pE(r);)r=hO(r,e);return r&&Pd(r)&&pE(r)&&!GA(r)?n:r||Rye(t)||n}const i1e=async function(t){const e=this.getOffsetParent||m9,n=this.getDimensions,r=await n(t.floating);return{reference:r1e(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function o1e(t){return as(t).direction==="rtl"}const s1e={convertOffsetParentRelativeRectToViewportRelativeRect:Yye,getDocumentElement:Xs,getClippingRect:t1e,getOffsetParent:m9,getElementRects:i1e,getClientRects:Kye,getDimensions:n1e,getScale:ad,isElement:li,isRTL:o1e};function a1e(t,e){let n=null,r;const i=Xs(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:f,height:h}=t.getBoundingClientRect();if(a||e(),!f||!h)return;const m=Gf(u),v=Gf(i.clientWidth-(c+f)),x=Gf(i.clientHeight-(u+h)),y=Gf(c),b={rootMargin:-m+"px "+-v+"px "+-x+"px "+-y+"px",threshold:Xi(0,Nd(1,l))||1};let _=!0;function S(P){const N=P[0].intersectionRatio;if(N!==l){if(!_)return s();N?s(!1,N):r=setTimeout(()=>{s(!1,1e-7)},1e3)}_=!1}try{n=new IntersectionObserver(S,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(t)}return s(!0),o}function KA(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=YA(t),u=i||o?[...c?qm(c):[],...qm(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const f=c&&a?a1e(c,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(g=>{let[b]=g;b&&b.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let v,x=l?fu(t):null;l&&y();function y(){const g=fu(t);x&&(g.x!==x.x||g.y!==x.y||g.width!==x.width||g.height!==x.height)&&n(),x=g,v=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),f==null||f(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const l1e=Wye,c1e=Hye,u1e=Gye,f1e=(t,e,n)=>{const r=new Map,i={platform:s1e,...n},o={...i.platform,_c:r};return Vye(t,e,{...i,platform:o})};var Vy=typeof document<"u"?A.useLayoutEffect:A.useEffect;function Ax(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Ax(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!Ax(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function g9(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function pO(t,e){const n=g9(t);return Math.round(e*n)/n}function mE(t){const e=A.useRef(t);return Vy(()=>{e.current=t}),e}function d1e(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[u,f]=A.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,m]=A.useState(r);Ax(h,r)||m(r);const[v,x]=A.useState(null),[y,g]=A.useState(null),b=A.useCallback(F=>{F!==N.current&&(N.current=F,x(F))},[]),_=A.useCallback(F=>{F!==R.current&&(R.current=F,g(F))},[]),S=o||v,P=s||y,N=A.useRef(null),R=A.useRef(null),L=A.useRef(u),U=l!=null,M=mE(l),T=mE(i),D=mE(c),O=A.useCallback(()=>{if(!N.current||!R.current)return;const F={placement:e,strategy:n,middleware:h};T.current&&(F.platform=T.current),f1e(N.current,R.current,F).then(q=>{const K={...q,isPositioned:D.current!==!1};j.current&&!Ax(L.current,K)&&(L.current=K,zl.flushSync(()=>{f(K)}))})},[h,e,n,T,D]);Vy(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(F=>({...F,isPositioned:!1})))},[c]);const j=A.useRef(!1);Vy(()=>(j.current=!0,()=>{j.current=!1}),[]),Vy(()=>{if(S&&(N.current=S),P&&(R.current=P),S&&P){if(M.current)return M.current(S,P,O);O()}},[S,P,O,M,U]);const X=A.useMemo(()=>({reference:N,floating:R,setReference:b,setFloating:_}),[b,_]),H=A.useMemo(()=>({reference:S,floating:P}),[S,P]),Z=A.useMemo(()=>{const F={position:n,left:0,top:0};if(!H.floating)return F;const q=pO(H.floating,u.x),K=pO(H.floating,u.y);return a?{...F,transform:"translate("+q+"px, "+K+"px)",...g9(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:K}},[n,a,H.floating,u.x,u.y]);return A.useMemo(()=>({...u,update:O,refs:X,elements:H,floatingStyles:Z}),[u,O,X,H,Z])}const ZA=(t,e)=>({...l1e(t),options:[t,e]}),JA=(t,e)=>({...c1e(t),options:[t,e]}),h1e=(t,e)=>({...u1e(t),options:[t,e]}),v9={...qp},p1e=v9.useInsertionEffect,m1e=p1e||(t=>t());function UC(t){const e=A.useRef(()=>{});return m1e(()=>{e.current=t}),A.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i=t.current.length}function gE(t,e){return Gr(t,{disabledIndices:e})}function mO(t,e){return Gr(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function Gr(t,e){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=e===void 0?{}:e;const s=t.current,a=i?c=>i.includes(c):c=>{const u=s[c];return u==null||u.hasAttribute("disabled")||u.getAttribute("aria-disabled")==="true"};let l=n;do l+=r?-o:o;while(l>=0&&l<=s.length-1&&a(l));return l}function g1e(t,e){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=e,f=c;if(n.key===QA){if(u&&So(n),c===-1)f=l;else if(f=Gr(t,{startingIndex:f,amount:o,decrement:!0,disabledIndices:s}),i&&(c-oh?v:v-o}Hp(t,f)&&(f=c)}if(n.key===Ig&&(u&&So(n),c===-1?f=a:(f=Gr(t,{startingIndex:c,amount:o,disabledIndices:s}),i&&c+o>l&&(f=Gr(t,{startingIndex:c%o-o,amount:o,disabledIndices:s}))),Hp(t,f)&&(f=c)),r==="both"){const h=Gf(c/o);n.key===sh&&(u&&So(n),c%o!==o-1?(f=Gr(t,{startingIndex:c,disabledIndices:s}),i&&cy(f,o,h)&&(f=Gr(t,{startingIndex:c-c%o-1,disabledIndices:s}))):i&&(f=Gr(t,{startingIndex:c-c%o-1,disabledIndices:s})),cy(f,o,h)&&(f=c)),n.key===Id&&(u&&So(n),c%o!==0?(f=Gr(t,{startingIndex:c,disabledIndices:s,decrement:!0}),i&&cy(f,o,h)&&(f=Gr(t,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:s}))):i&&(f=Gr(t,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:s})),cy(f,o,h)&&(f=c));const m=Gf(l/o)===h;Hp(t,f)&&(i&&m?f=n.key===Id?l:Gr(t,{startingIndex:c-c%o-1,disabledIndices:s}):f=c)}return f}function v1e(t,e,n){const r=[];let i=0;return t.forEach((o,s)=>{let{width:a,height:l}=o,c=!1;for(n&&(i=0);!c;){const u=[];for(let f=0;fr[f]==null)?(u.forEach(f=>{r[f]=s}),c=!0):i++}}),[...r]}function y1e(t,e,n,r,i){if(t===-1)return-1;const o=n.indexOf(t);switch(i){case"tl":return o;case"tr":return o+e[t].width-1;case"bl":return o+(e[t].height-1)*r;case"br":return n.lastIndexOf(t)}}function x1e(t,e){return e.flatMap((n,r)=>t.includes(n)?[r]:[])}let gO=0;function vO(t,e){e===void 0&&(e={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=e;r&&cancelAnimationFrame(gO);const o=()=>t==null?void 0:t.focus({preventScroll:n});i?o():gO=requestAnimationFrame(o)}var bi=typeof document<"u"?A.useLayoutEffect:A.useEffect;function b1e(t,e){const n=t.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function _1e(t,e){if(t.size!==e.size)return!1;for(const[n,r]of t.entries())if(r!==e.get(n))return!1;return!0}const y9=A.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function w1e(t){const{children:e,elementsRef:n,labelsRef:r}=t,[i,o]=A.useState(()=>new Map),s=A.useCallback(l=>{o(c=>new Map(c).set(l,null))},[]),a=A.useCallback(l=>{o(c=>{const u=new Map(c);return u.delete(l),u})},[]);return bi(()=>{const l=new Map(i);Array.from(l.keys()).sort(b1e).forEach((u,f)=>{l.set(u,f)}),_1e(i,l)||o(l)},[i]),A.createElement(y9.Provider,{value:A.useMemo(()=>({register:s,unregister:a,map:i,elementsRef:n,labelsRef:r}),[s,a,i,n,r])},e)}function S1e(t){t===void 0&&(t={});const{label:e}=t,{register:n,unregister:r,map:i,elementsRef:o,labelsRef:s}=A.useContext(y9),[a,l]=A.useState(null),c=A.useRef(null),u=A.useCallback(f=>{if(c.current=f,a!==null&&(o.current[a]=f,s)){var h;const m=e!==void 0;s.current[a]=m?e:(h=f==null?void 0:f.textContent)!=null?h:null}},[a,o,s,e]);return bi(()=>{const f=c.current;if(f)return n(f),()=>{r(f)}},[n,r]),bi(()=>{const f=c.current?i.get(c.current):null;f!=null&&l(f)},[i]),A.useMemo(()=>({ref:u,index:a??-1}),[a,u])}let yO=!1,M1e=0;const xO=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+M1e++;function E1e(){const[t,e]=A.useState(()=>yO?xO():void 0);return bi(()=>{t==null&&e(xO())},[]),A.useEffect(()=>{yO=!0},[]),t}const C1e=v9.useId,T1e=C1e||E1e;function R1e(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(i=>i(n))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var r;t.set(e,((r=t.get(e))==null?void 0:r.filter(i=>i!==n))||[])}}}const A1e=A.createContext(null),P1e=A.createContext(null),x9=()=>{var t;return((t=A.useContext(A1e))==null?void 0:t.id)||null},b9=()=>A.useContext(P1e);function uy(t){const e=A.useRef(t);return bi(()=>{e.current=t}),e}function N1e(t,e){let n=t.filter(i=>{var o;return i.parentId===e&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=t.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function I1e(t,e){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),N1e(t,o).forEach(l=>{i(l.id,s+1)})}return i(e,0),t.find(o=>o.id===n)}function bO(t){return io(t.target)&&t.target.tagName==="BUTTON"}function _O(t){return c9(t)}function eP(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=t,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=e,f=A.useRef(),h=A.useRef(!1);return A.useMemo(()=>s?{reference:{onPointerDown(m){f.current=m.pointerType},onMouseDown(m){m.button===0&&(cO(f.current)&&c||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){if(a==="mousedown"&&f.current){f.current=void 0;return}cO(f.current)&&c||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){f.current=void 0,!(m.defaultPrevented||!u||bO(m))&&(m.key===" "&&!_O(o)&&(m.preventDefault(),h.current=!0),m.key==="Enter"&&r(!(n&&l),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||bO(m)||_O(o)||m.key===" "&&h.current&&(h.current=!1,r(!(n&&l),m.nativeEvent,"click"))}}}:{},[s,i,a,c,u,o,l,n,r])}function L1e(t){const{open:e=!1,onOpenChange:n,elements:r}=t,i=T1e(),o=A.useRef({}),[s]=A.useState(()=>R1e()),a=x9()!=null,[l,c]=A.useState(r.reference),u=UC((m,v,x)=>{o.current.openEvent=m?v:void 0,s.emit("openchange",{open:m,event:v,reason:x,nested:a}),n==null||n(m,v,x)}),f=A.useMemo(()=>({setPositionReference:c}),[]),h=A.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return A.useMemo(()=>({dataRef:o,open:e,onOpenChange:u,elements:h,events:s,floatingId:i,refs:f}),[e,u,h,s,i,f])}function tP(t){t===void 0&&(t={});const{nodeId:e}=t,n=L1e({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,i=r.elements,[o,s]=A.useState(null),[a,l]=A.useState(null),u=(i==null?void 0:i.reference)||o,f=A.useRef(null),h=b9();bi(()=>{u&&(f.current=u)},[u]);const m=d1e({...t,elements:{...i,...a&&{reference:a}}}),v=A.useCallback(_=>{const S=li(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;l(S),m.refs.setReference(S)},[m.refs]),x=A.useCallback(_=>{(li(_)||_===null)&&(f.current=_,s(_)),(li(m.refs.reference.current)||m.refs.reference.current===null||_!==null&&!li(_))&&m.refs.setReference(_)},[m.refs]),y=A.useMemo(()=>({...m.refs,setReference:x,setPositionReference:v,domReference:f}),[m.refs,x,v]),g=A.useMemo(()=>({...m.elements,domReference:u}),[m.elements,u]),b=A.useMemo(()=>({...m,...r,refs:y,elements:g,nodeId:e}),[m,y,g,e,r]);return bi(()=>{r.dataRef.current.floatingContext=b;const _=h==null?void 0:h.nodesRef.current.find(S=>S.id===e);_&&(_.context=b)}),A.useMemo(()=>({...m,context:b,refs:y,elements:g}),[m,y,g,b])}const wO="active",SO="selected";function vE(t,e,n){const r=new Map,i=n==="item";let o=t;if(i&&t){const{[wO]:s,[SO]:a,...l}=t;o=l}return{...n==="floating"&&{tabIndex:-1},...o,...e.map(s=>{const a=s?s[n]:null;return typeof a=="function"?t?a(t):null:a}).concat(t).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(i&&[wO,SO].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var h,m=arguments.length,v=new Array(m),x=0;xy(...v)).find(y=>y!==void 0)}}}else s[c]=u}),s),{})}}function nP(t){t===void 0&&(t=[]);const e=t,n=A.useCallback(o=>vE(o,t,"reference"),e),r=A.useCallback(o=>vE(o,t,"floating"),e),i=A.useCallback(o=>vE(o,t,"item"),t.map(o=>o==null?void 0:o.item));return A.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let MO=!1;function $_(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function EO(t,e){return $_(e,t===QA||t===Ig,t===Id||t===sh)}function yE(t,e,n){return $_(e,t===Ig,n?t===Id:t===sh)||t==="Enter"||t===" "||t===""}function k1e(t,e,n){return $_(e,n?t===Id:t===sh,t===Ig)}function CO(t,e,n){return $_(e,n?t===sh:t===Id,t===QA)}function O1e(t,e){const{open:n,onOpenChange:r,elements:{domReference:i,floating:o}}=t,{listRef:s,activeIndex:a,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:f=!1,loop:h=!1,nested:m=!1,rtl:v=!1,virtual:x=!1,focusItemOnOpen:y="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:b=!0,disabledIndices:_=void 0,orientation:S="vertical",cols:P=1,scrollItemIntoView:N=!0,virtualItemRef:R,itemSizes:L,dense:U=!1}=e,M=x9(),T=b9(),D=UC(l),O=A.useRef(y),j=A.useRef(u??-1),X=A.useRef(null),H=A.useRef(!0),Z=A.useRef(D),F=A.useRef(!!o),q=A.useRef(!1),K=A.useRef(!1),J=uy(_),he=uy(n),le=uy(N),ee=uy(o),[ae,ge]=A.useState(),[Me,tt]=A.useState(),He=UC(function(se,B,ye){ye===void 0&&(ye=!1);const xe=se.current[B.current];xe&&(x?(ge(xe.id),T==null||T.events.emit("virtualfocus",xe),R&&(R.current=xe)):vO(xe,{preventScroll:!0,sync:Lye()&&Iye()?MO||q.current:!1}),requestAnimationFrame(()=>{const Re=le.current;Re&&xe&&(ye||!H.current)&&(xe.scrollIntoView==null||xe.scrollIntoView(typeof Re=="boolean"?{block:"nearest",inline:"nearest"}:Re))}))});bi(()=>{document.createElement("div").focus({get preventScroll(){return MO=!0,!1}})},[]),bi(()=>{c&&(n&&o?O.current&&u!=null&&(K.current=!0,j.current=u,D(u)):F.current&&(j.current=-1,Z.current(null)))},[c,n,o,u,D]),bi(()=>{if(c&&n&&o)if(a==null){if(q.current=!1,u!=null)return;if(F.current&&(j.current=-1,He(s,j)),!F.current&&O.current&&(X.current!=null||O.current===!0&&X.current==null)){let se=0;const B=()=>{s.current[0]==null?(se<2&&(se?requestAnimationFrame:queueMicrotask)(B),se++):(j.current=X.current==null||yE(X.current,S,v)||m?gE(s,J.current):mO(s,J.current),X.current=null,D(j.current))};B()}}else Hp(s,a)||(j.current=a,He(s,j,K.current),K.current=!1)},[c,n,o,a,u,m,s,S,v,D,He,J]),bi(()=>{var se;if(!c||o||!T||x||!F.current)return;const B=T.nodesRef.current,ye=(se=B.find(Pe=>Pe.id===M))==null||(se=se.context)==null?void 0:se.elements.floating,xe=lO(Oye(o)),Re=B.some(Pe=>Pe.context&&Aye(Pe.context.elements.floating,xe));ye&&!Re&&H.current&&ye.focus({preventScroll:!0})},[c,o,T,M,x]),bi(()=>{if(!c||!T||!x||M)return;function se(B){tt(B.id),R&&(R.current=B)}return T.events.on("virtualfocus",se),()=>{T.events.off("virtualfocus",se)}},[c,T,x,M,R]),bi(()=>{Z.current=D,F.current=!!o}),bi(()=>{n||(X.current=null)},[n]);const rt=a!=null,Ve=A.useMemo(()=>{function se(ye){if(!n)return;const xe=s.current.indexOf(ye);xe!==-1&&D(xe)}return{onFocus(ye){let{currentTarget:xe}=ye;se(xe)},onClick:ye=>{let{currentTarget:xe}=ye;return xe.focus({preventScroll:!0})},...g&&{onMouseMove(ye){let{currentTarget:xe}=ye;se(xe)},onPointerLeave(ye){let{pointerType:xe}=ye;!H.current||xe==="touch"||(j.current=-1,He(s,j),D(null),x||vO(ee.current,{preventScroll:!0}))}}}},[n,ee,He,g,s,D,x]);return A.useMemo(()=>{if(!c)return{};const se=J.current;function B(Ee){if(H.current=!1,q.current=!0,!he.current&&Ee.currentTarget===ee.current)return;if(m&&CO(Ee.key,S,v)){So(Ee),r(!1,Ee.nativeEvent,"list-navigation"),io(i)&&!x&&i.focus();return}const De=j.current,$=gE(s,se),z=mO(s,se);if(Ee.key==="Home"&&(So(Ee),j.current=$,D(j.current)),Ee.key==="End"&&(So(Ee),j.current=z,D(j.current)),P>1){const re=L||Array.from({length:s.current.length},()=>({width:1,height:1})),pe=v1e(re,P,U),me=pe.findIndex(Ge=>Ge!=null&&!(se!=null&&se.includes(Ge))),be=pe.reduce((Ge,Fe,Ne)=>Fe!=null&&!(se!=null&&se.includes(Fe))?Ne:Ge,-1);if(j.current=pe[g1e({current:pe.map(Ge=>Ge!=null?s.current[Ge]:null)},{event:Ee,orientation:S,loop:h,cols:P,disabledIndices:x1e([...se||[],void 0],pe),minIndex:me,maxIndex:be,prevIndex:y1e(j.current,re,pe,P,Ee.key===Ig?"bl":Ee.key===sh?"tr":"tl"),stopEvent:!0})],D(j.current),S==="both")return}if(EO(Ee.key,S)){if(So(Ee),n&&!x&&lO(Ee.currentTarget.ownerDocument)===Ee.currentTarget){j.current=yE(Ee.key,S,v)?$:z,D(j.current);return}yE(Ee.key,S,v)?h?j.current=De>=z?f&&De!==s.current.length?-1:$:Gr(s,{startingIndex:De,disabledIndices:se}):j.current=Math.min(z,Gr(s,{startingIndex:De,disabledIndices:se})):h?j.current=De<=$?f&&De!==-1?s.current.length:z:Gr(s,{startingIndex:De,decrement:!0,disabledIndices:se}):j.current=Math.max($,Gr(s,{startingIndex:De,decrement:!0,disabledIndices:se})),Hp(s,j.current)?D(null):D(j.current)}}function ye(Ee){y==="auto"&&Pye(Ee.nativeEvent)&&(O.current=!0)}function xe(Ee){O.current=y,y==="auto"&&Nye(Ee.nativeEvent)&&(O.current=!0)}const Re=x&&n&&rt&&{"aria-activedescendant":Me||ae},Pe=s.current.find(Ee=>(Ee==null?void 0:Ee.id)===ae);return{reference:{...Re,onKeyDown(Ee){H.current=!1;const De=Ee.key.indexOf("Arrow")===0,$=k1e(Ee.key,S,v),z=CO(Ee.key,S,v),re=EO(Ee.key,S),pe=(m?$:re)||Ee.key==="Enter"||Ee.key.trim()==="";if(x&&n){const Fe=T==null?void 0:T.nodesRef.current.find(ze=>ze.parentId==null),Ne=T&&Fe?I1e(T.nodesRef.current,Fe.id):null;if(De&&Ne&&R){const ze=new KeyboardEvent("keydown",{key:Ee.key,bubbles:!0});if($||z){var me,be;const Le=((me=Ne.context)==null?void 0:me.elements.domReference)===Ee.currentTarget,Xe=z&&!Le?(be=Ne.context)==null?void 0:be.elements.domReference:$?Pe:null;Xe&&(So(Ee),Xe.dispatchEvent(ze),tt(void 0))}if(re&&Ne.context&&Ne.context.open&&Ne.parentId&&Ee.currentTarget!==Ne.context.elements.domReference){var Ge;So(Ee),(Ge=Ne.context.elements.domReference)==null||Ge.dispatchEvent(ze);return}}return B(Ee)}if(!(!n&&!b&&De)){if(pe&&(X.current=m&&re?null:Ee.key),m){$&&(So(Ee),n?(j.current=gE(s,se),D(j.current)):r(!0,Ee.nativeEvent,"list-navigation"));return}re&&(u!=null&&(j.current=u),So(Ee),!n&&b?r(!0,Ee.nativeEvent,"list-navigation"):B(Ee),n&&D(j.current))}},onFocus(){n&&D(null)},onPointerDown:xe,onMouseDown:ye,onClick:ye},floating:{"aria-orientation":S==="both"?void 0:S,...!Fye(i)&&Re,onKeyDown:B,onPointerMove(){H.current=!0}},item:Ve}},[i,ee,ae,Me,J,he,s,c,S,v,x,n,rt,m,u,b,f,P,h,y,D,r,Ve,T,R,L,U])}var _9={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},TO=Mt.createContext&&Mt.createContext(_9),D1e=["attr","size","title"];function F1e(t,e){if(t==null)return{};var n=z1e(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function z1e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Px(){return Px=Object.assign?Object.assign.bind():function(t){for(var e=1;eMt.createElement(e.tag,Nx({key:n},e.attr),w9(e.child)))}function fs(t){return e=>Mt.createElement(V1e,Px({attr:Nx({},t.attr)},e),w9(t.child))}function V1e(t){var e=n=>{var{attr:r,size:i,title:o}=t,s=F1e(t,D1e),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),Mt.createElement("svg",Px({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:Nx(Nx({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&Mt.createElement("title",null,o),t.children)};return TO!==void 0?Mt.createElement(TO.Consumer,null,n=>e(n)):e(_9)}function $1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(t)}function W1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(t)}function H1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 10 20 15 15 20"},child:[]},{tag:"path",attr:{d:"M4 4v7a4 4 0 0 0 4 4h12"},child:[]}]})(t)}function G1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"path",attr:{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(t)}function X1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"3",y1:"12",x2:"21",y2:"12"},child:[]},{tag:"line",attr:{x1:"3",y1:"6",x2:"21",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"18",x2:"21",y2:"18"},child:[]}]})(t)}function q1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"},child:[]}]})(t)}function Y1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3 5 6.99h3V14h2V6.99h3L9 3z"},child:[]}]})(t)}function K1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"},child:[]}]})(t)}function Z1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"},child:[]}]})(t)}function J1e(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 11H1v2h6v-2zm2.17-3.24L7.05 5.64 5.64 7.05l2.12 2.12 1.41-1.41zM13 1h-2v6h2V1zm5.36 6.05-1.41-1.41-2.12 2.12 1.41 1.41 2.12-2.12zM17 11v2h6v-2h-6zm-5-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zm2.83 7.24 2.12 2.12 1.41-1.41-2.12-2.12-1.41 1.41zm-9.19.71 1.41 1.41 2.12-2.12-1.41-1.41-2.12 2.12zM11 23h2v-6h-2v6z"},child:[]}]})(t)}function S9(t){return fs({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m7 10 5 5 5-5z"},child:[]}]})(t)}var M9=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i0},t.prototype.connect_=function(){!BC||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ixe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!BC||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=rxe.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),E9=function(t,e){for(var n=0,r=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof Ld(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new hxe(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Ld(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new pxe(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),T9=typeof WeakMap<"u"?new WeakMap:new M9,R9=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=oxe.getInstance(),r=new mxe(e,n,this);T9.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){R9.prototype[t]=function(){var e;return(e=T9.get(this))[t].apply(e,arguments)}});var gxe=function(){return typeof Ix.ResizeObserver<"u"?Ix.ResizeObserver:R9}(),vxe=["client","offset","scroll","bounds","margin"];function PO(t){var e=[];return vxe.forEach(function(n){t[n]&&e.push(n)}),e}function NO(t,e){var n={};if(e.indexOf("client")>-1&&(n.client={top:t.clientTop,left:t.clientLeft,width:t.clientWidth,height:t.clientHeight}),e.indexOf("offset")>-1&&(n.offset={top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}),e.indexOf("scroll")>-1&&(n.scroll={top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}),e.indexOf("bounds")>-1){var r=t.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(e.indexOf("margin")>-1){var i=getComputedStyle(t);n.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0}}return n}function yxe(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||window}function xxe(t){return function(e){var n,r;return r=n=function(i){_R(o,i);function o(){for(var a,l=arguments.length,c=new Array(l),u=0;u{let e;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){const m=e;e=f??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(v=>v(e,m))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(bxe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=e=t(r,i,l);return l},_xe=t=>t?IO(t):IO;var A9={exports:{}},P9={},N9={exports:{}},I9={};/** - * @license React - * use-sync-external-store-shim.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 kd=A;function wxe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Sxe=typeof Object.is=="function"?Object.is:wxe,Mxe=kd.useState,Exe=kd.useEffect,Cxe=kd.useLayoutEffect,Txe=kd.useDebugValue;function Rxe(t,e){var n=e(),r=Mxe({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return Cxe(function(){i.value=n,i.getSnapshot=e,xE(i)&&o({inst:i})},[t,n,e]),Exe(function(){return xE(i)&&o({inst:i}),t(function(){xE(i)&&o({inst:i})})},[t]),Txe(n),n}function xE(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Sxe(t,n)}catch{return!0}}function Axe(t,e){return e()}var Pxe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Axe:Rxe;I9.useSyncExternalStore=kd.useSyncExternalStore!==void 0?kd.useSyncExternalStore:Pxe;N9.exports=I9;var Nxe=N9.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.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 H_=A,Ixe=Nxe;function Lxe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var kxe=typeof Object.is=="function"?Object.is:Lxe,Oxe=Ixe.useSyncExternalStore,Dxe=H_.useRef,Fxe=H_.useEffect,zxe=H_.useMemo,Uxe=H_.useDebugValue;P9.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=Dxe(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=zxe(function(){function l(m){if(!c){if(c=!0,u=m,m=r(m),i!==void 0&&s.hasValue){var v=s.value;if(i(v,m))return f=v}return f=m}if(v=f,kxe(u,m))return v;var x=r(m);return i!==void 0&&i(v,x)?v:(u=m,f=x)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,r,i]);var a=Oxe(t,o[0],o[1]);return Fxe(function(){s.hasValue=!0,s.value=a},[a]),Uxe(a),a};A9.exports=P9;var Bxe=A9.exports;const jxe=js(Bxe),L9={BASE_URL:"/webxdiviewer/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_XDI_REPO_LOCATION:"jacobfilik/XASDataLibrary"},{useDebugValue:Vxe}=Mt,{useSyncExternalStoreWithSelector:$xe}=jxe;let LO=!1;const Wxe=t=>t;function Hxe(t,e=Wxe,n){(L9?"production":void 0)!=="production"&&n&&!LO&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),LO=!0);const r=$xe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Vxe(r),r}const kO=t=>{(L9?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?_xe(t):t,n=(r,i)=>Hxe(e,r,i);return Object.assign(n,e),n},Gxe=t=>t?kO(t):kO;var Xxe=Object.defineProperty,qxe=(t,e,n)=>e in t?Xxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yp=(t,e,n)=>(qxe(t,typeof e!="symbol"?e+"":e,n),n);const iP=A.createContext({}),Yxe=A.createContext(void 0),Kxe="_wrapper_9665499",Zxe="_grid_5146261",Jxe="_innerContainer_27a3adb",Qxe="_colHeaders_a985f35",ebe="_rowHeaders_63b4056",tbe="_indexCell_080a16e",nbe="_stickyGrid_33fa7fa",rbe="_cell_2658e21",ibe="_topLeftCell_e826718 _indexCell_080a16e",Sc={wrapper:Kxe,grid:Zxe,innerContainer:Jxe,colHeaders:Qxe,rowHeaders:ebe,indexCell:tbe,stickyGrid:nbe,cell:rbe,topLeftCell:ibe};function obe(t){const{rowIndex:e,columnIndex:n,style:r}=t,{rowHeaderCellsWidth:i,cellSize:o,cellFormatter:s}=A.useContext(iP);return C.jsx("div",{className:Sc.cell,style:{...r,left:r.left+i,top:r.top+o.height},role:"cell","aria-rowindex":e,"aria-colindex":n,"data-bg":(e+n)%2===1||void 0,children:s(e,n)})}A.memo(obe);function OO(t){const{indexMin:e,indexMax:n,width:r,transform:i,headers:o}=t,{cellSize:s}=A.useContext(iP);return Jb(e,n+1).map(a=>C.jsx("div",{className:Sc.indexCell,style:{width:r||s.width,height:s.height,transform:i},"data-bg":a%2===1?"":void 0,children:a>=0&&o?o[a]:a},a.toString()))}const sbe=A.forwardRef((t,e)=>{const{children:n,style:r}=t,{rowCount:i,columnCount:o,cellSize:s,sticky:a,rowHeaderCellsWidth:l,columnHeaders:c}=A.useContext(iP),u=A.useContext(Yxe),{overscanColumnStartIndex:f=0,overscanColumnStopIndex:h=0,overscanRowStartIndex:m=0,overscanRowStopIndex:v=0}=u||{};return C.jsxs("div",{ref:e,className:Sc.stickyGrid,style:{...r,width:r.width+l,height:r.height+s.height},role:"table","aria-rowcount":i,"aria-colcount":o,"data-sticky":a||void 0,children:[C.jsxs("div",{className:Sc.colHeaders,children:[C.jsx("div",{className:Sc.topLeftCell,style:{width:l,height:s.height},"data-bg":!0,"aria-hidden":"true"}),C.jsx(OO,{indexMin:f,indexMax:h,transform:`translateX(${s.width*f}px)`,headers:c})]}),C.jsxs("div",{className:Sc.innerContainer,children:[C.jsx("div",{className:Sc.rowHeaders,"aria-hidden":"true",children:C.jsx(OO,{indexMin:m,indexMax:v,transform:`translateY(${s.height*m}px)`,width:l})}),n]})]})});sbe.displayName="StickyGrid";var bc=(t=>(t.Bool="Boolean",t.Integer="Integer",t.Unsigned="Integer (unsigned)",t.Float="Float",t.Complex="Complex",t.String="String",t.Compound="Compound",t.Array="Array",t.VLen="Array (variable length)",t.Enum="Enumeration",t.Time="Time",t.Bitfield="Bitfield",t.Opaque="Opaque",t.Reference="Reference",t.Unknown="Unknown",t))(bc||{}),Nt=(t=>(t.Linear="linear",t.Log="log",t.SymLog="symlog",t.Sqrt="sqrt",t.Gamma="gamma",t))(Nt||{}),$y=(t=>(t.Phase="phase",t.Amplitude="amplitude",t.PhaseAmplitude="phase-amplitude",t))($y||{});Nt.Linear,Nt.Log,Nt.SymLog;Nt.Linear,Nt.Log,Nt.SymLog,Nt.Sqrt;const DO=Ws(".3~e"),bE=Ws(".5~e"),_E=Ws(".5~g"),FO=Ws(".3~g");ube(".12~g");const oP=3,abe=/0\.([0-9]+)$/u,lbe=Ws(`.${oP}~g`),cbe=Ws(`.${oP}~e`);function wE(t){const e=lbe(t),n=abe.exec(e);return n&&n[1].length>oP?cbe(t):e}function ube(t,e=!1){const n=Ws(t);return r=>{const[i,o]=r;if(o===0&&!e)return`${n(i)}`;if(i===0&&!e)return`${n(o)} i`;const s=Math.sign(o)>=0?" + ":" − ";return`${n(i)}${s}${n(Math.abs(o))} i`}}function jC(t){return mbe(t)?t.data:t}function SE(t,e){const{min:n,max:r,positiveMin:i,strictPositiveMin:o}=t;return{min:Math.min(e,n),max:Math.max(e,r),positiveMin:e>=0?Math.min(e,i):i,strictPositiveMin:e>0?Math.min(e,o):o}}function fbe(t,e,n){const r=jC(t),i=e&&jC(e);$C(e,r.length,"error");const o=r.reduce((s,a,l)=>{if(!Number.isFinite(a)||n!=null&&n(a))return s;const c=SE(s,a),u=i==null?void 0:i[l];return u?SE(SE(c,a-u),a+u):c},{min:1/0,max:-1/0,positiveMin:1/0,strictPositiveMin:1/0});return Number.isFinite(o.min)?o:void 0}function dbe(t,e){if(t===void 0)return;const{min:n,max:r,positiveMin:i,strictPositiveMin:o}=t;return e===Nt.Log&&n*r<=0?Number.isFinite(o)?[o,r]:void 0:e===Nt.Sqrt&&n*r<0?[i,r]:[n,r]}function hbe(t){const[e,n]=t.shape;return{rows:e,cols:n}}function VC(t){return Array.isArray(t)?t:[t]}bc.Unsigned,bc.Integer,bc.Float,bc.String,bc.Bool,bc.Complex;function k9(t){return t!==void 0}function pbe(t){return t!==null}function Gp(t,e="Expected some value"){if(!k9(t))throw new TypeError(e)}function ME(t,e="Expected value to not be null"){if(!pbe(t))throw new TypeError(e)}function $C(t,e,n){if(!t)return;const{length:r}=jC(t);if(r!==e)throw new Error(`Expected ${n} array to have length ${e} instead of ${r}`)}function mbe(t){return"data"in t}const gbe=new G(0,0,0);class Xf extends Pr{get size(){const{x:e,y:n}=this.getSize(new G);return{width:e,height:n}}get center(){return this.getCenter(new G)}static empty(e=gbe){return new Xf(e.clone(),e.clone())}static fromPoints(...e){return new Xf().setFromPoints(e)}static fromSize({width:e,height:n}){return Xf.empty().expandBySize(e,n)}clampPoint(e){return super.clampPoint(e,new G)}expandBySize(e,n){const{size:r}=this,i=e<0?Math.max(e,-r.width):e,o=n<0?Math.max(n,-r.height):n;return this.expandByVector(new G(i,o).divideScalar(2))}expandToRatio(e){if(e===void 0||e<=0)return this;const{width:n,height:r}=this.size,i=n/r;return e>i?this.expandBySize(r*e-n,0):this.expandBySize(0,n/e-r)}hasMinSize(e,n=e){const{width:r,height:i}=this.size;return r>=e&&i>=n}keepWithin(e){const{center:n,size:r}=this,{width:i,height:o}=e.size,s=Xf.empty(e.center).expandBySize(Math.max(i-r.width,0),Math.max(o-r.height,0)).clampPoint(n).sub(n).setZ(0);return this.translate(s)}toRect(){return[this.min,this.max]}}const kl=Xf;function zO(t,e){const n=e-t;return r=>n!==0?(r-t)/n:.5}function O9(t){let e=(t==null?void 0:t.domain)||[0,1],n=(t==null?void 0:t.range)||[0,1],r=(t==null?void 0:t.exponent)??1,i=(t==null?void 0:t.clamp)||!1,o=Ad,s;const a=function(R){const L=typeof R=="number"?R:R.valueOf();return Number.isNaN(L)?s:o(...n)(zO(...e)(l(L))**r)};function l(R){if(!i)return R;const[L,U]=e;return Math.max(L,Math.min(U,R))}function c(R){return R?(e=R,N):[...e]}function u(R){return R?(n=R,N):[...n]}function f(R){return R?(n=R,o=LA,N):[...n]}function h(R){return R?(i=R,N):i}function m(){return s}function v(R){return R?(o=R,N):o}function x(R){return R?(r=R,N):r}function y(R){return l(Ad(...e)(zO(...n)(R)**(1/r)))}function g(){return ape({domain:e,range:n,exponent:r,clamp:i})}function b(R){return e=g().nice(R).domain(),N}function _(R){return g().ticks(R)}function S(R,L){return g().tickFormat(R,L)}function P(){return O9().domain(e).range(n).exponent(r).clamp(i).interpolate(o)}const N=Object.assign(a,{domain:c,range:u,rangeRound:f,clamp:h,interpolate:v,invert:y,unknown:m,exponent:x,nice:b,ticks:_,tickFormat:S,copy:P});return N}const vbe=0,sP=1e3,D9=sP,ybe=D9-sP,wi=ybe-1,F9=[.1,1],xbe={left:80,right:24,top:16,bottom:34},bbe=28,UO=24,_be={[Nt.Linear]:-1/0,[Nt.Log]:Number.MIN_VALUE,[Nt.SymLog]:-1/0,[Nt.Sqrt]:0,[Nt.Gamma]:-1/0},wbe=UA({domain:[300,900],range:[3,10],clamp:!0,round:!0}),Sbe=UA({domain:[300,500],range:[.8,1.4]});function aP(t,e){if(Array.isArray(t)){const[,n]=t;return O9({...e,exponent:n})}switch(t){case Nt.Linear:return UA(e);case Nt.Log:return ope(e);case Nt.SymLog:return cpe(e);case Nt.Sqrt:return hpe(e)}throw new Error("Unknown scale type")}function Mbe(t,e){const{width:n,height:r}=t;return e?n/r>e?{width:r*e,height:r}:{width:n,height:n/e}:{width:n,height:r}}function WC(t,e=Nt.Linear,n,r){const i=fbe(t,n,r);return dbe(i,e)}function Ebe(t,e,n){if(n===Nt.Log)return[t*10**-e,t*10**e];if(t===0)return[-1,1];const r=Math.abs(t)*e;return[t-r,t+r]}function Cbe(t,e=[-Number.MAX_VALUE/2,Number.MAX_VALUE/2]){const[n,r]=e;return CU.clamp(t,n,r)}function z9(t,e,n=Nt.Linear){if(e<=0)return t;const r=_be[n],[i]=t;if(it[s-1]+(t[s]-t[s-1])/2):t,r=Obe(n.slice(1)),i=Jb(t.length);return B9(r)&&(r.reverse(),i.reverse()),fpe({domain:r,range:i})}function BO(t,e){const{scaleType:n,visDomain:r,flip:i,nice:o=!1}=t;return aP(n??Nt.Linear,{domain:r,range:[-e/2,e/2],reverse:i,nice:o})}function Abe(t,e){const n=Math.min(...t),r=Math.max(...t),i=Math.ceil(n),o=Math.floor(r),s=o-i+1,a=Math.min(s,e);if(a===0)return[];const l=Math.max(I6(i,o,a),1),c=Math.ceil(n/l),u=Math.floor(r/l)-c+1;return Array.from({length:u},(f,h)=>(c+h)*l)}function Pbe(t,e,n){if(n!==Nt.Log)return wE;const[r,i]=t[0]>0?t:[-t[1],-[t[0]]],o=Sbe(e);return i/r<10**o?wE:s=>{const a=Math.log10(Math.abs(s.valueOf()));return a===Math.floor(a)?wE(s):""}}function Nbe(t){const e=t.filter(k9);if(e.length!==0)return e.reduce((n,r)=>[Math.min(n[0],r[0]),Math.max(n[1],r[1])])}function U9(t,e,n){if(t==="auto")return;if(t==="equal")return U9(1,e,n);const[r,i]=e,[o,s]=n;return Math.abs(i-r)/Math.abs(s-o)/t}function Ibe(t={}){const{left:e,right:n,top:r,bottom:i}=xbe;return{left:e+(t.left?UO:0),right:n,top:r+(t.top?bbe:0),bottom:i+(t.bottom?UO:0)}}function B9(t){return t[t.length-1]-t[0]<0}function Lbe(t,e=Nt.Linear,n=0){const r=WC(t,e);if(!r)return;const i=z9(r,n,e);return B9(t)?[i[1],i[0]]:i}const kbe=` - varying vec2 coords; - - void main() { - coords = uv; - gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); - } -`;function j9(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{value:n}]))}function Obe(t){return Array.isArray(t)?t:[...t]}function G_(t,e=3,n=Float32Array){return new hn(new n(t*e),e)}function V9(t){return Object.keys(t).some(e=>/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/u.test(e))}const $9=A.createContext({});function Fn(){return A.useContext($9)}function Dbe(t){const{visRatio:e,abscissaConfig:n,ordinateConfig:r,svgOverlay:i,floatingToolbar:o,children:s}=t,{width:a,height:l}=wr(D=>D.size),c={width:a,height:l},u=a/l,f=Mbe(c,e),h=A.useMemo(()=>kl.empty().expandByPoint(new G(a,l)),[a,l]),m=BO(n,f.width),v=BO(r,f.height),x=A.useCallback(D=>new G(m(D.x),v(D.y)),[m,v]),y=A.useCallback(D=>new G(m.invert(D.x),v.invert(D.y)),[m,v]),g=A.useMemo(()=>new wt().makeScale(a/2,-l/2,1).setPosition(a/2,l/2,0),[a,l]),b=A.useMemo(()=>g.clone().invert(),[g]),_=A.useCallback((D,O)=>O.clone().project(D).applyMatrix4(g),[g]),S=A.useCallback((D,O)=>O.clone().applyMatrix4(b).unproject(D),[b]),P=A.useCallback((D,O)=>_(D,x(O)),[x,_]),N=A.useCallback((D,O)=>y(S(D,O)),[S,y]),R=A.useCallback((D,O=D.position)=>{const{scale:j}=D;return kl.empty(O).expandBySize(a*j.x,l*j.y)},[a,l]),L=A.useCallback(D=>{const[O,j]=R(D).toRect().map(y);return{xVisibleDomain:[O.x,j.x],yVisibleDomain:[O.y,j.y]}},[R,y]),U=wr(D=>{var O;return(O=D.gl.domElement.parentElement)==null?void 0:O.parentElement});Gp(U),ME(U);const M=U.parentElement;ME(M);const T=M.parentElement;return ME(T),C.jsx($9.Provider,{value:{canvasSize:c,canvasRatio:u,canvasBox:h,visRatio:e,visSize:f,abscissaConfig:n,ordinateConfig:r,abscissaScale:m,ordinateScale:v,dataToWorld:x,dataToHtml:P,worldToHtml:_,worldToData:y,htmlToWorld:S,htmlToData:N,getFovBox:R,getVisibleDomains:L,visCanvas:T,canvasArea:M,r3fRoot:U,svgOverlay:i,floatingToolbar:o},children:s})}var X_=(t=>(t[t.Left=0]="Left",t[t.Middle=1]="Middle",t))(X_||{});class Fbe{constructor(e,n){yp(this,"buttons"),yp(this,"modifierKeys"),yp(this,"isWheel"),yp(this,"isEnabled"),this.id=e;const{button:r=X_.Left,modifierKey:i=[],disabled:o=!1}=n;r==="Wheel"?(this.buttons=[],this.isWheel=!0):(this.buttons=VC(r),this.isWheel=!1),this.modifierKeys=VC(i),this.isEnabled=!o}matches(e){return this.isEnabled&&(e instanceof WheelEvent?this.isWheel:this.buttons.includes(e.button))&&this.modifierKeys.every(n=>e.getModifierState(n))}}const W9=A.createContext({});function zbe(){return A.useContext(W9)}function Ube(t){const{children:e}=t,[n]=A.useState(new Map),r=A.useCallback((s,a)=>{n.has(s)?console.warn(`An interaction with ID "${s}" is already registered.`):n.set(s,new Fbe(s,a))},[n]),i=A.useCallback(s=>{n.delete(s)},[n]),o=A.useCallback((s,a)=>{const l=[...n.values()];if(!n.has(s))throw new Error(`Interaction ${s} is not registered`);const c=l.filter(u=>u.matches(a));return c.length===0?!1:c.length===1?c[0].id===s:c.reduce((u,f)=>f.modifierKeys.length>u.modifierKeys.length?f:u).id===s},[n]);return C.jsx(W9.Provider,{value:{registerInteraction:r,unregisterInteraction:i,shouldInteract:o},children:e})}const jO=.95,VO=new G(1,1,1),Bbe=["Alt","Control","Shift"];function Lg(){const{visSize:t,getFovBox:e}=Fn(),n=wr(i=>i.camera),r=wr(i=>i.invalidate);return A.useCallback(i=>{const{position:o}=n,s=kl.fromSize(t),a=e(n,i).keepWithin(s);o.copy(a.center.setZ(o.z)),n.updateMatrixWorld(),r()},[n,t,e,r])}function H9(){const{canvasSize:t}=Fn(),e=wr(r=>r.camera),n=Lg();return A.useCallback(({world:r})=>{const{width:i,height:o}=t,s=kl.fromPoints(...r),{width:a,height:l}=s.size;e.scale.set(Math.max(a,1)/i,Math.max(l,1)/o,1),n(s.center)},[e,t,n])}function lP(){const{canvasArea:t}=Fn();Uc(t,"wheel",e=>e.preventDefault(),{passive:!1})}function cP(t){const e=wr(r=>r.camera),n=Lg();return function(r){const{sourceEvent:i,worldPt:o}=r,{x:s,y:a}=t(i);if(!s&&!a)return;const l=new G(s?jO:1,a?jO:1,1);i.deltaY<0?e.scale.multiply(l).min(VO):e.scale.divide(l).min(VO);const c=e.position.clone().sub(o);i.deltaY<0?c.multiply(l):c.divide(l),n(o.clone().add(c))}}function _a(t,e,n={}){const r=gr(e),i=wr(c=>c.camera),{htmlToWorld:o,worldToData:s,canvasArea:a}=Fn();function l(c){const{offsetX:u,offsetY:f}=c,h=new G(u,f),m=o(i,h),v=s(m);r.current({htmlPt:h,worldPt:m,dataPt:v,sourceEvent:c})}Uc(a,t,l,n)}function kg(t,e){const{shouldInteract:n,registerInteraction:r,unregisterInteraction:i}=zbe();return A.useEffect(()=>(r(t,e),()=>i(t)),[t,r,i,e]),A.useCallback(o=>n(t,o),[t,n])}function G9(t=[]){const{canvasArea:e}=Fn(),n=VC(t),[r]=A.useState(new Map),[i,o]=Zb(!1);function s(){const a=n.every(l=>r.get(l));i!==a&&o(a)}return Uc(window,"keyup",a=>{const{key:l}=a;r.set(l,!1),s()}),Uc(window,"keydown",a=>{const{key:l}=a;r.set(l,!0),s()}),Uc(e,"pointerdown",a=>{Bbe.forEach(l=>{r.set(l,a.getModifierState(l))}),s()}),i}function jbe(t){const{id:e="Pan",button:n=X_.Left,modifierKey:r,disabled:i}=t,o=kg(e,{button:n,modifierKey:r,disabled:i}),s=wr(m=>m.camera),a=Lg(),l=A.useRef(),c=G9(r);function u(m){const{worldPt:v,sourceEvent:x}=m,{target:y,pointerId:g}=x;o(x)&&(y.setPointerCapture(g),l.current=v.clone())}function f(m){if(!l.current||!c)return;const{worldPt:v}=m,x=l.current.clone().sub(v);a(s.position.clone().add(x))}function h(m){const{sourceEvent:v}=m,{target:x,pointerId:y}=v;x.releasePointerCapture(y),l.current=void 0}return _a("pointerdown",u),_a("pointermove",f),_a("pointerup",h),null}function X9(t){const{id:e="Selection",modifierKey:n,disabled:r,transform:i=J=>J,validate:o=()=>!0,onSelectionStart:s,onSelectionChange:a,onSelectionEnd:l,onValidSelection:c,children:u}=t,f=gr(i),h=gr(o),m=gr(s),v=gr(a),x=gr(l),y=gr(c),g=wr(J=>J.camera),b=Fn(),{canvasBox:_,htmlToWorld:S,worldToData:P}=b,[N,R]=_ne(),L=A.useRef(),U=A.useRef(!1),M=G9(n),T=kg(e,{button:X_.Left,modifierKey:n,disabled:r});function D(J,he=J){const le=[J,_.clampPoint(he)],ee=le.map(ge=>S(g,ge)),ae=ee.map(P);return{html:le,world:ee,data:ae}}function O(J){const{sourceEvent:he}=J;if(!T(he))return;const{target:le,pointerId:ee}=he;le.setPointerCapture(ee),L.current=J,R(D(J.htmlPt))}function j(J){const{current:he}=L;he&&R(D(he.htmlPt,J.htmlPt))}function X(J){if(!L.current)return;const{sourceEvent:he}=J,{target:le,pointerId:ee}=he;le.releasePointerCapture(ee),L.current=void 0,U.current=T(he),R(void 0)}_a("pointerdown",O),_a("pointermove",j),_a("pointerup",X);function H(){L.current=void 0,R(void 0)}A6("Escape",H,[],{event:"keydown"}),Uc(window,"contextmenu",J=>{L.current&&(J.preventDefault(),H())});const Z=A.useMemo(()=>N&&f.current(N,g,b),[N,f,g,b]),F=A.useMemo(()=>!!Z&&h.current(Z),[Z,h]),q=P4(Z),K=P4(F);return A.useEffect(()=>{var J,he,le,ee;if(Z){Gp(N),q||(J=m.current)==null||J.call(m),(he=v.current)==null||he.call(v,M?Z:void 0,N,F);return}q&&(Gp(K),(le=x.current)==null||le.call(x,U.current?q:void 0,K),K&&U.current&&((ee=y.current)==null||ee.call(y,q)),U.current=!1)},[Z,q,N,F,K,M,m,v,x,y]),!Z||!M?null:(Gp(N),u(Z,N,F))}const Vbe="_selection_0f4643e",HC={selection:Vbe};function q_(t){const{overflowCanvas:e=!1,children:n}=t,{r3fRoot:r,canvasArea:i}=Fn(),o=e?i:r,[s]=A.useState(()=>{const l=document.createElement("div");return l.setAttribute("hidden",""),l}),[a]=A.useState(()=>XT(s));return A.useLayoutEffect(()=>{a.render(zl.createPortal(n,o))},[n,o,a]),A.useLayoutEffect(()=>(r.append(s),()=>{a.unmount(),s.remove()}),[r,a,s]),null}function q9(t){const{children:e}=t,{svgOverlay:n}=Fn();return n?C.jsx(q_,{children:zl.createPortal(e,n)}):null}function GC(t){const{coords:e,strokePosition:n,...r}=t,{stroke:i,strokeWidth:o=1}=r,s=i&&n?o*(n==="outside"?1:-1):0,{min:a,max:l}=kl.fromPoints(...e).expandBySize(s,s);return C.jsx("path",{d:`M ${a.x},${a.y} H ${l.x} V ${l.y} H ${a.x} z`,...r})}const $be=20;function Wbe(t){const{minZoom:e=$be,...n}=t,{canvasSize:r,canvasRatio:i,canvasBox:o,visRatio:s,visSize:a,htmlToWorld:l,worldToData:c}=Fn(),u=H9(),f=wr(v=>v.camera),h=s!==void 0;function m(v){if(!h)return v;const{scale:x}=f,y=kl.empty(new G(r.width/2,r.height/2)).expandBySize(a.width/x.x,a.height/x.y),g=kl.fromPoints(...v.html).expandToRatio(i).keepWithin(o).keepWithin(y).toRect(),b=g.map(S=>l(f,S)),_=b.map(c);return{html:g,world:b,data:_}}return C.jsx(X9,{id:"SelectToZoom",transform:m,validate:({html:v})=>v[0].manhattanDistanceTo(v[1])>=e,onValidSelection:u,...n,children:({html:v},{html:x},y)=>C.jsxs(q9,{children:[C.jsx(GC,{className:HC.selection,coords:x,fill:"white",fillOpacity:!h&&y?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:h||!y?4:void 0}),h&&C.jsx(GC,{className:HC.selection,coords:v,fill:"white",fillOpacity:y?.25:0,stroke:"black",strokePosition:"inside"})]})})}function Hbe(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=Fn(),i=kg("XAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=s=>({x:i(s),y:!1});return lP(),_a("wheel",cP(o)),null}function Gbe(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=Fn(),i=kg("YAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=s=>({x:!1,y:i(s)});return lP(),_a("wheel",cP(o)),null}function Xbe(t){const{modifierKey:e,disabled:n}=t,r=kg("Zoom",{button:"Wheel",modifierKey:e,disabled:n}),i=o=>{const s=r(o);return{x:s,y:s}};return lP(),_a("wheel",cP(i)),null}function qbe(t){const{axis:e,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,children:o,...s}=t;function a(l,c,u){const{canvasSize:f,htmlToWorld:h,worldToData:m}=u,{width:v,height:x}=f,[y,g]=l.html,b=e==="x"?[new G(y.x,0),new G(g.x,x)]:[new G(0,y.y),new G(v,g.y)],_=b.map(P=>h(c,P)),S=_.map(m);return{html:b,world:_,data:S}}return C.jsx(X9,{transform:a,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,...s,children:o})}const Ybe=20;function $O(t){const{axis:e,modifierKey:n,disabled:r,minZoom:i=Ybe}=t,{visRatio:o}=Fn(),s=H9();return C.jsx(qbe,{axis:e,id:`${e.toUpperCase()}SelectToZoom`,modifierKey:n,disabled:o!==void 0||r,validate:({html:a})=>kl.fromPoints(...a).hasMinSize(i),onValidSelection:s,children:({html:a},l,c)=>C.jsx(q9,{children:C.jsx(GC,{className:HC.selection,coords:a,fill:"white",fillOpacity:c?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:c?void 0:4})})})}function Kbe(t){const{...e}=t;return C.jsxs(C.Fragment,{children:[e.pan!==!1&&C.jsx(jbe,{...e.pan}),e.zoom!==!1&&C.jsx(Xbe,{...e.zoom}),e.xAxisZoom!==!1&&C.jsx(Hbe,{modifierKey:"Alt",...e.xAxisZoom}),e.yAxisZoom!==!1&&C.jsx(Gbe,{modifierKey:"Shift",...e.yAxisZoom}),e.selectToZoom!==!1&&C.jsx(Wbe,{modifierKey:"Control",...e.selectToZoom}),e.xSelectToZoom!==!1&&C.jsx($O,{axis:"x",modifierKey:["Control","Alt"],...e.xSelectToZoom}),e.ySelectToZoom!==!1&&C.jsx($O,{axis:"y",modifierKey:["Control","Shift"],...e.ySelectToZoom})]})}function Y_(t){return(...e)=>A.useMemo(()=>t(...e),e)}const Zbe=Y_(Rbe),Jbe=Y_(Lbe);function Y9(t,e,n=(r,i)=>Object.is(r,i)){const r=wr(a=>a.camera),i=R6(),o=A.useRef(),s=gr(t);return A.useMemo(()=>{o.current=s.current(r)},e),CA(()=>{const a=s.current(r);n(o.current,a)||(o.current=a,i())}),o.current}function Qbe(t){const[e,n]=A.useState(),r=A.useCallback(i=>n(i?window.getComputedStyle(i):void 0),[]);return e?[t.map(i=>e.getPropertyValue(i).trim()),r]:[t.map(()=>"transparent"),r]}function kx(t,e,n,r=!1){const i=A.useMemo(()=>new t(e),[t,e]),o=wr(s=>s.invalidate);return A.useLayoutEffect(()=>{if(n){i.prepare(n);for(let s=0;s{s.needsUpdate=!0}),i.index&&(i.index.needsUpdate=!0),o()}},[i,...Object.values(n||{}),o]),i}function e_e(t){const{children:e}=t,{floatingToolbar:n}=Fn();return n?C.jsx(q_,{children:zl.createPortal(e,n)}):null}const t_e="_btnLike_0154b53",n_e="_icon_bcb8f77",r_e="_label_5a75092",i_e="_popup_954b735",o_e="_btn_f1cebe5 btnClean",uP={btnLike:t_e,icon:n_e,label:r_e,popup:i_e,btn:o_e},{btn:s_e,btnLike:a_e}=uP,l_e=`_btn_579cee1 ${s_e}`,c_e=`_btnLike_5797793 ${a_e}`,WO={btn:l_e,btnLike:c_e};function u_e(){const t=wr(i=>i.camera),e=wr(i=>i.invalidate),n=Y9(({scale:i})=>i.x<1||i.y<1,[]);function r(){t.scale.x=1,t.scale.y=1,t.position.x=0,t.position.y=0,t.updateMatrixWorld(),e()}return C.jsx(e_e,{children:C.jsx("button",{className:WO.btn,type:"button",hidden:!n,onClick:()=>r(),children:C.jsx("span",{className:WO.btnLike,children:"Reset zoom"})})})}function f_e(t){const{children:e,style:n,className:r}=t,{canvasSize:i}=Fn();return C.jsx(q_,{overflowCanvas:!0,children:C.jsx("div",{className:r,style:{position:"absolute",top:0,left:0,...i,...n},children:e})})}const d_e="_overlay_df4a4fe",h_e="_tooltip_c303daa",p_e="_guides_073d0c4",EE={overlay:d_e,tooltip:h_e,guides:p_e};function m_e(t){const{tooltipOpen:e,tooltipLeft:n,tooltipTop:r,guides:i,children:o}=t,{canvasSize:s}=Fn(),{width:a,height:l}=s;return C.jsx(f_e,{className:EE.overlay,children:e&&o&&C.jsxs(C.Fragment,{children:[C.jsx(Cpe,{className:EE.tooltip,top:r,left:n,unstyled:!0,applyPositionStyle:!0,children:o},Math.random()),i&&C.jsxs("svg",{className:EE.guides,children:[i!=="horizontal"&&C.jsx(Mx,{from:{x:n,y:0},to:{x:n,y:l}}),i!=="vertical"&&C.jsx(Mx,{from:{x:0,y:r},to:{x:a,y:r}})]})]})})}function K9(t){const{children:e,size:n,...r}=t,{visSize:i}=Fn(),{width:o,height:s}=n??i;return C.jsxs("mesh",{...r,children:[C.jsx("planeGeometry",{args:[o,s]}),e]})}function g_e(t){const{guides:e,renderTooltip:n,size:r}=t,{canvasSize:i,worldToData:o}=Fn(),{width:s,height:a}=i,{tooltipOpen:l,tooltipTop:c,tooltipLeft:u,tooltipData:f,showTooltip:h,hideTooltip:m}=vpe(),v=A.useCallback(_=>{const{unprojectedPoint:S,nativeEvent:P}=_;if(P.buttons!==0)return;const N=o(S);h({tooltipLeft:P.offsetX,tooltipTop:P.offsetY,tooltipData:[N.x,N.y]})},[o,h]),x=A.useCallback(()=>{l&&m()},[m,l]),y=A.useCallback(()=>m(),[m]),g=A.useCallback(_=>{const{nativeEvent:S}=_,{offsetX:P,offsetY:N}=S;P>=0&&P<=s&&N>=0&&N<=a&&v(_)},[a,v,s]),b=f&&n(...f);return C.jsxs(C.Fragment,{children:[C.jsx(K9,{onPointerMove:v,onPointerOut:x,onPointerDown:y,onPointerUp:g,size:r,children:C.jsx("meshBasicMaterial",{opacity:0,transparent:!0})}),C.jsx(m_e,{tooltipOpen:l,tooltipLeft:u,tooltipTop:c,guides:e,children:b})]})}const v_e="_axis_1002b06",y_e="_grid_a397f58",x_e="_tick_44c4d9c",b_e="_label_4a1d111",Ox={axis:v_e,grid:y_e,tick:x_e,label:b_e};function __e(t){const{formattedValue:e,...n}=t;return C.jsx("text",{...n,dy:"0.3125em",children:e})}const w_e={labelClassName:Ox.label,labelProps:{fontSize:"inherit"},tickClassName:Ox.tick,tickComponent:__e},S_e={abscissa:[ive,i9],ordinate:[eve,r9]};function HO(t){const{type:e,config:n,domain:r,canvasSize:i,offset:o,flipAxis:s,showAxis:a}=t,{width:l,height:c}=i,u=e==="abscissa",f=u?l:c,{scaleType:h=Nt.Linear,isIndexAxis:m,showGrid:v,label:x,nice:y=!1}=n,g=aP(h,{domain:r,range:s?[f,0]:[0,f],nice:y}),[b,_]=S_e[e],S=wbe(f),P=m?{tickValues:Abe(r,S)}:{numTicks:S};return C.jsxs(C.Fragment,{children:[a&&C.jsx("svg",{className:Ox.axis,"data-type":e,style:u?{width:l,height:o}:{width:o,height:c},children:C.jsx(b,{scale:g,tickFormat:Pbe(r,f,h),label:x,labelOffset:o-(u?32:36),hideAxisLine:v,...P,...w_e})}),v&&C.jsx("svg",{className:Ox.grid,...i,children:C.jsx(_,{scale:g,...i,...P})})]})}function M_e(t){const{axisOffsets:e,showAxes:n}=t,{canvasSize:r,visCanvas:i,abscissaConfig:o,ordinateConfig:s,getVisibleDomains:a}=Fn(),l=Y9(a,[a]);return C.jsx(q_,{children:zl.createPortal(C.jsxs(C.Fragment,{children:[C.jsx(HO,{type:"abscissa",config:o,domain:l.xVisibleDomain,canvasSize:r,offset:e.bottom,showAxis:n}),C.jsx(HO,{type:"ordinate",config:s,domain:l.yVisibleDomain,canvasSize:r,offset:e.left,showAxis:n,flipAxis:!0})]}),i)})}function E_e(t){const{className:e,orthographic:n,children:r}=t;return C.jsxs(Ede,{className:e,orthographic:n,flat:!0,frameloop:"demand",dpr:[1,3],resize:{debounce:{scroll:20,resize:200},scroll:!1},gl:{preserveDrawingBuffer:!0},camera:{near:vbe,far:sP,position:[0,0,D9]},children:[C.jsx("ambientLight",{}),r]})}function C_e(){const{visRatio:t}=Fn(),e=wr(r=>r.camera),n=Lg();return A.useEffect(()=>{if(!t||e.scale.x===e.scale.y)return;const r=Math.max(e.scale.x,e.scale.y);e.scale.x=r,e.scale.y=r,n(e.position)},[e,n,t]),null}function T_e(t){const{value:e}=t,n=wr(i=>i.raycaster),r=wr(i=>i.camera);return A.useEffect(()=>{const i=n.params.Points,o=i?i.threshold:1;return i&&(i.threshold=e),()=>{i&&(i.threshold=o)}},[n,e]),CA(()=>{const i=(r.scale.x+r.scale.y)/2;n.params.Points&&(n.params.Points.threshold=e*i/2)}),null}function R_e(){const{dataToWorld:t,worldToData:e}=Fn(),n=A.useRef(),r=wr(o=>o.camera),i=Lg();return CA(()=>{n.current=e(r.position)}),A.useEffect(()=>{n.current&&i(t(n.current))},[n,i,t,r]),null}const A_e="_visCanvas_2387375",P_e="_title_313417a",N_e="_canvasArea_6300bb7",I_e="_r3fRoot_f557f0c",L_e="_svgOverlay_3f84e2f",k_e="_floatingToolbar_de4854e",vf={visCanvas:A_e,title:P_e,canvasArea:N_e,r3fRoot:I_e,svgOverlay:L_e,floatingToolbar:k_e},O_e={left:0,right:0,top:0,bottom:0};function D_e(t){const{title:e,aspect:n="auto",abscissaConfig:r,ordinateConfig:i,raycasterThreshold:o,showAxes:s=!0,children:a}=t,l=U9(n,r.visDomain,i.visDomain),c=s?Ibe({left:!!i.label,bottom:!!r.label,top:!!e}):O_e,[u,f]=A.useState(null),[h,m]=A.useState(null);return C.jsxs("div",{className:vf.visCanvas,style:{gridTemplateColumns:`${c.left}px minmax(0, 1fr) ${c.right}px`,gridTemplateRows:`${c.top}px minmax(0, 1fr) ${c.bottom}px`},children:[s&&e&&C.jsx("p",{className:vf.title,children:e}),C.jsxs("div",{className:vf.canvasArea,children:[C.jsx(E_e,{className:vf.r3fRoot,orthographic:!0,children:C.jsxs(Dbe,{visRatio:l,abscissaConfig:r,ordinateConfig:i,svgOverlay:u,floatingToolbar:h,children:[C.jsx(M_e,{axisOffsets:c,showAxes:s}),C.jsx(Ube,{children:a}),C.jsx(R_e,{}),C.jsx(C_e,{}),o!==void 0&&C.jsx(T_e,{value:o})]})}),C.jsx("svg",{ref:f,className:vf.svgOverlay,overflow:"hidden"})]}),C.jsx("div",{ref:m,className:vf.floatingToolbar})]})}class F_e extends Ut{constructor(){super(...arguments),yp(this,"params")}prepare(e){this.params=e}}const K_=F_e;class z_e extends K_{constructor(e){super(),this.setAttribute("position",G_(e*2))}update(e){const{abscissas:n,ordinates:r,errors:i,abscissaScale:o,ordinateScale:s,ignoreValue:a}=this.params,l=r[e],c=a?a(l):!1,u=e*2;if(c){this.attributes.position.setXYZ(u,0,0,wi),this.attributes.position.setXYZ(u+1,0,0,wi);return}const f=o(n[e]),h=s(l);if(!Number.isFinite(f)||!Number.isFinite(h)){this.attributes.position.setXYZ(u,0,0,wi),this.attributes.position.setXYZ(u+1,0,0,wi);return}const m=i[e],v=s(l-m),x=s(l+m),y=Number.isFinite(v)?v:h,g=Number.isFinite(x)?x:h;this.attributes.position.setXYZ(u,f,y,0),this.attributes.position.setXYZ(u+1,f,g,0)}}const U_e=z_e;class B_e extends K_{constructor(e){super(),this.setAttribute("position",G_(e*2))}update(e){const{abscissas:n,ordinates:r,errors:i,abscissaScale:o,ordinateScale:s,ignoreValue:a}=this.params,l=r[e],c=a?a(l):!1,u=e*2;if(c){this.attributes.position.setXYZ(u,0,0,wi),this.attributes.position.setXYZ(u+1,0,0,wi);return}const f=o(n[e]),h=s(l);if(!Number.isFinite(f)||!Number.isFinite(h)){this.attributes.position.setXYZ(u,0,0,wi),this.attributes.position.setXYZ(u+1,0,0,wi);return}const m=i[e],v=s(l-m),x=s(l+m);Number.isFinite(v)?this.attributes.position.setXYZ(u,f,v,0):this.attributes.position.setXYZ(u,0,0,wi),Number.isFinite(x)?this.attributes.position.setXYZ(u+1,f,x,0):this.attributes.position.setXYZ(u+1,0,0,wi)}}const j_e=B_e;var ld=(t=>(t.LineOnly="OnlyLine",t.GlyphsOnly="OnlyGlyphs",t.LineAndGlyphs="LineAndGlyphs",t))(ld||{}),pl=(t=>(t.Circle="Circle",t.Cross="Cross",t.Square="Square",t.Cap="Cap",t))(pl||{});const V_e={[pl.Cross]:` - float alphaSymbol(vec2 coord, float size) { - vec2 pos = floor(size * coord) + 0.5; - vec2 d_x = abs(pos.x + vec2(- pos.y, pos.y - size)); - if (min(d_x.x, d_x.y) <= 0.5) { - return 1.0; - } else { - return 0.0; - } - } - `,[pl.Cap]:` - float alphaSymbol(vec2 coord, float size) { - float dy = abs(size * (coord.y - 0.5)); - if (dy < 0.5) { - return 1.0; - } else { - return 0.0; - } - } - `,[pl.Circle]:` - float alphaSymbol(vec2 coord, float size) { - float r = distance(coord, vec2(0.5, 0.5)); - if( r < 0.5) { - return 1.0; - } else { - return 0.0; - } - } - `,[pl.Square]:` - float alphaSymbol(vec2 coord, float size) { - return 1.0; - } - `};function Z9(t){const{color:e,size:n,glyphType:r}=t,i=!e,o={uniforms:j9({size:n,color:new ot(e)}),vertexShader:` - ${e?"uniform vec3 color;":""} - uniform float size; - varying vec3 vertexColor; - - void main() { - gl_PointSize = size; - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - vertexColor = color; - } - `,fragmentShader:` - uniform float size; - varying vec3 vertexColor; - - ${V_e[r]} - - void main() { - float alpha = alphaSymbol(gl_PointCoord, size); - if (alpha <= 0.0) { - discard; - } else { - gl_FragColor = vec4(vertexColor.rgb, alpha); - } - } - `};return C.jsx("shaderMaterial",{args:[o],vertexColors:i})}function $_e(t){const{abscissas:e,ordinates:n,errors:r,color:i,visible:o,ignoreValue:s}=t,{abscissaScale:a,ordinateScale:l}=Fn(),c=o&&{abscissas:e,ordinates:n,errors:r,abscissaScale:a,ordinateScale:l,ignoreValue:s},u=kx(U_e,n.length,c),f=kx(j_e,n.length,c);return C.jsxs(C.Fragment,{children:[C.jsx("lineSegments",{geometry:u,visible:o,children:C.jsx("lineBasicMaterial",{color:i})}),C.jsx("points",{geometry:f,visible:o,children:C.jsx(Z9,{glyphType:pl.Cap,color:i,size:9})})]})}class W_e extends K_{constructor(e){super(),this.setAttribute("position",G_(e))}update(e){const{abscissas:n,ordinates:r,abscissaScale:i,ordinateScale:o,ignoreValue:s}=this.params,a=r[e];if(s&&s(a)){this.attributes.position.setXYZ(e,0,0,wi);return}const l=i(n[e]),c=o(a);if(!Number.isFinite(l)||!Number.isFinite(c)){this.attributes.position.setXYZ(e,0,0,wi);return}this.attributes.position.setXYZ(e,l,c,0)}}const H_e=W_e;function G_e(t){const{abscissas:e,ordinates:n,glyphType:r=pl.Cross,color:i,size:o=6,visible:s=!0,ignoreValue:a,...l}=t,{abscissaScale:c,ordinateScale:u}=Fn(),f=kx(H_e,n.length,s&&{abscissas:e,ordinates:n,abscissaScale:c,ordinateScale:u,ignoreValue:a},V9(l));return C.jsx("points",{geometry:f,visible:s,...l,children:C.jsx(Z9,{glyphType:r,color:i,size:o})})}class X_e extends K_{constructor(e){super(),this.setAttribute("position",G_(e))}update(e){const{abscissas:n,ordinates:r,abscissaScale:i,ordinateScale:o,ignoreValue:s}=this.params,a=r[e];if(s&&s(a)){this.attributes.position.setXYZ(e,0,0,wi);return}const l=i(n[e]),c=o(a);if(!Number.isFinite(l)||!Number.isFinite(c)){this.attributes.position.setXYZ(e,0,0,wi);return}this.attributes.position.setXYZ(e,l,c,0)}}const q_e=X_e;class Y_e extends Na{}VB({Line_:Y_e});function K_e(t){const{abscissas:e,ordinates:n,color:r,visible:i=!0,ignoreValue:o,...s}=t,{abscissaScale:a,ordinateScale:l}=Fn(),c=kx(q_e,n.length,i&&{abscissas:e,ordinates:n,abscissaScale:a,ordinateScale:l,ignoreValue:o},V9(s));return C.jsx("line_",{geometry:c,visible:i,...s,children:C.jsx("lineBasicMaterial",{color:r})})}function GO(t){const{abscissas:e,ordinates:n,errors:r,showErrors:i,color:o,curveType:s=ld.LineOnly,glyphType:a=pl.Cross,glyphSize:l=6,visible:c=!0,onDataPointClick:u,onDataPointEnter:f,onDataPointLeave:h,ignoreValue:m}=t,v=A.useCallback(g=>{const{index:b}=g;u&&b!==void 0&&u(b,g)},[u]),x=A.useCallback(g=>{const{index:b}=g;f&&b!==void 0&&f(b,g)},[f]),y=A.useCallback(g=>{const{index:b}=g;h&&b!==void 0&&h(b,g)},[h]);return C.jsxs(C.Fragment,{children:[C.jsx(K_e,{abscissas:e,ordinates:n,color:o,ignoreValue:m,visible:s!==ld.GlyphsOnly&&c}),C.jsx(G_e,{abscissas:e,ordinates:n,glyphType:a,color:o,size:l,ignoreValue:m,visible:s!==ld.LineOnly&&c,onClick:u&&v,onPointerEnter:f&&x,onPointerLeave:h&&y}),r&&C.jsx($_e,{abscissas:e,ordinates:n,errors:r,color:o,ignoreValue:m,visible:c&&i})]})}function Z_e(t,e){if(!t)return Jb(e);if(t.length$C(H,e.size,`'${X||Z}' auxiliary`));const R=J_e(P,e.size),L=Zbe(R,!0),U=Jbe(R,N,.01);Gp(U,"Abscissas have undefined domain");const M=A.useMemo(()=>n?z9(n,.05,o):F9,[o,n]),[[T,D],O]=Qbe(["--curve-color","--aux-colors"]),j=D.split(",").map(X=>X.trim());return C.jsx("figure",{ref:O,className:`${cp.root} ${b}`,style:_,"aria-label":l,"data-keep-canvas-colors":!0,"data-testid":y,children:C.jsxs(D_e,{title:l,abscissaConfig:{visDomain:U,showGrid:i,scaleType:N,isIndexAxis:!P,label:S},ordinateConfig:{visDomain:M,showGrid:i,scaleType:o,label:a},children:[C.jsx(Kbe,{...x}),C.jsx(u_e,{}),C.jsx(g_e,{guides:"vertical",renderTooltip:X=>{const H=L(X),Z=R[H];if(m)return m({abscissa:Z,xi:H,x:X});const F=e.get(H),q=u==null?void 0:u.get(H);return C.jsxs(C.Fragment,{children:[`${S??"x"} = ${_E(Z)}`,C.jsxs("div",{className:cp.tooltipValue,children:[h.length>0&&C.jsx("span",{className:cp.mark,"data-keep-colors":!0,style:{color:T}}),C.jsxs("span",{children:[C.jsx("strong",{children:_E(F)}),q!==void 0&&` ±${FO(q)}`,c&&C.jsx("em",{children:` (${c})`})]})]}),h.map(({label:K,array:J,errors:he},le)=>C.jsxs("div",{className:cp.tooltipAux,children:[C.jsx("span",{className:cp.mark,"data-keep-colors":!0,style:{color:j[le%j.length]}}),K?`${K} = `:"",_E(J.get(H)),he&&` ±${FO(he.get(H))}`]},K||le))]})}}),C.jsx(GO,{abscissas:R,ordinates:e.data,errors:u==null?void 0:u.data,showErrors:f,color:T,curveType:r,ignoreValue:g}),h.map(({array:X,label:H,errors:Z},F)=>C.jsx(GO,{abscissas:R,ordinates:X.data,errors:Z==null?void 0:Z.data,showErrors:f,color:j[F%j.length],curveType:r,ignoreValue:g},H)),v]})})}var qf=(t=>(t.MinGreater="min-greater",t.InvalidMinWithScale="invalid-min-with-scale",t.InvalidMaxWithScale="invalid-max-with-scale",t.CustomMaxFallback="custom-max-fallback",t))(qf||{});function owe(t){return xx(t*360,1,.5).formatRgb()}function yf(t){return e=>t(1-e)}const swe={Blues:yf(rye),Greens:yf(oye),Greys:yf(aye),Oranges:yf(hye),Purples:yf(cye),Reds:yf(fye),Turbo:wye,Viridis:Sye,Inferno:Eye,Magma:Mye,Plasma:Cye,Cividis:pye,Warm:gye,Cool:vye,Cubehelix:mye,BuGn:Lve,BuPu:Ove,GnBu:Fve,OrRd:Uve,PuBuGn:jve,PuBu:$ve,PuRd:Hve,RdPu:Xve,YlGnBu:Yve,YlGn:Zve,YlOrBr:Qve,YlOrRd:tye,Rainbow:yye,Sinebow:_ye,HSL:owe,BrBG:mve,PRGn:vve,PiYG:xve,PuOr:_ve,RdBu:Sve,RdGy:Eve,RdYlBu:Tve,RdYlGn:Ave,Spectral:Nve},XO=1/20;Jb(0,1+XO,XO);const awe={[Nt.Linear]:t=>t,[Nt.Log]:Math.log10,[Nt.SymLog]:t=>Math.sign(t)*Math.log10(1+Math.abs(t)),[Nt.Sqrt]:Math.sqrt,[Nt.Gamma]:t=>t},lwe={float32:ai,uint16:vu,uint8:Fi,uint8_clamped:Fi};function cwe(t,e){const n=swe[t];return e?r=>n(1-r):n}function uwe(t,e=Nt.Linear){const n=awe[e];return[n(t[0]),n(t[1])]}function fwe(t,e=lr){if(!t)return;const{rows:n,cols:r}=hbe(t),i=new No(t.data,r,n,hg,lwe[t.dtype],dg,Ti,Ti,e);return i.needsUpdate=!0,i}const CE=Y_(fwe),dwe=Pl(255,255,255,0),TE=256,hwe={[Nt.Log]:"log(value) * oneOverLog10",[Nt.SymLog]:"sign(value) * log(1. + abs(value)) * oneOverLog10",[Nt.Sqrt]:"sqrt(value)"},pwe={[Nt.Log]:"value > 0.",[Nt.Sqrt]:"value >= 0."};function mwe(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o=!1,magFilter:s,alphaValues:a,alphaDomain:l=F9,badColor:c=dwe,mask:u}=t,f=CE(e,s),h=CE(a),m=CE(u),v=A.useMemo(()=>{const S=cwe(i,o),P=Array.from({length:TE}).flatMap((R,L)=>{const{r:U,g:M,b:T}=Pl(S(L/(TE-1)));return[U,M,T,255]}),N=new No(Uint8Array.from(P),TE,1,Rr,Fi);return N.needsUpdate=!0,N},[i,o]),[x,y]=Array.isArray(r)?r:[r,1],g=uwe(n,x),b=typeof c=="string"?Pl(c):c,_={uniforms:j9({data:f,mask:m,colorMap:v,min:g[0],oneOverRange:1/(g[1]-g[0]),gammaExponent:y,normRevertFactor:e.dtype==="uint8"?255:1,alpha:h,withAlpha:a?1:0,alphaMin:l[0],oneOverAlphaRange:1/(l[1]-l[0]),badColor:new Zt(b.r/255,b.g/255,b.b/255,b.opacity)}),vertexShader:kbe,fragmentShader:` - uniform sampler2D data; - uniform sampler2D colorMap; - - uniform float min; - uniform float oneOverRange; - uniform float gammaExponent; - uniform float normRevertFactor; - - uniform sampler2D alpha; - uniform float alphaMin; - uniform float oneOverAlphaRange; - uniform int withAlpha; - uniform vec4 badColor; - - uniform sampler2D mask; - - const float oneOverLog10 = 0.43429448190325176; - - varying vec2 coords; - - bool isSupported(float value) { - return ${pwe[x]||"true"}; - } - - float scale(float value) { - return ${hwe[x]||"value"}; - } - - void main() { - float value = texture2D(data, coords).r * normRevertFactor; - float maskValue = texture2D(mask, coords).r; - - if (isnan(value) || !isSupported(value) || maskValue == 1.) { - gl_FragColor = badColor; - } else { - float scaledValue = scale(value); - float normalizedValue = clamp(oneOverRange * (scaledValue - min), 0., 1.); - - gl_FragColor = texture2D(colorMap, vec2(pow(normalizedValue, gammaExponent), 0.5)); - - if (withAlpha == 1) { - gl_FragColor.a = oneOverAlphaRange * (texture2D(alpha, coords).r - alphaMin); - } - } - } - `};return C.jsx("shaderMaterial",{args:[_],side:Qo})}const gwe=A.memo(mwe);function vwe(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:s,alphaValues:a,alphaDomain:l,badColor:c,mask:u,...f}=t;return C.jsx(K9,{...f,children:C.jsx(gwe,{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:s,alphaValues:a,alphaDomain:l,badColor:c,mask:u})})}const{btn:ywe,btnLike:xwe,icon:bwe,label:_we,popup:wwe}=uP,Swe="_toolbar_d77010c",Mwe="_controls_6f2898a",Ewe="_controlWrapper_c53184f",Cwe="_control_72c50d3",Twe="_sep_9963159",Rwe="_arrowIcon_52a7a56",Awe="_menu_9a962f8",Pwe="_btnOption_14b8d45 btnClean",Nwe=`_btn_ea88005 ${ywe}`,Iwe=`_btnLike_059b9d6 ${xwe}`,Lwe=`_icon_b73dfea ${bwe}`,kwe=`_label_917dfbf ${_we}`,Owe=`_popup_486e2ed ${wwe}`,Ei={toolbar:Swe,controls:Mwe,controlWrapper:Ewe,control:Cwe,sep:Twe,arrowIcon:Rwe,menu:Awe,btnOption:Pwe,btn:Nwe,btnLike:Iwe,icon:Lwe,label:kwe,popup:Owe},Dwe=A.forwardRef((t,e)=>{const{label:n,icon:r,iconOnly:i,small:o,raised:s,withArrow:a,disabled:l,...c}=t;return C.jsx("button",{ref:e,className:Ei.btn,type:"button",title:i?n:void 0,"aria-label":i?n:void 0,disabled:l,"data-small":o||void 0,"data-raised":s||void 0,...c,children:C.jsxs("span",{className:Ei.btnLike,children:[r&&C.jsx(r,{className:Ei.icon}),!i&&C.jsx("span",{className:Ei.label,children:n}),a&&C.jsx(S9,{className:Ei.arrowIcon})]})})}),fP=Dwe,Xc=6,Fwe=320;function zwe(){const[t,e]=Zb();return tP({open:t,middleware:[ZA(Xc),h1e({padding:Xc*2,apply({availableHeight:n,elements:r,rects:i}){Object.assign(r.floating.style,{maxHeight:`${Math.min(n,Fwe)}px`,minWidth:`${i.reference.width}px`})}}),JA({padding:Xc})],onOpenChange:e,whileElementsMounted:KA})}function dP(t){const{refs:e,onOpenChange:n}=t,{domReference:r,floating:i}=e,o=A.useCallback(l=>{var c,u;const{relatedTarget:f}=l;f&&!((c=r.current)!=null&&c.contains(f))&&!((u=i.current)!=null&&u.contains(f))&&n(!1)},[r,i,n]),s=A.useMemo(()=>({onBlur:o}),[o]),a=A.useMemo(()=>({onBlur:o}),[o]);return A6("Escape",()=>n(!1)),Pne(e.floating,l=>{const c=e.domReference.current;l.target instanceof Element&&c!=null&&c.contains(l.target)||n(!1)}),A.useMemo(()=>({reference:s,floating:a}),[s,a])}const Uwe="_list_0eb2b49",Bwe="_entry_d2776e7",jwe="_shortcut_cf4534d",RE={list:Uwe,entry:Bwe,shortcut:jwe};function Vwe(t){const{interactions:e}=t,[n,r]=Zb(),i=A.useId(),{refs:o,floatingStyles:s,context:a}=tP({open:n,middleware:[ZA(Xc),JA({padding:Xc})],onOpenChange:r,whileElementsMounted:KA}),{getReferenceProps:l,getFloatingProps:c}=nP([eP(a),dP(a)]);return C.jsxs(C.Fragment,{children:[C.jsx(fP,{ref:o.setReference,id:i,label:"Show help",icon:G1e,iconOnly:!0,"aria-haspopup":"dialog","aria-expanded":n,"aria-controls":n&&a.floatingId||void 0,...l()}),n&&C.jsx("div",{ref:o.setFloating,id:a.floatingId,className:Ei.popup,style:s,role:"dialog","aria-labelledby":i,...c(),children:C.jsx("ul",{className:RE.list,children:e.map(({shortcut:u,description:f})=>C.jsxs("li",{className:RE.entry,children:[C.jsx("span",{children:f})," ",C.jsx("kbd",{className:RE.shortcut,children:u})]},u))})})]})}const $we="_controlWrapper_8627c21",Wwe="_control_0b569a9",qO={controlWrapper:$we,control:Wwe};function Hwe(t){const{children:e,knownWidth:n,onMeasure:r}=t;return C.jsx(rP,{onResize:({entry:i})=>{i&&i.width>(n||0)&&r(i.width)},children:({measureRef:i})=>C.jsx("div",{className:qO.controlWrapper,"data-measured":n!==void 0,children:C.jsx("div",{ref:i,className:qO.control,children:e})})})}const{popup:Gwe}=uP,Xwe="_control_ad90dfa",qwe=`_popup_c29165d ${Gwe}`,YO={control:Xwe,popup:qwe};function qc(t){return C.jsx("span",{className:Ei.sep,...t})}function Ywe(t){const{children:e}=t,n=HA(e).filter(A.isValidElement),[r,i]=Zb(),o=A.useId(),{refs:s,floatingStyles:a,context:l}=tP({open:r,placement:"bottom-end",middleware:[ZA(Xc),JA({padding:Xc})],onOpenChange:i,whileElementsMounted:KA}),{getReferenceProps:c,getFloatingProps:u}=nP([eP(l),dP(l)]);return n.length===0?null:C.jsxs(C.Fragment,{children:[C.jsx(qc,{}),C.jsx(fP,{ref:s.setReference,id:o,label:"More controls",icon:X1e,iconOnly:!0,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r&&l.floatingId||void 0,...c()}),r&&C.jsx("div",{ref:s.setFloating,id:l.floatingId,className:YO.popup,style:a,role:"dialog","aria-labelledby":o,...u(),children:n.map(f=>C.jsx("div",{className:YO.control,children:A.cloneElement(f)},f.key))})]})}function Kwe(t){var e;const{children:n,interactions:r,overflowChildren:i=[]}=t,o=HA(n).filter(A.isValidElement),[s,a]=Ene(),l=s?s.width:0,c=bne(),[u,f]=o.reduce(([m,v,x],y)=>{const g=c.get(y.key)??0,b=x+g>l;return[b?m:[...m,y],b?[...v,y]:v,x+g]},[[],[],0]),h=((e=u[u.length-1])==null?void 0:e.type)===qc;return C.jsxs("div",{className:Ei.toolbar,children:[C.jsx("div",{ref:a,className:Ei.controls,children:(h?u.slice(0,-1):u).map(m=>C.jsx(Hwe,{knownWidth:c.get(m.key),onMeasure:v=>{c.set(m.key,v)},children:m},m.key))}),C.jsxs(Ywe,{children:[i,f.filter(m=>m.type!==qc)]}),r&&C.jsx(qc,{}),r&&C.jsx(Vwe,{interactions:r})]})}function Mc(t){const{value:e,onToggle:n,...r}=t;return C.jsx(fP,{...r,"aria-pressed":e,onClick:()=>n()})}A.createContext(void 0);const Zwe="_boundEditor_ce4a770",Jwe="_label_1e85446",Qwe="_value_c7f465d",AE={boundEditor:Zwe,label:Jwe,value:Qwe},eSe="_root_86b0b1e",tSe="_dataRange_03d542e",nSe="_autoscale_8ea032e",rSe="_error_841a0df",iSe="_errorMessage_a16acf6",oSe="_actionBtn_18350cd btnClean",sSe="_swapBtn_2e22485 _actionBtn_18350cd btnClean",El={root:eSe,dataRange:tSe,autoscale:nSe,error:rSe,errorMessage:iSe,actionBtn:oSe,swapBtn:sSe},XC=A.forwardRef((t,e)=>{const{bound:n,value:r,isEditing:i,hasError:o,onEditToggle:s,onChange:a}=t,l=`${n}-bound`,c=A.useRef(null),[u,f]=A.useState("");function h(){s(!1),f(bE(r))}return A.useImperativeHandle(e,()=>({cancel:h})),A.useEffect(()=>{f(bE(r))},[r,f]),A.useEffect(()=>{var m,v;i||(m=c.current)==null||m.blur(),i&&n==="min"&&((v=c.current)==null||v.focus())},[i,n]),C.jsxs("form",{className:AE.boundEditor,"data-error":o||void 0,"data-editing":i,onSubmit:m=>{m.preventDefault();const v=Number.parseFloat(u.replace("−","-")),x=Number.isNaN(v)?r:Cbe(v);f(bE(x)),a(x),s(!1)},children:[C.jsx("label",{id:`${l}-label`,className:AE.label,htmlFor:l,children:n}),C.jsx("input",{id:l,ref:c,className:AE.value,type:"text",name:"bound",value:u,title:i?void 0:r.toString(),"aria-labelledby":`${l}-label`,onChange:m=>f(m.target.value),onFocus:()=>{i||s(!0)}}),C.jsx("button",{className:El.actionBtn,type:"submit",disabled:!i,"aria-label":`Apply ${n}`,children:C.jsx(W1e,{})}),C.jsx("button",{className:El.actionBtn,type:"button",disabled:!i,"aria-label":`Cancel ${n}`,onClick:()=>h(),children:C.jsx(q1e,{})})]})});XC.displayName="BoundEditor";const aSe={[qf.MinGreater]:{message:"Min greater than max",fallback:"data range"},[qf.InvalidMinWithScale]:{message:"Custom min invalid with this scale",fallback:"data min"},[qf.InvalidMaxWithScale]:{message:"Custom max invalid with this scale",fallback:"data max"},[qf.CustomMaxFallback]:{message:"Custom min invalid with this scale",fallback:"custom max"}};function PE(t){const{error:e,showSwapBtn:n=!1,onSwap:r}=t,{message:i,fallback:o}=aSe[e];return C.jsxs("p",{className:El.error,children:[C.jsxs("span",{className:El.errorMessage,children:[i,C.jsx("br",{}),C.jsx(H1e,{})," falling back to ",C.jsx("strong",{children:o})]}),n&&r&&C.jsx("button",{className:El.swapBtn,type:"button","aria-label":"Swap min and max",onClick:()=>r(),children:C.jsx(Y1e,{})})]})}const lSe=A.forwardRef((t,e)=>{const{sliderDomain:n,dataDomain:r,errors:i}=t,{isAutoMin:o,isAutoMax:s,isEditingMin:a,isEditingMax:l}=t,{onAutoMinToggle:c,onAutoMaxToggle:u,onEditMin:f,onEditMax:h,onChangeMin:m,onChangeMax:v,onSwap:x}=t,{minGreater:y,minError:g,maxError:b}=i,_=A.useRef(null),S=A.useRef(null);return A.useImperativeHandle(e,()=>({cancelEditing:()=>{var P,N;(P=_.current)==null||P.cancel(),(N=S.current)==null||N.cancel()}})),C.jsxs("div",{className:El.root,children:[y&&C.jsx(PE,{error:qf.MinGreater,showSwapBtn:!o&&!s,onSwap:x}),C.jsx(XC,{ref:_,bound:"min",value:n[0],isEditing:a,hasError:y||!!g,onEditToggle:f,onChange:m}),g&&C.jsx(PE,{error:g}),C.jsx(XC,{ref:S,bound:"max",value:n[1],isEditing:l,hasError:y||!!b,onEditToggle:h,onChange:v}),b&&C.jsx(PE,{error:b}),C.jsxs("p",{className:El.dataRange,children:["Data range"," ",C.jsxs("span",{children:["["," ",C.jsx("abbr",{title:r[0].toString(),children:DO(r[0])})," ",","," ",C.jsx("abbr",{title:r[1].toString(),children:DO(r[1])})," ","]"]})]}),C.jsxs("p",{className:El.autoscale,children:["Autoscale"," ",C.jsx(Mc,{label:"Min",raised:!0,value:o,onToggle:c}),C.jsx(Mc,{label:"Max",raised:!0,value:s,onToggle:u})]})]})});lSe.displayName="DomainControls";const cSe="_thumb_be15bc7",uSe="_thumbBtnLike_3744319",fSe="_icon_4b34f14",fy={thumb:cSe,thumbBtnLike:uSe,icon:fSe},dSe=A.forwardRef((t,e)=>{const{bound:n,isAuto:r,hasError:i,disabled:o,AutoIcon:s,...a}=t;return C.jsx("div",{ref:e,...a,className:fy.thumb,"aria-label":`Change ${n} limit`,"aria-disabled":o||void 0,tabIndex:o?-1:a.tabIndex,"data-auto":r,"data-error":i||void 0,children:C.jsxs("div",{className:fy.thumbBtnLike,children:[r&&C.jsx(s,{className:fy.icon}),!r&&i&&C.jsx($1e,{className:fy.icon,strokeWidth:"3"})]})})});dSe.displayName="Thumb";function hSe(t){return Array.isArray(t)?t:Object.values(t).flat()}function KO(t){const{activeIndex:e,selectedIndex:n,children:r,getItemProps:i,onSelect:o}=t,{ref:s,index:a}=S1e();return C.jsx("button",{ref:s,className:Ei.btnOption,type:"button",role:"option","aria-selected":a===n||void 0,tabIndex:a===e?0:-1,"data-active":a===e||void 0,...i({onClick:()=>o(a)}),children:r})}const pSe="_label_568c73e",mSe="_groups_6cecc1b",gSe="_groupLabel_b6d0922",NE={label:pSe,groups:mSe,groupLabel:gSe};function vSe(t){const{label:e,value:n,disabled:r,onChange:i,options:o,renderOption:s}=t,{context:a,refs:l,floatingStyles:c}=zwe(),{open:u,onOpenChange:f}=a,h=A.useId(),m=A.useId(),v=A.useId(),x=A.useRef([]),[y,g]=A.useState(null),[b,_]=A.useState(()=>hSe(o).indexOf(n)),{getReferenceProps:S,getFloatingProps:P,getItemProps:N}=nP([eP(a),dP(a),O1e(a,{listRef:x,activeIndex:y,loop:!0,focusItemOnHover:!1,onNavigate:g})]);function R(L,U){_(L),f(!1),i(U)}return C.jsxs(C.Fragment,{children:[e&&C.jsx("span",{id:h,className:NE.label,children:e}),C.jsx("button",{ref:l.setReference,id:m,className:Ei.btn,type:"button",disabled:r,role:"combobox","aria-labelledby":`${e?h:""} ${v}`,"aria-haspopup":"listbox","aria-expanded":u,"aria-controls":u&&a.floatingId||void 0,...S(),children:C.jsxs("span",{id:v,className:Ei.btnLike,children:[s(n),C.jsx(S9,{className:Ei.arrowIcon})]})}),u&&C.jsx("div",{ref:l.setFloating,id:a.floatingId,className:Ei.menu,style:c,role:"listbox","aria-labelledby":m,...P(),children:C.jsx(w1e,{elementsRef:x,children:Array.isArray(o)?o.map(L=>C.jsx(KO,{activeIndex:y,selectedIndex:b,getItemProps:N,onSelect:U=>R(U,L),children:s(L)},L)):C.jsx("ul",{className:NE.groups,children:Object.entries(o).map(([L,U])=>C.jsxs("li",{children:[C.jsx("span",{className:NE.groupLabel,children:L}),U.map(M=>C.jsx(KO,{activeIndex:y,selectedIndex:b,getItemProps:N,onSelect:T=>R(T,M),children:s(M)},M))]},L))})})})]})}function ySe(t){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:C.jsx("path",{d:"M18 17v-2H6v2zm4-4v-2H2v2zm-8 8v-2h-4v2zm4-12V7H6v2zm-8-4h4V3h-4z",stroke:"none"})})}function xSe(t){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",fill:"none",strokeWidth:"2",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"1em",width:"1em",...t,children:C.jsx("polyline",{points:"2 12 6 12 9 21 15 3 19 3"})})}Nt.Linear+"",Nt.Log+"",Nt.SymLog+"",Nt.Sqrt+"",Nt.Gamma+"";$y.Phase+"",$y.Amplitude+"",$y.PhaseAmplitude+"";Gxe(t=>({val:void 0,setTooltipValue:(e,n,r)=>t(()=>({val:{x:e,y:n,v:r}}))}));function bSe(t){const{api:e,layer:n,x:r,y:i,magFilter:o,onPointerMove:s,...a}=t,l=e.get(n,new Ie(r,i)),[c,u]=l.shape,f=mne(h=>{s==null||s(h,l)},[s],50);return C.jsx("group",{position:[r+u/2,i+c/2,0],children:C.jsx(vwe,{values:l,...a,magFilter:o,size:{width:u,height:c},onPointerMove:s&&f})})}A.memo(bSe);new Pr(new G(-1,-1,-1),new G(1,1,1));var J9={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ZO=Mt.createContext&&Mt.createContext(J9),_Se=["attr","size","title"];function wSe(t,e){if(t==null)return{};var n=SSe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function SSe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Dx(){return Dx=Object.assign?Object.assign.bind():function(t){for(var e=1;eMt.createElement(e.tag,Fx({key:n},e.attr),Q9(e.child)))}function hP(t){return e=>Mt.createElement(TSe,Dx({attr:Fx({},t.attr)},e),Q9(t.child))}function TSe(t){var e=n=>{var{attr:r,size:i,title:o}=t,s=wSe(t,_Se),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),Mt.createElement("svg",Dx({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:Fx(Fx({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&Mt.createElement("title",null,o),t.children)};return ZO!==void 0?Mt.createElement(ZO.Consumer,null,n=>e(n)):e(J9)}function RSe(t){return hP({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26 5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z"},child:[]}]})(t)}function ASe(t){return hP({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"},child:[]}]})(t)}function PSe(t){return hP({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"},child:[]}]})(t)}var Xt={};const NSe=Object.prototype.toString;function Bs(t){const e=NSe.call(t);return e.endsWith("Array]")&&!e.includes("Big")}const ISe=Object.freeze(Object.defineProperty({__proto__:null,isAnyArray:Bs},Symbol.toStringTag,{value:"Module"})),LSe=Vs(ISe);function kSe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Bs(t))throw new TypeError("input must be an array");if(t.length===0)throw new TypeError("input must not be empty");var n=e.fromIndex,r=n===void 0?0:n,i=e.toIndex,o=i===void 0?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],a=r+1;as&&(s=t[a]);return s}function OSe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Bs(t))throw new TypeError("input must be an array");if(t.length===0)throw new TypeError("input must not be empty");var n=e.fromIndex,r=n===void 0?0:n,i=e.toIndex,o=i===void 0?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[r],a=r+1;a1&&arguments[1]!==void 0?arguments[1]:{};if(Bs(t)){if(t.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var n;if(e.output!==void 0){if(!Bs(e.output))throw new TypeError("output option must be an array if specified");n=e.output}else n=new Array(t.length);var r=OSe(t),i=kSe(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=e.min,s=o===void 0?e.autoMinMax?r:0:o,a=e.max,l=a===void 0?e.autoMinMax?i:1:a;if(s>=l)throw new RangeError("min option must be smaller than max option");for(var c=(l-s)/(i-r),u=0;u=0&&n?` ${e5(t,e-1)}`:e5(t,e)).padEnd(e)}function e5(t,e){let n=t.toString();if(n.length<=e)return n;let r=t.toFixed(e);if(r.length>e&&(r=t.toFixed(Math.max(0,e-(r.length-e)))),r.length<=e&&!r.startsWith("0.000")&&!r.startsWith("-0.000"))return r;let i=t.toExponential(e);return i.length>e&&(i=t.toExponential(Math.max(0,e-(i.length-e)))),i.slice(0)}function VSe(t,e){t.prototype.add=function(r){return typeof r=="number"?this.addS(r):this.addM(r)},t.prototype.addS=function(r){for(let i=0;i>r);return this},t.prototype.signPropagatingRightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i>r.get(i,o));return this},t.signPropagatingRightShift=function(r,i){return new e(r).signPropagatingRightShift(i)},t.prototype.rightShift=function(r){return typeof r=="number"?this.rightShiftS(r):this.rightShiftM(r)},t.prototype.rightShiftS=function(r){for(let i=0;i>>r);return this},t.prototype.rightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i>>r.get(i,o));return this},t.rightShift=function(r,i){return new e(r).rightShift(i)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let r=0;rr)throw new RangeError("Row index out of range")}function _o(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function Cf(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Tf(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function pP(t,e){if(!Si.isAnyArray(e))throw new TypeError("row indices must be an array");for(let n=0;n=t.rows)throw new RangeError("row indices are out of range")}function mP(t,e){if(!Si.isAnyArray(e))throw new TypeError("column indices must be an array");for(let n=0;n=t.columns)throw new RangeError("column indices are out of range")}function qC(t,e,n,r,i){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(hy("startRow",e),hy("endRow",n),hy("startColumn",r),hy("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function Z_(t,e=0){let n=[];for(let r=0;r=o)throw new RangeError("min must be smaller than max");let a=o-i,l=new Ke(e,n);for(let c=0;cr?(o=!0,r=n):(i=!1,o=!0);e++}return i}isReducedEchelonForm(){let e=0,n=0,r=-1,i=!0,o=!1;for(;er?(o=!0,r=n):(i=!1,o=!0);for(let s=n+1;se.get(i,r)&&(i=o);if(e.get(i,r)===0)r++;else{e.swapRows(n,i);let o=e.get(n,r);for(let s=r;s=0;)if(e.maxRow(i)===0)i--;else{let o=0,s=!1;for(;on[r]&&(n[r]=this.get(r,i));return n}case"column":{const n=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let r=0;rn[i]&&(n[i]=this.get(r,i));return n}case void 0:{let n=this.get(0,0);for(let r=0;rn&&(n=this.get(r,i));return n}default:throw new Error(`invalid option: ${e}`)}}maxIndex(){xf(this);let e=this.get(0,0),n=[0,0];for(let r=0;re&&(e=this.get(r,i),n[0]=r,n[1]=i);return n}min(e){if(this.isEmpty())return NaN;switch(e){case"row":{const n=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let r=0;rn&&(n=this.get(e,r));return n}maxRowIndex(e){bo(this,e),xf(this);let n=this.get(e,0),r=[e,0];for(let i=1;in&&(n=this.get(e,i),r[1]=i);return r}minRow(e){if(bo(this,e),this.isEmpty())return NaN;let n=this.get(e,0);for(let r=1;rn&&(n=this.get(r,e));return n}maxColumnIndex(e){_o(this,e),xf(this);let n=this.get(0,e),r=[0,e];for(let i=1;in&&(n=this.get(i,e),r[0]=i);return r}minColumn(e){if(_o(this,e),this.isEmpty())return NaN;let n=this.get(0,e);for(let r=1;r1;i/=2)i&1&&(n=n.mmul(r)),r=r.mmul(r);return n}strassen2x2(e){e=Ke.checkMatrix(e);let n=new Ke(2,2);const r=this.get(0,0),i=e.get(0,0),o=this.get(0,1),s=e.get(0,1),a=this.get(1,0),l=e.get(1,0),c=this.get(1,1),u=e.get(1,1),f=(r+c)*(i+u),h=(a+c)*i,m=r*(s-u),v=c*(l-i),x=(r+o)*u,y=(a-r)*(i+s),g=(o-c)*(l+u),b=f+v-x+g,_=m+x,S=h+v,P=f-h+m+y;return n.set(0,0,b),n.set(0,1,_),n.set(1,0,S),n.set(1,1,P),n}strassen3x3(e){e=Ke.checkMatrix(e);let n=new Ke(3,3);const r=this.get(0,0),i=this.get(0,1),o=this.get(0,2),s=this.get(1,0),a=this.get(1,1),l=this.get(1,2),c=this.get(2,0),u=this.get(2,1),f=this.get(2,2),h=e.get(0,0),m=e.get(0,1),v=e.get(0,2),x=e.get(1,0),y=e.get(1,1),g=e.get(1,2),b=e.get(2,0),_=e.get(2,1),S=e.get(2,2),P=(r+i+o-s-a-u-f)*y,N=(r-s)*(-m+y),R=a*(-h+m+x-y-g-b+S),L=(-r+s+a)*(h-m+y),U=(s+a)*(-h+m),M=r*h,T=(-r+c+u)*(h-v+g),D=(-r+c)*(v-g),O=(c+u)*(-h+v),j=(r+i+o-a-l-c-u)*g,X=u*(-h+v+x-y-g-b+_),H=(-o+u+f)*(y+b-_),Z=(o-f)*(y-_),F=o*b,q=(u+f)*(-b+_),K=(-o+a+l)*(g+b-S),J=(o-l)*(g-S),he=(a+l)*(-b+S),le=i*x,ee=l*_,ae=s*v,ge=c*m,Me=f*S,tt=M+F+le,He=P+L+U+M+H+F+q,rt=M+T+O+j+F+K+he,Ve=N+R+L+M+F+K+J,se=N+L+U+M+ee,B=F+K+J+he+ae,ye=M+T+D+X+H+Z+F,xe=H+Z+F+q+ge,Re=M+T+D+O+Me;return n.set(0,0,tt),n.set(0,1,He),n.set(0,2,rt),n.set(1,0,Ve),n.set(1,1,se),n.set(1,2,B),n.set(2,0,ye),n.set(2,1,xe),n.set(2,2,Re),n}mmulStrassen(e){e=Ke.checkMatrix(e);let n=this.clone(),r=n.rows,i=n.columns,o=e.rows,s=e.columns;i!==o&&console.warn(`Multiplying ${r} x ${i} and ${o} x ${s} matrix: dimensions do not match.`);function a(f,h,m){let v=f.rows,x=f.columns;if(v===h&&x===m)return f;{let y=Ot.zeros(h,m);return y=y.setSubMatrix(f,0,0),y}}let l=Math.max(r,o),c=Math.max(i,s);n=a(n,l,c),e=a(e,l,c);function u(f,h,m,v){if(m<=512||v<=512)return f.mmul(h);m%2===1&&v%2===1?(f=a(f,m+1,v+1),h=a(h,m+1,v+1)):m%2===1?(f=a(f,m+1,v),h=a(h,m+1,v)):v%2===1&&(f=a(f,m,v+1),h=a(h,m,v+1));let x=parseInt(f.rows/2,10),y=parseInt(f.columns/2,10),g=f.subMatrix(0,x-1,0,y-1),b=h.subMatrix(0,x-1,0,y-1),_=f.subMatrix(0,x-1,y,f.columns-1),S=h.subMatrix(0,x-1,y,h.columns-1),P=f.subMatrix(x,f.rows-1,0,y-1),N=h.subMatrix(x,h.rows-1,0,y-1),R=f.subMatrix(x,f.rows-1,y,f.columns-1),L=h.subMatrix(x,h.rows-1,y,h.columns-1),U=u(Ot.add(g,R),Ot.add(b,L),x,y),M=u(Ot.add(P,R),b,x,y),T=u(g,Ot.sub(S,L),x,y),D=u(R,Ot.sub(N,b),x,y),O=u(Ot.add(g,_),L,x,y),j=u(Ot.sub(P,g),Ot.add(b,S),x,y),X=u(Ot.sub(_,R),Ot.add(N,L),x,y),H=Ot.add(U,D);H.sub(O),H.add(X);let Z=Ot.add(T,O),F=Ot.add(M,D),q=Ot.sub(U,M);q.add(T),q.add(j);let K=Ot.zeros(2*H.rows,2*H.columns);return K=K.setSubMatrix(H,0,0),K=K.setSubMatrix(Z,H.rows,0),K=K.setSubMatrix(F,0,H.columns),K=K.setSubMatrix(q,H.rows,H.columns),K.subMatrix(0,m-1,0,v-1)}return u(n,e,l,c)}scaleRows(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:n=0,max:r=1}=e;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(n>=r)throw new RangeError("min must be smaller than max");let i=new Ke(this.rows,this.columns);for(let o=0;o0&&QO(s,{min:n,max:r,output:s}),i.setRow(o,s)}return i}scaleColumns(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:n=0,max:r=1}=e;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(n>=r)throw new RangeError("min must be smaller than max");let i=new Ke(this.rows,this.columns);for(let o=0;or||n<0||n>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");let i=new Ke(e.length,r-n+1);for(let o=0;o=this.rows)throw new RangeError(`Row index out of range: ${e[o]}`);i.set(o,s-n,this.get(e[o],s))}return i}subMatrixColumn(e,n,r){if(n===void 0&&(n=0),r===void 0&&(r=this.rows-1),n>r||n<0||n>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");let i=new Ke(r-n+1,e.length);for(let o=0;o=this.columns)throw new RangeError(`Column index out of range: ${e[o]}`);i.set(s-n,o,this.get(s,e[o]))}return i}setSubMatrix(e,n,r){if(e=Ke.checkMatrix(e),e.isEmpty())return this;let i=n+e.rows-1,o=r+e.columns-1;qC(this,n,i,r,o);for(let s=0;stypeof e=="number")}Ot.random=Ot.rand;Ot.randomInt=Ot.randInt;Ot.diagonal=Ot.diag;Ot.prototype.diagonal=Ot.prototype.diag;Ot.identity=Ot.eye;Ot.prototype.negate=Ot.prototype.neg;Ot.prototype.tensorProduct=Ot.prototype.kroneckerProduct;var Zm,YC,Kc;let Ke=(Kc=class extends Ot{constructor(n,r){super();dS(this,Zm);Ht(this,"data");if(Kc.isMatrix(n))hS(this,Zm,YC).call(this,n.rows,n.columns),Kc.copy(n,this);else if(Number.isInteger(n)&&n>=0)hS(this,Zm,YC).call(this,n,r);else if(Si.isAnyArray(n)){const i=n;if(n=i.length,r=n?i[0].length:0,typeof r!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let o=0;o"u"&&(r=n,n=this.columns),_o(this,n,!0),r=Tf(this,r);for(let i=0;i=0)for(let i=0;i=0)O0(this,Hr,new Ke(n,n));else if(O0(this,Hr,new Ke(n)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return Vo(this,Hr).size}get rows(){return Vo(this,Hr).rows}get columns(){return Vo(this,Hr).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(n){return Ke.isMatrix(n)&&n.klassType==="SymmetricMatrix"}static zeros(n){return new this(n)}static ones(n){return new this(n).fill(1)}clone(){const n=new $x(this.diagonalSize);for(const[r,i,o]of this.upperRightEntries())n.set(r,i,o);return n}toMatrix(){return new Ke(this)}get(n,r){return Vo(this,Hr).get(n,r)}set(n,r,i){return Vo(this,Hr).set(n,r,i),Vo(this,Hr).set(r,n,i),this}removeCross(n){return Vo(this,Hr).removeRow(n),Vo(this,Hr).removeColumn(n),this}addCross(n,r){r===void 0&&(r=n,n=this.diagonalSize);const i=r.slice();return i.splice(n,1),Vo(this,Hr).addRow(n,i),Vo(this,Hr).addColumn(n,r),this}applyMask(n){if(n.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const r=[];for(const[i,o]of n.entries())o||r.push(i);r.reverse();for(const i of r)this.removeCross(i);return this}toCompact(){const{diagonalSize:n}=this,r=new Array(n*(n+1)/2);for(let i=0,o=0,s=0;s=n&&(i=++o);return r}static fromCompact(n){const r=n.length,i=(Math.sqrt(8*r+1)-1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(n)}`);const o=new $x(i);for(let s=0,a=0,l=0;l=i&&(s=++a);return o}*upperRightEntries(){for(let n=0,r=0;n=this.diagonalSize&&(r=++n)}}*upperRightValues(){for(let n=0,r=0;n=this.diagonalSize&&(r=++n)}};Hr=new WeakMap;let Yc=$x;Yc.prototype.klassType="SymmetricMatrix";class J_ extends Yc{static isDistanceMatrix(e){return Yc.isSymmetricMatrix(e)&&e.klassSubType==="DistanceMatrix"}constructor(e){if(super(e),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(e,n,r){return e===n&&(r=0),super.set(e,n,r)}addCross(e,n){return n===void 0&&(n=e,e=this.diagonalSize),n=n.slice(),n[e]=0,super.addCross(e,n)}toSymmetricMatrix(){return new Yc(this)}clone(){const e=new J_(this.diagonalSize);for(const[n,r,i]of this.upperRightEntries())n!==r&&e.set(n,r,i);return e}toCompact(){const{diagonalSize:e}=this,n=(e-1)*e/2,r=new Array(n);for(let i=1,o=0,s=0;s=e&&(i=++o+1);return r}static fromCompact(e){const n=e.length;if(n===0)return new this(0);const r=(Math.sqrt(8*n+1)+1)/2;if(!Number.isInteger(r))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(e)}`);const i=new this(r);for(let o=1,s=0,a=0;a=r&&(o=++s+1);return i}}J_.prototype.klassSubType="DistanceMatrix";class Da extends Ot{constructor(e,n,r){super(),this.matrix=e,this.rows=n,this.columns=r}}class lMe extends Da{constructor(e,n){_o(e,n),super(e,e.rows,1),this.column=n}set(e,n,r){return this.matrix.set(e,this.column,r),this}get(e){return this.matrix.get(e,this.column)}}class cMe extends Da{constructor(e,n){mP(e,n),super(e,e.rows,n.length),this.columnIndices=n}set(e,n,r){return this.matrix.set(e,this.columnIndices[n],r),this}get(e,n){return this.matrix.get(e,this.columnIndices[n])}}class uMe extends Da{constructor(e){super(e,e.rows,e.columns)}set(e,n,r){return this.matrix.set(e,this.columns-n-1,r),this}get(e,n){return this.matrix.get(e,this.columns-n-1)}}class fMe extends Da{constructor(e){super(e,e.rows,e.columns)}set(e,n,r){return this.matrix.set(this.rows-e-1,n,r),this}get(e,n){return this.matrix.get(this.rows-e-1,n)}}class dMe extends Da{constructor(e,n){bo(e,n),super(e,1,e.columns),this.row=n}set(e,n,r){return this.matrix.set(this.row,n,r),this}get(e,n){return this.matrix.get(this.row,n)}}class hMe extends Da{constructor(e,n){pP(e,n),super(e,n.length,e.columns),this.rowIndices=n}set(e,n,r){return this.matrix.set(this.rowIndices[e],n,r),this}get(e,n){return this.matrix.get(this.rowIndices[e],n)}}class Wy extends Da{constructor(e,n,r){pP(e,n),mP(e,r),super(e,n.length,r.length),this.rowIndices=n,this.columnIndices=r}set(e,n,r){return this.matrix.set(this.rowIndices[e],this.columnIndices[n],r),this}get(e,n){return this.matrix.get(this.rowIndices[e],this.columnIndices[n])}}class pMe extends Da{constructor(e,n,r,i,o){qC(e,n,r,i,o),super(e,r-n+1,o-i+1),this.startRow=n,this.startColumn=i}set(e,n,r){return this.matrix.set(this.startRow+e,this.startColumn+n,r),this}get(e,n){return this.matrix.get(this.startRow+e,this.startColumn+n)}}let mMe=class extends Da{constructor(e){super(e,e.columns,e.rows)}set(e,n,r){return this.matrix.set(n,e,r),this}get(e,n){return this.matrix.get(n,e)}};class n7 extends Ot{constructor(e,n={}){const{rows:r=1}=n;if(e.length%r!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=r,this.columns=e.length/r,this.data=e}set(e,n,r){let i=this._calculateIndex(e,n);return this.data[i]=r,this}get(e,n){let r=this._calculateIndex(e,n);return this.data[r]}_calculateIndex(e,n){return e*this.columns+n}}class oo extends Ot{constructor(e){super(),this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,n,r){return this.data[e][n]=r,this}get(e,n){return this.data[e][n]}}function gMe(t,e){if(Si.isAnyArray(t))return t[0]&&Si.isAnyArray(t[0])?new oo(t):new n7(t,e);throw new Error("the argument is not an array")}class Q_{constructor(e){e=oo.checkMatrix(e);let n=e.clone(),r=n.rows,i=n.columns,o=new Float64Array(r),s=1,a,l,c,u,f,h,m,v,x;for(a=0;aMath.abs(v[u])&&(u=a);if(u!==l){for(c=0;c=0;c--){for(l=0;ls?i.set(o,s,e.get(o,s)):o===s?i.set(o,s,1):i.set(o,s,0);return i}get upperTriangularMatrix(){let e=this.LU,n=e.rows,r=e.columns,i=new Ke(n,r);for(let o=0;oMath.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):e!==0?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class gP{constructor(e){e=oo.checkMatrix(e);let n=e.clone(),r=e.rows,i=e.columns,o=new Float64Array(i),s,a,l,c;for(l=0;l=0;c--){for(l=0;l=0;a--){for(o=0;o=0;M--)if(v[M]!==0){for(let T=M+1;T=0;M--){if(M0;){let M,T;for(M=R-2;M>=-1&&M!==-1;M--){const D=Number.MIN_VALUE+U*Math.abs(v[M]+Math.abs(v[M+1]));if(Math.abs(g[M])<=D||Number.isNaN(g[M])){g[M]=0;break}}if(M===R-2)T=4;else{let D;for(D=R-1;D>=M&&D!==M;D--){let O=(D!==R?Math.abs(g[D]):0)+(D!==M+1?Math.abs(g[D-1]):0);if(Math.abs(v[D])<=U*O){v[D]=0;break}}D===M?T=3:D===R-1?T=1:(T=2,M=D)}switch(M++,T){case 1:{let D=g[R-2];g[R-2]=0;for(let O=R-2;O>=M;O--){let j=ca(v[O],D),X=v[O]/j,H=D/j;if(v[O]=j,O!==M&&(D=-H*g[O-1],g[O-1]=X*g[O-1]),c)for(let Z=0;Z=v[M+1]);){let D=v[M];if(v[M]=v[M+1],v[M+1]=D,c&&Mn&&o.set(u,f,e.get(u,f)/this.s[f]);let s=this.U,a=s.rows,l=s.columns,c=new Ke(r,a);for(let u=0;ue&&n++;return n}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return Ke.diag(this.s)}}function vMe(t,e=!1){return t=oo.checkMatrix(t),e?new ah(t).inverse():r7(t,Ke.eye(t.rows))}function r7(t,e,n=!1){return t=oo.checkMatrix(t),e=oo.checkMatrix(e),n?new ah(t).solve(e):t.isSquare()?new Q_(t).solve(e):new gP(t).solve(e)}function Hy(t){if(t=Ke.checkMatrix(t),t.isSquare()){if(t.columns===0)return 1;let e,n,r,i;if(t.columns===2)return e=t.get(0,0),n=t.get(0,1),r=t.get(1,0),i=t.get(1,1),e*i-n*r;if(t.columns===3){let o,s,a;return o=new Wy(t,[1,2],[1,2]),s=new Wy(t,[1,2],[0,2]),a=new Wy(t,[1,2],[0,1]),e=t.get(0,0),n=t.get(0,1),r=t.get(0,2),e*Hy(o)-n*Hy(s)+r*Hy(a)}else return new Q_(t).determinant}else throw Error("determinant can only be calculated for a square matrix")}function yMe(t,e){let n=[];for(let r=0;ri)return new Array(e.rows+1).fill(0);{let o=e.addRow(n,[0]);for(let s=0;se?o[s]=1/o[s]:o[s]=0;return i.mmul(Ke.diag(o).mmul(r.transpose()))}function wMe(t,e=t,n={}){t=new Ke(t);let r=!1;if(typeof e=="object"&&!Ke.isMatrix(e)&&!Si.isAnyArray(e)?(n=e,e=t,r=!0):e=new Ke(e),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:i=!0}=n;i&&(t=t.center("column"),r||(e=e.center("column")));const o=t.transpose().mmul(e);for(let s=0;s0?i.set(o,o+1,n[o]):n[o]<0&&i.set(o,o-1,n[o])}return i}}function MMe(t,e,n,r){let i,o,s,a,l,c,u,f;for(l=0;l0;a--){for(f=0,s=0,c=0;c0&&(o=-o),e[a]=f*o,s=s-i*o,n[a-1]=i-o,l=0;lc)do{for(i=n[c],f=(n[c+1]-i)/(2*e[c]),h=ca(f,1),f<0&&(h=-h),n[c]=e[c]/(f+h),n[c+1]=e[c]*(f+h),m=n[c+1],o=i-n[c],s=c+2;s=c;s--)for(y=x,x=v,_=b,i=v*e[s],o=v*f,h=ca(f,e[s]),e[s+1]=b*h,b=e[s]/h,v=f/h,f=v*n[s]-b*i,n[s+1]=o+b*(v*i+b*n[s]),l=0;lN*P);n[c]=n[c]+S,e[c]=0}for(s=0;s=f;c--)n[c]=e.get(c,f-1)/h,l+=n[c]*n[c];for(a=Math.sqrt(l),n[f]>0&&(a=-a),l=l-n[f]*a,n[f]=n[f]-a,u=f;u=f;c--)s+=n[c]*e.get(c,u);for(s=s/l,c=f;c<=o;c++)e.set(c,u,e.get(c,u)-s*n[c])}for(c=0;c<=o;c++){for(s=0,u=o;u>=f;u--)s+=n[u]*e.get(c,u);for(s=s/l,u=f;u<=o;u++)e.set(c,u,e.get(c,u)-s*n[u])}n[f]=h*n[f],e.set(f,f-1,h*a)}}for(c=0;c=i+1;f--)if(e.get(f,f-1)!==0){for(c=f+1;c<=o;c++)n[c]=e.get(c,f-1);for(u=f;u<=o;u++){for(a=0,c=f;c<=o;c++)a+=n[c]*r.get(c,u);for(a=a/n[f]/e.get(f,f-1),c=f;c<=o;c++)r.set(c,u,r.get(c,u)+a*n[c])}}}function TMe(t,e,n,r,i){let o=t-1,s=0,a=t-1,l=Number.EPSILON,c=0,u=0,f=0,h=0,m=0,v=0,x=0,y=0,g,b,_,S,P,N,R,L,U,M,T,D,O,j,X;for(g=0;ga)&&(n[g]=i.get(g,g),e[g]=0),b=Math.max(g-1,0);b=s;){for(S=o;S>s&&(v=Math.abs(i.get(S-1,S-1))+Math.abs(i.get(S,S)),v===0&&(v=u),!(Math.abs(i.get(S,S-1))=0){for(x=f>=0?f+x:f-x,n[o-1]=L+x,n[o]=n[o-1],x!==0&&(n[o]=L-R/x),e[o-1]=0,e[o]=0,L=i.get(o,o-1),v=Math.abs(L)+Math.abs(x),f=L/v,h=x/v,m=Math.sqrt(f*f+h*h),f=f/m,h=h/m,b=o-1;b0)){for(v=Math.sqrt(v),U=S&&(x=i.get(P,P),m=L-x,v=U-x,f=(m*v-R)/i.get(P+1,P)+i.get(P,P+1),h=i.get(P+1,P+1)-x-m-v,m=i.get(P+2,P+1),v=Math.abs(f)+Math.abs(h)+Math.abs(m),f=f/v,h=h/v,m=m/v,!(P===S||Math.abs(i.get(P,P-1))*(Math.abs(h)+Math.abs(m))P+2&&i.set(g,g-3,0);for(_=P;_<=o-1&&(j=_!==o-1,_!==P&&(f=i.get(_,_-1),h=i.get(_+1,_-1),m=j?i.get(_+2,_-1):0,L=Math.abs(f)+Math.abs(h)+Math.abs(m),L!==0&&(f=f/L,h=h/L,m=m/L)),L!==0);_++)if(v=Math.sqrt(f*f+h*h+m*m),f<0&&(v=-v),v!==0){for(_!==P?i.set(_,_-1,-v*L):S!==P&&i.set(_,_-1,-i.get(_,_-1)),f=f+v,L=f/v,U=h/v,x=m/v,h=h/f,m=m/f,b=_;b=0;o--)if(f=n[o],h=e[o],h===0)for(S=o,i.set(o,o,1),g=o-1;g>=0;g--){for(R=i.get(g,g)-f,m=0,b=S;b<=o;b++)m=m+i.get(g,b)*i.get(b,o);if(e[g]<0)x=R,v=m;else if(S=g,e[g]===0?i.set(g,o,R!==0?-m/R:-m/(l*u)):(L=i.get(g,g+1),U=i.get(g+1,g),h=(n[g]-f)*(n[g]-f)+e[g]*e[g],N=(L*v-x*m)/h,i.set(g,o,N),i.set(g+1,o,Math.abs(L)>Math.abs(x)?(-m-R*N)/L:(-v-U*N)/x)),N=Math.abs(i.get(g,o)),l*N*N>1)for(b=g;b<=o;b++)i.set(b,o,i.get(b,o)/N)}else if(h<0)for(S=o-1,Math.abs(i.get(o,o-1))>Math.abs(i.get(o-1,o))?(i.set(o-1,o-1,h/i.get(o,o-1)),i.set(o-1,o,-(i.get(o,o)-f)/i.get(o,o-1))):(X=py(0,-i.get(o-1,o),i.get(o-1,o-1)-f,h),i.set(o-1,o-1,X[0]),i.set(o-1,o,X[1])),i.set(o,o-1,0),i.set(o,o,1),g=o-2;g>=0;g--){for(M=0,T=0,b=S;b<=o;b++)M=M+i.get(g,b)*i.get(b,o-1),T=T+i.get(g,b)*i.get(b,o);if(R=i.get(g,g)-f,e[g]<0)x=R,m=M,v=T;else if(S=g,e[g]===0?(X=py(-M,-T,R,h),i.set(g,o-1,X[0]),i.set(g,o,X[1])):(L=i.get(g,g+1),U=i.get(g+1,g),D=(n[g]-f)*(n[g]-f)+e[g]*e[g]-h*h,O=(n[g]-f)*2*h,D===0&&O===0&&(D=l*u*(Math.abs(R)+Math.abs(h)+Math.abs(L)+Math.abs(U)+Math.abs(x))),X=py(L*m-x*M+h*T,L*v-x*T-h*M,D,O),i.set(g,o-1,X[0]),i.set(g,o,X[1]),Math.abs(L)>Math.abs(x)+Math.abs(h)?(i.set(g+1,o-1,(-M-R*i.get(g,o-1)+h*i.get(g,o))/L),i.set(g+1,o,(-T-R*i.get(g,o)-h*i.get(g,o-1))/L)):(X=py(-m-U*i.get(g,o-1),-v-U*i.get(g,o),x,h),i.set(g+1,o-1,X[0]),i.set(g+1,o,X[1]))),N=Math.max(Math.abs(i.get(g,o-1)),Math.abs(i.get(g,o))),l*N*N>1)for(b=g;b<=o;b++)i.set(b,o-1,i.get(b,o-1)/N),i.set(b,o,i.get(b,o)/N)}for(g=0;ga)for(b=g;b=s;b--)for(g=s;g<=a;g++){for(x=0,_=s;_<=Math.min(b,a);_++)x=x+r.get(g,_)*i.get(_,b);r.set(g,b,x)}}}function py(t,e,n,r){let i,o;return Math.abs(n)>Math.abs(r)?(i=r/n,o=n+i*r,[(t+i*e)/o,(e-i*t)/o]):(i=n/r,o=r+i*n,[(i*t+e)/o,(i*e-t)/o])}class o7{constructor(e){if(e=oo.checkMatrix(e),!e.isSymmetric())throw new Error("Matrix is not symmetric");let n=e,r=n.rows,i=new Ke(r,r),o=!0,s,a,l;for(a=0;a0),i.set(a,a,Math.sqrt(Math.max(c,0))),l=a+1;l=0;l--)for(a=0;as;m++)f=e.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),f=f.div(f.norm()),c=e.mmul(f).div(f.transpose().mmul(f).get(0,0)),m>0&&(l=c.clone().sub(h).pow(2).sum()),h=c.clone(),r?(u=r.transpose().mmul(c).div(c.transpose().mmul(c).get(0,0)),u=u.div(u.norm()),a=r.mmul(u).div(u.transpose().mmul(u).get(0,0))):a=c;if(r){let m=e.transpose().mmul(c).div(c.transpose().mmul(c).get(0,0));m=m.div(m.norm());let v=e.clone().sub(c.clone().mmul(m.transpose())),x=a.transpose().mmul(c).div(c.transpose().mmul(c).get(0,0)),y=r.clone().sub(c.clone().mulS(x.get(0,0)).mmul(u.transpose()));this.t=c,this.p=m.transpose(),this.w=f.transpose(),this.q=u,this.u=a,this.s=c.transpose().mmul(c),this.xResidual=v,this.yResidual=y,this.betas=x}else this.w=f.transpose(),this.s=c.transpose().mmul(c).sqrt(),i?this.t=c.clone().div(this.s.get(0,0)):this.t=c,this.xResidual=e.sub(c.mmul(f.transpose()))}}Xt.AbstractMatrix=Ot;Xt.CHO=o7;Xt.CholeskyDecomposition=o7;Xt.DistanceMatrix=J_;Xt.EVD=i7;Xt.EigenvalueDecomposition=i7;Xt.LU=Q_;Xt.LuDecomposition=Q_;var a7=Xt.Matrix=Ke;Xt.MatrixColumnSelectionView=cMe;Xt.MatrixColumnView=lMe;Xt.MatrixFlipColumnView=uMe;Xt.MatrixFlipRowView=fMe;Xt.MatrixRowSelectionView=hMe;Xt.MatrixRowView=dMe;Xt.MatrixSelectionView=Wy;Xt.MatrixSubView=pMe;var RMe=Xt.MatrixTransposeView=mMe;Xt.NIPALS=s7;Xt.Nipals=s7;Xt.QR=gP;Xt.QrDecomposition=gP;Xt.SVD=ah;Xt.SingularValueDecomposition=ah;Xt.SymmetricMatrix=Yc;Xt.WrapperMatrix1D=n7;Xt.WrapperMatrix2D=oo;Xt.correlation=SMe;Xt.covariance=wMe;var n5=Xt.default=Ke;Xt.determinant=Hy;Xt.inverse=vMe;Xt.linearDependencies=bMe;Xt.pseudoInverse=_Me;var AMe=Xt.solve=r7;Xt.wrap=gMe;const r5=a7,i5=RMe;n5.Matrix&&n5.Matrix;const PMe=AMe;function l7(t,e){if(!Bs(t)||!Bs(e))throw new TypeError("x and y must be arrays");if(t.length!==e.length)throw new RangeError("x and y arrays must have the same length")}class vP{constructor(){if(new.target===vP)throw new Error("BaseRegression must be subclassed")}predict(e){if(typeof e=="number")return this._predict(e);if(Bs(e)){const n=[];for(const r of e)n.push(this._predict(r));return n}else throw new TypeError("x must be a number or array")}_predict(e){throw new Error("_predict must be implemented")}train(){}toString(e){return""}toLaTeX(e){return""}score(e,n){l7(e,n);const r=e.length,i=new Array(r);for(let m=0;m0&&l!==this.coefficients.length-1?a=` + ${a}`:l!==this.coefficients.length-1&&(a=` ${a}`)),s=a+s;return s.startsWith("+")&&(s=s.slice(1)),`f(x) = ${s}`}static load(e){if(e.name!=="polynomialRegression")throw new TypeError("not a polynomial regression model");return new zx(!0,e)}}function NMe(t,e,n,r={}){const i=t.length;let{interceptAtZero:o=!1}=r,s=[];if(Array.isArray(n))s=n,o=!1;else if(typeof n=="number")if(o){s=new Array(n);for(let m=0;m"u")throw new TypeError("X must be defined");if(r>t.length)throw new RangeError(`Window size is higher than the data length ${r}>${t.length}`);if(i<0||!Number.isInteger(i))throw new RangeError("Derivative should be a positive integer");if(o<1||!Number.isInteger(o))throw new RangeError("Polynomial should be a positive integer");o>=6&&console.warn("You should not use polynomial grade higher than 5 if you are not sure that your data arises from such a model. Possible polynomial oscillation problems");const s=Math.floor(r/2),a=t.length,l=new Float64Array(a),c=kMe(r,o,i);let u=0,f=!0;Bs(e)?f=!1:u=e**i;for(let m=0;m=0&&s0?i=(4*n-2)/(n*(2*e-n+1))*(t*Xp(t,e,n-1,r)+r*Xp(t,e,n-1,r-1))-(n-1)*(2*e+n)/(n*(2*e-n+1))*Xp(t,e,n-2,r):n===0&&r===0?i=1:i=0,i}function o5(t,e){let n=1;if(t>=e)for(let r=t-e+1;r<=t;r++)n*=r;return n}function LMe(t,e,n,r,i){let o=0;for(let s=0;s<=r;s++)o+=(2*s+1)*(o5(2*n,s)/o5(2*n+s+1,s+1))*Xp(t,n,s,0)*Xp(e,n,s,i);return o}function kMe(t,e,n){const r=new Array(t),i=Math.floor(t/2);for(let o=-i;o<=i;o++){r[o+i]=new Float64Array(t);for(let s=-i;s<=i;s++)r[o+i][s+i]=LMe(s,o,i,e,n)}return r}function my(t,e){let n=1/0,r=0;for(let i=0;ie&&(e=t[r],n=r);return n}function kE(t,e){const n=IMe(e,t,{windowSize:9,derivative:1,polynomial:3}),r=OMe(n),i=t[r];let o=5;r<20&&(o=2);const s=o*Math.round((t[1]-i)/o),a=.5*s,l=my(t,s+i),c=my(t,a+i),u=e.slice(l,c),f=t.slice(l,c),h=new zx(f,u,1),m=e.map((N,R)=>N-h.predict(t[R])),v=5*Math.round((t[t.length-1]-i)/5),x=5*Math.round(v/15),y=2,g=my(t,x+i),b=my(t,v+i),_=new zx(t.slice(g,b),m.slice(g,b),y),S=_.predict(i);for(let N=r;NN/S),[m.length])}function DMe(t){var L,U,M;const[e,n]=A.useState({showTrans:!1,showFluor:!1,showRefer:!1});A.useEffect(()=>{var T,D,O;n({showTrans:((T=t.xasData)==null?void 0:T.mutrans)!=null,showFluor:((D=t.xasData)==null?void 0:D.mufluor)!=null,showRefer:((O=t.xasData)==null?void 0:O.murefer)!=null})},[t.xasData]);const r=Object.values(ld),[i,o]=A.useState(!0),[s,a]=A.useState(!0),[l,c]=A.useState(r[0]),u=pu(),{showTrans:f,showFluor:h,showRefer:m}=e,v=t.xasData,x=[((L=t.xasData)==null?void 0:L.mutrans)!=null,((U=t.xasData)==null?void 0:U.mufluor)!=null,((M=t.xasData)==null?void 0:M.murefer)!=null];let y=vc([0]),g=vc([0]);const b=[];let _="";const S=!f&&!h&&!m;if(v!=null&&!S){y=vc(v.energy,[v.energy.length]);let T=!1;if(f&&v.mutrans&&(T=!0,g=s?kE(v.energy,v.mutrans):vc(v.mutrans,[v.mutrans.length]),_="Transmission"),h&&v.mufluor){const D=s?kE(v.energy,v.mufluor):vc(v.mufluor,[v.mufluor.length]);T?b.push({label:"Fluorescence",array:D}):(T=!0,g=D,_="Fluorescence")}if(m&&v.murefer){const D=s?kE(v.energy,v.murefer):vc(v.murefer,[v.murefer.length]);T?b.push({label:"Reference",array:D}):(T=!0,g=D,_="Reference")}}const P={"--h5w-toolbar--bgColor":u.palette.action.hover,"--h5w-tickLabels--color":u.palette.text.primary,"--h5w-ticks--color":u.palette.text.primary,"--h5w-grid--color":"black","--h5w-toolbar-label--color":u.palette.primary.dark,"--h5w-btn-hover--bgColor":u.palette.action.hover,"--h5w-btnPressed--bgColor":u.palette.action.selected,"--h5w-selector-menu--bgColor":u.palette.background.default,"--h5w-selector-option-selected--bgColor":u.palette.action.selected},N={"--h5w-tickLabels--color":u.palette.text.primary,"--h5w-ticks--color":u.palette.text.primary,"--h5w-grid--color":u.palette.text.secondary,"--h5w-axisLabels--color":u.palette.text.primary,"--h5w-line--color":u.palette.primary.dark,"--h5w-tooltip--bgColor":u.palette.action.hover,"--h5w-tooltip--color":u.palette.text.primary,"--h5w-line--colorAux":[u.palette.success.light,u.palette.secondary.dark]},R=Nbe([WC(g)].concat(b.map(T=>WC(T.array))));return C.jsxs(Xd,{sx:{height:"100%",display:"flex",flexDirection:"column",backgroundColor:T=>T.palette.background.default,fontFamily:T=>T.typography.fontFamily},children:[C.jsx(Ta,{style:P,children:C.jsxs(Kwe,{children:[C.jsx(Mc,{label:"Normalize",value:s,onToggle:()=>{a(!s)}}),C.jsx(qc,{}),C.jsx(Mc,{label:"Transmission",value:f,onToggle:()=>{n({...e,showTrans:!f})},disabled:!x[0]}),C.jsx(Mc,{label:"Fluorescence",value:h,onToggle:()=>{n({...e,showFluor:!h})},disabled:!x[1]}),C.jsx(Mc,{label:"Reference",value:m,onToggle:()=>{n({...e,showRefer:!m})},disabled:!x[2]}),C.jsx(qc,{}),C.jsx(vSe,{label:"Line Style",onChange:T=>{c(T)},options:r,value:l,renderOption:T=>C.jsx("div",{children:C.jsx("span",{children:String(T)})})}),C.jsx(qc,{}),C.jsx(Mc,{label:"Grid",icon:PSe,value:i,onToggle:()=>o(!i)})]})}),C.jsx(Ta,{style:N,flex:1,display:"flex",children:C.jsx(iwe,{abscissaParams:{value:y.data,scaleType:Nt.Linear,label:"Energy"},dataArray:g,ordinateLabel:_,domain:R,showGrid:i,curveType:l,scaleType:Nt.Linear,auxiliaries:b})})]})}function yP(){const t=A.useContext(Kb);let e=null;if(t.xdiFile!=null){const n=t.xdiFile,r=n.energy(),i=n.muTrans(),o=n.muFluor(),s=n.muRefer();e={energy:r,mutrans:i,mufluor:o,murefer:s}}return C.jsx(DMe,{xasData:e})}function FMe(){const[t,e]=A.useState(null),n=A.useContext(kR);function r(){return o=>{Dn.get("/webxdiviewer/xdidata/"+o).then(s=>{const a=_d.parseFile(s.data);e(a)})}}const i=r();return C.jsx(IR,{value:{xdiFile:t,setXDIFile:e},children:C.jsxs(xa,{height:"100%",container:!0,children:[C.jsx(xa,{item:!0,lg:5,md:12,padding:1,children:C.jsx(une,{standards:n,updatePlot:i})}),C.jsx(xa,{item:!0,height:"100%",lg:7,md:12,padding:1,children:C.jsx(yP,{})})]})})}/** - * @remix-run/router v1.20.0 - * - * 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 Ym(){return Ym=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function xP(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function UMe(){return Math.random().toString(36).substr(2,8)}function a5(t,e){return{usr:t.state,key:t.key,idx:e}}function KC(t,e,n,r){return n===void 0&&(n=null),Ym({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Mu(e):e,{state:n,key:e&&e.key||r||UMe()})}function Ux(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Mu(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function BMe(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=ml.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(Ym({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function f(){a=ml.Pop;let y=u(),g=y==null?null:y-c;c=y,l&&l({action:a,location:x.location,delta:g})}function h(y,g){a=ml.Push;let b=KC(x.location,y,g);n&&n(b,y),c=u()+1;let _=a5(b,c),S=x.createHref(b);try{s.pushState(_,"",S)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(S)}o&&l&&l({action:a,location:x.location,delta:1})}function m(y,g){a=ml.Replace;let b=KC(x.location,y,g);n&&n(b,y),c=u();let _=a5(b,c),S=x.createHref(b);s.replaceState(_,"",S),o&&l&&l({action:a,location:x.location,delta:0})}function v(y){let g=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof y=="string"?y:Ux(y);return b=b.replace(/ $/,"%20"),Wn(g,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,g)}let x={get action(){return a},get location(){return t(i,s)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(s5,f),l=y,()=>{i.removeEventListener(s5,f),l=null}},createHref(y){return e(i,y)},createURL:v,encodeLocation(y){let g=v(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:m,go(y){return s.go(y)}};return x}var l5;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(l5||(l5={}));function jMe(t,e,n){return n===void 0&&(n="/"),VMe(t,e,n,!1)}function VMe(t,e,n,r){let i=typeof e=="string"?Mu(e):e,o=Od(i.pathname||"/",n);if(o==null)return null;let s=c7(t);$Me(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(Wn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Cl([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(Wn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),c7(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:KMe(c,o.index),routesMeta:u})};return t.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of u7(o.path))i(o,s,l)}),e}function u7(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=u7(r.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function $Me(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:ZMe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const WMe=/^:[\w-]+$/,HMe=3,GMe=2,XMe=1,qMe=10,YMe=-2,c5=t=>t==="*";function KMe(t,e){let n=t.split("/"),r=n.length;return n.some(c5)&&(r+=YMe),e&&(r+=GMe),n.filter(i=>!c5(i)).reduce((i,o)=>i+(WMe.test(o)?HMe:o===""?XMe:qMe),r)}function ZMe(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function JMe(t,e,n){let{routesMeta:r}=t,i={},o="/",s=[];for(let a=0;a{let{paramName:h,isOptional:m}=u;if(h==="*"){let x=a[f]||"";s=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const v=a[f];return m&&!v?c[h]=void 0:c[h]=(v||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:s,pattern:t}}function QMe(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),xP(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function eEe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return xP(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Od(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function tEe(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Mu(t):t;return{pathname:n?n.startsWith("/")?n:nEe(n,e):e,search:oEe(r),hash:sEe(i)}}function nEe(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function OE(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function rEe(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function f7(t,e){let n=rEe(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function d7(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Mu(t):(i=Ym({},t),Wn(!i.pathname||!i.pathname.includes("?"),OE("?","pathname","search",i)),Wn(!i.pathname||!i.pathname.includes("#"),OE("#","pathname","hash",i)),Wn(!i.search||!i.search.includes("#"),OE("#","search","hash",i)));let o=t===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let f=e.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}a=f>=0?e[f]:"/"}let l=tEe(i,a),c=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Cl=t=>t.join("/").replace(/\/\/+/g,"/"),iEe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),oEe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,sEe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function aEe(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const h7=["post","put","patch","delete"];new Set(h7);const lEe=["get",...h7];new Set(lEe);/** - * React Router v6.27.0 - * - * 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 Km(){return Km=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),A.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=d7(c,JSON.parse(s),o,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Cl([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,s,o,t])}function nw(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=A.useContext(Wl),{matches:i}=A.useContext(Eu),{pathname:o}=lh(),s=JSON.stringify(f7(i,r.v7_relativeSplatPath));return A.useMemo(()=>d7(t,JSON.parse(s),o,n==="path"),[t,s,o,n])}function dEe(t,e){return hEe(t,e)}function hEe(t,e,n,r){Og()||Wn(!1);let{navigator:i}=A.useContext(Wl),{matches:o}=A.useContext(Eu),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=lh(),u;if(e){var f;let y=typeof e=="string"?Mu(e):e;l==="/"||(f=y.pathname)!=null&&f.startsWith(l)||Wn(!1),u=y}else u=c;let h=u.pathname||"/",m=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=jMe(t,{pathname:m}),x=yEe(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Cl([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Cl([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,n,r);return e&&x?A.createElement(tw.Provider,{value:{location:Km({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:ml.Pop}},x):x}function pEe(){let t=wEe(),e=aEe(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return A.createElement(A.Fragment,null,A.createElement("h2",null,"Unexpected Application Error!"),A.createElement("h3",{style:{fontStyle:"italic"}},e),n?A.createElement("pre",{style:i},n):null,null)}const mEe=A.createElement(pEe,null);class gEe extends A.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?A.createElement(Eu.Provider,{value:this.props.routeContext},A.createElement(m7.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vEe(t){let{routeContext:e,match:n,children:r}=t,i=A.useContext(ew);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),A.createElement(Eu.Provider,{value:e},r)}function yEe(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let u=s.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);u>=0||Wn(!1),s=s.slice(0,Math.min(s.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((u,f,h)=>{let m,v=!1,x=null,y=null;n&&(m=a&&f.route.id?a[f.route.id]:void 0,x=f.route.errorElement||mEe,l&&(c<0&&h===0?(v=!0,y=null):c===h&&(v=!0,y=f.route.hydrateFallbackElement||null)));let g=e.concat(s.slice(0,h+1)),b=()=>{let _;return m?_=x:v?_=y:f.route.Component?_=A.createElement(f.route.Component,null):f.route.element?_=f.route.element:_=u,A.createElement(vEe,{match:f,routeContext:{outlet:u,matches:g,isDataRoute:n!=null},children:_})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?A.createElement(gEe,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:b(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):b()},null)}var v7=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(v7||{}),jx=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(jx||{});function xEe(t){let e=A.useContext(ew);return e||Wn(!1),e}function bEe(t){let e=A.useContext(p7);return e||Wn(!1),e}function _Ee(t){let e=A.useContext(Eu);return e||Wn(!1),e}function y7(t){let e=_Ee(),n=e.matches[e.matches.length-1];return n.route.id||Wn(!1),n.route.id}function wEe(){var t;let e=A.useContext(m7),n=bEe(jx.UseRouteError),r=y7(jx.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function SEe(){let{router:t}=xEe(v7.UseNavigateStable),e=y7(jx.UseNavigateStable),n=A.useRef(!1);return g7(()=>{n.current=!0}),A.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Km({fromRouteId:e},o)))},[t,e])}function xp(t){Wn(!1)}function MEe(t){let{basename:e="/",children:n=null,location:r,navigationType:i=ml.Pop,navigator:o,static:s=!1,future:a}=t;Og()&&Wn(!1);let l=e.replace(/^\/*/,"/"),c=A.useMemo(()=>({basename:l,navigator:o,static:s,future:Km({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof r=="string"&&(r=Mu(r));let{pathname:u="/",search:f="",hash:h="",state:m=null,key:v="default"}=r,x=A.useMemo(()=>{let y=Od(u,l);return y==null?null:{location:{pathname:y,search:f,hash:h,state:m,key:v},navigationType:i}},[l,u,f,h,m,v,i]);return x==null?null:A.createElement(Wl.Provider,{value:c},A.createElement(tw.Provider,{children:n,value:x}))}function EEe(t){let{children:e,location:n}=t;return dEe(ZC(e),n)}new Promise(()=>{});function ZC(t,e){e===void 0&&(e=[]);let n=[];return A.Children.forEach(t,(r,i)=>{if(!A.isValidElement(r))return;let o=[...e,i];if(r.type===A.Fragment){n.push.apply(n,ZC(r.props.children,o));return}r.type!==xp&&Wn(!1),!r.props.index||!r.props.children||Wn(!1);let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=ZC(r.props.children,o)),n.push(s)}),n}/** - * React Router DOM v6.27.0 - * - * 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 Vx(){return Vx=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function CEe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function TEe(t,e){return t.button===0&&(!e||e==="_self")&&!CEe(t)}const REe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],AEe=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],PEe="6";try{window.__reactRouterVersion=PEe}catch{}const NEe=A.createContext({isTransitioning:!1}),IEe="startTransition",u5=qp[IEe];function LEe(t){let{basename:e,children:n,future:r,window:i}=t,o=A.useRef();o.current==null&&(o.current=zMe({window:i,v5Compat:!0}));let s=o.current,[a,l]=A.useState({action:s.action,location:s.location}),{v7_startTransition:c}=r||{},u=A.useCallback(f=>{c&&u5?u5(()=>l(f)):l(f)},[l,c]);return A.useLayoutEffect(()=>s.listen(u),[s,u]),A.createElement(MEe,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const kEe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",OEe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gy=A.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,viewTransition:f}=e,h=x7(e,REe),{basename:m}=A.useContext(Wl),v,x=!1;if(typeof c=="string"&&OEe.test(c)&&(v=c,kEe))try{let _=new URL(window.location.href),S=c.startsWith("//")?new URL(_.protocol+c):new URL(c),P=Od(S.pathname,m);S.origin===_.origin&&P!=null?c=P+S.search+S.hash:x=!0}catch{}let y=cEe(c,{relative:i}),g=zEe(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:f});function b(_){r&&r(_),_.defaultPrevented||g(_)}return A.createElement("a",Vx({},h,{href:v||y,onClick:x||o?r:b,ref:n,target:l}))}),DEe=A.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:s=!1,style:a,to:l,viewTransition:c,children:u}=e,f=x7(e,AEe),h=nw(l,{relative:f.relative}),m=lh(),v=A.useContext(p7),{navigator:x,basename:y}=A.useContext(Wl),g=v!=null&&UEe(h)&&c===!0,b=x.encodeLocation?x.encodeLocation(h).pathname:h.pathname,_=m.pathname,S=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;i||(_=_.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase()),S&&y&&(S=Od(S,y)||S);const P=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let N=_===b||!s&&_.startsWith(b)&&_.charAt(P)==="/",R=S!=null&&(S===b||!s&&S.startsWith(b)&&S.charAt(b.length)==="/"),L={isActive:N,isPending:R,isTransitioning:g},U=N?r:void 0,M;typeof o=="function"?M=o(L):M=[o,N?"active":null,R?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let T=typeof a=="function"?a(L):a;return A.createElement(Gy,Vx({},f,{"aria-current":U,className:M,ref:n,style:T,to:l,viewTransition:c}),typeof u=="function"?u(L):u)});var JC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(JC||(JC={}));var f5;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(f5||(f5={}));function FEe(t){let e=A.useContext(ew);return e||Wn(!1),e}function zEe(t,e){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,viewTransition:a}=e===void 0?{}:e,l=uEe(),c=lh(),u=nw(t,{relative:s});return A.useCallback(f=>{if(TEe(f,n)){f.preventDefault();let h=r!==void 0?r:Ux(c)===Ux(u);l(t,{replace:h,state:i,preventScrollReset:o,relative:s,viewTransition:a})}},[c,l,u,r,i,n,t,o,s,a])}function UEe(t,e){e===void 0&&(e={});let n=A.useContext(NEe);n==null&&Wn(!1);let{basename:r}=FEe(JC.useViewTransitionState),i=nw(t,{relative:e.relative});if(!n.isTransitioning)return!1;let o=Od(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Od(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Bx(i.pathname,s)!=null||Bx(i.pathname,o)!=null}const BEe="jacobfilik/XASDataLibrary";function jEe(){const t=BEe;return console.log(t),C.jsxs(FZ,{maxWidth:"md",sx:{alignSelf:"center",p:"24px"},children:[C.jsx(sr,{variant:"h4",padding:"24px",children:"Welcome to the XAS Data Viewer!"}),C.jsxs(Ta,{children:[C.jsxs(sr,{paragraph:!0,children:["A prototype viewer for"," ",C.jsx(Gy,{to:"https://docs.xrayabsorption.org/xaslib/xdi.html",children:"XDI files"})," ","stored in a github repository. As part of the website build process, the XDI files are pulled in and indexed, giving simple static website to display open data. The website is currently pointing as a fork of the data in"," ",C.jsx(Gy,{to:"https://github.com/"+t,children:t}),"."]}),C.jsxs(sr,{paragraph:!0,children:["The database is open to ",C.jsx(Gy,{to:"view",children:" search and download "}),"."]})]})]})}function VEe(){return C.jsx(w1,{fontSize:"large",children:C.jsx("svg",{"xmlns:cc":"http://creativecommons.org/ns#","xmlns:rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns:svg":"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/svg","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape",width:"128mm",height:"128mm",stroke:"currentColor",strokeWidth:"10",fill:"currentColor",fillOpacity:0,viewBox:"0 0 128 128",version:"1.1",id:"svg8","inkscape:version":"1.0.2 (e86c870879, 2021-01-15)","sodipodi:docname":"xas.svg",children:C.jsxs("g",{children:[C.jsx("ellipse",{id:"path10",cx:"63.999969",cy:"63.999977","inkscape:transform-center-x":"-5.865903","inkscape:transform-center-y":"5.0209768",rx:"56.583519",ry:"56.583527"}),C.jsx("path",{d:"m 16.735593,100.44088 c 0,0 7.70744,-0.26134 11.237986,-2.870607 3.530546,-2.609263 5.156198,-5.498236 7.679809,-12.583372 2.523611,-7.085136 2.848188,-18.380097 4.131012,-30.102996 1.282824,-11.722899 3.230562,-44.480225 3.230562,-44.480225 4.962867,19.231513 6.224793,38.773768 14.888602,57.69454 2.414322,5.272605 9.885109,-17.110327 17.038135,-18.175536 7.378059,-1.10638 11.361319,13.99222 22.096164,13.889823 7.447127,0.173557 14.641057,-5.092574 22.300757,-7.450702 v 0",id:"path835","sodipodi:nodetypes":"czzzcscccc"})]})})})}function $Ee(t){const e={Home:"/",Explore:"/view",Viewer:"/xdiviewer"};return C.jsx(EK,{style:{position:"static"},children:C.jsxs(fte,{sx:{justifyContent:"space-between",alignItems:"center"},children:[C.jsxs(Is,{direction:"row",alignItems:"center",spacing:2,children:[C.jsx(Ta,{children:C.jsx(VEe,{})}),C.jsx(sr,{variant:"h4",component:"div",sx:{flexGrow:1},children:"XAS Data Viewer"}),C.jsx(h6,{component:Is,direction:"row",children:Object.entries(e).map(([n,r])=>C.jsx(TQ,{children:C.jsx(gQ,{component:DEe,to:r,sx:{"&.active":{color:i=>i.palette.text.secondary}},children:C.jsx(IQ,{primary:n})})},n))})]}),C.jsx(Is,{direction:"row",alignItems:"center",children:C.jsx(DZ,{icon:C.jsx(ASe,{}),checkedIcon:C.jsx(RSe,{}),checked:t.colorMode==="dark",onChange:t.toggleColorMode})})]})})}const WEe=Ze("input")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",bottom:0,left:0,whiteSpace:"nowrap",width:1});function HEe(t){const[e,n]=A.useState(""),[r,i]=A.useState("No file"),o=A.useContext(Kb),s=l=>{l.preventDefault(),Dn.get(e).then(c=>{const u=_d.parseFile(c.data);o.setXDIFile(u);const f={id:e,beamline:u.beamline,edge:u.edge,element:u.element,sample:u.sample,start_time:u.date};i(e),t.setXASMetadata(f)})},a=l=>{if(l.target.files!=null){const c=new FileReader;c.onload=async u=>{if(u.target!=null&&typeof u.target.result=="string"){let f;try{f=_d.parseFile(u.target.result),o.setXDIFile(f);const h={id:e,beamline:{name:f.beamline},edge:f.edge,element:f.element,sample:f.build_sample(),start_time:f.date};t.setXASMetadata(h)}catch(h){console.log(h)}}},i(l.target.files[0].name),c.readAsText(l.target.files[0])}};return C.jsx(Xd,{elevation:3,variant:"outlined",square:!1,sx:{p:2},children:C.jsxs(Is,{spacing:2,sx:{justifyContent:"flex-start",alignItems:"flex-start"},children:[C.jsx(sr,{variant:"h5",children:"Upload XDI File"}),C.jsxs(Is,{direction:"row",component:"form",onSubmit:s,spacing:1,children:[C.jsx($te,{margin:"dense",sx:{width:"75%"},id:"xdi-url",label:"XDI file URL",variant:"outlined",value:e,onChange:l=>{n(l.target.value)}}),C.jsx(ym,{variant:"contained",type:"submit",children:"Fetch"})]}),C.jsxs(ym,{variant:"contained",role:void 0,tabIndex:-1,component:"label",children:["Upload Local File",C.jsx(WEe,{type:"file",name:"file1",onChange:a})]}),C.jsx(sr,{noWrap:!0,sx:{overflow:"hidden",textOverflow:"ellipsis",width:"100%"},children:r})]})})}function GEe(){const[t,e]=A.useState(null);return C.jsxs(Is,{spacing:2,children:[C.jsx(HEe,{setXASMetadata:e}),t&&C.jsx(LR,{standard:t,showDownload:!1})]})}function XEe(){const[t,e]=A.useState(null);return C.jsx(IR,{value:{xdiFile:t,setXDIFile:e},children:C.jsxs(xa,{height:"100%",container:!0,children:[C.jsx(xa,{item:!0,lg:5,md:12,padding:1,children:C.jsx(GEe,{})}),C.jsx(xa,{item:!0,height:"100%",lg:7,md:12,padding:1,children:C.jsx(yP,{})})]})})}function qEe(){const e=lh().pathname.slice(5),[n,r]=A.useState(null),i=A.useContext(kR);console.log(e),console.log(i[1]);const o=i.find(s=>s.location===e);return A.useEffect(()=>{Dn.get("/webxdiviewer/xdidata/"+e).then(s=>{let a=null;try{a=_d.parseFile(s.data)}catch{console.log("Could not read {}",focus)}r(a)})},[e]),C.jsx(IR,{value:{xdiFile:n,setXDIFile:r},children:C.jsxs(xa,{height:"100%",container:!0,children:[C.jsx(xa,{item:!0,lg:5,md:12,padding:1,children:o?C.jsx(LR,{standard:o,showDownload:!0}):C.jsxs(sr,{children:[" Could not find ",e," "]})}),C.jsx(xa,{item:!0,height:"100%",lg:7,md:12,padding:1,children:C.jsx(yP,{})})]})})}function YEe(){const t=Dz("(prefers-color-scheme: dark)"),[e,n]=A.useState(t?"dark":"light"),r=A.useMemo(()=>({toggleColorMode:()=>{n(o=>o==="light"?"dark":"light")}}),[]),i=A.useMemo(()=>xR({palette:{mode:e}}),[e]);return C.jsxs(UY,{theme:i,children:[C.jsx(jZ,{}),C.jsxs(Is,{height:"100vh",width:"100vw",spacing:1,children:[C.jsx($Ee,{colorMode:e,toggleColorMode:r.toggleColorMode}),C.jsx(pne,{children:C.jsxs(EEe,{children:[C.jsx(xp,{path:"/",element:C.jsx(jEe,{})}),C.jsx(xp,{path:"/view",element:C.jsx(FMe,{})}),C.jsx(xp,{path:"/xdiviewer",element:C.jsx(XEe,{})}),C.jsx(xp,{path:"/xdi/:id/*",element:C.jsx(qEe,{})})]})})]})]})}XT(document.getElementById("root")).render(C.jsx(A.StrictMode,{children:C.jsx(LEe,{children:C.jsx(YEe,{})})})); diff --git a/assets/index-Bs4p1Vux.css b/assets/index-Y93th5Ow.css similarity index 100% rename from assets/index-Bs4p1Vux.css rename to assets/index-Y93th5Ow.css diff --git a/index.html b/index.html index 26a7fbc..6623d26 100644 --- a/index.html +++ b/index.html @@ -5,8 +5,8 @@ Web XDI Viewer - - + +