From 4496b820481e113009434ea029f6c007e1b269fe Mon Sep 17 00:00:00 2001 From: tizayi <57833318+tizayi@users.noreply.github.com> Date: Mon, 4 Dec 2023 11:04:02 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20tizayi/d?= =?UTF-8?q?edi-web@85c378b6823212ddff771fd6e7d84f6a01603478=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/index-055d3968.js | 3896 ------------------------------------- assets/index-e75c3f43.js | 3923 ++++++++++++++++++++++++++++++++++++++ index.html | 2 +- 3 files changed, 3924 insertions(+), 3897 deletions(-) delete mode 100644 assets/index-055d3968.js create mode 100644 assets/index-e75c3f43.js diff --git a/assets/index-055d3968.js b/assets/index-055d3968.js deleted file mode 100644 index ad4974f..0000000 --- a/assets/index-055d3968.js +++ /dev/null @@ -1,3896 +0,0 @@ -var jY=Object.defineProperty;var XY=(t,e,n)=>e in t?jY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var qY=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var jc=(t,e,n)=>(XY(t,typeof e!="symbol"?e+"":e,n),n);var K$e=qY((ts,ns)=>{function YY(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 a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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 iu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Au(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function KY(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 q8={exports:{}},mM={},Y8={exports:{}},On={};/** - * @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 Z1=Symbol.for("react.element"),ZY=Symbol.for("react.portal"),QY=Symbol.for("react.fragment"),JY=Symbol.for("react.strict_mode"),eK=Symbol.for("react.profiler"),tK=Symbol.for("react.provider"),nK=Symbol.for("react.context"),rK=Symbol.for("react.forward_ref"),iK=Symbol.for("react.suspense"),oK=Symbol.for("react.memo"),aK=Symbol.for("react.lazy"),F4=Symbol.iterator;function sK(t){return t===null||typeof t!="object"?null:(t=F4&&t[F4]||t["@@iterator"],typeof t=="function"?t:null)}var K8={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z8=Object.assign,Q8={};function f0(t,e,n){this.props=t,this.context=e,this.refs=Q8,this.updater=n||K8}f0.prototype.isReactComponent={};f0.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")};f0.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function J8(){}J8.prototype=f0.prototype;function iP(t,e,n){this.props=t,this.context=e,this.refs=Q8,this.updater=n||K8}var oP=iP.prototype=new J8;oP.constructor=iP;Z8(oP,f0.prototype);oP.isPureReactComponent=!0;var U4=Array.isArray,e6=Object.prototype.hasOwnProperty,aP={current:null},t6={key:!0,ref:!0,__self:!0,__source:!0};function n6(t,e,n){var r,i={},o=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(o=""+e.key),e)e6.call(e,r)&&!t6.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,ae=H[Q];if(0>>1;Qi(Te,te))Vei(Ye,Te)?(H[Q]=Ye,H[Ve]=te,Q=Ve):(H[Q]=Te,H[we]=te,Q=we);else if(Vei(Ye,te))H[Q]=Ye,H[Ve]=te,Q=Ve;else break e}}return Y}function i(H,Y){var te=H.sortIndex-Y.sortIndex;return te!==0?te:H.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],c=[],f=1,p=null,m=3,v=!1,x=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(H){for(var Y=n(c);Y!==null;){if(Y.callback===null)r(c);else if(Y.startTime<=H)r(c),Y.sortIndex=Y.expirationTime,e(l,Y);else break;Y=n(c)}}function C(H){if(_=!1,M(H),!x)if(n(l)!==null)x=!0,ie(A);else{var Y=n(c);Y!==null&&se(C,Y.startTime-H)}}function A(H,Y){x=!1,_&&(_=!1,y(U),U=-1),v=!0;var te=m;try{for(M(Y),p=n(l);p!==null&&(!(p.expirationTime>Y)||H&&!z());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,m=p.priorityLevel;var ae=Q(p.expirationTime<=Y);Y=t.unstable_now(),typeof ae=="function"?p.callback=ae:p===n(l)&&r(l),M(Y)}else r(l);p=n(l)}if(p!==null)var xe=!0;else{var we=n(c);we!==null&&se(C,we.startTime-Y),xe=!1}return xe}finally{p=null,m=te,v=!1}}var R=!1,P=null,U=-1,k=5,N=-1;function z(){return!(t.unstable_now()-NH||125Q?(H.sortIndex=te,e(c,H),n(l)===null&&H===n(c)&&(_?(y(U),U=-1):_=!0,se(C,te-Q))):(H.sortIndex=ae,e(l,H),x||v||(x=!0,ie(A))),H},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(H){var Y=m;return function(){var te=m;m=Y;try{return H.apply(this,arguments)}finally{m=te}}}})(a6);o6.exports=a6;var yK=o6.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 s6=F,ss=yK;function nt(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"),CA=Object.prototype.hasOwnProperty,xK=/^[: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]*$/,z4={},$4={};function bK(t){return CA.call($4,t)?!0:CA.call(z4,t)?!1:xK.test(t)?$4[t]=!0:(z4[t]=!0,!1)}function _K(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 wK(t,e,n,r){if(e===null||typeof e>"u"||_K(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 qo(t,e,n,r,i,o,a){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=a}var io={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){io[t]=new qo(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];io[e]=new qo(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){io[t]=new qo(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){io[t]=new qo(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){io[t]=new qo(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){io[t]=new qo(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){io[t]=new qo(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){io[t]=new qo(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){io[t]=new qo(t,5,!1,t.toLowerCase(),null,!1,!1)});var lP=/[\-:]([a-z])/g;function cP(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(lP,cP);io[e]=new qo(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(lP,cP);io[e]=new qo(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(lP,cP);io[e]=new qo(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){io[t]=new qo(t,1,!1,t.toLowerCase(),null,!1,!1)});io.xlinkHref=new qo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){io[t]=new qo(t,1,!1,t.toLowerCase(),null,!0,!0)});function uP(t,e,n,r){var i=io.hasOwnProperty(e)?io[e]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` -`+i[a].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=s);break}}}finally{vC=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?oy(t):""}function SK(t){switch(t.tag){case 5:return oy(t.type);case 16:return oy("Lazy");case 13:return oy("Suspense");case 19:return oy("SuspenseList");case 0:case 2:case 15:return t=yC(t.type,!1),t;case 11:return t=yC(t.type.render,!1),t;case 1:return t=yC(t.type,!0),t;default:return""}}function PA(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 sg:return"Fragment";case ag:return"Portal";case TA:return"Profiler";case fP:return"StrictMode";case AA:return"Suspense";case RA:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case u6:return(t.displayName||"Context")+".Consumer";case c6:return(t._context.displayName||"Context")+".Provider";case dP:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case hP:return e=t.displayName||null,e!==null?e:PA(t.type)||"Memo";case Mf:e=t._payload,t=t._init;try{return PA(t(e))}catch{}}return null}function MK(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 PA(e);case 8:return e===fP?"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 qf(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function d6(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function EK(t){var e=d6(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(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Gb(t){t._valueTracker||(t._valueTracker=EK(t))}function h6(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=d6(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function nS(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 IA(t,e){var n=e.checked;return Fr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function V4(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=qf(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 p6(t,e){e=e.checked,e!=null&&uP(t,"checked",e,!1)}function LA(t,e){p6(t,e);var n=qf(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")?OA(t,e.type,n):e.hasOwnProperty("defaultValue")&&OA(t,e.type,qf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function W4(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 OA(t,e,n){(e!=="number"||nS(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ay=Array.isArray;function Eg(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=jb.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function qy(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var yy={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},CK=["Webkit","ms","Moz","O"];Object.keys(yy).forEach(function(t){CK.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),yy[e]=yy[t]})});function y6(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||yy.hasOwnProperty(t)&&yy[t]?(""+e).trim():e+"px"}function x6(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=y6(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var TK=Fr({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 DA(t,e){if(e){if(TK[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(nt(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(nt(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(nt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(nt(62))}}function FA(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 UA=null;function pP(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var BA=null,Cg=null,Tg=null;function X4(t){if(t=ex(t)){if(typeof BA!="function")throw Error(nt(280));var e=t.stateNode;e&&(e=bM(e),BA(t.stateNode,t.type,e))}}function b6(t){Cg?Tg?Tg.push(t):Tg=[t]:Cg=t}function _6(){if(Cg){var t=Cg,e=Tg;if(Tg=Cg=null,X4(t),e)for(t=0;t>>=0,t===0?32:31-(UK(t)/BK|0)|0}var Xb=64,qb=4194304;function sy(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 aS(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=sy(s):(o&=a,o!==0&&(r=sy(o)))}else a=n&~i,a!==0?r=sy(a):o!==0&&(r=sy(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 Q1(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-El(e),t[e]=n}function VK(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=by),nk=String.fromCharCode(32),rk=!1;function $6(t,e){switch(t){case"keyup":return vZ.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function H6(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var lg=!1;function xZ(t,e){switch(t){case"compositionend":return H6(e);case"keypress":return e.which!==32?null:(rk=!0,nk);case"textInput":return t=e.data,t===nk&&rk?null:t;default:return null}}function bZ(t,e){if(lg)return t==="compositionend"||!wP&&$6(t,e)?(t=B6(),Rw=xP=If=null,lg=!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=sk(n)}}function j6(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?j6(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function X6(){for(var t=window,e=nS();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=nS(t.document)}return e}function SP(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 RZ(t){var e=X6(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&j6(n.ownerDocument.documentElement,n)){if(r!==null&&SP(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=lk(n,o);var a=lk(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.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,cg=null,GA=null,wy=null,jA=!1;function ck(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jA||cg==null||cg!==nS(r)||(r=cg,"selectionStart"in r&&SP(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}),wy&&e1(wy,r)||(wy=r,r=cS(GA,"onSelect"),0dg||(t.current=QA[dg],QA[dg]=null,dg--)}function gr(t,e){dg++,QA[dg]=t.current,t.current=e}var Yf={},Eo=od(Yf),ha=od(!1),Vh=Yf;function Vg(t,e){var n=t.type.contextTypes;if(!n)return Yf;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 pa(t){return t=t.childContextTypes,t!=null}function fS(){_r(ha),_r(Eo)}function gk(t,e,n){if(Eo.current!==Yf)throw Error(nt(168));gr(Eo,e),gr(ha,n)}function nB(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(nt(108,MK(t)||"Unknown",i));return Fr({},n,r)}function dS(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Yf,Vh=Eo.current,gr(Eo,t),gr(ha,ha.current),!0}function vk(t,e,n){var r=t.stateNode;if(!r)throw Error(nt(169));n?(t=nB(t,e,Vh),r.__reactInternalMemoizedMergedChildContext=t,_r(ha),_r(Eo),gr(Eo,t)):_r(ha),gr(ha,n)}var nu=null,_M=!1,LC=!1;function rB(t){nu===null?nu=[t]:nu.push(t)}function $Z(t){_M=!0,rB(t)}function ad(){if(!LC&&nu!==null){LC=!0;var t=0,e=Jn;try{var n=nu;for(Jn=1;t>=a,i-=a,cu=1<<32-El(e)+i|n<U?(k=P,P=null):k=P.sibling;var N=m(y,P,M[U],C);if(N===null){P===null&&(P=k);break}t&&P&&N.alternate===null&&e(y,P),S=o(N,S,U),R===null?A=N:R.sibling=N,R=N,P=k}if(U===M.length)return n(y,P),Cr&&lh(y,U),A;if(P===null){for(;UU?(k=P,P=null):k=P.sibling;var z=m(y,P,N.value,C);if(z===null){P===null&&(P=k);break}t&&P&&z.alternate===null&&e(y,P),S=o(z,S,U),R===null?A=z:R.sibling=z,R=z,P=k}if(N.done)return n(y,P),Cr&&lh(y,U),A;if(P===null){for(;!N.done;U++,N=M.next())N=p(y,N.value,C),N!==null&&(S=o(N,S,U),R===null?A=N:R.sibling=N,R=N);return Cr&&lh(y,U),A}for(P=r(y,P);!N.done;U++,N=M.next())N=v(P,y,U,N.value,C),N!==null&&(t&&N.alternate!==null&&P.delete(N.key===null?U:N.key),S=o(N,S,U),R===null?A=N:R.sibling=N,R=N);return t&&P.forEach(function(K){return e(y,K)}),Cr&&lh(y,U),A}function b(y,S,M,C){if(typeof M=="object"&&M!==null&&M.type===sg&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case Wb:e:{for(var A=M.key,R=S;R!==null;){if(R.key===A){if(A=M.type,A===sg){if(R.tag===7){n(y,R.sibling),S=i(R,M.props.children),S.return=y,y=S;break e}}else if(R.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Mf&&Mk(A)===R.type){n(y,R.sibling),S=i(R,M.props),S.ref=Rv(y,R,M),S.return=y,y=S;break e}n(y,R);break}else e(y,R);R=R.sibling}M.type===sg?(S=Ih(M.props.children,y.mode,C,M.key),S.return=y,y=S):(C=Fw(M.type,M.key,M.props,null,y.mode,C),C.ref=Rv(y,S,M),C.return=y,y=C)}return a(y);case ag:e:{for(R=M.key;S!==null;){if(S.key===R)if(S.tag===4&&S.stateNode.containerInfo===M.containerInfo&&S.stateNode.implementation===M.implementation){n(y,S.sibling),S=i(S,M.children||[]),S.return=y,y=S;break e}else{n(y,S);break}else e(y,S);S=S.sibling}S=zC(M,y.mode,C),S.return=y,y=S}return a(y);case Mf:return R=M._init,b(y,S,R(M._payload),C)}if(ay(M))return x(y,S,M,C);if(Mv(M))return _(y,S,M,C);t_(y,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,S!==null&&S.tag===6?(n(y,S.sibling),S=i(S,M),S.return=y,y=S):(n(y,S),S=BC(M,y.mode,C),S.return=y,y=S),a(y)):n(y,S)}return b}var Gg=fB(!0),dB=fB(!1),tx={},cc=od(tx),i1=od(tx),o1=od(tx);function wh(t){if(t===tx)throw Error(nt(174));return t}function LP(t,e){switch(gr(o1,e),gr(i1,t),gr(cc,tx),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:NA(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=NA(e,t)}_r(cc),gr(cc,e)}function jg(){_r(cc),_r(i1),_r(o1)}function hB(t){wh(o1.current);var e=wh(cc.current),n=NA(e,t.type);e!==n&&(gr(i1,t),gr(cc,n))}function OP(t){i1.current===t&&(_r(cc),_r(i1))}var kr=od(0);function yS(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var OC=[];function kP(){for(var t=0;tn?n:4,t(!0);var r=kC.transition;kC.transition={};try{t(!1),e()}finally{Jn=n,kC.transition=r}}function RB(){return Vs().memoizedState}function GZ(t,e,n){var r=Bf(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},PB(t))IB(e,n);else if(n=sB(t,e,n,r),n!==null){var i=Go();Cl(n,t,r,i),LB(n,e,r)}}function jZ(t,e,n){var r=Bf(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(PB(t))IB(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Tl(s,a)){var l=e.interleaved;l===null?(i.next=i,PP(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=sB(t,e,i,r),n!==null&&(i=Go(),Cl(n,t,r,i),LB(n,e,r))}}function PB(t){var e=t.alternate;return t===Dr||e!==null&&e===Dr}function IB(t,e){Sy=xS=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function LB(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,gP(t,n)}}var bS={readContext:Hs,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useInsertionEffect:mo,useLayoutEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useMutableSource:mo,useSyncExternalStore:mo,useId:mo,unstable_isNewReconciler:!1},XZ={readContext:Hs,useCallback:function(t,e){return Jl().memoizedState=[t,e===void 0?null:e],t},useContext:Hs,useEffect:Ck,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ow(4194308,4,MB.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ow(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ow(4,2,t,e)},useMemo:function(t,e){var n=Jl();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Jl();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=GZ.bind(null,Dr,t),[r.memoizedState,t]},useRef:function(t){var e=Jl();return t={current:t},e.memoizedState=t},useState:Ek,useDebugValue:BP,useDeferredValue:function(t){return Jl().memoizedState=t},useTransition:function(){var t=Ek(!1),e=t[0];return t=WZ.bind(null,t[1]),Jl().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Dr,i=Jl();if(Cr){if(n===void 0)throw Error(nt(407));n=n()}else{if(n=e(),ji===null)throw Error(nt(349));Gh&30||gB(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Ck(yB.bind(null,r,o,t),[t]),r.flags|=2048,l1(9,vB.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Jl(),e=ji.identifierPrefix;if(Cr){var n=uu,r=cu;n=(r&~(1<<32-El(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=a1++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[ic]=e,t[r1]=r,$B(t,e,!1,!1),e.stateNode=t;e:{switch(a=FA(n,r),n){case"dialog":yr("cancel",t),yr("close",t),i=r;break;case"iframe":case"object":case"embed":yr("load",t),i=r;break;case"video":case"audio":for(i=0;iqg&&(e.flags|=128,r=!0,Pv(o,!1),e.lanes=4194304)}else{if(!r)if(t=yS(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Pv(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Cr)return go(e),null}else 2*oi()-o.renderingStartTime>qg&&n!==1073741824&&(e.flags|=128,r=!0,Pv(o,!1),e.lanes=4194304);o.isBackwards?(a.sibling=e.child,e.child=a):(n=o.last,n!==null?n.sibling=a:e.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=oi(),e.sibling=null,n=kr.current,gr(kr,r?n&1|2:n&1),e):(go(e),null);case 22:case 23:return GP(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ja&1073741824&&(go(e),e.subtreeFlags&6&&(e.flags|=8192)):go(e),null;case 24:return null;case 25:return null}throw Error(nt(156,e.tag))}function tQ(t,e){switch(EP(e),e.tag){case 1:return pa(e.type)&&fS(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return jg(),_r(ha),_r(Eo),kP(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return OP(e),null;case 13:if(_r(kr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(nt(340));Wg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return _r(kr),null;case 4:return jg(),null;case 10:return RP(e.type._context),null;case 22:case 23:return GP(),null;case 24:return null;default:return null}}var r_=!1,wo=!1,nQ=typeof WeakSet=="function"?WeakSet:Set,St=null;function gg(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xr(t,e,r)}else n.current=null}function uR(t,e,n){try{n()}catch(r){Xr(t,e,r)}}var Nk=!1;function rQ(t,e){if(XA=sS,t=X6(),SP(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 a=0,s=-1,l=-1,c=0,f=0,p=t,m=null;t:for(;;){for(var v;p!==n||i!==0&&p.nodeType!==3||(s=a+i),p!==o||r!==0&&p.nodeType!==3||(l=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(v=p.firstChild)!==null;)m=p,p=v;for(;;){if(p===t)break t;if(m===n&&++c===i&&(s=a),m===o&&++f===r&&(l=a),(v=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=v}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(qA={focusedElem:t,selectionRange:n},sS=!1,St=e;St!==null;)if(e=St,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,St=t;else for(;St!==null;){e=St;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var _=x.memoizedProps,b=x.memoizedState,y=e.stateNode,S=y.getSnapshotBeforeUpdate(e.elementType===e.type?_:hl(e.type,_),b);y.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var M=e.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(nt(163))}}catch(C){Xr(e,e.return,C)}if(t=e.sibling,t!==null){t.return=e.return,St=t;break}St=e.return}return x=Nk,Nk=!1,x}function My(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&&uR(e,n,o)}i=i.next}while(i!==r)}}function MM(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 fR(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 WB(t){var e=t.alternate;e!==null&&(t.alternate=null,WB(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ic],delete e[r1],delete e[ZA],delete e[BZ],delete e[zZ])),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 GB(t){return t.tag===5||t.tag===3||t.tag===4}function Dk(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||GB(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 dR(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=uS));else if(r!==4&&(t=t.child,t!==null))for(dR(t,e,n),t=t.sibling;t!==null;)dR(t,e,n),t=t.sibling}function hR(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(hR(t,e,n),t=t.sibling;t!==null;)hR(t,e,n),t=t.sibling}var Ji=null,gl=!1;function mf(t,e,n){for(n=n.child;n!==null;)jB(t,e,n),n=n.sibling}function jB(t,e,n){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(gM,n)}catch{}switch(n.tag){case 5:wo||gg(n,e);case 6:var r=Ji,i=gl;Ji=null,mf(t,e,n),Ji=r,gl=i,Ji!==null&&(gl?(t=Ji,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ji.removeChild(n.stateNode));break;case 18:Ji!==null&&(gl?(t=Ji,n=n.stateNode,t.nodeType===8?IC(t.parentNode,n):t.nodeType===1&&IC(t,n),Qy(t)):IC(Ji,n.stateNode));break;case 4:r=Ji,i=gl,Ji=n.stateNode.containerInfo,gl=!0,mf(t,e,n),Ji=r,gl=i;break;case 0:case 11:case 14:case 15:if(!wo&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&uR(n,e,a),i=i.next}while(i!==r)}mf(t,e,n);break;case 1:if(!wo&&(gg(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Xr(n,e,s)}mf(t,e,n);break;case 21:mf(t,e,n);break;case 22:n.mode&1?(wo=(r=wo)||n.memoizedState!==null,mf(t,e,n),wo=r):mf(t,e,n);break;default:mf(t,e,n)}}function Fk(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new nQ),e.forEach(function(r){var i=dQ.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function sl(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=oi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*oQ(r/1960))-r,10t?16:t,Lf===null)var r=!1;else{if(t=Lf,Lf=null,SS=0,zn&6)throw Error(nt(331));var i=zn;for(zn|=4,St=t.current;St!==null;){var o=St,a=o.child;if(St.flags&16){var s=o.deletions;if(s!==null){for(var l=0;loi()-VP?Ph(t,0):HP|=n),ma(t,e)}function ez(t,e){e===0&&(t.mode&1?(e=qb,qb<<=1,!(qb&130023424)&&(qb=4194304)):e=1);var n=Go();t=bu(t,e),t!==null&&(Q1(t,e,n),ma(t,n))}function fQ(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),ez(t,n)}function dQ(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(nt(314))}r!==null&&r.delete(e),ez(t,n)}var tz;tz=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ha.current)da=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return da=!1,JZ(t,e,n);da=!!(t.flags&131072)}else da=!1,Cr&&e.flags&1048576&&iB(e,pS,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;kw(t,e),t=e.pendingProps;var i=Vg(e,Eo.current);Rg(e,n),i=DP(null,e,r,t,i,n);var o=FP();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,pa(r)?(o=!0,dS(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,IP(e),i.updater=wM,e.stateNode=i,i._reactInternals=e,rR(e,r,t,n),e=aR(null,e,r,!0,o,n)):(e.tag=0,Cr&&o&&MP(e),$o(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(kw(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=pQ(r),t=hl(r,t),i){case 0:e=oR(null,e,r,t,n);break e;case 1:e=Lk(null,e,r,t,n);break e;case 11:e=Pk(null,e,r,t,n);break e;case 14:e=Ik(null,e,r,hl(r.type,t),n);break e}throw Error(nt(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:hl(r,i),oR(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:hl(r,i),Lk(t,e,r,i,n);case 3:e:{if(UB(e),t===null)throw Error(nt(387));r=e.pendingProps,o=e.memoizedState,i=o.element,lB(t,e),vS(e,r,null,n);var a=e.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Xg(Error(nt(423)),e),e=Ok(t,e,r,n,i);break e}else if(r!==i){i=Xg(Error(nt(424)),e),e=Ok(t,e,r,n,i);break e}else for(Ja=Df(e.stateNode.containerInfo.firstChild),rs=e,Cr=!0,vl=null,n=dB(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wg(),r===i){e=_u(t,e,n);break e}$o(t,e,r,n)}e=e.child}return e;case 5:return hB(e),t===null&&eR(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,YA(r,i)?a=null:o!==null&&YA(r,o)&&(e.flags|=32),FB(t,e),$o(t,e,a,n),e.child;case 6:return t===null&&eR(e),null;case 13:return BB(t,e,n);case 4:return LP(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Gg(e,null,r,n):$o(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:hl(r,i),Pk(t,e,r,i,n);case 7:return $o(t,e,e.pendingProps,n),e.child;case 8:return $o(t,e,e.pendingProps.children,n),e.child;case 12:return $o(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,a=i.value,gr(mS,r._currentValue),r._currentValue=a,o!==null)if(Tl(o.value,a)){if(o.children===i.children&&!ha.current){e=_u(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=hu(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),tR(o.return,n,e),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===e.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(nt(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),tR(a,n,e),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}$o(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Rg(e,n),i=Hs(i),r=r(i),e.flags|=1,$o(t,e,r,n),e.child;case 14:return r=e.type,i=hl(r,e.pendingProps),i=hl(r.type,i),Ik(t,e,r,i,n);case 15:return NB(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:hl(r,i),kw(t,e),e.tag=1,pa(r)?(t=!0,dS(e)):t=!1,Rg(e,n),uB(e,r,i),rR(e,r,i,n),aR(null,e,r,!0,t,n);case 19:return zB(t,e,n);case 22:return DB(t,e,n)}throw Error(nt(156,e.tag))};function nz(t,e){return A6(t,e)}function hQ(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 Us(t,e,n,r){return new hQ(t,e,n,r)}function XP(t){return t=t.prototype,!(!t||!t.isReactComponent)}function pQ(t){if(typeof t=="function")return XP(t)?1:0;if(t!=null){if(t=t.$$typeof,t===dP)return 11;if(t===hP)return 14}return 2}function zf(t,e){var n=t.alternate;return n===null?(n=Us(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 Fw(t,e,n,r,i,o){var a=2;if(r=t,typeof t=="function")XP(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case sg:return Ih(n.children,i,o,e);case fP:a=8,i|=8;break;case TA:return t=Us(12,n,e,i|2),t.elementType=TA,t.lanes=o,t;case AA:return t=Us(13,n,e,i),t.elementType=AA,t.lanes=o,t;case RA:return t=Us(19,n,e,i),t.elementType=RA,t.lanes=o,t;case f6:return CM(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case c6:a=10;break e;case u6:a=9;break e;case dP:a=11;break e;case hP:a=14;break e;case Mf:a=16,r=null;break e}throw Error(nt(130,t==null?t:typeof t,""))}return e=Us(a,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Ih(t,e,n,r){return t=Us(7,t,r,e),t.lanes=n,t}function CM(t,e,n,r){return t=Us(22,t,r,e),t.elementType=f6,t.lanes=n,t.stateNode={isHidden:!1},t}function BC(t,e,n){return t=Us(6,t,null,e),t.lanes=n,t}function zC(t,e,n){return e=Us(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function mQ(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=bC(0),this.expirationTimes=bC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bC(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function qP(t,e,n,r,i,o,a,s,l){return t=new mQ(t,e,n,s,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Us(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},IP(o),t}function gQ(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(az)}catch(t){console.error(t)}}az(),i6.exports=us;var sd=i6.exports;const a_=Au(sd);var sz,Gk=sd;sz=EA.createRoot=Gk.createRoot,EA.hydrateRoot=Gk.hydrateRoot;const _Q={black:"#000",white:"#fff"},u1=_Q,wQ={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"},am=wQ,SQ={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"},sm=SQ,MQ={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"},lm=MQ,EQ={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"},cm=EQ,CQ={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"},um=CQ,TQ={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"},Lv=TQ,AQ={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"},RQ=AQ;function j(){return j=Object.assign?Object.assign.bind():function(t){for(var e=1;e{e[n]=lz(t[n])}),e}function So(t,e,n={clone:!0}){const r=n.clone?j({},t):t;return ou(t)&&ou(e)&&Object.keys(e).forEach(i=>{i!=="__proto__"&&(ou(e[i])&&i in t&&ou(t[i])?r[i]=So(t[i],e[i],n):n.clone?r[i]=ou(e[i])?lz(e[i]):e[i]:r[i]=e[i])}),r}var cz={exports:{}},PQ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",IQ=PQ,LQ=IQ;function uz(){}function fz(){}fz.resetWarningCache=uz;var OQ=function(){function t(r,i,o,a,s,l){if(l!==LQ){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:fz,resetWarningCache:uz};return n.PropTypes=n,n};cz.exports=OQ();var p0=cz.exports;const qe=Au(p0);function Kf(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;nn==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function $M(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 DQ(t,e){return()=>null}function Ty(t,e){var n,r;return F.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 Mo(t){return t&&t.ownerDocument||document}function xc(t){return Mo(t).defaultView||window}function FQ(t,e){return()=>null}function f1(t,e){typeof t=="function"?t(e):t&&(t.current=e)}const UQ=typeof window<"u"?F.useLayoutEffect:F.useEffect,Ws=UQ;let jk=0;function BQ(t){const[e,n]=F.useState(t),r=t||e;return F.useEffect(()=>{e==null&&(jk+=1,n(`mui-${jk}`))},[e]),r}const Xk=MA["useId".toString()];function nx(t){if(Xk!==void 0){const e=Xk();return t??e}return BQ(t)}function zQ(t,e,n,r,i){return null}function $f({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=F.useRef(t!==void 0),[o,a]=F.useState(e),s=i?t:o,l=F.useCallback(c=>{i||a(c)},[]);return[s,l]}function _l(t){const e=F.useRef(t);return Ws(()=>{e.current=t}),F.useRef((...n)=>(0,e.current)(...n)).current}function Ur(...t){return F.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{f1(n,e)})},t)}let HM=!0,yR=!1,qk;const $Q={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 HQ(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&$Q[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function VQ(t){t.metaKey||t.altKey||t.ctrlKey||(HM=!0)}function $C(){HM=!1}function WQ(){this.visibilityState==="hidden"&&yR&&(HM=!0)}function GQ(t){t.addEventListener("keydown",VQ,!0),t.addEventListener("mousedown",$C,!0),t.addEventListener("pointerdown",$C,!0),t.addEventListener("touchstart",$C,!0),t.addEventListener("visibilitychange",WQ,!0)}function jQ(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return HM||HQ(e)}function hz(){const t=F.useCallback(i=>{i!=null&&GQ(i.ownerDocument)},[]),e=F.useRef(!1);function n(){return e.current?(yR=!0,window.clearTimeout(qk),qk=window.setTimeout(()=>{yR=!1},100),e.current=!1,!0):!1}function r(i){return jQ(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function pz(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}const XQ=t=>{const e=F.useRef({});return F.useEffect(()=>{e.current=t}),e.current},qQ=XQ;function eI(t,e){const n=j({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=j({},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]=j({},o),Object.keys(i).forEach(a=>{n[r][a]=eI(i[a],o[a])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function an(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((o,a)=>{if(a){const s=e(a);s!==""&&o.push(s),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}const Yk=t=>t,YQ=()=>{let t=Yk;return{configure(e){t=e},generate(e){return t(e)},reset(){t=Yk}}},KQ=YQ(),tI=KQ,ZQ={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 tn(t,e,n="Mui"){const r=ZQ[e];return r?`${n}-${r}`:`${tI.generate(t)}-${e}`}function Zt(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=tn(t,i,n)}),r}const rx="$$material";function ht(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function mz(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var QQ=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,JQ=mz(function(t){return QQ.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91});function eJ(t){if(t.sheet)return t.sheet;for(var e=0;e0?eo(m0,--xa):0,Yg--,gi===10&&(Yg=1,WM--),gi}function is(){return gi=xa2||h1(gi)>3?"":" "}function hJ(t,e){for(;--e&&is()&&!(gi<48||gi>102||gi>57&&gi<65||gi>70&&gi<97););return ix(t,Uw()+(e<6&&uc()==32&&is()==32))}function bR(t){for(;is();)switch(gi){case t:return xa;case 34:case 39:t!==34&&t!==39&&bR(gi);break;case 40:t===41&&bR(t);break;case 92:is();break}return xa}function pJ(t,e){for(;is()&&t+gi!==47+10;)if(t+gi===42+42&&uc()===47)break;return"/*"+ix(e,xa-1)+"*"+VM(t===47?t:is())}function mJ(t){for(;!h1(uc());)is();return ix(t,xa)}function gJ(t){return _z(zw("",null,null,null,[""],t=bz(t),0,[0],t))}function zw(t,e,n,r,i,o,a,s,l){for(var c=0,f=0,p=a,m=0,v=0,x=0,_=1,b=1,y=1,S=0,M="",C=i,A=o,R=r,P=M;b;)switch(x=S,S=is()){case 40:if(x!=108&&eo(P,p-1)==58){xR(P+=Wn(Bw(S),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:P+=Bw(S);break;case 9:case 10:case 13:case 32:P+=dJ(x);break;case 92:P+=hJ(Uw()-1,7);continue;case 47:switch(uc()){case 42:case 47:s_(vJ(pJ(is(),Uw()),e,n),l);break;default:P+="/"}break;case 123*_:s[c++]=nc(P)*y;case 125*_:case 59:case 0:switch(S){case 0:case 125:b=0;case 59+f:y==-1&&(P=Wn(P,/\f/g,"")),v>0&&nc(P)-p&&s_(v>32?Zk(P+";",r,n,p-1):Zk(Wn(P," ","")+";",r,n,p-2),l);break;case 59:P+=";";default:if(s_(R=Kk(P,e,n,c,f,i,s,M,C=[],A=[],p),o),S===123)if(f===0)zw(P,e,R,R,C,o,p,s,A);else switch(m===99&&eo(P,3)===110?100:m){case 100:case 108:case 109:case 115:zw(t,R,R,r&&s_(Kk(t,R,R,0,0,i,s,M,i,C=[],p),A),i,A,p,s,r?C:A);break;default:zw(P,R,R,R,[""],A,0,s,A)}}c=f=v=0,_=y=1,M=P="",p=a;break;case 58:p=1+nc(P),v=x;default:if(_<1){if(S==123)--_;else if(S==125&&_++==0&&fJ()==125)continue}switch(P+=VM(S),S*_){case 38:y=f>0?1:(P+="\f",-1);break;case 44:s[c++]=(nc(P)-1)*y,y=1;break;case 64:uc()===45&&(P+=Bw(is())),m=uc(),f=p=nc(M=P+=mJ(Uw())),S++;break;case 45:x===45&&nc(P)==2&&(_=0)}}return o}function Kk(t,e,n,r,i,o,a,s,l,c,f){for(var p=i-1,m=i===0?o:[""],v=iI(m),x=0,_=0,b=0;x0?m[y]+" "+S:Wn(S,/&\f/g,m[y])))&&(l[b++]=M);return GM(t,e,n,i===0?nI:s,l,c,f)}function vJ(t,e,n){return GM(t,e,n,gz,VM(uJ()),d1(t,2,-2),0)}function Zk(t,e,n,r){return GM(t,e,n,rI,d1(t,0,r),d1(t,r+1,-1),r)}function Ig(t,e){for(var n="",r=iI(t),i=0;i6)switch(eo(t,e+1)){case 109:if(eo(t,e+4)!==45)break;case 102:return Wn(t,/(.+:)(.+)-([^]+)/,"$1"+Vn+"$2-$3$1"+TS+(eo(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~xR(t,"stretch")?wz(Wn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(eo(t,e+1)!==115)break;case 6444:switch(eo(t,nc(t)-3-(~xR(t,"!important")&&10))){case 107:return Wn(t,":",":"+Vn)+t;case 101:return Wn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Vn+(eo(t,14)===45?"inline-":"")+"box$3$1"+Vn+"$2$3$1"+_o+"$2box$3")+t}break;case 5936:switch(eo(t,e+11)){case 114:return Vn+t+_o+Wn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Vn+t+_o+Wn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Vn+t+_o+Wn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Vn+t+_o+t+t}return t}var CJ=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case rI:e.return=wz(e.value,e.length);break;case vz:return Ig([Ov(e,{value:Wn(e.value,"@","@"+Vn)})],i);case nI:if(e.length)return cJ(e.props,function(o){switch(lJ(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ig([Ov(e,{props:[Wn(o,/:(read-\w+)/,":"+TS+"$1")]})],i);case"::placeholder":return Ig([Ov(e,{props:[Wn(o,/:(plac\w+)/,":"+Vn+"input-$1")]}),Ov(e,{props:[Wn(o,/:(plac\w+)/,":"+TS+"$1")]}),Ov(e,{props:[Wn(o,/:(plac\w+)/,_o+"input-$1")]})],i)}return""})}},TJ=[CJ],AJ=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(_){var b=_.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(_),_.setAttribute("data-s",""))})}var i=e.stylisPlugins||TJ,o={},a,s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(_){for(var b=_.getAttribute("data-emotion").split(" "),y=1;y=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 zJ={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,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},$J=/[A-Z]|^ms/g,HJ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Rz=function(e){return e.charCodeAt(1)===45},Jk=function(e){return e!=null&&typeof e!="boolean"},HC=mz(function(t){return Rz(t)?t:t.replace($J,"-$&").toLowerCase()}),e5=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(HJ,function(r,i,o){return rc={name:i,styles:o,next:rc},i})}return zJ[e]!==1&&!Rz(e)&&typeof n=="number"&&n!==0?n+"px":n};function p1(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return rc={name:n.name,styles:n.styles,next:rc},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)rc={name:r.name,styles:r.styles,next:rc},r=r.next;var i=n.styles+";";return i}return VJ(t,e,n)}case"function":{if(t!==void 0){var o=rc,a=n(t);return rc=o,p1(t,e,a)}break}}if(e==null)return n;var s=e[n];return s!==void 0?s:n}function VJ(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?qJ:YJ},i5=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(a){return e.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},KJ=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return Tz(n,r,i),GJ(function(){return Az(n,r,i)}),null},ZJ=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,a;n!==void 0&&(o=n.label,a=n.target);var s=i5(e,n,r),l=s||r5(i),c=!l("as");return function(){var f=arguments,p=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&p.push("label:"+o+";"),f[0]==null||f[0].raw===void 0)p.push.apply(p,f);else{p.push(f[0][0]);for(var m=f.length,v=1;ve(JJ(i)?n:i):e;return O.jsx(jJ,{styles:r})}/** - * @mui/styled-engine v5.14.17 - * - * @license MIT - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */function Oz(t,e){return _R(t,e)}const tee=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},nee=["values","unit","step"],ree=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)=>j({},n,{[r.key]:r.val}),{})};function iee(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=ht(t,nee),o=ree(e),a=Object.keys(o);function s(m){return`@media (min-width:${typeof e[m]=="number"?e[m]:m}${n})`}function l(m){return`@media (max-width:${(typeof e[m]=="number"?e[m]:m)-r/100}${n})`}function c(m,v){const x=a.indexOf(v);return`@media (min-width:${typeof e[m]=="number"?e[m]:m}${n}) and (max-width:${(x!==-1&&typeof e[a[x]]=="number"?e[a[x]]:v)-r/100}${n})`}function f(m){return a.indexOf(m)+1`@media (min-width:${fI[t]}px)`};function Al(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||o5;return e.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(e[l]),a),{})}if(typeof e=="object"){const o=r.breakpoints||o5;return Object.keys(e).reduce((a,s)=>{if(Object.keys(o.values||fI).indexOf(s)!==-1){const l=o.up(s);a[l]=n(e[s],s)}else{const l=s;a[l]=e[l]}return a},{})}return n(e)}function kz(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function Nz(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function see(t,...e){const n=kz(t),r=[n,...e].reduce((i,o)=>So(i,o),{});return Nz(Object.keys(n),r)}function lee(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 VC({values:t,breakpoints:e,base:n}){const r=n||lee(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((a,s,l)=>(Array.isArray(t)?(a[s]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(a[s]=t[s]!=null?t[s]:t[o],o=s):a[s]=t,a),{})}function nE(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 AS(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=nE(t,n)||r,e&&(i=e(i,r,t)),i}function Kn(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=a=>{if(a[e]==null)return null;const s=a[e],l=a.theme,c=nE(l,r)||{};return Al(a,s,p=>{let m=AS(c,i,p);return p===m&&typeof p=="string"&&(m=AS(c,i,`${e}${p==="default"?"":Qe(p)}`,p)),n===!1?m:{[n]:m}})};return o.propTypes={},o.filterProps=[e],o}function cee(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const uee={m:"margin",p:"padding"},fee={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},a5={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},dee=cee(t=>{if(t.length>2)if(a5[t])t=a5[t];else return[t];const[e,n]=t.split(""),r=uee[e],i=fee[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),dI=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],hI=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...dI,...hI];function ox(t,e,n,r){var i;const o=(i=nE(t,e,!1))!=null?i:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function pI(t){return ox(t,"spacing",8)}function qh(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 hee(t,e){return n=>t.reduce((r,i)=>(r[i]=qh(e,n),r),{})}function pee(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=dee(n),o=hee(i,r),a=t[n];return Al(t,a,o)}function Dz(t,e){const n=pI(t.theme);return Object.keys(t).map(r=>pee(t,e,r,n)).reduce(Ay,{})}function Gr(t){return Dz(t,dI)}Gr.propTypes={};Gr.filterProps=dI;function jr(t){return Dz(t,hI)}jr.propTypes={};jr.filterProps=hI;function mee(t=8){if(t.mui)return t;const e=pI({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=e(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function rE(...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]?Ay(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function oc(t){return typeof t!="number"?t:`${t}px solid`}const gee=Kn({prop:"border",themeKey:"borders",transform:oc}),vee=Kn({prop:"borderTop",themeKey:"borders",transform:oc}),yee=Kn({prop:"borderRight",themeKey:"borders",transform:oc}),xee=Kn({prop:"borderBottom",themeKey:"borders",transform:oc}),bee=Kn({prop:"borderLeft",themeKey:"borders",transform:oc}),_ee=Kn({prop:"borderColor",themeKey:"palette"}),wee=Kn({prop:"borderTopColor",themeKey:"palette"}),See=Kn({prop:"borderRightColor",themeKey:"palette"}),Mee=Kn({prop:"borderBottomColor",themeKey:"palette"}),Eee=Kn({prop:"borderLeftColor",themeKey:"palette"}),iE=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=ox(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:qh(e,r)});return Al(t,t.borderRadius,n)}return null};iE.propTypes={};iE.filterProps=["borderRadius"];rE(gee,vee,yee,xee,bee,_ee,wee,See,Mee,Eee,iE);const oE=t=>{if(t.gap!==void 0&&t.gap!==null){const e=ox(t.theme,"spacing",8),n=r=>({gap:qh(e,r)});return Al(t,t.gap,n)}return null};oE.propTypes={};oE.filterProps=["gap"];const aE=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=ox(t.theme,"spacing",8),n=r=>({columnGap:qh(e,r)});return Al(t,t.columnGap,n)}return null};aE.propTypes={};aE.filterProps=["columnGap"];const sE=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=ox(t.theme,"spacing",8),n=r=>({rowGap:qh(e,r)});return Al(t,t.rowGap,n)}return null};sE.propTypes={};sE.filterProps=["rowGap"];const Cee=Kn({prop:"gridColumn"}),Tee=Kn({prop:"gridRow"}),Aee=Kn({prop:"gridAutoFlow"}),Ree=Kn({prop:"gridAutoColumns"}),Pee=Kn({prop:"gridAutoRows"}),Iee=Kn({prop:"gridTemplateColumns"}),Lee=Kn({prop:"gridTemplateRows"}),Oee=Kn({prop:"gridTemplateAreas"}),kee=Kn({prop:"gridArea"});rE(oE,aE,sE,Cee,Tee,Aee,Ree,Pee,Iee,Lee,Oee,kee);function Lg(t,e){return e==="grey"?e:t}const Nee=Kn({prop:"color",themeKey:"palette",transform:Lg}),Dee=Kn({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Lg}),Fee=Kn({prop:"backgroundColor",themeKey:"palette",transform:Lg});rE(Nee,Dee,Fee);function Ka(t){return t<=1&&t!==0?`${t*100}%`:t}const Uee=Kn({prop:"width",transform:Ka}),mI=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])||fI[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:Ka(n)}};return Al(t,t.maxWidth,e)}return null};mI.filterProps=["maxWidth"];const Bee=Kn({prop:"minWidth",transform:Ka}),zee=Kn({prop:"height",transform:Ka}),$ee=Kn({prop:"maxHeight",transform:Ka}),Hee=Kn({prop:"minHeight",transform:Ka});Kn({prop:"size",cssProperty:"width",transform:Ka});Kn({prop:"size",cssProperty:"height",transform:Ka});const Vee=Kn({prop:"boxSizing"});rE(Uee,mI,Bee,zee,$ee,Hee,Vee);const Wee={border:{themeKey:"borders",transform:oc},borderTop:{themeKey:"borders",transform:oc},borderRight:{themeKey:"borders",transform:oc},borderBottom:{themeKey:"borders",transform:oc},borderLeft:{themeKey:"borders",transform:oc},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:iE},color:{themeKey:"palette",transform:Lg},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Lg},backgroundColor:{themeKey:"palette",transform:Lg},p:{style:jr},pt:{style:jr},pr:{style:jr},pb:{style:jr},pl:{style:jr},px:{style:jr},py:{style:jr},padding:{style:jr},paddingTop:{style:jr},paddingRight:{style:jr},paddingBottom:{style:jr},paddingLeft:{style:jr},paddingX:{style:jr},paddingY:{style:jr},paddingInline:{style:jr},paddingInlineStart:{style:jr},paddingInlineEnd:{style:jr},paddingBlock:{style:jr},paddingBlockStart:{style:jr},paddingBlockEnd:{style:jr},m:{style:Gr},mt:{style:Gr},mr:{style:Gr},mb:{style:Gr},ml:{style:Gr},mx:{style:Gr},my:{style:Gr},margin:{style:Gr},marginTop:{style:Gr},marginRight:{style:Gr},marginBottom:{style:Gr},marginLeft:{style:Gr},marginX:{style:Gr},marginY:{style:Gr},marginInline:{style:Gr},marginInlineStart:{style:Gr},marginInlineEnd:{style:Gr},marginBlock:{style:Gr},marginBlockStart:{style:Gr},marginBlockEnd:{style:Gr},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:oE},rowGap:{style:sE},columnGap:{style:aE},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ka},maxWidth:{style:mI},minWidth:{transform:Ka},height:{transform:Ka},maxHeight:{transform:Ka},minHeight:{transform:Ka},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},lE=Wee;function Gee(...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 jee(t,e){return typeof t=="function"?t(e):t}function Xee(){function t(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:f,style:p}=s;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const m=nE(i,c)||{};return p?p(a):Al(a,r,x=>{let _=AS(m,f,x);return x===_&&typeof x=="string"&&(_=AS(m,f,`${n}${x==="default"?"":Qe(x)}`,x)),l===!1?_:{[l]:_}})}function e(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const a=(r=o.unstable_sxConfig)!=null?r:lE;function s(l){let c=l;if(typeof l=="function")c=l(o);else if(typeof l!="object")return l;if(!c)return null;const f=kz(o.breakpoints),p=Object.keys(f);let m=f;return Object.keys(c).forEach(v=>{const x=jee(c[v],o);if(x!=null)if(typeof x=="object")if(a[v])m=Ay(m,t(v,x,o,a));else{const _=Al({theme:o},x,b=>({[v]:b}));Gee(_,x)?m[v]=e({sx:x,theme:o}):m=Ay(m,_)}else m=Ay(m,t(v,x,o,a))}),Nz(p,m)}return Array.isArray(i)?i.map(s):s(i)}return e}const Fz=Xee();Fz.filterProps=["sx"];const cE=Fz,qee=["breakpoints","palette","spacing","shape"];function uE(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,a=ht(t,qee),s=iee(n),l=mee(i);let c=So({breakpoints:s,direction:"ltr",components:{},palette:j({mode:"light"},r),spacing:l,shape:j({},aee,o)},a);return c=e.reduce((f,p)=>So(f,p),c),c.unstable_sxConfig=j({},lE,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(p){return cE({sx:p,theme:this})},c}function Yee(t){return Object.keys(t).length===0}function Uz(t=null){const e=F.useContext(cI);return!e||Yee(e)?t:e}const Kee=uE();function fE(t=Kee){return Uz(t)}function Zee({styles:t,themeId:e,defaultTheme:n={}}){const r=fE(n),i=typeof t=="function"?t(e&&r[e]||r):t;return O.jsx(eee,{styles:i})}const Qee=["sx"],Jee=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:lE;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function gI(t){const{sx:e}=t,n=ht(t,Qee),{systemProps:r,otherProps:i}=Jee(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...a)=>{const s=e(...a);return ou(s)?j({},r,s):r}:o=j({},r,e),j({},i,{sx:o})}function Bz(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;es!=="theme"&&s!=="sx"&&s!=="as"})(cE);return F.forwardRef(function(l,c){const f=fE(n),p=gI(l),{className:m,component:v="div"}=p,x=ht(p,ete);return O.jsx(o,j({as:v,ref:c,className:gt(m,i?i(r):r),theme:e&&f[e]||f},x))})}const nte=["variant"];function s5(t){return t.length===0}function zz(t){const{variant:e}=t,n=ht(t,nte);let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=s5(r)?t[i]:Qe(t[i]):r+=`${s5(r)?i:Qe(i)}${Qe(t[i].toString())}`}),r}const rte=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function ite(t){return Object.keys(t).length===0}function ote(t){return typeof t=="string"&&t.charCodeAt(0)>96}const ate=(t,e)=>e.components&&e.components[t]&&e.components[t].styleOverrides?e.components[t].styleOverrides:null,RS=t=>{const e={};return t&&t.forEach(n=>{const r=zz(n.props);e[r]=n.style}),e},ste=(t,e)=>{let n=[];return e&&e.components&&e.components[t]&&e.components[t].variants&&(n=e.components[t].variants),RS(n)},PS=(t,e,n)=>{const{ownerState:r={}}=t,i=[];return n&&n.forEach(o=>{let a=!0;Object.keys(o.props).forEach(s=>{r[s]!==o.props[s]&&t[s]!==o.props[s]&&(a=!1)}),a&&i.push(e[zz(o.props)])}),i},lte=(t,e,n,r)=>{var i;const o=n==null||(i=n.components)==null||(i=i[r])==null?void 0:i.variants;return PS(t,e,o)};function Ry(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const cte=uE(),ute=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function $w({defaultTheme:t,theme:e,themeId:n}){return ite(e)?t:e[n]||e}function fte(t){return t?(e,n)=>n[t]:null}const l5=({styledArg:t,props:e,defaultTheme:n,themeId:r})=>{const i=t(j({},e,{theme:$w(j({},e,{defaultTheme:n,themeId:r}))}));let o;if(i&&i.variants&&(o=i.variants,delete i.variants),o){const a=PS(e,RS(o),o);return[i,...a]}return i};function $z(t={}){const{themeId:e,defaultTheme:n=cte,rootShouldForwardProp:r=Ry,slotShouldForwardProp:i=Ry}=t,o=a=>cE(j({},a,{theme:$w(j({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{tee(a,C=>C.filter(A=>!(A!=null&&A.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:f,skipSx:p,overridesResolver:m=fte(ute(c))}=s,v=ht(s,rte),x=f!==void 0?f:c&&c!=="Root"&&c!=="root"||!1,_=p||!1;let b,y=Ry;c==="Root"||c==="root"?y=r:c?y=i:ote(a)&&(y=void 0);const S=Oz(a,j({shouldForwardProp:y,label:b},v)),M=(C,...A)=>{const R=A?A.map(N=>{if(typeof N=="function"&&N.__emotion_real!==N)return z=>l5({styledArg:N,props:z,defaultTheme:n,themeId:e});if(ou(N)){let z=N,K;return N&&N.variants&&(K=N.variants,delete z.variants,z=J=>{let G=N;return PS(J,RS(K),K).forEach(ie=>{G=So(G,ie)}),G}),z}return N}):[];let P=C;if(ou(C)){let N;C&&C.variants&&(N=C.variants,delete P.variants,P=z=>{let K=C;return PS(z,RS(N),N).forEach(G=>{K=So(K,G)}),K})}else typeof C=="function"&&C.__emotion_real!==C&&(P=N=>l5({styledArg:C,props:N,defaultTheme:n,themeId:e}));l&&m&&R.push(N=>{const z=$w(j({},N,{defaultTheme:n,themeId:e})),K=ate(l,z);if(K){const J={};return Object.entries(K).forEach(([G,ne])=>{J[G]=typeof ne=="function"?ne(j({},N,{theme:z})):ne}),m(N,J)}return null}),l&&!x&&R.push(N=>{const z=$w(j({},N,{defaultTheme:n,themeId:e}));return lte(N,ste(l,z),z,l)}),_||R.push(o);const U=R.length-A.length;if(Array.isArray(C)&&U>0){const N=new Array(U).fill("");P=[...C,...N],P.raw=[...C.raw,...N]}const k=S(P,...R);return a.muiName&&(k.muiName=a.muiName),k};return S.withConfig&&(M.withConfig=S.withConfig),M}}const dte=$z(),hte=dte;function pte(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:eI(e.components[n].defaultProps,r)}function Hz({props:t,name:e,defaultTheme:n,themeId:r}){let i=fE(n);return r&&(i=i[r]||i),pte({theme:i,name:e,props:t})}function vI(t,e=0,n=1){return Math.min(Math.max(e,t),n)}function mte(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 Yh(t){if(t.type)return t;if(t.charAt(0)==="#")return Yh(mte(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(Kf(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(Kf(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function dE(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 gte(t){t=Yh(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),a=(c,f=(c+n/30)%12)=>i-o*Math.max(Math.min(f-3,9-f,1),-1);let s="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(s+="a",l.push(e[3])),dE({type:s,values:l})}function c5(t){t=Yh(t);let e=t.type==="hsl"||t.type==="hsla"?Yh(gte(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 vte(t,e){const n=c5(t),r=c5(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Ln(t,e){return t=Yh(t),e=vI(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,dE(t)}function Vz(t,e){if(t=Yh(t),e=vI(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 dE(t)}function Wz(t,e){if(t=Yh(t),e=vI(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 dE(t)}const yte=["component","direction","spacing","divider","children","className","useFlexGap"],xte=uE(),bte=hte("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function _te(t){return Hz({props:t,name:"MuiStack",defaultTheme:xte})}function wte(t,e){const n=F.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],Mte=({ownerState:t,theme:e})=>{let n=j({display:"flex",flexDirection:"column"},Al({theme:e},VC({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=pI(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=VC({values:t.direction,base:i}),a=VC({values:t.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,c,f)=>{if(!o[l]){const m=c>0?o[f[c-1]]:"column";o[l]=m}}),n=So(n,Al({theme:e},a,(l,c)=>t.useFlexGap?{gap:qh(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Ste(c?o[c]:t.direction)}`]:qh(r,l)}}))}return n=see(e.breakpoints,n),n};function Gz(t={}){const{createStyledComponent:e=bte,useThemeProps:n=_te,componentName:r="MuiStack"}=t,i=()=>an({root:["root"]},l=>tn(r,l),{}),o=e(Mte);return F.forwardRef(function(l,c){const f=n(l),p=gI(f),{component:m="div",direction:v="column",spacing:x=0,divider:_,children:b,className:y,useFlexGap:S=!1}=p,M=ht(p,yte),C={direction:v,spacing:x,useFlexGap:S},A=i();return O.jsx(o,j({as:m,ownerState:C,ref:c,className:gt(A.root,y)},M,{children:_?wte(b,_):b}))})}const Ete=Gz(),l_=Ete;function Cte(t,e){return j({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}const Tte=["mode","contrastThreshold","tonalOffset"],u5={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:u1.white,default:u1.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}},WC={text:{primary:u1.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:u1.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 f5(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=Wz(t.main,i):e==="dark"&&(t.dark=Vz(t.main,o)))}function Ate(t="light"){return t==="dark"?{main:lm[200],light:lm[50],dark:lm[400]}:{main:lm[700],light:lm[400],dark:lm[800]}}function Rte(t="light"){return t==="dark"?{main:sm[200],light:sm[50],dark:sm[400]}:{main:sm[500],light:sm[300],dark:sm[700]}}function Pte(t="light"){return t==="dark"?{main:am[500],light:am[300],dark:am[700]}:{main:am[700],light:am[400],dark:am[800]}}function Ite(t="light"){return t==="dark"?{main:cm[400],light:cm[300],dark:cm[700]}:{main:cm[700],light:cm[500],dark:cm[900]}}function Lte(t="light"){return t==="dark"?{main:um[400],light:um[300],dark:um[700]}:{main:um[800],light:um[500],dark:um[900]}}function Ote(t="light"){return t==="dark"?{main:Lv[400],light:Lv[300],dark:Lv[700]}:{main:"#ed6c02",light:Lv[500],dark:Lv[900]}}function kte(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=ht(t,Tte),o=t.primary||Ate(e),a=t.secondary||Rte(e),s=t.error||Pte(e),l=t.info||Ite(e),c=t.success||Lte(e),f=t.warning||Ote(e);function p(_){return vte(_,WC.text.primary)>=n?WC.text.primary:u5.text.primary}const m=({color:_,name:b,mainShade:y=500,lightShade:S=300,darkShade:M=700})=>{if(_=j({},_),!_.main&&_[y]&&(_.main=_[y]),!_.hasOwnProperty("main"))throw new Error(Kf(11,b?` (${b})`:"",y));if(typeof _.main!="string")throw new Error(Kf(12,b?` (${b})`:"",JSON.stringify(_.main)));return f5(_,"light",S,r),f5(_,"dark",M,r),_.contrastText||(_.contrastText=p(_.main)),_},v={dark:WC,light:u5};return So(j({common:j({},u1),mode:e,primary:m({color:o,name:"primary"}),secondary:m({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:m({color:s,name:"error"}),warning:m({color:f,name:"warning"}),info:m({color:l,name:"info"}),success:m({color:c,name:"success"}),grey:RQ,contrastThreshold:n,getContrastText:p,augmentColor:m,tonalOffset:r},v[e]),i)}const Nte=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Dte(t){return Math.round(t*1e5)/1e5}const d5={textTransform:"uppercase"},h5='"Roboto", "Helvetica", "Arial", sans-serif';function Fte(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=h5,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:f,pxToRem:p}=n,m=ht(n,Nte),v=i/14,x=p||(y=>`${y/c*v}rem`),_=(y,S,M,C,A)=>j({fontFamily:r,fontWeight:y,fontSize:x(S),lineHeight:M},r===h5?{letterSpacing:`${Dte(C/S)}em`}:{},A,f),b={h1:_(o,96,1.167,-1.5),h2:_(o,60,1.2,-.5),h3:_(a,48,1.167,0),h4:_(a,34,1.235,.25),h5:_(a,24,1.334,0),h6:_(s,20,1.6,.15),subtitle1:_(a,16,1.75,.15),subtitle2:_(s,14,1.57,.1),body1:_(a,16,1.5,.15),body2:_(a,14,1.43,.15),button:_(s,14,1.75,.4,d5),caption:_(a,12,1.66,.4),overline:_(a,12,2.66,1,d5),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return So(j({htmlFontSize:c,pxToRem:x,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},b),m,{clone:!1})}const Ute=.2,Bte=.14,zte=.12;function Sr(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${Ute})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${Bte})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${zte})`].join(",")}const $te=["none",Sr(0,2,1,-1,0,1,1,0,0,1,3,0),Sr(0,3,1,-2,0,2,2,0,0,1,5,0),Sr(0,3,3,-2,0,3,4,0,0,1,8,0),Sr(0,2,4,-1,0,4,5,0,0,1,10,0),Sr(0,3,5,-1,0,5,8,0,0,1,14,0),Sr(0,3,5,-1,0,6,10,0,0,1,18,0),Sr(0,4,5,-2,0,7,10,1,0,2,16,1),Sr(0,5,5,-3,0,8,10,1,0,3,14,2),Sr(0,5,6,-3,0,9,12,1,0,3,16,2),Sr(0,6,6,-3,0,10,14,1,0,4,18,3),Sr(0,6,7,-4,0,11,15,1,0,4,20,3),Sr(0,7,8,-4,0,12,17,2,0,5,22,4),Sr(0,7,8,-4,0,13,19,2,0,5,24,4),Sr(0,7,9,-4,0,14,21,2,0,5,26,4),Sr(0,8,9,-5,0,15,22,2,0,6,28,5),Sr(0,8,10,-5,0,16,24,2,0,6,30,5),Sr(0,8,11,-5,0,17,26,2,0,6,32,5),Sr(0,9,11,-5,0,18,28,2,0,7,34,6),Sr(0,9,12,-6,0,19,29,2,0,7,36,6),Sr(0,10,13,-6,0,20,31,3,0,8,38,7),Sr(0,10,13,-6,0,21,33,3,0,8,40,7),Sr(0,10,14,-6,0,22,35,3,0,8,42,7),Sr(0,11,14,-7,0,23,36,3,0,9,44,8),Sr(0,11,15,-7,0,24,38,3,0,9,46,8)],Hte=$te,Vte=["duration","easing","delay"],Wte={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)"},Gte={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function p5(t){return`${Math.round(t)}ms`}function jte(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function Xte(t){const e=j({},Wte,t.easing),n=j({},Gte,t.duration);return j({getAutoHeightDuration:jte,create:(i=["all"],o={})=>{const{duration:a=n.standard,easing:s=e.easeInOut,delay:l=0}=o;return ht(o,Vte),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof a=="string"?a:p5(a)} ${s} ${typeof l=="string"?l:p5(l)}`).join(",")}},t,{easing:e,duration:n})}const qte={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Yte=qte,Kte=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function jz(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,a=ht(t,Kte);if(t.vars)throw new Error(Kf(18));const s=kte(r),l=uE(t);let c=So(l,{mixins:Cte(l.breakpoints,n),palette:s,shadows:Hte.slice(),typography:Fte(s,o),transitions:Xte(i),zIndex:j({},Yte)});return c=So(c,a),c=e.reduce((f,p)=>So(f,p),c),c.unstable_sxConfig=j({},lE,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(p){return cE({sx:p,theme:this})},c}const Zte=jz(),hE=Zte;function ax(){const t=fE(hE);return t[rx]||t}function ln({props:t,name:e}){return Hz({props:t,name:e,defaultTheme:hE,themeId:rx})}const ao=t=>Ry(t)&&t!=="classes",Qte=Ry,Jte=$z({themeId:rx,defaultTheme:hE,rootShouldForwardProp:ao}),st=Jte,ene=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)},m5=ene;function tne(t){return tn("MuiSvgIcon",t)}Zt("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const nne=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],rne=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${Qe(e)}`,`fontSize${Qe(n)}`]};return an(i,tne,r)},ine=st("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Qe(n.color)}`],e[`fontSize${Qe(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,o,a,s,l,c,f,p,m,v,x;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||(a=o.pxToRem)==null?void 0:a.call(o,20))||"1.25rem",medium:((s=t.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem",large:((c=t.typography)==null||(f=c.pxToRem)==null?void 0:f.call(c,35))||"2.1875rem"}[e.fontSize],color:(p=(m=(t.vars||t).palette)==null||(m=m[e.color])==null?void 0:m.main)!=null?p:{action:(v=(t.vars||t).palette)==null||(v=v.action)==null?void 0:v.active,disabled:(x=(t.vars||t).palette)==null||(x=x.action)==null?void 0:x.disabled,inherit:void 0}[e.color]}}),Xz=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:f=!1,titleAccess:p,viewBox:m="0 0 24 24"}=r,v=ht(r,nne),x=F.isValidElement(i)&&i.type==="svg",_=j({},r,{color:a,component:s,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:f,viewBox:m,hasSvgAsChild:x}),b={};f||(b.viewBox=m);const y=rne(_);return O.jsxs(ine,j({as:s,className:gt(y.root,o),focusable:"false",color:c,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:n},b,v,x&&i.props,{ownerState:_,children:[x?i.props.children:i,p?O.jsx("title",{children:p}):null]}))});Xz.muiName="SvgIcon";const g5=Xz;function Pu(t,e){function n(r,i){return O.jsx(g5,j({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=g5.muiName,F.memo(F.forwardRef(n))}const one={configure:t=>{tI.configure(t)}},ane=Object.freeze(Object.defineProperty({__proto__:null,capitalize:Qe,createChainedFunction:CS,createSvgIcon:Pu,debounce:$M,deprecatedPropType:DQ,isMuiElement:Ty,ownerDocument:Mo,ownerWindow:xc,requirePropFactory:FQ,setRef:f1,unstable_ClassNameGenerator:one,unstable_useEnhancedEffect:Ws,unstable_useId:nx,unsupportedProp:zQ,useControlled:$f,useEventCallback:_l,useForkRef:Ur,useIsFocusVisible:hz},Symbol.toStringTag,{value:"Module"}));function wR(t,e){return wR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},wR(t,e)}function yI(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,wR(t,e)}const v5={disabled:!1},IS=Z.createContext(null);var sne=function(e){return e.scrollTop},cy="unmounted",uh="exited",fh="entering",Bm="entered",SR="exiting",Iu=function(t){yI(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=uh,o.appearStatus=fh):l=Bm:r.unmountOnExit||r.mountOnEnter?l=cy:l=uh,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===cy?{status:uh}: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 a=this.state.status;this.props.in?a!==fh&&a!==Bm&&(o=fh):(a===fh||a===Bm)&&(o=SR)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===fh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:a_.findDOMNode(this);a&&sne(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===uh&&this.setState({status:cy})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[a_.findDOMNode(this),s],c=l[0],f=l[1],p=this.getTimeouts(),m=s?p.appear:p.enter;if(!i&&!a||v5.disabled){this.safeSetState({status:Bm},function(){o.props.onEntered(c)});return}this.props.onEnter(c,f),this.safeSetState({status:fh},function(){o.props.onEntering(c,f),o.onTransitionEnd(m,function(){o.safeSetState({status:Bm},function(){o.props.onEntered(c,f)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:a_.findDOMNode(this);if(!o||v5.disabled){this.safeSetState({status:uh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:SR},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:uh},function(){i.props.onExited(s)})})})},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,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:a_.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],f=l[1];this.props.addEndListener(c,f)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===cy)return null;var o=this.props,a=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 s=ht(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Z.createElement(IS.Provider,{value:null},typeof a=="function"?a(i,s):Z.cloneElement(Z.Children.only(a),s))},e}(Z.Component);Iu.contextType=IS;Iu.propTypes={};function fm(){}Iu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fm,onEntering:fm,onEntered:fm,onExit:fm,onExiting:fm,onExited:fm};Iu.UNMOUNTED=cy;Iu.EXITED=uh;Iu.ENTERING=fh;Iu.ENTERED=Bm;Iu.EXITING=SR;const xI=Iu;function lne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bI(t,e){var n=function(o){return e&&F.isValidElement(o)?e(o):o},r=Object.create(null);return t&&F.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function cne(t,e){t=t||{},e=e||{};function n(f){return f in e?e[f]:t[f]}var r=Object.create(null),i=[];for(var o in t)o in e?i.length&&(r[o]=i,i=[]):i.push(o);var a,s={};for(var l in e){if(r[l])for(a=0;at.scrollTop;function Kg(t,e){var n,r;const{timeout:i,easing:o,style:a={}}=t;return{duration:(n=a.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:a.transitionDelay}}function mne(t){return tn("MuiPaper",t)}Zt("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 gne=["className","component","elevation","square","variant"],vne=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return an(o,mne,i)},yne=st("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 j({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"&&j({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Ln("#fff",m5(e.elevation))}, ${Ln("#fff",m5(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),xne=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiPaper"}),{className:i,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,c=ht(r,gne),f=j({},r,{component:o,elevation:a,square:s,variant:l}),p=vne(f);return O.jsx(yne,j({as:o,ownerState:f,className:gt(p.root,i),ref:n},c))}),lp=xne;function bne(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:c}=t,[f,p]=F.useState(!1),m=gt(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),v={width:a,height:a,top:-(a/2)+o,left:-(a/2)+i},x=gt(n.child,f&&n.childLeaving,r&&n.childPulsate);return!s&&!f&&p(!0),F.useEffect(()=>{if(!s&&l!=null){const _=setTimeout(l,c);return()=>{clearTimeout(_)}}},[l,s,c]),O.jsx("span",{className:m,style:v,children:O.jsx("span",{className:x})})}const _ne=Zt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),ks=_ne,wne=["center","classes","className"];let pE=t=>t,y5,x5,b5,_5;const MR=550,Sne=80,Mne=uI(y5||(y5=pE` - 0% { - transform: scale(0); - opacity: 0.1; - } - - 100% { - transform: scale(1); - opacity: 0.3; - } -`)),Ene=uI(x5||(x5=pE` - 0% { - opacity: 1; - } - - 100% { - opacity: 0; - } -`)),Cne=uI(b5||(b5=pE` - 0% { - transform: scale(1); - } - - 50% { - transform: scale(0.92); - } - - 100% { - transform: scale(1); - } -`)),Tne=st("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Ane=st(bne,{name:"MuiTouchRipple",slot:"Ripple"})(_5||(_5=pE` - 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; - } -`),ks.rippleVisible,Mne,MR,({theme:t})=>t.transitions.easing.easeInOut,ks.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,ks.child,ks.childLeaving,Ene,MR,({theme:t})=>t.transitions.easing.easeInOut,ks.childPulsate,Cne,({theme:t})=>t.transitions.easing.easeInOut),Rne=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:a}=r,s=ht(r,wne),[l,c]=F.useState([]),f=F.useRef(0),p=F.useRef(null);F.useEffect(()=>{p.current&&(p.current(),p.current=null)},[l]);const m=F.useRef(!1),v=F.useRef(0),x=F.useRef(null),_=F.useRef(null);F.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const b=F.useCallback(C=>{const{pulsate:A,rippleX:R,rippleY:P,rippleSize:U,cb:k}=C;c(N=>[...N,O.jsx(Ane,{classes:{ripple:gt(o.ripple,ks.ripple),rippleVisible:gt(o.rippleVisible,ks.rippleVisible),ripplePulsate:gt(o.ripplePulsate,ks.ripplePulsate),child:gt(o.child,ks.child),childLeaving:gt(o.childLeaving,ks.childLeaving),childPulsate:gt(o.childPulsate,ks.childPulsate)},timeout:MR,pulsate:A,rippleX:R,rippleY:P,rippleSize:U},f.current)]),f.current+=1,p.current=k},[o]),y=F.useCallback((C={},A={},R=()=>{})=>{const{pulsate:P=!1,center:U=i||A.pulsate,fakeElement:k=!1}=A;if((C==null?void 0:C.type)==="mousedown"&&m.current){m.current=!1;return}(C==null?void 0:C.type)==="touchstart"&&(m.current=!0);const N=k?null:_.current,z=N?N.getBoundingClientRect():{width:0,height:0,left:0,top:0};let K,J,G;if(U||C===void 0||C.clientX===0&&C.clientY===0||!C.clientX&&!C.touches)K=Math.round(z.width/2),J=Math.round(z.height/2);else{const{clientX:ne,clientY:ie}=C.touches&&C.touches.length>0?C.touches[0]:C;K=Math.round(ne-z.left),J=Math.round(ie-z.top)}if(U)G=Math.sqrt((2*z.width**2+z.height**2)/3),G%2===0&&(G+=1);else{const ne=Math.max(Math.abs((N?N.clientWidth:0)-K),K)*2+2,ie=Math.max(Math.abs((N?N.clientHeight:0)-J),J)*2+2;G=Math.sqrt(ne**2+ie**2)}C!=null&&C.touches?x.current===null&&(x.current=()=>{b({pulsate:P,rippleX:K,rippleY:J,rippleSize:G,cb:R})},v.current=setTimeout(()=>{x.current&&(x.current(),x.current=null)},Sne)):b({pulsate:P,rippleX:K,rippleY:J,rippleSize:G,cb:R})},[i,b]),S=F.useCallback(()=>{y({},{pulsate:!0})},[y]),M=F.useCallback((C,A)=>{if(clearTimeout(v.current),(C==null?void 0:C.type)==="touchend"&&x.current){x.current(),x.current=null,v.current=setTimeout(()=>{M(C,A)});return}x.current=null,c(R=>R.length>0?R.slice(1):R),p.current=A},[]);return F.useImperativeHandle(n,()=>({pulsate:S,start:y,stop:M}),[S,y,M]),O.jsx(Tne,j({className:gt(ks.root,o.root,a),ref:_},s,{children:O.jsx(pne,{component:null,exit:!0,children:l})}))}),Pne=Rne;function Ine(t){return tn("MuiButtonBase",t)}const Lne=Zt("MuiButtonBase",["root","disabled","focusVisible"]),One=Lne,kne=["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"],Nne=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,a=an({root:["root",e&&"disabled",n&&"focusVisible"]},Ine,i);return n&&r&&(a.root+=` ${r}`),a},Dne=st("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"},[`&.${One.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Fne=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:a,className:s,component:l="button",disabled:c=!1,disableRipple:f=!1,disableTouchRipple:p=!1,focusRipple:m=!1,LinkComponent:v="a",onBlur:x,onClick:_,onContextMenu:b,onDragLeave:y,onFocus:S,onFocusVisible:M,onKeyDown:C,onKeyUp:A,onMouseDown:R,onMouseLeave:P,onMouseUp:U,onTouchEnd:k,onTouchMove:N,onTouchStart:z,tabIndex:K=0,TouchRippleProps:J,touchRippleRef:G,type:ne}=r,ie=ht(r,kne),se=F.useRef(null),H=F.useRef(null),Y=Ur(H,G),{isFocusVisibleRef:te,onFocus:Q,onBlur:ae,ref:xe}=hz(),[we,Te]=F.useState(!1);c&&we&&Te(!1),F.useImperativeHandle(i,()=>({focusVisible:()=>{Te(!0),se.current.focus()}}),[]);const[Ve,Ye]=F.useState(!1);F.useEffect(()=>{Ye(!0)},[]);const et=Ve&&!f&&!c;F.useEffect(()=>{we&&m&&!f&&Ve&&H.current.pulsate()},[f,m,we,Ve]);function ct(De,je,at=p){return _l(At=>(je&&je(At),!at&&H.current&&H.current[De](At),!0))}const Lt=ct("start",R),$e=ct("stop",b),oe=ct("stop",y),Ae=ct("stop",U),ge=ct("stop",De=>{we&&De.preventDefault(),P&&P(De)}),ve=ct("start",z),Ue=ct("stop",k),We=ct("stop",N),Je=ct("stop",De=>{ae(De),te.current===!1&&Te(!1),x&&x(De)},!1),ot=_l(De=>{se.current||(se.current=De.currentTarget),Q(De),te.current===!0&&(Te(!0),M&&M(De)),S&&S(De)}),ft=()=>{const De=se.current;return l&&l!=="button"&&!(De.tagName==="A"&&De.href)},lt=F.useRef(!1),Ht=_l(De=>{m&&!lt.current&&we&&H.current&&De.key===" "&&(lt.current=!0,H.current.stop(De,()=>{H.current.start(De)})),De.target===De.currentTarget&&ft()&&De.key===" "&&De.preventDefault(),C&&C(De),De.target===De.currentTarget&&ft()&&De.key==="Enter"&&!c&&(De.preventDefault(),_&&_(De))}),ee=_l(De=>{m&&De.key===" "&&H.current&&we&&!De.defaultPrevented&&(lt.current=!1,H.current.stop(De,()=>{H.current.pulsate(De)})),A&&A(De),_&&De.target===De.currentTarget&&ft()&&De.key===" "&&!De.defaultPrevented&&_(De)});let $=l;$==="button"&&(ie.href||ie.to)&&($=v);const ye={};$==="button"?(ye.type=ne===void 0?"button":ne,ye.disabled=c):(!ie.href&&!ie.to&&(ye.role="button"),c&&(ye["aria-disabled"]=c));const Ge=Ur(n,xe,se),Le=j({},r,{centerRipple:o,component:l,disabled:c,disableRipple:f,disableTouchRipple:p,focusRipple:m,tabIndex:K,focusVisible:we}),Me=Nne(Le);return O.jsxs(Dne,j({as:$,className:gt(Me.root,s),ownerState:Le,onBlur:Je,onClick:_,onContextMenu:$e,onFocus:ot,onKeyDown:Ht,onKeyUp:ee,onMouseDown:Lt,onMouseLeave:ge,onMouseUp:Ae,onDragLeave:oe,onTouchEnd:Ue,onTouchMove:We,onTouchStart:ve,ref:Ge,tabIndex:c?-1:K,type:ne},ye,ie,{children:[a,et?O.jsx(Pne,j({ref:Y,center:o},J)):null]}))}),Kh=Fne;function Une(t){return tn("MuiIconButton",t)}const Bne=Zt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),zne=Bne,$ne=["edge","children","className","color","disabled","disableFocusRipple","size"],Hne=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,a={root:["root",n&&"disabled",r!=="default"&&`color${Qe(r)}`,i&&`edge${Qe(i)}`,`size${Qe(o)}`]};return an(a,Une,e)},Vne=st(Kh,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Qe(n.color)}`],n.edge&&e[`edge${Qe(n.edge)}`],e[`size${Qe(n.size)}`]]}})(({theme:t,ownerState:e})=>j({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Ln(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var n;const r=(n=(t.vars||t).palette)==null?void 0:n[e.color];return j({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&j({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":j({},r&&{backgroundColor:t.vars?`rgba(${r.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Ln(r.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${zne.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),Wne=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:a,color:s="default",disabled:l=!1,disableFocusRipple:c=!1,size:f="medium"}=r,p=ht(r,$ne),m=j({},r,{edge:i,color:s,disabled:l,disableFocusRipple:c,size:f}),v=Hne(m);return O.jsx(Vne,j({className:gt(v.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:n,ownerState:m},p,{children:o}))}),mE=Wne,Gne=Pu(O.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function jne(t){return tn("MuiTypography",t)}Zt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Xne=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],qne=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=t,s={root:["root",o,t.align!=="inherit"&&`align${Qe(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return an(s,jne,a)},Yne=st("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${Qe(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>j({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})),w5={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Kne={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Zne=t=>Kne[t]||t,Qne=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiTypography"}),i=Zne(r.color),o=gI(j({},r,{color:i})),{align:a="inherit",className:s,component:l,gutterBottom:c=!1,noWrap:f=!1,paragraph:p=!1,variant:m="body1",variantMapping:v=w5}=o,x=ht(o,Xne),_=j({},o,{align:a,color:i,className:s,component:l,gutterBottom:c,noWrap:f,paragraph:p,variant:m,variantMapping:v}),b=l||(p?"p":v[m]||w5[m])||"span",y=qne(_);return O.jsx(Yne,j({as:b,ref:n,ownerState:_,className:gt(y.root,s)},x))}),yn=Qne;function Jne(t){return tn("MuiAppBar",t)}Zt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const ere=["className","color","enableColorOnDark","position"],tre=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${Qe(e)}`,`position${Qe(n)}`]};return an(i,Jne,r)},c_=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,nre=st(lp,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Qe(n.position)}`],e[`color${Qe(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return j({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&&j({},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"&&j({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&j({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:c_(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:c_(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:c_(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:c_(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),rre=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:a=!1,position:s="fixed"}=r,l=ht(r,ere),c=j({},r,{color:o,position:s,enableColorOnDark:a}),f=tre(c);return O.jsx(nre,j({square:!0,component:"header",ownerState:c,elevation:4,className:gt(f.root,i,s==="fixed"&&"mui-fixed"),ref:n},l))}),ire=rre;function Zg(t){return typeof t=="string"}function ore(t,e,n){return t===void 0||Zg(t)?e:j({},e,{ownerState:j({},e.ownerState,n)})}const are={disableDefaultClasses:!1},sre=F.createContext(are);function lre(t){const{disableDefaultClasses:e}=F.useContext(sre);return n=>e?"":t(n)}function qz(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 cre(t,e,n){return typeof t=="function"?t(e,n):t}function S5(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 ure(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const v=gt(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),x=j({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),_=j({},n,i,r);return v.length>0&&(_.className=v),Object.keys(x).length>0&&(_.style=x),{props:_,internalRef:void 0}}const a=qz(j({},i,r)),s=S5(r),l=S5(i),c=e(a),f=gt(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),p=j({},c==null?void 0:c.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),m=j({},c,n,l,s);return f.length>0&&(m.className=f),Object.keys(p).length>0&&(m.style=p),{props:m,internalRef:c.ref}}const fre=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Zh(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,a=ht(t,fre),s=o?{}:cre(r,i),{props:l,internalRef:c}=ure(j({},a,{externalSlotProps:s})),f=Ur(c,s==null?void 0:s.ref,(e=t.additionalProps)==null?void 0:e.ref);return ore(n,j({},l,{ref:f}),i)}const dre=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function hre(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 pre(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 mre(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||pre(t))}function gre(t){const e=[],n=[];return Array.from(t.querySelectorAll(dre)).forEach((r,i)=>{const o=hre(r);o===-1||!mre(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 vre(){return!0}function yre(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=gre,isEnabled:a=vre,open:s}=t,l=F.useRef(!1),c=F.useRef(null),f=F.useRef(null),p=F.useRef(null),m=F.useRef(null),v=F.useRef(!1),x=F.useRef(null),_=Ur(e.ref,x),b=F.useRef(null);F.useEffect(()=>{!s||!x.current||(v.current=!n)},[n,s]),F.useEffect(()=>{if(!s||!x.current)return;const M=Mo(x.current);return x.current.contains(M.activeElement)||(x.current.hasAttribute("tabIndex")||x.current.setAttribute("tabIndex","-1"),v.current&&x.current.focus()),()=>{i||(p.current&&p.current.focus&&(l.current=!0,p.current.focus()),p.current=null)}},[s]),F.useEffect(()=>{if(!s||!x.current)return;const M=Mo(x.current),C=P=>{b.current=P,!(r||!a()||P.key!=="Tab")&&M.activeElement===x.current&&P.shiftKey&&(l.current=!0,f.current&&f.current.focus())},A=()=>{const P=x.current;if(P===null)return;if(!M.hasFocus()||!a()||l.current){l.current=!1;return}if(P.contains(M.activeElement)||r&&M.activeElement!==c.current&&M.activeElement!==f.current)return;if(M.activeElement!==m.current)m.current=null;else if(m.current!==null)return;if(!v.current)return;let U=[];if((M.activeElement===c.current||M.activeElement===f.current)&&(U=o(x.current)),U.length>0){var k,N;const z=!!((k=b.current)!=null&&k.shiftKey&&((N=b.current)==null?void 0:N.key)==="Tab"),K=U[0],J=U[U.length-1];typeof K!="string"&&typeof J!="string"&&(z?J.focus():K.focus())}else P.focus()};M.addEventListener("focusin",A),M.addEventListener("keydown",C,!0);const R=setInterval(()=>{M.activeElement&&M.activeElement.tagName==="BODY"&&A()},50);return()=>{clearInterval(R),M.removeEventListener("focusin",A),M.removeEventListener("keydown",C,!0)}},[n,r,i,a,s,o]);const y=M=>{p.current===null&&(p.current=M.relatedTarget),v.current=!0,m.current=M.target;const C=e.props.onFocus;C&&C(M)},S=M=>{p.current===null&&(p.current=M.relatedTarget),v.current=!0};return O.jsxs(F.Fragment,{children:[O.jsx("div",{tabIndex:s?0:-1,onFocus:S,ref:c,"data-testid":"sentinelStart"}),F.cloneElement(e,{ref:_,onFocus:y}),O.jsx("div",{tabIndex:s?0:-1,onFocus:S,ref:f,"data-testid":"sentinelEnd"})]})}var ga="top",Gs="bottom",js="right",va="left",SI="auto",sx=[ga,Gs,js,va],Qg="start",m1="end",xre="clippingParents",Yz="viewport",kv="popper",bre="reference",M5=sx.reduce(function(t,e){return t.concat([e+"-"+Qg,e+"-"+m1])},[]),Kz=[].concat(sx,[SI]).reduce(function(t,e){return t.concat([e,e+"-"+Qg,e+"-"+m1])},[]),_re="beforeRead",wre="read",Sre="afterRead",Mre="beforeMain",Ere="main",Cre="afterMain",Tre="beforeWrite",Are="write",Rre="afterWrite",Pre=[_re,wre,Sre,Mre,Ere,Cre,Tre,Are,Rre];function bc(t){return t?(t.nodeName||"").toLowerCase():null}function ls(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Qh(t){var e=ls(t).Element;return t instanceof e||t instanceof Element}function zs(t){var e=ls(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function MI(t){if(typeof ShadowRoot>"u")return!1;var e=ls(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Ire(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!zs(o)||!bc(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function Lre(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=a.reduce(function(l,c){return l[c]="",l},{});!zs(i)||!bc(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Ore={name:"applyStyles",enabled:!0,phase:"write",fn:Ire,effect:Lre,requires:["computeStyles"]};function fc(t){return t.split("-")[0]}var Lh=Math.max,LS=Math.min,Jg=Math.round;function ER(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Zz(){return!/^((?!chrome|android).)*safari/i.test(ER())}function e0(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&zs(t)&&(i=t.offsetWidth>0&&Jg(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Jg(r.height)/t.offsetHeight||1);var a=Qh(t)?ls(t):window,s=a.visualViewport,l=!Zz()&&n,c=(r.left+(l&&s?s.offsetLeft:0))/i,f=(r.top+(l&&s?s.offsetTop:0))/o,p=r.width/i,m=r.height/o;return{width:p,height:m,top:f,right:c+p,bottom:f+m,left:c,x:c,y:f}}function EI(t){var e=e0(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Qz(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&MI(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function wu(t){return ls(t).getComputedStyle(t)}function kre(t){return["table","td","th"].indexOf(bc(t))>=0}function ld(t){return((Qh(t)?t.ownerDocument:t.document)||window.document).documentElement}function gE(t){return bc(t)==="html"?t:t.assignedSlot||t.parentNode||(MI(t)?t.host:null)||ld(t)}function E5(t){return!zs(t)||wu(t).position==="fixed"?null:t.offsetParent}function Nre(t){var e=/firefox/i.test(ER()),n=/Trident/i.test(ER());if(n&&zs(t)){var r=wu(t);if(r.position==="fixed")return null}var i=gE(t);for(MI(i)&&(i=i.host);zs(i)&&["html","body"].indexOf(bc(i))<0;){var o=wu(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function lx(t){for(var e=ls(t),n=E5(t);n&&kre(n)&&wu(n).position==="static";)n=E5(n);return n&&(bc(n)==="html"||bc(n)==="body"&&wu(n).position==="static")?e:n||Nre(t)||e}function CI(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Py(t,e,n){return Lh(t,LS(e,n))}function Dre(t,e,n){var r=Py(t,e,n);return r>n?n:r}function Jz(){return{top:0,right:0,bottom:0,left:0}}function e$(t){return Object.assign({},Jz(),t)}function t$(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Fre=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,e$(typeof e!="number"?e:t$(e,sx))};function Ure(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=fc(n.placement),l=CI(s),c=[va,js].indexOf(s)>=0,f=c?"height":"width";if(!(!o||!a)){var p=Fre(i.padding,n),m=EI(o),v=l==="y"?ga:va,x=l==="y"?Gs:js,_=n.rects.reference[f]+n.rects.reference[l]-a[l]-n.rects.popper[f],b=a[l]-n.rects.reference[l],y=lx(o),S=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,M=_/2-b/2,C=p[v],A=S-m[f]-p[x],R=S/2-m[f]/2+M,P=Py(C,R,A),U=l;n.modifiersData[r]=(e={},e[U]=P,e.centerOffset=P-R,e)}}function Bre(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Qz(e.elements.popper,i)&&(e.elements.arrow=i))}const zre={name:"arrow",enabled:!0,phase:"main",fn:Ure,effect:Bre,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function t0(t){return t.split("-")[1]}var $re={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Hre(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Jg(n*i)/i||0,y:Jg(r*i)/i||0}}function C5(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,a=t.offsets,s=t.position,l=t.gpuAcceleration,c=t.adaptive,f=t.roundOffsets,p=t.isFixed,m=a.x,v=m===void 0?0:m,x=a.y,_=x===void 0?0:x,b=typeof f=="function"?f({x:v,y:_}):{x:v,y:_};v=b.x,_=b.y;var y=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),M=va,C=ga,A=window;if(c){var R=lx(n),P="clientHeight",U="clientWidth";if(R===ls(n)&&(R=ld(n),wu(R).position!=="static"&&s==="absolute"&&(P="scrollHeight",U="scrollWidth")),R=R,i===ga||(i===va||i===js)&&o===m1){C=Gs;var k=p&&R===A&&A.visualViewport?A.visualViewport.height:R[P];_-=k-r.height,_*=l?1:-1}if(i===va||(i===ga||i===Gs)&&o===m1){M=js;var N=p&&R===A&&A.visualViewport?A.visualViewport.width:R[U];v-=N-r.width,v*=l?1:-1}}var z=Object.assign({position:s},c&&$re),K=f===!0?Hre({x:v,y:_},ls(n)):{x:v,y:_};if(v=K.x,_=K.y,l){var J;return Object.assign({},z,(J={},J[C]=S?"0":"",J[M]=y?"0":"",J.transform=(A.devicePixelRatio||1)<=1?"translate("+v+"px, "+_+"px)":"translate3d("+v+"px, "+_+"px, 0)",J))}return Object.assign({},z,(e={},e[C]=S?_+"px":"",e[M]=y?v+"px":"",e.transform="",e))}function Vre(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,c={placement:fc(e.placement),variation:t0(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,C5(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,C5(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Wre={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Vre,data:{}};var u_={passive:!0};function Gre(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=ls(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(f){f.addEventListener("scroll",n.update,u_)}),s&&l.addEventListener("resize",n.update,u_),function(){o&&c.forEach(function(f){f.removeEventListener("scroll",n.update,u_)}),s&&l.removeEventListener("resize",n.update,u_)}}const jre={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Gre,data:{}};var Xre={left:"right",right:"left",bottom:"top",top:"bottom"};function Hw(t){return t.replace(/left|right|bottom|top/g,function(e){return Xre[e]})}var qre={start:"end",end:"start"};function T5(t){return t.replace(/start|end/g,function(e){return qre[e]})}function TI(t){var e=ls(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function AI(t){return e0(ld(t)).left+TI(t).scrollLeft}function Yre(t,e){var n=ls(t),r=ld(t),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=Zz();(c||!c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+AI(t),y:l}}function Kre(t){var e,n=ld(t),r=TI(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Lh(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Lh(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+AI(t),l=-r.scrollTop;return wu(i||n).direction==="rtl"&&(s+=Lh(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function RI(t){var e=wu(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function n$(t){return["html","body","#document"].indexOf(bc(t))>=0?t.ownerDocument.body:zs(t)&&RI(t)?t:n$(gE(t))}function Iy(t,e){var n;e===void 0&&(e=[]);var r=n$(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=ls(r),a=i?[o].concat(o.visualViewport||[],RI(r)?r:[]):r,s=e.concat(a);return i?s:s.concat(Iy(gE(a)))}function CR(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Zre(t,e){var n=e0(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function A5(t,e,n){return e===Yz?CR(Yre(t,n)):Qh(e)?Zre(e,n):CR(Kre(ld(t)))}function Qre(t){var e=Iy(gE(t)),n=["absolute","fixed"].indexOf(wu(t).position)>=0,r=n&&zs(t)?lx(t):t;return Qh(r)?e.filter(function(i){return Qh(i)&&Qz(i,r)&&bc(i)!=="body"}):[]}function Jre(t,e,n,r){var i=e==="clippingParents"?Qre(t):[].concat(e),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,c){var f=A5(t,c,r);return l.top=Lh(f.top,l.top),l.right=LS(f.right,l.right),l.bottom=LS(f.bottom,l.bottom),l.left=Lh(f.left,l.left),l},A5(t,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function r$(t){var e=t.reference,n=t.element,r=t.placement,i=r?fc(r):null,o=r?t0(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,l;switch(i){case ga:l={x:a,y:e.y-n.height};break;case Gs:l={x:a,y:e.y+e.height};break;case js:l={x:e.x+e.width,y:s};break;case va:l={x:e.x-n.width,y:s};break;default:l={x:e.x,y:e.y}}var c=i?CI(i):null;if(c!=null){var f=c==="y"?"height":"width";switch(o){case Qg:l[c]=l[c]-(e[f]/2-n[f]/2);break;case m1:l[c]=l[c]+(e[f]/2-n[f]/2);break}}return l}function g1(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,a=o===void 0?t.strategy:o,s=n.boundary,l=s===void 0?xre:s,c=n.rootBoundary,f=c===void 0?Yz:c,p=n.elementContext,m=p===void 0?kv:p,v=n.altBoundary,x=v===void 0?!1:v,_=n.padding,b=_===void 0?0:_,y=e$(typeof b!="number"?b:t$(b,sx)),S=m===kv?bre:kv,M=t.rects.popper,C=t.elements[x?S:m],A=Jre(Qh(C)?C:C.contextElement||ld(t.elements.popper),l,f,a),R=e0(t.elements.reference),P=r$({reference:R,element:M,strategy:"absolute",placement:i}),U=CR(Object.assign({},M,P)),k=m===kv?U:R,N={top:A.top-k.top+y.top,bottom:k.bottom-A.bottom+y.bottom,left:A.left-k.left+y.left,right:k.right-A.right+y.right},z=t.modifiersData.offset;if(m===kv&&z){var K=z[i];Object.keys(N).forEach(function(J){var G=[js,Gs].indexOf(J)>=0?1:-1,ne=[ga,Gs].indexOf(J)>=0?"y":"x";N[J]+=K[ne]*G})}return N}function eie(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?Kz:l,f=t0(r),p=f?s?M5:M5.filter(function(x){return t0(x)===f}):sx,m=p.filter(function(x){return c.indexOf(x)>=0});m.length===0&&(m=p);var v=m.reduce(function(x,_){return x[_]=g1(t,{placement:_,boundary:i,rootBoundary:o,padding:a})[fc(_)],x},{});return Object.keys(v).sort(function(x,_){return v[x]-v[_]})}function tie(t){if(fc(t)===SI)return[];var e=Hw(t);return[T5(t),e,T5(e)]}function nie(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,c=n.padding,f=n.boundary,p=n.rootBoundary,m=n.altBoundary,v=n.flipVariations,x=v===void 0?!0:v,_=n.allowedAutoPlacements,b=e.options.placement,y=fc(b),S=y===b,M=l||(S||!x?[Hw(b)]:tie(b)),C=[b].concat(M).reduce(function(we,Te){return we.concat(fc(Te)===SI?eie(e,{placement:Te,boundary:f,rootBoundary:p,padding:c,flipVariations:x,allowedAutoPlacements:_}):Te)},[]),A=e.rects.reference,R=e.rects.popper,P=new Map,U=!0,k=C[0],N=0;N=0,ne=G?"width":"height",ie=g1(e,{placement:z,boundary:f,rootBoundary:p,altBoundary:m,padding:c}),se=G?J?js:va:J?Gs:ga;A[ne]>R[ne]&&(se=Hw(se));var H=Hw(se),Y=[];if(o&&Y.push(ie[K]<=0),s&&Y.push(ie[se]<=0,ie[H]<=0),Y.every(function(we){return we})){k=z,U=!1;break}P.set(z,Y)}if(U)for(var te=x?3:1,Q=function(Te){var Ve=C.find(function(Ye){var et=P.get(Ye);if(et)return et.slice(0,Te).every(function(ct){return ct})});if(Ve)return k=Ve,"break"},ae=te;ae>0;ae--){var xe=Q(ae);if(xe==="break")break}e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}}const rie={name:"flip",enabled:!0,phase:"main",fn:nie,requiresIfExists:["offset"],data:{_skip:!1}};function R5(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function P5(t){return[ga,js,Gs,va].some(function(e){return t[e]>=0})}function iie(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=g1(e,{elementContext:"reference"}),s=g1(e,{altBoundary:!0}),l=R5(a,r),c=R5(s,i,o),f=P5(l),p=P5(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}const oie={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iie};function aie(t,e,n){var r=fc(t),i=[va,ga].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[va,js].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function sie(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,a=Kz.reduce(function(f,p){return f[p]=aie(p,e.rects,o),f},{}),s=a[e.placement],l=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a}const lie={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:sie};function cie(t){var e=t.state,n=t.name;e.modifiersData[n]=r$({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const uie={name:"popperOffsets",enabled:!0,phase:"read",fn:cie,data:{}};function fie(t){return t==="x"?"y":"x"}function die(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,c=n.rootBoundary,f=n.altBoundary,p=n.padding,m=n.tether,v=m===void 0?!0:m,x=n.tetherOffset,_=x===void 0?0:x,b=g1(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:f}),y=fc(e.placement),S=t0(e.placement),M=!S,C=CI(y),A=fie(C),R=e.modifiersData.popperOffsets,P=e.rects.reference,U=e.rects.popper,k=typeof _=="function"?_(Object.assign({},e.rects,{placement:e.placement})):_,N=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,K={x:0,y:0};if(R){if(o){var J,G=C==="y"?ga:va,ne=C==="y"?Gs:js,ie=C==="y"?"height":"width",se=R[C],H=se+b[G],Y=se-b[ne],te=v?-U[ie]/2:0,Q=S===Qg?P[ie]:U[ie],ae=S===Qg?-U[ie]:-P[ie],xe=e.elements.arrow,we=v&&xe?EI(xe):{width:0,height:0},Te=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Jz(),Ve=Te[G],Ye=Te[ne],et=Py(0,P[ie],we[ie]),ct=M?P[ie]/2-te-et-Ve-N.mainAxis:Q-et-Ve-N.mainAxis,Lt=M?-P[ie]/2+te+et+Ye+N.mainAxis:ae+et+Ye+N.mainAxis,$e=e.elements.arrow&&lx(e.elements.arrow),oe=$e?C==="y"?$e.clientTop||0:$e.clientLeft||0:0,Ae=(J=z==null?void 0:z[C])!=null?J:0,ge=se+ct-Ae-oe,ve=se+Lt-Ae,Ue=Py(v?LS(H,ge):H,se,v?Lh(Y,ve):Y);R[C]=Ue,K[C]=Ue-se}if(s){var We,Je=C==="x"?ga:va,ot=C==="x"?Gs:js,ft=R[A],lt=A==="y"?"height":"width",Ht=ft+b[Je],ee=ft-b[ot],$=[ga,va].indexOf(y)!==-1,ye=(We=z==null?void 0:z[A])!=null?We:0,Ge=$?Ht:ft-P[lt]-U[lt]-ye+N.altAxis,Le=$?ft+P[lt]+U[lt]-ye-N.altAxis:ee,Me=v&&$?Dre(Ge,ft,Le):Py(v?Ge:Ht,ft,v?Le:ee);R[A]=Me,K[A]=Me-ft}e.modifiersData[r]=K}}const hie={name:"preventOverflow",enabled:!0,phase:"main",fn:die,requiresIfExists:["offset"]};function pie(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function mie(t){return t===ls(t)||!zs(t)?TI(t):pie(t)}function gie(t){var e=t.getBoundingClientRect(),n=Jg(e.width)/t.offsetWidth||1,r=Jg(e.height)/t.offsetHeight||1;return n!==1||r!==1}function vie(t,e,n){n===void 0&&(n=!1);var r=zs(e),i=zs(e)&&gie(e),o=ld(e),a=e0(t,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((bc(e)!=="body"||RI(o))&&(s=mie(e)),zs(e)?(l=e0(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=AI(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function yie(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=e.get(s);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function xie(t){var e=yie(t);return Pre.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function bie(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function _ie(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var I5={placement:"bottom",modifiers:[],strategy:"absolute"};function L5(){for(var t=arguments.length,e=new Array(t),n=0;n{o||s(Eie(i)||document.body)},[i,o]),Ws(()=>{if(a&&!o)return f1(n,a),()=>{f1(n,null)}},[n,a,o]),o){if(F.isValidElement(r)){const c={ref:l};return F.cloneElement(r,c)}return O.jsx(F.Fragment,{children:r})}return O.jsx(F.Fragment,{children:a&&sd.createPortal(r,a)})});function Cie(t){return tn("MuiPopper",t)}Zt("MuiPopper",["root"]);const Tie=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],Aie=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function Rie(t,e){if(e==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function TR(t){return typeof t=="function"?t():t}function Pie(t){return t.nodeType!==void 0}const Iie=()=>an({root:["root"]},lre(Cie)),Lie={},Oie=F.forwardRef(function(e,n){var r;const{anchorEl:i,children:o,direction:a,disablePortal:s,modifiers:l,open:c,placement:f,popperOptions:p,popperRef:m,slotProps:v={},slots:x={},TransitionProps:_}=e,b=ht(e,Tie),y=F.useRef(null),S=Ur(y,n),M=F.useRef(null),C=Ur(M,m),A=F.useRef(C);Ws(()=>{A.current=C},[C]),F.useImperativeHandle(m,()=>M.current,[]);const R=Rie(f,a),[P,U]=F.useState(R),[k,N]=F.useState(TR(i));F.useEffect(()=>{M.current&&M.current.forceUpdate()}),F.useEffect(()=>{i&&N(TR(i))},[i]),Ws(()=>{if(!k||!c)return;const ne=H=>{U(H.placement)};let ie=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:H})=>{ne(H)}}];l!=null&&(ie=ie.concat(l)),p&&p.modifiers!=null&&(ie=ie.concat(p.modifiers));const se=Mie(k,y.current,j({placement:R},p,{modifiers:ie}));return A.current(se),()=>{se.destroy(),A.current(null)}},[k,s,l,c,p,R]);const z={placement:P};_!==null&&(z.TransitionProps=_);const K=Iie(),J=(r=x.root)!=null?r:"div",G=Zh({elementType:J,externalSlotProps:v.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:S},ownerState:e,className:K.root});return O.jsx(J,j({},G,{children:typeof o=="function"?o(z):o}))}),kie=F.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:c,open:f,placement:p="bottom",popperOptions:m=Lie,popperRef:v,style:x,transition:_=!1,slotProps:b={},slots:y={}}=e,S=ht(e,Aie),[M,C]=F.useState(!0),A=()=>{C(!1)},R=()=>{C(!0)};if(!l&&!f&&(!_||M))return null;let P;if(o)P=o;else if(r){const N=TR(r);P=N&&Pie(N)?Mo(N).body:Mo(null).body}const U=!f&&l&&(!_||M)?"none":void 0,k=_?{in:f,onEnter:A,onExited:R}:void 0;return O.jsx(i$,{disablePortal:s,container:P,children:O.jsx(Oie,j({anchorEl:r,direction:a,disablePortal:s,modifiers:c,ref:n,open:_?!M:f,placement:p,popperOptions:m,popperRef:v,slotProps:b,slots:y},S,{style:j({position:"fixed",top:0,left:0,display:U},x),TransitionProps:k,children:i}))})});function Nie(t){const e=Mo(t);return e.body===t?xc(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Ly(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function O5(t){return parseInt(xc(t).getComputedStyle(t).paddingRight,10)||0}function Die(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 k5(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,a=>{const s=o.indexOf(a)===-1,l=!Die(a);s&&l&&Ly(a,i)})}function GC(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function Fie(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(Nie(r)){const a=pz(Mo(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${O5(r)+a}px`;const s=Mo(r).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${O5(l)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=Mo(r).body;else{const a=r.parentElement,s=xc(r);o=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a: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:a,property:s})=>{o?a.style.setProperty(s,o):a.style.removeProperty(s)})}}function Uie(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class Bie{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&&Ly(e.modalRef,!1);const i=Uie(n);k5(n,e.mount,e.modalRef,i,!0);const o=GC(this.containers,a=>a.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=GC(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=Fie(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=GC(this.containers,a=>a.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&&Ly(e.modalRef,n),k5(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const a=o.modals[o.modals.length-1];a.modalRef&&Ly(a.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function zie(t){return typeof t=="function"?t():t}function $ie(t){return t?t.props.hasOwnProperty("in"):!1}const Hie=new Bie;function Vie(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=Hie,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:f,rootRef:p}=t,m=F.useRef({}),v=F.useRef(null),x=F.useRef(null),_=Ur(x,p),[b,y]=F.useState(!f),S=$ie(l);let M=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(M=!1);const C=()=>Mo(v.current),A=()=>(m.current.modalRef=x.current,m.current.mount=v.current,m.current),R=()=>{i.mount(A(),{disableScrollLock:r}),x.current&&(x.current.scrollTop=0)},P=_l(()=>{const ie=zie(e)||C().body;i.add(A(),ie),x.current&&R()}),U=F.useCallback(()=>i.isTopModal(A()),[i]),k=_l(ie=>{v.current=ie,ie&&(f&&U()?R():x.current&&Ly(x.current,M))}),N=F.useCallback(()=>{i.remove(A(),M)},[M,i]);F.useEffect(()=>()=>{N()},[N]),F.useEffect(()=>{f?P():(!S||!o)&&N()},[f,N,S,o,P]);const z=ie=>se=>{var H;(H=ie.onKeyDown)==null||H.call(ie,se),!(se.key!=="Escape"||se.which===229||!U())&&(n||(se.stopPropagation(),c&&c(se,"escapeKeyDown")))},K=ie=>se=>{var H;(H=ie.onClick)==null||H.call(ie,se),se.target===se.currentTarget&&c&&c(se,"backdropClick")};return{getRootProps:(ie={})=>{const se=qz(t);delete se.onTransitionEnter,delete se.onTransitionExited;const H=j({},se,ie);return j({role:"presentation"},H,{onKeyDown:z(H),ref:_})},getBackdropProps:(ie={})=>{const se=ie;return j({"aria-hidden":!0},se,{onClick:K(se),open:f})},getTransitionProps:()=>{const ie=()=>{y(!1),a&&a()},se=()=>{y(!0),s&&s(),o&&N()};return{onEnter:CS(ie,l==null?void 0:l.props.onEnter),onExited:CS(se,l==null?void 0:l.props.onExited)}},rootRef:_,portalRef:k,isTopModal:U,exited:b,hasTransition:S}}const Wie=["onChange","maxRows","minRows","style","value"];function f_(t){return parseInt(t,10)||0}const Gie={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function N5(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflow}const jie=F.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:a,value:s}=e,l=ht(e,Wie),{current:c}=F.useRef(s!=null),f=F.useRef(null),p=Ur(n,f),m=F.useRef(null),v=F.useRef(0),[x,_]=F.useState({outerHeightStyle:0}),b=F.useCallback(()=>{const C=f.current,R=xc(C).getComputedStyle(C);if(R.width==="0px")return{outerHeightStyle:0};const P=m.current;P.style.width=R.width,P.value=C.value||e.placeholder||"x",P.value.slice(-1)===` -`&&(P.value+=" ");const U=R.boxSizing,k=f_(R.paddingBottom)+f_(R.paddingTop),N=f_(R.borderBottomWidth)+f_(R.borderTopWidth),z=P.scrollHeight;P.value="x";const K=P.scrollHeight;let J=z;o&&(J=Math.max(Number(o)*K,J)),i&&(J=Math.min(Number(i)*K,J)),J=Math.max(J,K);const G=J+(U==="border-box"?k+N:0),ne=Math.abs(J-z)<=1;return{outerHeightStyle:G,overflow:ne}},[i,o,e.placeholder]),y=(C,A)=>{const{outerHeightStyle:R,overflow:P}=A;return v.current<20&&(R>0&&Math.abs((C.outerHeightStyle||0)-R)>1||C.overflow!==P)?(v.current+=1,{overflow:P,outerHeightStyle:R}):C},S=F.useCallback(()=>{const C=b();N5(C)||_(A=>y(A,C))},[b]);Ws(()=>{const C=()=>{const z=b();N5(z)||sd.flushSync(()=>{_(K=>y(K,z))})},A=()=>{v.current=0,C()};let R;const P=$M(A),U=f.current,k=xc(U);k.addEventListener("resize",P);let N;return typeof ResizeObserver<"u"&&(N=new ResizeObserver(A),N.observe(U)),()=>{P.clear(),cancelAnimationFrame(R),k.removeEventListener("resize",P),N&&N.disconnect()}},[b]),Ws(()=>{S()}),F.useEffect(()=>{v.current=0},[s]);const M=C=>{v.current=0,c||S(),r&&r(C)};return O.jsxs(F.Fragment,{children:[O.jsx("textarea",j({value:s,onChange:M,ref:p,rows:o,style:j({height:x.outerHeightStyle,overflow:x.overflow?"hidden":void 0},a)},l)),O.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:m,tabIndex:-1,style:j({},Gie.shadow,a,{paddingTop:0,paddingBottom:0})})]})});function D5(t){return typeof t.normalize<"u"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t}function Xie(t={}){const{ignoreAccents:e=!0,ignoreCase:n=!0,limit:r,matchFrom:i="any",stringify:o,trim:a=!1}=t;return(s,{inputValue:l,getOptionLabel:c})=>{let f=a?l.trim():l;n&&(f=f.toLowerCase()),e&&(f=D5(f));const p=f?s.filter(m=>{let v=(o||c)(m);return n&&(v=v.toLowerCase()),e&&(v=D5(v)),i==="start"?v.indexOf(f)===0:v.indexOf(f)>-1}):s;return typeof r=="number"?p.slice(0,r):p}}function jC(t,e){for(let n=0;n{var e;return t.current!==null&&((e=t.current.parentElement)==null?void 0:e.contains(document.activeElement))};function Kie(t){const{unstable_isActiveElementInListbox:e=Yie,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:i=!1,autoSelect:o=!1,blurOnSelect:a=!1,clearOnBlur:s=!t.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:f=t.multiple?[]:null,disableClearable:p=!1,disableCloseOnSelect:m=!1,disabled:v,disabledItemsFocusable:x=!1,disableListWrap:_=!1,filterOptions:b=qie,filterSelectedOptions:y=!1,freeSolo:S=!1,getOptionDisabled:M,getOptionLabel:C=Fe=>{var Ie;return(Ie=Fe.label)!=null?Ie:Fe},groupBy:A,handleHomeEndKeys:R=!t.freeSolo,id:P,includeInputInList:U=!1,inputValue:k,isOptionEqualToValue:N=(Fe,Ie)=>Fe===Ie,multiple:z=!1,onChange:K,onClose:J,onHighlightChange:G,onInputChange:ne,onOpen:ie,open:se,openOnFocus:H=!1,options:Y,readOnly:te=!1,selectOnFocus:Q=!t.freeSolo,value:ae}=t,xe=nx(P);let we=C;we=Fe=>{const Ie=C(Fe);return typeof Ie!="string"?String(Ie):Ie};const Te=F.useRef(!1),Ve=F.useRef(!0),Ye=F.useRef(null),et=F.useRef(null),[ct,Lt]=F.useState(null),[$e,oe]=F.useState(-1),Ae=i?0:-1,ge=F.useRef(Ae),[ve,Ue]=$f({controlled:ae,default:f,name:c}),[We,Je]=$f({controlled:k,default:"",name:c,state:"inputValue"}),[ot,ft]=F.useState(!1),lt=F.useCallback((Fe,Ie)=>{if(!(z?ve.length!(y&&(z?ve:[ve]).some(Ie=>Ie!==null&&N(Fe,Ie)))),{inputValue:Ge&&$?"":We,getOptionLabel:we}):[],De=qQ({filteredOptions:Me,value:ve,inputValue:We});F.useEffect(()=>{const Fe=ve!==De.value;ot&&!Fe||S&&!Fe||lt(null,ve)},[ve,lt,ot,De.value,S]);const je=Ht&&Me.length>0&&!te,at=_l(Fe=>{Fe===-1?Ye.current.focus():ct.querySelector(`[data-tag-index="${Fe}"]`).focus()});F.useEffect(()=>{z&&$e>ve.length-1&&(oe(-1),at(-1))},[ve,z,$e,at]);function At(Fe,Ie){if(!et.current||Fe<0||Fe>=Me.length)return-1;let Ke=Fe;for(;;){const V=et.current.querySelector(`[data-option-index="${Ke}"]`),fe=x?!1:!V||V.disabled||V.getAttribute("aria-disabled")==="true";if(V&&V.hasAttribute("tabindex")&&!fe)return Ke;if(Ie==="next"?Ke=(Ke+1)%Me.length:Ke=(Ke-1+Me.length)%Me.length,Ke===Fe)return-1}}const Ze=_l(({event:Fe,index:Ie,reason:Ke="auto"})=>{if(ge.current=Ie,Ie===-1?Ye.current.removeAttribute("aria-activedescendant"):Ye.current.setAttribute("aria-activedescendant",`${xe}-option-${Ie}`),G&&G(Fe,Ie===-1?null:Me[Ie],Ke),!et.current)return;const V=et.current.querySelector(`[role="option"].${n}-focused`);V&&(V.classList.remove(`${n}-focused`),V.classList.remove(`${n}-focusVisible`));let fe=et.current;if(et.current.getAttribute("role")!=="listbox"&&(fe=et.current.parentElement.querySelector('[role="listbox"]')),!fe)return;if(Ie===-1){fe.scrollTop=0;return}const be=et.current.querySelector(`[data-option-index="${Ie}"]`);if(be&&(be.classList.add(`${n}-focused`),Ke==="keyboard"&&be.classList.add(`${n}-focusVisible`),fe.scrollHeight>fe.clientHeight&&Ke!=="mouse"&&Ke!=="touch")){const Se=be,Ee=fe.clientHeight+fe.scrollTop,yt=Se.offsetTop+Se.offsetHeight;yt>Ee?fe.scrollTop=yt-fe.clientHeight:Se.offsetTop-Se.offsetHeight*(A?1.3:0){if(!Le)return;const be=At((()=>{const Se=Me.length-1;if(Ie==="reset")return Ae;if(Ie==="start")return 0;if(Ie==="end")return Se;const Ee=ge.current+Ie;return Ee<0?Ee===-1&&U?-1:_&&ge.current!==-1||Math.abs(Ie)>1?0:Se:Ee>Se?Ee===Se+1&&U?-1:_||Math.abs(Ie)>1?Se:0:Ee})(),Ke);if(Ze({index:be,reason:V,event:Fe}),r&&Ie!=="reset")if(be===-1)Ye.current.value=We;else{const Se=we(Me[be]);Ye.current.value=Se,Se.toLowerCase().indexOf(We.toLowerCase())===0&&We.length>0&&Ye.current.setSelectionRange(We.length,Se.length)}}),Ut=()=>{const Fe=(Ie,Ke)=>{const V=Ie?we(Ie):"",fe=Ke?we(Ke):"";return V===fe};if(ge.current!==-1&&De.filteredOptions&&De.filteredOptions.length!==Me.length&&De.inputValue===We&&(z?ve.length===De.value.length&&De.value.every((Ie,Ke)=>we(ve[Ke])===we(Ie)):Fe(De.value,ve))){const Ie=De.filteredOptions[ge.current];if(Ie&&Me.some(V=>we(V)===we(Ie)))return!0}return!1},Et=F.useCallback(()=>{if(!Le||Ut())return;const Fe=z?ve[0]:ve;if(Me.length===0||Fe==null){Oe({diff:"reset"});return}if(et.current){if(Fe!=null){const Ie=Me[ge.current];if(z&&Ie&&jC(ve,V=>N(Ie,V))!==-1)return;const Ke=jC(Me,V=>N(V,Fe));Ke===-1?Oe({diff:"reset"}):Ze({index:Ke});return}if(ge.current>=Me.length-1){Ze({index:Me.length-1});return}Ze({index:ge.current})}},[Me.length,z?!1:ve,y,Oe,Ze,Le,We,z]),Nt=_l(Fe=>{f1(et,Fe),Fe&&Et()});F.useEffect(()=>{Et()},[Et]);const Ct=Fe=>{Ht||(ee(!0),ye(!0),ie&&ie(Fe))},dt=(Fe,Ie)=>{Ht&&(ee(!1),J&&J(Fe,Ie))},Qt=(Fe,Ie,Ke,V)=>{if(z){if(ve.length===Ie.length&&ve.every((fe,be)=>fe===Ie[be]))return}else if(ve===Ie)return;K&&K(Fe,Ie,Ke,V),Ue(Ie)},de=F.useRef(!1),ut=(Fe,Ie,Ke="selectOption",V="options")=>{let fe=Ke,be=Ie;if(z){be=Array.isArray(ve)?ve.slice():[];const Se=jC(be,Ee=>N(Ie,Ee));Se===-1?be.push(Ie):V!=="freeSolo"&&(be.splice(Se,1),fe="removeOption")}lt(Fe,be),Qt(Fe,be,fe,{option:Ie}),!m&&(!Fe||!Fe.ctrlKey&&!Fe.metaKey)&&dt(Fe,fe),(a===!0||a==="touch"&&de.current||a==="mouse"&&!de.current)&&Ye.current.blur()};function rt(Fe,Ie){if(Fe===-1)return-1;let Ke=Fe;for(;;){if(Ie==="next"&&Ke===ve.length||Ie==="previous"&&Ke===-1)return-1;const V=ct.querySelector(`[data-tag-index="${Ke}"]`);if(!V||!V.hasAttribute("tabindex")||V.disabled||V.getAttribute("aria-disabled")==="true")Ke+=Ie==="next"?1:-1;else return Ke}}const Ne=(Fe,Ie)=>{if(!z)return;We===""&&dt(Fe,"toggleInput");let Ke=$e;$e===-1?We===""&&Ie==="previous"&&(Ke=ve.length-1):(Ke+=Ie==="next"?1:-1,Ke<0&&(Ke=0),Ke===ve.length&&(Ke=-1)),Ke=rt(Ke,Ie),oe(Ke),at(Ke)},it=Fe=>{Te.current=!0,Je(""),ne&&ne(Fe,"","clear"),Qt(Fe,z?[]:null,"clear")},Bt=Fe=>Ie=>{if(Fe.onKeyDown&&Fe.onKeyDown(Ie),!Ie.defaultMuiPrevented&&($e!==-1&&["ArrowLeft","ArrowRight"].indexOf(Ie.key)===-1&&(oe(-1),at(-1)),Ie.which!==229))switch(Ie.key){case"Home":Le&&R&&(Ie.preventDefault(),Oe({diff:"start",direction:"next",reason:"keyboard",event:Ie}));break;case"End":Le&&R&&(Ie.preventDefault(),Oe({diff:"end",direction:"previous",reason:"keyboard",event:Ie}));break;case"PageUp":Ie.preventDefault(),Oe({diff:-F5,direction:"previous",reason:"keyboard",event:Ie}),Ct(Ie);break;case"PageDown":Ie.preventDefault(),Oe({diff:F5,direction:"next",reason:"keyboard",event:Ie}),Ct(Ie);break;case"ArrowDown":Ie.preventDefault(),Oe({diff:1,direction:"next",reason:"keyboard",event:Ie}),Ct(Ie);break;case"ArrowUp":Ie.preventDefault(),Oe({diff:-1,direction:"previous",reason:"keyboard",event:Ie}),Ct(Ie);break;case"ArrowLeft":Ne(Ie,"previous");break;case"ArrowRight":Ne(Ie,"next");break;case"Enter":if(ge.current!==-1&&Le){const Ke=Me[ge.current],V=M?M(Ke):!1;if(Ie.preventDefault(),V)return;ut(Ie,Ke,"selectOption"),r&&Ye.current.setSelectionRange(Ye.current.value.length,Ye.current.value.length)}else S&&We!==""&&Ge===!1&&(z&&Ie.preventDefault(),ut(Ie,We,"createOption","freeSolo"));break;case"Escape":Le?(Ie.preventDefault(),Ie.stopPropagation(),dt(Ie,"escape")):l&&(We!==""||z&&ve.length>0)&&(Ie.preventDefault(),Ie.stopPropagation(),it(Ie));break;case"Backspace":if(z&&!te&&We===""&&ve.length>0){const Ke=$e===-1?ve.length-1:$e,V=ve.slice();V.splice(Ke,1),Qt(Ie,V,"removeOption",{option:ve[Ke]})}break;case"Delete":if(z&&!te&&We===""&&ve.length>0&&$e!==-1){const Ke=$e,V=ve.slice();V.splice(Ke,1),Qt(Ie,V,"removeOption",{option:ve[Ke]})}break}},xn=Fe=>{ft(!0),H&&!Te.current&&Ct(Fe)},Zn=Fe=>{if(e(et)){Ye.current.focus();return}ft(!1),Ve.current=!0,Te.current=!1,o&&ge.current!==-1&&Le?ut(Fe,Me[ge.current],"blur"):o&&S&&We!==""?ut(Fe,We,"blur","freeSolo"):s&<(Fe,ve),dt(Fe,"blur")},Ar=Fe=>{const Ie=Fe.target.value;We!==Ie&&(Je(Ie),ye(!1),ne&&ne(Fe,Ie,"input")),Ie===""?!p&&!z&&Qt(Fe,null,"clear"):Ct(Fe)},nn=Fe=>{const Ie=Number(Fe.currentTarget.getAttribute("data-option-index"));ge.current!==Ie&&Ze({event:Fe,index:Ie,reason:"mouse"})},Mn=Fe=>{Ze({event:Fe,index:Number(Fe.currentTarget.getAttribute("data-option-index")),reason:"touch"}),de.current=!0},ur=Fe=>{const Ie=Number(Fe.currentTarget.getAttribute("data-option-index"));ut(Fe,Me[Ie],"selectOption"),de.current=!1},hs=Fe=>Ie=>{const Ke=ve.slice();Ke.splice(Fe,1),Qt(Ie,Ke,"removeOption",{option:ve[Fe]})},ps=Fe=>{Ht?dt(Fe,"toggleInput"):Ct(Fe)},Ks=Fe=>{Fe.currentTarget.contains(Fe.target)&&Fe.target.getAttribute("id")!==xe&&Fe.preventDefault()},Ko=Fe=>{Fe.currentTarget.contains(Fe.target)&&(Ye.current.focus(),Q&&Ve.current&&Ye.current.selectionEnd-Ye.current.selectionStart===0&&Ye.current.select(),Ve.current=!1)},Sa=Fe=>{!v&&(We===""||!Ht)&&ps(Fe)};let Zo=S&&We.length>0;Zo=Zo||(z?ve.length>0:ve!==null);let Ma=Me;return A&&(Ma=Me.reduce((Fe,Ie,Ke)=>{const V=A(Ie);return Fe.length>0&&Fe[Fe.length-1].group===V?Fe[Fe.length-1].options.push(Ie):Fe.push({key:Ke,index:Ke,group:V,options:[Ie]}),Fe},[])),v&&ot&&Zn(),{getRootProps:(Fe={})=>j({"aria-owns":je?`${xe}-listbox`:null},Fe,{onKeyDown:Bt(Fe),onMouseDown:Ks,onClick:Ko}),getInputLabelProps:()=>({id:`${xe}-label`,htmlFor:xe}),getInputProps:()=>({id:xe,value:We,onBlur:Zn,onFocus:xn,onChange:Ar,onMouseDown:Sa,"aria-activedescendant":Le?"":null,"aria-autocomplete":r?"both":"list","aria-controls":je?`${xe}-listbox`:void 0,"aria-expanded":je,autoComplete:"off",ref:Ye,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:v}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:it}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:ps}),getTagProps:({index:Fe})=>j({key:Fe,"data-tag-index":Fe,tabIndex:-1},!te&&{onDelete:hs(Fe)}),getListboxProps:()=>({role:"listbox",id:`${xe}-listbox`,"aria-labelledby":`${xe}-label`,ref:Nt,onMouseDown:Fe=>{Fe.preventDefault()}}),getOptionProps:({index:Fe,option:Ie})=>{const Ke=(z?ve:[ve]).some(fe=>fe!=null&&N(Ie,fe)),V=M?M(Ie):!1;return{key:we(Ie),tabIndex:-1,role:"option",id:`${xe}-option-${Fe}`,onMouseMove:nn,onClick:ur,onTouchStart:Mn,"data-option-index":Fe,"aria-disabled":V,"aria-selected":Ke}},id:xe,inputValue:We,value:ve,dirty:Zo,expanded:Le&&ct,popupOpen:Le,focused:ot||$e!==-1,anchorEl:ct,setAnchorEl:Lt,focusedTag:$e,groupedOptions:Ma}}const Zie=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],Qie=st(kie,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Jie=F.forwardRef(function(e,n){var r;const i=Uz(),o=ln({props:e,name:"MuiPopper"}),{anchorEl:a,component:s,components:l,componentsProps:c,container:f,disablePortal:p,keepMounted:m,modifiers:v,open:x,placement:_,popperOptions:b,popperRef:y,transition:S,slots:M,slotProps:C}=o,A=ht(o,Zie),R=(r=M==null?void 0:M.root)!=null?r:l==null?void 0:l.Root,P=j({anchorEl:a,container:f,disablePortal:p,keepMounted:m,modifiers:v,open:x,placement:_,popperOptions:b,popperRef:y,transition:S},A);return O.jsx(Qie,j({as:s,direction:i==null?void 0:i.direction,slots:{root:R},slotProps:C??c},P,{ref:n}))}),o$=Jie;function eoe(t){return tn("MuiListSubheader",t)}Zt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const toe=["className","color","component","disableGutters","disableSticky","inset"],noe=t=>{const{classes:e,color:n,disableGutters:r,inset:i,disableSticky:o}=t,a={root:["root",n!=="default"&&`color${Qe(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return an(a,eoe,e)},roe=st("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Qe(n.color)}`],!n.disableGutters&&e.gutters,n.inset&&e.inset,!n.disableSticky&&e.sticky]}})(({theme:t,ownerState:e})=>j({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},e.color==="primary"&&{color:(t.vars||t).palette.primary.main},e.color==="inherit"&&{color:"inherit"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.inset&&{paddingLeft:72},!e.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})),a$=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiListSubheader"}),{className:i,color:o="default",component:a="li",disableGutters:s=!1,disableSticky:l=!1,inset:c=!1}=r,f=ht(r,toe),p=j({},r,{color:o,component:a,disableGutters:s,disableSticky:l,inset:c}),m=noe(p);return O.jsx(roe,j({as:a,className:gt(m.root,i),ref:n,ownerState:p},f))});a$.muiSkipListHighlight=!0;const ioe=a$,ooe=Pu(O.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function aoe(t){return tn("MuiChip",t)}const soe=Zt("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),$n=soe,loe=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],coe=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:a,clickable:s,variant:l}=t,c={root:["root",l,n&&"disabled",`size${Qe(r)}`,`color${Qe(i)}`,s&&"clickable",s&&`clickableColor${Qe(i)}`,a&&"deletable",a&&`deletableColor${Qe(i)}`,`${l}${Qe(i)}`],label:["label",`label${Qe(r)}`],avatar:["avatar",`avatar${Qe(r)}`,`avatarColor${Qe(i)}`],icon:["icon",`icon${Qe(r)}`,`iconColor${Qe(o)}`],deleteIcon:["deleteIcon",`deleteIcon${Qe(r)}`,`deleteIconColor${Qe(i)}`,`deleteIcon${Qe(l)}Color${Qe(i)}`]};return an(c,aoe,e)},uoe=st("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:a,size:s,variant:l}=n;return[{[`& .${$n.avatar}`]:e.avatar},{[`& .${$n.avatar}`]:e[`avatar${Qe(s)}`]},{[`& .${$n.avatar}`]:e[`avatarColor${Qe(r)}`]},{[`& .${$n.icon}`]:e.icon},{[`& .${$n.icon}`]:e[`icon${Qe(s)}`]},{[`& .${$n.icon}`]:e[`iconColor${Qe(i)}`]},{[`& .${$n.deleteIcon}`]:e.deleteIcon},{[`& .${$n.deleteIcon}`]:e[`deleteIcon${Qe(s)}`]},{[`& .${$n.deleteIcon}`]:e[`deleteIconColor${Qe(r)}`]},{[`& .${$n.deleteIcon}`]:e[`deleteIcon${Qe(l)}Color${Qe(r)}`]},e.root,e[`size${Qe(s)}`],e[`color${Qe(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${Qe(r)})`],a&&e.deletable,a&&r!=="default"&&e[`deletableColor${Qe(r)}`],e[l],e[`${l}${Qe(r)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return j({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${$n.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${$n.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:n,fontSize:t.typography.pxToRem(12)},[`& .${$n.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${$n.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${$n.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${$n.icon}`]:j({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&j({color:t.vars?t.vars.palette.Chip.defaultIconColor:n},e.color!=="default"&&{color:"inherit"})),[`& .${$n.deleteIcon}`]:j({WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:Ln(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:Ln(t.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:t.vars?`rgba(${t.vars.palette[e.color].contrastTextChannel} / 0.7)`:Ln(t.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(t.vars||t).palette[e.color].main,color:(t.vars||t).palette[e.color].contrastText},e.onDelete&&{[`&.${$n.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Ln(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${$n.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}})},({theme:t,ownerState:e})=>j({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Ln(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${$n.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Ln(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${$n.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}}),({theme:t,ownerState:e})=>j({},e.variant==="outlined"&&{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${$n.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${$n.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${$n.avatar}`]:{marginLeft:4},[`& .${$n.avatarSmall}`]:{marginLeft:2},[`& .${$n.icon}`]:{marginLeft:4},[`& .${$n.iconSmall}`]:{marginLeft:2},[`& .${$n.deleteIcon}`]:{marginRight:5},[`& .${$n.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(t.vars||t).palette[e.color].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:Ln(t.palette[e.color].main,.7)}`,[`&.${$n.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Ln(t.palette[e.color].main,t.palette.action.hoverOpacity)},[`&.${$n.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.focusOpacity})`:Ln(t.palette[e.color].main,t.palette.action.focusOpacity)},[`& .${$n.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:Ln(t.palette[e.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].main}}})),foe=st("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${Qe(r)}`]]}})(({ownerState:t})=>j({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},t.variant==="outlined"&&{paddingLeft:11,paddingRight:11},t.size==="small"&&{paddingLeft:8,paddingRight:8},t.size==="small"&&t.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function U5(t){return t.key==="Backspace"||t.key==="Delete"}const doe=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:a,color:s="default",component:l,deleteIcon:c,disabled:f=!1,icon:p,label:m,onClick:v,onDelete:x,onKeyDown:_,onKeyUp:b,size:y="medium",variant:S="filled",tabIndex:M,skipFocusWhenDisabled:C=!1}=r,A=ht(r,loe),R=F.useRef(null),P=Ur(R,n),U=Y=>{Y.stopPropagation(),x&&x(Y)},k=Y=>{Y.currentTarget===Y.target&&U5(Y)&&Y.preventDefault(),_&&_(Y)},N=Y=>{Y.currentTarget===Y.target&&(x&&U5(Y)?x(Y):Y.key==="Escape"&&R.current&&R.current.blur()),b&&b(Y)},z=a!==!1&&v?!0:a,K=z||x?Kh:l||"div",J=j({},r,{component:K,disabled:f,size:y,color:s,iconColor:F.isValidElement(p)&&p.props.color||s,onDelete:!!x,clickable:z,variant:S}),G=coe(J),ne=K===Kh?j({component:l||"div",focusVisibleClassName:G.focusVisible},x&&{disableRipple:!0}):{};let ie=null;x&&(ie=c&&F.isValidElement(c)?F.cloneElement(c,{className:gt(c.props.className,G.deleteIcon),onClick:U}):O.jsx(ooe,{className:gt(G.deleteIcon),onClick:U}));let se=null;i&&F.isValidElement(i)&&(se=F.cloneElement(i,{className:gt(G.avatar,i.props.className)}));let H=null;return p&&F.isValidElement(p)&&(H=F.cloneElement(p,{className:gt(G.icon,p.props.className)})),O.jsxs(uoe,j({as:K,className:gt(G.root,o),disabled:z&&f?!0:void 0,onClick:v,onKeyDown:k,onKeyUp:N,ref:P,tabIndex:C&&f?-1:M,ownerState:J},ne,A,{children:[se||H,O.jsx(foe,{className:gt(G.label),ownerState:J,children:m}),ie]}))}),hoe=doe;function cd({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 poe=F.createContext(void 0),PI=poe;function Lu(){return F.useContext(PI)}function moe(t){return O.jsx(Zee,j({},t,{defaultTheme:hE,themeId:rx}))}function B5(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function OS(t,e=!1){return t&&(B5(t.value)&&t.value!==""||e&&B5(t.defaultValue)&&t.defaultValue!=="")}function goe(t){return t.startAdornment}function voe(t){return tn("MuiInputBase",t)}const yoe=Zt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Xa=yoe,xoe=["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"],vE=(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${Qe(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},yE=(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]},boe=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:a,formControl:s,fullWidth:l,hiddenLabel:c,multiline:f,readOnly:p,size:m,startAdornment:v,type:x}=t,_={root:["root",`color${Qe(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",m&&m!=="medium"&&`size${Qe(m)}`,f&&"multiline",v&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",p&&"readOnly"],input:["input",r&&"disabled",x==="search"&&"inputTypeSearch",f&&"inputMultiline",m==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",v&&"inputAdornedStart",o&&"inputAdornedEnd",p&&"readOnly"]};return an(_,voe,e)},xE=st("div",{name:"MuiInputBase",slot:"Root",overridesResolver:vE})(({theme:t,ownerState:e})=>j({},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",[`&.${Xa.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&j({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),bE=st("input",{name:"MuiInputBase",slot:"Input",overridesResolver:yE})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=j({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 j({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] + .${Xa.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},[`&.${Xa.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"})}),_oe=O.jsx(moe,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),woe=F.forwardRef(function(e,n){var r;const i=ln({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:s,className:l,components:c={},componentsProps:f={},defaultValue:p,disabled:m,disableInjectingGlobalStyles:v,endAdornment:x,fullWidth:_=!1,id:b,inputComponent:y="input",inputProps:S={},inputRef:M,maxRows:C,minRows:A,multiline:R=!1,name:P,onBlur:U,onChange:k,onClick:N,onFocus:z,onKeyDown:K,onKeyUp:J,placeholder:G,readOnly:ne,renderSuffix:ie,rows:se,slotProps:H={},slots:Y={},startAdornment:te,type:Q="text",value:ae}=i,xe=ht(i,xoe),we=S.value!=null?S.value:ae,{current:Te}=F.useRef(we!=null),Ve=F.useRef(),Ye=F.useCallback(Me=>{},[]),et=Ur(Ve,M,S.ref,Ye),[ct,Lt]=F.useState(!1),$e=Lu(),oe=cd({props:i,muiFormControl:$e,states:["color","disabled","error","hiddenLabel","size","required","filled"]});oe.focused=$e?$e.focused:ct,F.useEffect(()=>{!$e&&m&&ct&&(Lt(!1),U&&U())},[$e,m,ct,U]);const Ae=$e&&$e.onFilled,ge=$e&&$e.onEmpty,ve=F.useCallback(Me=>{OS(Me)?Ae&&Ae():ge&&ge()},[Ae,ge]);Ws(()=>{Te&&ve({value:we})},[we,ve,Te]);const Ue=Me=>{if(oe.disabled){Me.stopPropagation();return}z&&z(Me),S.onFocus&&S.onFocus(Me),$e&&$e.onFocus?$e.onFocus(Me):Lt(!0)},We=Me=>{U&&U(Me),S.onBlur&&S.onBlur(Me),$e&&$e.onBlur?$e.onBlur(Me):Lt(!1)},Je=(Me,...De)=>{if(!Te){const je=Me.target||Ve.current;if(je==null)throw new Error(Kf(1));ve({value:je.value})}S.onChange&&S.onChange(Me,...De),k&&k(Me,...De)};F.useEffect(()=>{ve(Ve.current)},[]);const ot=Me=>{Ve.current&&Me.currentTarget===Me.target&&Ve.current.focus(),N&&N(Me)};let ft=y,lt=S;R&&ft==="input"&&(se?lt=j({type:void 0,minRows:se,maxRows:se},lt):lt=j({type:void 0,maxRows:C,minRows:A},lt),ft=jie);const Ht=Me=>{ve(Me.animationName==="mui-auto-fill-cancel"?Ve.current:{value:"x"})};F.useEffect(()=>{$e&&$e.setAdornedStart(!!te)},[$e,te]);const ee=j({},i,{color:oe.color||"primary",disabled:oe.disabled,endAdornment:x,error:oe.error,focused:oe.focused,formControl:$e,fullWidth:_,hiddenLabel:oe.hiddenLabel,multiline:R,size:oe.size,startAdornment:te,type:Q}),$=boe(ee),ye=Y.root||c.Root||xE,Ge=H.root||f.root||{},Le=Y.input||c.Input||bE;return lt=j({},lt,(r=H.input)!=null?r:f.input),O.jsxs(F.Fragment,{children:[!v&&_oe,O.jsxs(ye,j({},Ge,!Zg(ye)&&{ownerState:j({},ee,Ge.ownerState)},{ref:n,onClick:ot},xe,{className:gt($.root,Ge.className,l,ne&&"MuiInputBase-readOnly"),children:[te,O.jsx(PI.Provider,{value:null,children:O.jsx(Le,j({ownerState:ee,"aria-invalid":oe.error,"aria-describedby":o,autoComplete:a,autoFocus:s,defaultValue:p,disabled:oe.disabled,id:b,onAnimationStart:Ht,name:P,placeholder:G,readOnly:ne,required:oe.required,rows:se,value:we,onKeyDown:K,onKeyUp:J,type:Q},lt,!Zg(Le)&&{as:ft,ownerState:j({},ee,lt.ownerState)},{ref:et,className:gt($.input,lt.className,ne&&"MuiInputBase-readOnly"),onBlur:We,onChange:Je,onFocus:Ue}))}),x,ie?ie(j({},oe,{startAdornment:te})):null]}))]})}),II=woe;function Soe(t){return tn("MuiInput",t)}const Moe=j({},Xa,Zt("MuiInput",["root","underline","input"])),Rf=Moe;function Eoe(t){return tn("MuiOutlinedInput",t)}const Coe=j({},Xa,Zt("MuiOutlinedInput",["root","notchedOutline","input"])),ec=Coe;function Toe(t){return tn("MuiFilledInput",t)}const Aoe=j({},Xa,Zt("MuiFilledInput",["root","underline","input"])),qa=Aoe,s$=Pu(O.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function Roe(t){return tn("MuiAutocomplete",t)}const Poe=Zt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),Pn=Poe;var z5,$5;const Ioe=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],Loe=["ref"],Ooe=t=>{const{classes:e,disablePortal:n,expanded:r,focused:i,fullWidth:o,hasClearIcon:a,hasPopupIcon:s,inputFocused:l,popupOpen:c,size:f}=t,p={root:["root",r&&"expanded",i&&"focused",o&&"fullWidth",a&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Qe(f)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return an(p,Roe,e)},koe=st("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{fullWidth:r,hasClearIcon:i,hasPopupIcon:o,inputFocused:a,size:s}=n;return[{[`& .${Pn.tag}`]:e.tag},{[`& .${Pn.tag}`]:e[`tagSize${Qe(s)}`]},{[`& .${Pn.inputRoot}`]:e.inputRoot},{[`& .${Pn.input}`]:e.input},{[`& .${Pn.input}`]:a&&e.inputFocused},e.root,r&&e.fullWidth,o&&e.hasPopupIcon,i&&e.hasClearIcon]}})(({ownerState:t})=>j({[`&.${Pn.focused} .${Pn.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${Pn.clearIndicator}`]:{visibility:"visible"}}},t.fullWidth&&{width:"100%"},{[`& .${Pn.tag}`]:j({margin:3,maxWidth:"calc(100% - 6px)"},t.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${Pn.inputRoot}`]:{flexWrap:"wrap",[`.${Pn.hasPopupIcon}&, .${Pn.hasClearIcon}&`]:{paddingRight:26+4},[`.${Pn.hasPopupIcon}.${Pn.hasClearIcon}&`]:{paddingRight:52+4},[`& .${Pn.input}`]:{width:0,minWidth:30}},[`& .${Rf.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Rf.root}.${Xa.sizeSmall}`]:{[`& .${Rf.input}`]:{padding:"2px 4px 3px 0"}},[`& .${ec.root}`]:{padding:9,[`.${Pn.hasPopupIcon}&, .${Pn.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${Pn.hasPopupIcon}.${Pn.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${Pn.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${Pn.endAdornment}`]:{right:9}},[`& .${ec.root}.${Xa.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${Pn.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${qa.root}`]:{paddingTop:19,paddingLeft:8,[`.${Pn.hasPopupIcon}&, .${Pn.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${Pn.hasPopupIcon}.${Pn.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${qa.input}`]:{padding:"7px 4px"},[`& .${Pn.endAdornment}`]:{right:9}},[`& .${qa.root}.${Xa.sizeSmall}`]:{paddingBottom:1,[`& .${qa.input}`]:{padding:"2.5px 4px"}},[`& .${Xa.hiddenLabel}`]:{paddingTop:8},[`& .${qa.root}.${Xa.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${Pn.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${qa.root}.${Xa.hiddenLabel}.${Xa.sizeSmall}`]:{[`& .${Pn.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${Pn.input}`]:j({flexGrow:1,textOverflow:"ellipsis",opacity:0},t.inputFocused&&{opacity:1})})),Noe=st("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,e)=>e.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),Doe=st(mE,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,e)=>e.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),Foe=st(mE,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:t},e)=>j({},e.popupIndicator,t.popupOpen&&e.popupIndicatorOpen)})(({ownerState:t})=>j({padding:2,marginRight:-2},t.popupOpen&&{transform:"rotate(180deg)"})),Uoe=st(o$,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Pn.option}`]:e.option},e.popper,n.disablePortal&&e.popperDisablePortal]}})(({theme:t,ownerState:e})=>j({zIndex:(t.vars||t).zIndex.modal},e.disablePortal&&{position:"absolute"})),Boe=st(lp,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({theme:t})=>j({},t.typography.body1,{overflow:"auto"})),zoe=st("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,e)=>e.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),$oe=st("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),Hoe=st("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${Pn.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${Pn.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Pn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Pn.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${Pn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}})),Voe=st(ioe,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,e)=>e.groupLabel})(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8})),Woe=st("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,e)=>e.groupUl})({padding:0,[`& .${Pn.option}`]:{paddingLeft:24}}),Goe=F.forwardRef(function(e,n){var r,i,o,a;const s=ln({props:e,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:c=!1,autoSelect:f=!1,blurOnSelect:p=!1,ChipProps:m,className:v,clearIcon:x=z5||(z5=O.jsx(Gne,{fontSize:"small"})),clearOnBlur:_=!s.freeSolo,clearOnEscape:b=!1,clearText:y="Clear",closeText:S="Close",componentsProps:M={},defaultValue:C=s.multiple?[]:null,disableClearable:A=!1,disableCloseOnSelect:R=!1,disabled:P=!1,disabledItemsFocusable:U=!1,disableListWrap:k=!1,disablePortal:N=!1,filterSelectedOptions:z=!1,forcePopupIcon:K="auto",freeSolo:J=!1,fullWidth:G=!1,getLimitTagsText:ne=Ke=>`+${Ke}`,getOptionLabel:ie,groupBy:se,handleHomeEndKeys:H=!s.freeSolo,includeInputInList:Y=!1,limitTags:te=-1,ListboxComponent:Q="ul",ListboxProps:ae,loading:xe=!1,loadingText:we="Loading…",multiple:Te=!1,noOptionsText:Ve="No options",openOnFocus:Ye=!1,openText:et="Open",PaperComponent:ct=lp,PopperComponent:Lt=o$,popupIcon:$e=$5||($5=O.jsx(s$,{})),readOnly:oe=!1,renderGroup:Ae,renderInput:ge,renderOption:ve,renderTags:Ue,selectOnFocus:We=!s.freeSolo,size:Je="medium",slotProps:ot={}}=s,ft=ht(s,Ioe),{getRootProps:lt,getInputProps:Ht,getInputLabelProps:ee,getPopupIndicatorProps:$,getClearProps:ye,getTagProps:Ge,getListboxProps:Le,getOptionProps:Me,value:De,dirty:je,expanded:at,id:At,popupOpen:Ze,focused:Oe,focusedTag:Ut,anchorEl:Et,setAnchorEl:Nt,inputValue:Ct,groupedOptions:dt}=Kie(j({},s,{componentName:"Autocomplete"})),Qt=!A&&!P&&je&&!oe,de=(!J||K===!0)&&K!==!1,{onMouseDown:ut}=Ht(),{ref:rt}=ae??{},Ne=Le(),{ref:it}=Ne,Bt=ht(Ne,Loe),xn=Ur(it,rt),Ar=ie||(Ke=>{var V;return(V=Ke.label)!=null?V:Ke}),nn=j({},s,{disablePortal:N,expanded:at,focused:Oe,fullWidth:G,getOptionLabel:Ar,hasClearIcon:Qt,hasPopupIcon:de,inputFocused:Ut===-1,popupOpen:Ze,size:Je}),Mn=Ooe(nn);let ur;if(Te&&De.length>0){const Ke=V=>j({className:Mn.tag,disabled:P},Ge(V));Ue?ur=Ue(De,Ke,nn):ur=De.map((V,fe)=>O.jsx(hoe,j({label:Ar(V),size:Je},Ke({index:fe}),m)))}if(te>-1&&Array.isArray(ur)){const Ke=ur.length-te;!Oe&&Ke>0&&(ur=ur.splice(0,te),ur.push(O.jsx("span",{className:Mn.tag,children:ne(Ke)},ur.length)))}const ps=Ae||(Ke=>O.jsxs("li",{children:[O.jsx(Voe,{className:Mn.groupLabel,ownerState:nn,component:"div",children:Ke.group}),O.jsx(Woe,{className:Mn.groupUl,ownerState:nn,children:Ke.children})]},Ke.key)),Ko=ve||((Ke,V)=>O.jsx("li",j({},Ke,{children:Ar(V)}))),Sa=(Ke,V)=>{const fe=Me({option:Ke,index:V});return Ko(j({},fe,{className:Mn.option}),Ke,{selected:fe["aria-selected"],index:V,inputValue:Ct},nn)},Zo=(r=ot.clearIndicator)!=null?r:M.clearIndicator,Ma=(i=ot.paper)!=null?i:M.paper,Fe=(o=ot.popper)!=null?o:M.popper,Ie=(a=ot.popupIndicator)!=null?a:M.popupIndicator;return O.jsxs(F.Fragment,{children:[O.jsx(koe,j({ref:n,className:gt(Mn.root,v),ownerState:nn},lt(ft),{children:ge({id:At,disabled:P,fullWidth:!0,size:Je==="small"?"small":void 0,InputLabelProps:ee(),InputProps:j({ref:Nt,className:Mn.inputRoot,startAdornment:ur,onClick:Ke=>{Ke.target===Ke.currentTarget&&ut(Ke)}},(Qt||de)&&{endAdornment:O.jsxs(Noe,{className:Mn.endAdornment,ownerState:nn,children:[Qt?O.jsx(Doe,j({},ye(),{"aria-label":y,title:y,ownerState:nn},Zo,{className:gt(Mn.clearIndicator,Zo==null?void 0:Zo.className),children:x})):null,de?O.jsx(Foe,j({},$(),{disabled:P,"aria-label":Ze?S:et,title:Ze?S:et,ownerState:nn},Ie,{className:gt(Mn.popupIndicator,Ie==null?void 0:Ie.className),children:$e})):null]})}),inputProps:j({className:Mn.input,disabled:P,readOnly:oe},Ht())})})),Et?O.jsx(Uoe,j({as:Lt,disablePortal:N,style:{width:Et?Et.clientWidth:null},ownerState:nn,role:"presentation",anchorEl:Et,open:Ze},Fe,{className:gt(Mn.popper,Fe==null?void 0:Fe.className),children:O.jsxs(Boe,j({ownerState:nn,as:ct},Ma,{className:gt(Mn.paper,Ma==null?void 0:Ma.className),children:[xe&&dt.length===0?O.jsx(zoe,{className:Mn.loading,ownerState:nn,children:we}):null,dt.length===0&&!J&&!xe?O.jsx($oe,{className:Mn.noOptions,ownerState:nn,role:"presentation",onMouseDown:Ke=>{Ke.preventDefault()},children:Ve}):null,dt.length>0?O.jsx(Hoe,j({as:Q,className:Mn.listbox,ownerState:nn},Bt,ae,{ref:xn,children:dt.map((Ke,V)=>se?ps({key:Ke.key,group:Ke.group,children:Ke.options.map((fe,be)=>Sa(fe,Ke.index+be))}):Sa(Ke,V))})):null]}))})):null]})}),l$=Goe,joe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],Xoe={entering:{opacity:1},entered:{opacity:1}},qoe=F.forwardRef(function(e,n){const r=ax(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,easing:l,in:c,onEnter:f,onEntered:p,onEntering:m,onExit:v,onExited:x,onExiting:_,style:b,timeout:y=i,TransitionComponent:S=xI}=e,M=ht(e,joe),C=F.useRef(null),A=Ur(C,s.ref,n),R=G=>ne=>{if(G){const ie=C.current;ne===void 0?G(ie):G(ie,ne)}},P=R(m),U=R((G,ne)=>{wI(G);const ie=Kg({style:b,timeout:y,easing:l},{mode:"enter"});G.style.webkitTransition=r.transitions.create("opacity",ie),G.style.transition=r.transitions.create("opacity",ie),f&&f(G,ne)}),k=R(p),N=R(_),z=R(G=>{const ne=Kg({style:b,timeout:y,easing:l},{mode:"exit"});G.style.webkitTransition=r.transitions.create("opacity",ne),G.style.transition=r.transitions.create("opacity",ne),v&&v(G)}),K=R(x),J=G=>{o&&o(C.current,G)};return O.jsx(S,j({appear:a,in:c,nodeRef:C,onEnter:U,onEntered:k,onEntering:P,onExit:z,onExited:K,onExiting:N,addEndListener:J,timeout:y},M,{children:(G,ne)=>F.cloneElement(s,j({style:j({opacity:0,visibility:G==="exited"&&!c?"hidden":void 0},Xoe[G],b,s.props.style),ref:A},ne))}))}),Yoe=qoe;function Koe(t){return tn("MuiBackdrop",t)}Zt("MuiBackdrop",["root","invisible"]);const Zoe=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Qoe=t=>{const{classes:e,invisible:n}=t;return an({root:["root",n&&"invisible"]},Koe,e)},Joe=st("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>j({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"})),eae=F.forwardRef(function(e,n){var r,i,o;const a=ln({props:e,name:"MuiBackdrop"}),{children:s,className:l,component:c="div",components:f={},componentsProps:p={},invisible:m=!1,open:v,slotProps:x={},slots:_={},TransitionComponent:b=Yoe,transitionDuration:y}=a,S=ht(a,Zoe),M=j({},a,{component:c,invisible:m}),C=Qoe(M),A=(r=x.root)!=null?r:p.root;return O.jsx(b,j({in:v,timeout:y},S,{children:O.jsx(Joe,j({"aria-hidden":!0},A,{as:(i=(o=_.root)!=null?o:f.Root)!=null?i:c,className:gt(C.root,l,A==null?void 0:A.className),ownerState:j({},M,A==null?void 0:A.ownerState),classes:C,ref:n,children:s}))}))}),tae=eae,nae=jz(),rae=tte({themeId:rx,defaultTheme:nae,defaultClassName:"MuiBox-root",generateClassName:tI.generate}),Su=rae;function iae(t){return tn("MuiButton",t)}const oae=Zt("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","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),d_=oae,aae=F.createContext({}),sae=aae,lae=F.createContext(void 0),cae=lae,uae=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],fae=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:a}=t,s={root:["root",o,`${o}${Qe(e)}`,`size${Qe(i)}`,`${o}Size${Qe(i)}`,e==="inherit"&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${Qe(i)}`],endIcon:["endIcon",`iconSize${Qe(i)}`]},l=an(s,iae,a);return j({},a,l)},c$=t=>j({},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}}),dae=st(Kh,{shouldForwardProp:t=>ao(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Qe(n.color)}`],e[`size${Qe(n.size)}`],e[`${n.variant}Size${Qe(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 j({},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":j({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Ln(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})`:Ln(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})`:Ln(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":j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${d_.focusVisible}`]:j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${d_.disabled}`]:j({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 ${Ln(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"},[`&.${d_.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${d_.disabled}`]:{boxShadow:"none"}}),hae=st("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${Qe(n.size)}`]]}})(({ownerState:t})=>j({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},c$(t))),pae=st("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${Qe(n.size)}`]]}})(({ownerState:t})=>j({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},c$(t))),mae=F.forwardRef(function(e,n){const r=F.useContext(sae),i=F.useContext(cae),o=eI(r,e),a=ln({props:o,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:f,disabled:p=!1,disableElevation:m=!1,disableFocusRipple:v=!1,endIcon:x,focusVisibleClassName:_,fullWidth:b=!1,size:y="medium",startIcon:S,type:M,variant:C="text"}=a,A=ht(a,uae),R=j({},a,{color:l,component:c,disabled:p,disableElevation:m,disableFocusRipple:v,fullWidth:b,size:y,type:M,variant:C}),P=fae(R),U=S&&O.jsx(hae,{className:P.startIcon,ownerState:R,children:S}),k=x&&O.jsx(pae,{className:P.endIcon,ownerState:R,children:x}),N=i||"";return O.jsxs(dae,j({ownerState:R,className:gt(r.className,P.root,f,N),component:c,disabled:p,focusRipple:!v,focusVisibleClassName:gt(P.focusVisible,_),ref:n,type:M},A,{classes:P,children:[U,s,k]}))}),H5=mae;function gae(t){return tn("MuiCard",t)}Zt("MuiCard",["root"]);const vae=["className","raised"],yae=t=>{const{classes:e}=t;return an({root:["root"]},gae,e)},xae=st(lp,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),bae=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,a=ht(r,vae),s=j({},r,{raised:o}),l=yae(s);return O.jsx(xae,j({className:gt(l.root,i),elevation:o?8:void 0,ref:n,ownerState:s},a))}),_E=bae;function _ae(t){return tn("MuiCardContent",t)}Zt("MuiCardContent",["root"]);const wae=["className","component"],Sae=t=>{const{classes:e}=t;return an({root:["root"]},_ae,e)},Mae=st("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),Eae=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,a=ht(r,wae),s=j({},r,{component:o}),l=Sae(s);return O.jsx(Mae,j({as:o,className:gt(l.root,i),ownerState:s,ref:n},a))}),wE=Eae;function Cae(t){return tn("PrivateSwitchBase",t)}Zt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Tae=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Aae=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${Qe(i)}`],input:["input"]};return an(o,Cae,e)},Rae=st(Kh)(({ownerState:t})=>j({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),Pae=st("input",{shouldForwardProp:ao})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Iae=F.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:a,defaultChecked:s,disabled:l,disableFocusRipple:c=!1,edge:f=!1,icon:p,id:m,inputProps:v,inputRef:x,name:_,onBlur:b,onChange:y,onFocus:S,readOnly:M,required:C=!1,tabIndex:A,type:R,value:P}=e,U=ht(e,Tae),[k,N]=$f({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),z=Lu(),K=Y=>{S&&S(Y),z&&z.onFocus&&z.onFocus(Y)},J=Y=>{b&&b(Y),z&&z.onBlur&&z.onBlur(Y)},G=Y=>{if(Y.nativeEvent.defaultPrevented)return;const te=Y.target.checked;N(te),y&&y(Y,te)};let ne=l;z&&typeof ne>"u"&&(ne=z.disabled);const ie=R==="checkbox"||R==="radio",se=j({},e,{checked:k,disabled:ne,disableFocusRipple:c,edge:f}),H=Aae(se);return O.jsxs(Rae,j({component:"span",className:gt(H.root,a),centerRipple:!0,focusRipple:!c,disabled:ne,tabIndex:null,role:void 0,onFocus:K,onBlur:J,ownerState:se,ref:n},U,{children:[O.jsx(Pae,j({autoFocus:r,checked:i,defaultChecked:s,className:H.input,disabled:ne,id:ie?m:void 0,name:_,onChange:G,readOnly:M,ref:x,required:C,ownerState:se,tabIndex:A,type:R},R==="checkbox"&&P===void 0?{}:{value:P},v)),k?o:p]}))}),u$=Iae,Lae=Pu(O.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"),Oae=Pu(O.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"),kae=Pu(O.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 Nae(t){return tn("MuiCheckbox",t)}const Dae=Zt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),XC=Dae,Fae=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],Uae=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${Qe(r)}`,`size${Qe(i)}`]},a=an(o,Nae,e);return j({},e,a)},Bae=st(u$,{shouldForwardProp:t=>ao(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${Qe(n.size)}`],n.color!=="default"&&e[`color${Qe(n.color)}`]]}})(({theme:t,ownerState:e})=>j({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})`:Ln(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${XC.checked}, &.${XC.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${XC.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),zae=O.jsx(Oae,{}),$ae=O.jsx(Lae,{}),Hae=O.jsx(kae,{}),Vae=F.forwardRef(function(e,n){var r,i;const o=ln({props:e,name:"MuiCheckbox"}),{checkedIcon:a=zae,color:s="primary",icon:l=$ae,indeterminate:c=!1,indeterminateIcon:f=Hae,inputProps:p,size:m="medium",className:v}=o,x=ht(o,Fae),_=c?f:l,b=c?f:a,y=j({},o,{color:s,indeterminate:c,size:m}),S=Uae(y);return O.jsx(Bae,j({type:"checkbox",inputProps:j({"data-indeterminate":c},p),icon:F.cloneElement(_,{fontSize:(r=_.props.fontSize)!=null?r:m}),checkedIcon:F.cloneElement(b,{fontSize:(i=b.props.fontSize)!=null?i:m}),ownerState:y,ref:n,className:gt(S.root,v)},x,{classes:S}))}),Zd=Vae;function Wae(t){return tn("MuiModal",t)}Zt("MuiModal",["root","hidden","backdrop"]);const Gae=["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"],jae=t=>{const{open:e,exited:n,classes:r}=t;return an({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},Wae,r)},Xae=st("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})=>j({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),qae=st(tae,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),Yae=F.forwardRef(function(e,n){var r,i,o,a,s,l;const c=ln({name:"MuiModal",props:e}),{BackdropComponent:f=qae,BackdropProps:p,className:m,closeAfterTransition:v=!1,children:x,container:_,component:b,components:y={},componentsProps:S={},disableAutoFocus:M=!1,disableEnforceFocus:C=!1,disableEscapeKeyDown:A=!1,disablePortal:R=!1,disableRestoreFocus:P=!1,disableScrollLock:U=!1,hideBackdrop:k=!1,keepMounted:N=!1,onBackdropClick:z,open:K,slotProps:J,slots:G}=c,ne=ht(c,Gae),ie=j({},c,{closeAfterTransition:v,disableAutoFocus:M,disableEnforceFocus:C,disableEscapeKeyDown:A,disablePortal:R,disableRestoreFocus:P,disableScrollLock:U,hideBackdrop:k,keepMounted:N}),{getRootProps:se,getBackdropProps:H,getTransitionProps:Y,portalRef:te,isTopModal:Q,exited:ae,hasTransition:xe}=Vie(j({},ie,{rootRef:n})),we=j({},ie,{exited:ae}),Te=jae(we),Ve={};if(x.props.tabIndex===void 0&&(Ve.tabIndex="-1"),xe){const{onEnter:Ae,onExited:ge}=Y();Ve.onEnter=Ae,Ve.onExited=ge}const Ye=(r=(i=G==null?void 0:G.root)!=null?i:y.Root)!=null?r:Xae,et=(o=(a=G==null?void 0:G.backdrop)!=null?a:y.Backdrop)!=null?o:f,ct=(s=J==null?void 0:J.root)!=null?s:S.root,Lt=(l=J==null?void 0:J.backdrop)!=null?l:S.backdrop,$e=Zh({elementType:Ye,externalSlotProps:ct,externalForwardedProps:ne,getSlotProps:se,additionalProps:{ref:n,as:b},ownerState:we,className:gt(m,ct==null?void 0:ct.className,Te==null?void 0:Te.root,!we.open&&we.exited&&(Te==null?void 0:Te.hidden))}),oe=Zh({elementType:et,externalSlotProps:Lt,additionalProps:p,getSlotProps:Ae=>H(j({},Ae,{onClick:ge=>{z&&z(ge),Ae!=null&&Ae.onClick&&Ae.onClick(ge)}})),className:gt(Lt==null?void 0:Lt.className,p==null?void 0:p.className,Te==null?void 0:Te.backdrop),ownerState:we});return!N&&!K&&(!xe||ae)?null:O.jsx(i$,{ref:te,container:_,disablePortal:R,children:O.jsxs(Ye,j({},$e,{children:[!k&&f?O.jsx(et,j({},oe)):null,O.jsx(yre,{disableEnforceFocus:C,disableAutoFocus:M,disableRestoreFocus:P,isEnabled:Q,open:K,children:F.cloneElement(x,Ve)})]}))})}),f$=Yae;function Kae(t){return tn("MuiDivider",t)}const Zae=Zt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),V5=Zae,Qae=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],Jae=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=t;return an({root:["root",e&&"absolute",l,o&&"light",a==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&a==="vertical"&&"withChildrenVertical",s==="right"&&a!=="vertical"&&"textAlignRight",s==="left"&&a!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",a==="vertical"&&"wrapperVertical"]},Kae,r)},ese=st("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>j({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:Ln(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>j({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>j({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>j({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>j({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),tse=st("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>j({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),d$=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:a,component:s=o?"div":"hr",flexItem:l=!1,light:c=!1,orientation:f="horizontal",role:p=s!=="hr"?"separator":void 0,textAlign:m="center",variant:v="fullWidth"}=r,x=ht(r,Qae),_=j({},r,{absolute:i,component:s,flexItem:l,light:c,orientation:f,role:p,textAlign:m,variant:v}),b=Jae(_);return O.jsx(ese,j({as:s,className:gt(b.root,a),role:p,ref:n,ownerState:_},x,{children:o?O.jsx(tse,{className:b.wrapper,ownerState:_,children:o}):null}))});d$.muiSkipListHighlight=!0;const Oh=d$,nse=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function rse(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=xc(e);let a;if(e.fakeTransform)a=e.fakeTransform;else{const c=o.getComputedStyle(e);a=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let s=0,l=0;if(a&&a!=="none"&&typeof a=="string"){const c=a.split("(")[1].split(")")[0].split(",");s=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?i?`translateX(${i.right+s-r.left}px)`:`translateX(${o.innerWidth+s-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:t==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function ise(t){return typeof t=="function"?t():t}function h_(t,e,n){const r=ise(n),i=rse(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const ose=F.forwardRef(function(e,n){const r=ax(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:l,container:c,direction:f="down",easing:p=i,in:m,onEnter:v,onEntered:x,onEntering:_,onExit:b,onExited:y,onExiting:S,style:M,timeout:C=o,TransitionComponent:A=xI}=e,R=ht(e,nse),P=F.useRef(null),U=Ur(l.ref,P,n),k=H=>Y=>{H&&(Y===void 0?H(P.current):H(P.current,Y))},N=k((H,Y)=>{h_(f,H,c),wI(H),v&&v(H,Y)}),z=k((H,Y)=>{const te=Kg({timeout:C,style:M,easing:p},{mode:"enter"});H.style.webkitTransition=r.transitions.create("-webkit-transform",j({},te)),H.style.transition=r.transitions.create("transform",j({},te)),H.style.webkitTransform="none",H.style.transform="none",_&&_(H,Y)}),K=k(x),J=k(S),G=k(H=>{const Y=Kg({timeout:C,style:M,easing:p},{mode:"exit"});H.style.webkitTransition=r.transitions.create("-webkit-transform",Y),H.style.transition=r.transitions.create("transform",Y),h_(f,H,c),b&&b(H)}),ne=k(H=>{H.style.webkitTransition="",H.style.transition="",y&&y(H)}),ie=H=>{a&&a(P.current,H)},se=F.useCallback(()=>{P.current&&h_(f,P.current,c)},[f,c]);return F.useEffect(()=>{if(m||f==="down"||f==="right")return;const H=$M(()=>{P.current&&h_(f,P.current,c)}),Y=xc(P.current);return Y.addEventListener("resize",H),()=>{H.clear(),Y.removeEventListener("resize",H)}},[f,m,c]),F.useEffect(()=>{m||se()},[m,se]),O.jsx(A,j({nodeRef:P,onEnter:N,onEntered:K,onEntering:z,onExit:G,onExited:ne,onExiting:J,addEndListener:ie,appear:s,in:m,timeout:C},R,{children:(H,Y)=>F.cloneElement(l,j({ref:U,style:j({visibility:H==="exited"&&!m?"hidden":void 0},M,l.props.style)},Y))}))}),ase=ose;function sse(t){return tn("MuiDrawer",t)}Zt("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const lse=["BackdropProps"],cse=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],h$=(t,e)=>{const{ownerState:n}=t;return[e.root,(n.variant==="permanent"||n.variant==="persistent")&&e.docked,e.modal]},use=t=>{const{classes:e,anchor:n,variant:r}=t,i={root:["root"],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${Qe(n)}`,r!=="temporary"&&`paperAnchorDocked${Qe(n)}`]};return an(i,sse,e)},fse=st(f$,{name:"MuiDrawer",slot:"Root",overridesResolver:h$})(({theme:t})=>({zIndex:(t.vars||t).zIndex.drawer})),W5=st("div",{shouldForwardProp:ao,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:h$})({flex:"0 0 auto"}),dse=st(lp,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`paperAnchor${Qe(n.anchor)}`],n.variant!=="temporary"&&e[`paperAnchorDocked${Qe(n.anchor)}`]]}})(({theme:t,ownerState:e})=>j({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},e.anchor==="left"&&{left:0},e.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="right"&&{right:0},e.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="left"&&e.variant!=="temporary"&&{borderRight:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="top"&&e.variant!=="temporary"&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="right"&&e.variant!=="temporary"&&{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="bottom"&&e.variant!=="temporary"&&{borderTop:`1px solid ${(t.vars||t).palette.divider}`})),p$={left:"right",right:"left",top:"down",bottom:"up"};function hse(t){return["left","right"].indexOf(t)!==-1}function pse(t,e){return t.direction==="rtl"&&hse(e)?p$[e]:e}const mse=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiDrawer"}),i=ax(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:s,children:l,className:c,elevation:f=16,hideBackdrop:p=!1,ModalProps:{BackdropProps:m}={},onClose:v,open:x=!1,PaperProps:_={},SlideProps:b,TransitionComponent:y=ase,transitionDuration:S=o,variant:M="temporary"}=r,C=ht(r.ModalProps,lse),A=ht(r,cse),R=F.useRef(!1);F.useEffect(()=>{R.current=!0},[]);const P=pse(i,a),k=j({},r,{anchor:a,elevation:f,open:x,variant:M},A),N=use(k),z=O.jsx(dse,j({elevation:M==="temporary"?f:0,square:!0},_,{className:gt(N.paper,_.className),ownerState:k,children:l}));if(M==="permanent")return O.jsx(W5,j({className:gt(N.root,N.docked,c),ownerState:k,ref:n},A,{children:z}));const K=O.jsx(y,j({in:x,direction:p$[P],timeout:S,appear:R.current},b,{children:z}));return M==="persistent"?O.jsx(W5,j({className:gt(N.root,N.docked,c),ownerState:k,ref:n},A,{children:K})):O.jsx(fse,j({BackdropProps:j({},s,m,{transitionDuration:S}),className:gt(N.root,N.modal,c),open:x,ownerState:k,onClose:v,hideBackdrop:p,ref:n},A,C,{children:K}))}),gse=mse,vse=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],yse=t=>{const{classes:e,disableUnderline:n}=t,i=an({root:["root",!n&&"underline"],input:["input"]},Toe,e);return j({},e,i)},xse=st(xE,{shouldForwardProp:t=>ao(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...vE(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)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return j({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:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${qa.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${qa.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:s}},!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"},[`&.${qa.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${qa.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(.${qa.disabled}, .${qa.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${qa.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&j({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17}))}),bse=st(bE,{name:"MuiFilledInput",slot:"Input",overridesResolver:yE})(({theme:t,ownerState:e})=>j({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.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9})),m$=F.forwardRef(function(e,n){var r,i,o,a;const s=ln({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:f=!1,inputComponent:p="input",multiline:m=!1,slotProps:v,slots:x={},type:_="text"}=s,b=ht(s,vse),y=j({},s,{fullWidth:f,inputComponent:p,multiline:m,type:_}),S=yse(s),M={root:{ownerState:y},input:{ownerState:y}},C=v??c?So(v??c,M):M,A=(r=(i=x.root)!=null?i:l.Root)!=null?r:xse,R=(o=(a=x.input)!=null?a:l.Input)!=null?o:bse;return O.jsx(II,j({slots:{root:A,input:R},componentsProps:C,fullWidth:f,inputComponent:p,multiline:m,ref:n,type:_},b,{classes:S}))});m$.muiName="Input";const g$=m$;function _se(t){return tn("MuiFormControl",t)}Zt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const wse=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Sse=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${Qe(n)}`,r&&"fullWidth"]};return an(i,_se,e)},Mse=st("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>j({},e.root,e[`margin${Qe(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>j({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%"})),Ese=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiFormControl"}),{children:i,className:o,color:a="primary",component:s="div",disabled:l=!1,error:c=!1,focused:f,fullWidth:p=!1,hiddenLabel:m=!1,margin:v="none",required:x=!1,size:_="medium",variant:b="outlined"}=r,y=ht(r,wse),S=j({},r,{color:a,component:s,disabled:l,error:c,fullWidth:p,hiddenLabel:m,margin:v,required:x,size:_,variant:b}),M=Sse(S),[C,A]=F.useState(()=>{let J=!1;return i&&F.Children.forEach(i,G=>{if(!Ty(G,["Input","Select"]))return;const ne=Ty(G,["Select"])?G.props.input:G;ne&&goe(ne.props)&&(J=!0)}),J}),[R,P]=F.useState(()=>{let J=!1;return i&&F.Children.forEach(i,G=>{Ty(G,["Input","Select"])&&(OS(G.props,!0)||OS(G.props.inputProps,!0))&&(J=!0)}),J}),[U,k]=F.useState(!1);l&&U&&k(!1);const N=f!==void 0&&!l?f:U;let z;const K=F.useMemo(()=>({adornedStart:C,setAdornedStart:A,color:a,disabled:l,error:c,filled:R,focused:N,fullWidth:p,hiddenLabel:m,size:_,onBlur:()=>{k(!1)},onEmpty:()=>{P(!1)},onFilled:()=>{P(!0)},onFocus:()=>{k(!0)},registerEffect:z,required:x,variant:b}),[C,a,l,c,R,N,p,m,z,x,_,b]);return O.jsx(PI.Provider,{value:K,children:O.jsx(Mse,j({as:s,ownerState:S,className:gt(M.root,o),ref:n},y,{children:i}))})}),$s=Ese,Cse=Gz({createStyledComponent:st("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>ln({props:t,name:"MuiStack"})}),Fn=Cse;function Tse(t){return tn("MuiFormControlLabel",t)}const Ase=Zt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),uy=Ase,Rse=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],Pse=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,a={root:["root",n&&"disabled",`labelPlacement${Qe(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return an(a,Tse,e)},Ise=st("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${uy.label}`]:e.label},e.root,e[`labelPlacement${Qe(n.labelPlacement)}`]]}})(({theme:t,ownerState:e})=>j({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${uy.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${uy.label}`]:{[`&.${uy.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),Lse=st("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${uy.error}`]:{color:(t.vars||t).palette.error.main}})),Ose=F.forwardRef(function(e,n){var r,i;const o=ln({props:e,name:"MuiFormControlLabel"}),{className:a,componentsProps:s={},control:l,disabled:c,disableTypography:f,label:p,labelPlacement:m="end",required:v,slotProps:x={}}=o,_=ht(o,Rse),b=Lu(),y=(r=c??l.props.disabled)!=null?r:b==null?void 0:b.disabled,S=v??l.props.required,M={disabled:y,required:S};["checked","name","onChange","value","inputRef"].forEach(k=>{typeof l.props[k]>"u"&&typeof o[k]<"u"&&(M[k]=o[k])});const C=cd({props:o,muiFormControl:b,states:["error"]}),A=j({},o,{disabled:y,labelPlacement:m,required:S,error:C.error}),R=Pse(A),P=(i=x.typography)!=null?i:s.typography;let U=p;return U!=null&&U.type!==yn&&!f&&(U=O.jsx(yn,j({component:"span"},P,{className:gt(R.label,P==null?void 0:P.className),children:U}))),O.jsxs(Ise,j({className:gt(R.root,a),ownerState:A,ref:n},_,{children:[F.cloneElement(l,M),S?O.jsxs(Fn,{direction:"row",alignItems:"center",children:[U,O.jsxs(Lse,{ownerState:A,"aria-hidden":!0,className:R.asterisk,children:[" ","*"]})]}):U]}))}),Ga=Ose;function kse(t){return tn("MuiFormGroup",t)}Zt("MuiFormGroup",["root","row","error"]);const Nse=["className","row"],Dse=t=>{const{classes:e,row:n,error:r}=t;return an({root:["root",n&&"row",r&&"error"]},kse,e)},Fse=st("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})(({ownerState:t})=>j({display:"flex",flexDirection:"column",flexWrap:"wrap"},t.row&&{flexDirection:"row"})),Use=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1}=r,a=ht(r,Nse),s=Lu(),l=cd({props:r,muiFormControl:s,states:["error"]}),c=j({},r,{row:o,error:l.error}),f=Dse(c);return O.jsx(Fse,j({className:gt(f.root,i),ownerState:c,ref:n},a))}),v$=Use;function Bse(t){return tn("MuiFormHelperText",t)}const zse=Zt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),G5=zse;var j5;const $se=["children","className","component","disabled","error","filled","focused","margin","required","variant"],Hse=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:a,focused:s,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${Qe(r)}`,n&&"contained",s&&"focused",a&&"filled",l&&"required"]};return an(c,Bse,e)},Vse=st("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${Qe(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${G5.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${G5.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),Wse=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:a="p"}=r,s=ht(r,$se),l=Lu(),c=cd({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),f=j({},r,{component:a,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}),p=Hse(f);return O.jsx(Vse,j({as:a,ownerState:f,className:gt(p.root,o),ref:n},s,{children:i===" "?j5||(j5=O.jsx("span",{className:"notranslate",children:"​"})):i}))}),Gse=Wse;function jse(t){return tn("MuiFormLabel",t)}const Xse=Zt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Oy=Xse,qse=["children","className","color","component","disabled","error","filled","focused","required"],Yse=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:a,required:s}=t,l={root:["root",`color${Qe(n)}`,i&&"disabled",o&&"error",a&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",o&&"error"]};return an(l,jse,e)},Kse=st("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>j({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Oy.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Oy.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Oy.error}`]:{color:(t.vars||t).palette.error.main}})),Zse=st("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Oy.error}`]:{color:(t.vars||t).palette.error.main}})),Qse=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:a="label"}=r,s=ht(r,qse),l=Lu(),c=cd({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),f=j({},r,{color:c.color||"primary",component:a,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),p=Yse(f);return O.jsxs(Kse,j({as:a,ownerState:f,className:gt(p.root,o),ref:n},s,{children:[i,c.required&&O.jsxs(Zse,{ownerState:f,"aria-hidden":!0,className:p.asterisk,children:[" ","*"]})]}))}),LI=Qse,Jse=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function AR(t){return`scale(${t}, ${t**2})`}const ele={entering:{opacity:1,transform:AR(1)},entered:{opacity:1,transform:"none"}},qC=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),y$=F.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:a,in:s,onEnter:l,onEntered:c,onEntering:f,onExit:p,onExited:m,onExiting:v,style:x,timeout:_="auto",TransitionComponent:b=xI}=e,y=ht(e,Jse),S=F.useRef(),M=F.useRef(),C=ax(),A=F.useRef(null),R=Ur(A,o.ref,n),P=ne=>ie=>{if(ne){const se=A.current;ie===void 0?ne(se):ne(se,ie)}},U=P(f),k=P((ne,ie)=>{wI(ne);const{duration:se,delay:H,easing:Y}=Kg({style:x,timeout:_,easing:a},{mode:"enter"});let te;_==="auto"?(te=C.transitions.getAutoHeightDuration(ne.clientHeight),M.current=te):te=se,ne.style.transition=[C.transitions.create("opacity",{duration:te,delay:H}),C.transitions.create("transform",{duration:qC?te:te*.666,delay:H,easing:Y})].join(","),l&&l(ne,ie)}),N=P(c),z=P(v),K=P(ne=>{const{duration:ie,delay:se,easing:H}=Kg({style:x,timeout:_,easing:a},{mode:"exit"});let Y;_==="auto"?(Y=C.transitions.getAutoHeightDuration(ne.clientHeight),M.current=Y):Y=ie,ne.style.transition=[C.transitions.create("opacity",{duration:Y,delay:se}),C.transitions.create("transform",{duration:qC?Y:Y*.666,delay:qC?se:se||Y*.333,easing:H})].join(","),ne.style.opacity=0,ne.style.transform=AR(.75),p&&p(ne)}),J=P(m),G=ne=>{_==="auto"&&(S.current=setTimeout(ne,M.current||0)),r&&r(A.current,ne)};return F.useEffect(()=>()=>{clearTimeout(S.current)},[]),O.jsx(b,j({appear:i,in:s,nodeRef:A,onEnter:k,onEntered:N,onEntering:U,onExit:K,onExited:J,onExiting:z,addEndListener:G,timeout:_==="auto"?null:_},y,{children:(ne,ie)=>F.cloneElement(o,j({style:j({opacity:0,transform:AR(.75),visibility:ne==="exited"&&!s?"hidden":void 0},ele[ne],x,o.props.style),ref:R},ie))}))});y$.muiSupportAuto=!0;const tle=y$,nle=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],rle=t=>{const{classes:e,disableUnderline:n}=t,i=an({root:["root",!n&&"underline"],input:["input"]},Soe,e);return j({},e,i)},ile=st(xE,{shouldForwardProp:t=>ao(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...vE(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})`),j({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"},[`&.${Rf.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Rf.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(.${Rf.disabled}, .${Rf.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Rf.disabled}:before`]:{borderBottomStyle:"dotted"}})}),ole=st(bE,{name:"MuiInput",slot:"Input",overridesResolver:yE})({}),x$=F.forwardRef(function(e,n){var r,i,o,a;const s=ln({props:e,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:f,fullWidth:p=!1,inputComponent:m="input",multiline:v=!1,slotProps:x,slots:_={},type:b="text"}=s,y=ht(s,nle),S=rle(s),C={root:{ownerState:{disableUnderline:l}}},A=x??f?So(x??f,C):C,R=(r=(i=_.root)!=null?i:c.Root)!=null?r:ile,P=(o=(a=_.input)!=null?a:c.Input)!=null?o:ole;return O.jsx(II,j({slots:{root:R,input:P},slotProps:A,fullWidth:p,inputComponent:m,multiline:v,ref:n,type:b},y,{classes:S}))});x$.muiName="Input";const b$=x$;function ale(t){return tn("MuiInputLabel",t)}Zt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const sle=["disableAnimation","margin","shrink","variant","className"],lle=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:a,required:s}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${Qe(r)}`,a],asterisk:[s&&"asterisk"]},c=an(l,ale,e);return j({},e,c)},cle=st(LI,{shouldForwardProp:t=>ao(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Oy.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})=>j({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"&&j({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&&j({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"&&j({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)"}))),ule=F.forwardRef(function(e,n){const r=ln({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:a}=r,s=ht(r,sle),l=Lu();let c=o;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const f=cd({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),p=j({},r,{disableAnimation:i,formControl:l,shrink:c,size:f.size,variant:f.variant,required:f.required,focused:f.focused}),m=lle(p);return O.jsx(cle,j({"data-shrink":c,ownerState:p,ref:n,className:gt(m.root,a)},s,{classes:m}))}),dc=ule,fle=F.createContext({}),kh=fle;function dle(t){return tn("MuiList",t)}Zt("MuiList",["root","padding","dense","subheader"]);const hle=["children","className","component","dense","disablePadding","subheader"],ple=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return an({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},dle,e)},mle=st("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})=>j({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),gle=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiList"}),{children:i,className:o,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:c}=r,f=ht(r,hle),p=F.useMemo(()=>({dense:s}),[s]),m=j({},r,{component:a,dense:s,disablePadding:l}),v=ple(m);return O.jsx(kh.Provider,{value:p,children:O.jsxs(mle,j({as:a,className:gt(v.root,o),ref:n,ownerState:m},f,{children:[c,i]}))})}),_$=gle;function vle(t){return tn("MuiListItem",t)}const yle=Zt("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),zm=yle,xle=Zt("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),ble=xle;function _le(t){return tn("MuiListItemSecondaryAction",t)}Zt("MuiListItemSecondaryAction",["root","disableGutters"]);const wle=["className"],Sle=t=>{const{disableGutters:e,classes:n}=t;return an({root:["root",e&&"disableGutters"]},_le,n)},Mle=st("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})(({ownerState:t})=>j({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),w$=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,o=ht(r,wle),a=F.useContext(kh),s=j({},r,{disableGutters:a.disableGutters}),l=Sle(s);return O.jsx(Mle,j({className:gt(l.root,i),ownerState:s,ref:n},o))});w$.muiName="ListItemSecondaryAction";const Ele=w$,Cle=["className"],Tle=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],Ale=(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]},Rle=t=>{const{alignItems:e,button:n,classes:r,dense:i,disabled:o,disableGutters:a,disablePadding:s,divider:l,hasSecondaryAction:c,selected:f}=t;return an({root:["root",i&&"dense",!a&&"gutters",!s&&"padding",l&&"divider",o&&"disabled",n&&"button",e==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",f&&"selected"],container:["container"]},vle,r)},Ple=st("div",{name:"MuiListItem",slot:"Root",overridesResolver:Ale})(({theme:t,ownerState:e})=>j({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&j({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${ble.root}`]:{paddingRight:48}},{[`&.${zm.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${zm.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${zm.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${zm.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"}},[`&.${zm.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Ln(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})`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),Ile=st("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),Lle=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiListItem"}),{alignItems:i="center",autoFocus:o=!1,button:a=!1,children:s,className:l,component:c,components:f={},componentsProps:p={},ContainerComponent:m="li",ContainerProps:{className:v}={},dense:x=!1,disabled:_=!1,disableGutters:b=!1,disablePadding:y=!1,divider:S=!1,focusVisibleClassName:M,secondaryAction:C,selected:A=!1,slotProps:R={},slots:P={}}=r,U=ht(r.ContainerProps,Cle),k=ht(r,Tle),N=F.useContext(kh),z=F.useMemo(()=>({dense:x||N.dense||!1,alignItems:i,disableGutters:b}),[i,N.dense,x,b]),K=F.useRef(null);Ws(()=>{o&&K.current&&K.current.focus()},[o]);const J=F.Children.toArray(s),G=J.length&&Ty(J[J.length-1],["ListItemSecondaryAction"]),ne=j({},r,{alignItems:i,autoFocus:o,button:a,dense:z.dense,disabled:_,disableGutters:b,disablePadding:y,divider:S,hasSecondaryAction:G,selected:A}),ie=Rle(ne),se=Ur(K,n),H=P.root||f.Root||Ple,Y=R.root||p.root||{},te=j({className:gt(ie.root,Y.className,l),disabled:_},k);let Q=c||"li";return a&&(te.component=c||"div",te.focusVisibleClassName=gt(zm.focusVisible,M),Q=Kh),G?(Q=!te.component&&!c?"div":Q,m==="li"&&(Q==="li"?Q="div":te.component==="li"&&(te.component="div")),O.jsx(kh.Provider,{value:z,children:O.jsxs(Ile,j({as:m,className:gt(ie.container,v),ref:se,ownerState:ne},U,{children:[O.jsx(H,j({},Y,!Zg(H)&&{as:Q,ownerState:j({},ne,Y.ownerState)},te,{children:J})),J.pop()]}))})):O.jsx(kh.Provider,{value:z,children:O.jsxs(H,j({},Y,{as:Q,ref:se},!Zg(H)&&{ownerState:j({},ne,Y.ownerState)},te,{children:[J,C&&O.jsx(Ele,{children:C})]}))})}),Ole=Lle,kle=Zt("MuiListItemIcon",["root","alignItemsFlexStart"]),X5=kle,Nle=Zt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),q5=Nle,Dle=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function YC(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function Y5(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function S$(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 Nv(t,e,n,r,i,o){let a=!1,s=i(t,e,e?n:!1);for(;s;){if(s===t.firstChild){if(a)return!1;a=!0}const l=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!S$(s,o)||l)s=i(t,s,n);else return s.focus(),!0}return!1}const Fle=F.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:f,variant:p="selectedMenu"}=e,m=ht(e,Dle),v=F.useRef(null),x=F.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ws(()=>{i&&v.current.focus()},[i]),F.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(M,C)=>{const A=!v.current.style.width;if(M.clientHeight{const C=v.current,A=M.key,R=Mo(C).activeElement;if(A==="ArrowDown")M.preventDefault(),Nv(C,R,c,l,YC);else if(A==="ArrowUp")M.preventDefault(),Nv(C,R,c,l,Y5);else if(A==="Home")M.preventDefault(),Nv(C,null,c,l,YC);else if(A==="End")M.preventDefault(),Nv(C,null,c,l,Y5);else if(A.length===1){const P=x.current,U=A.toLowerCase(),k=performance.now();P.keys.length>0&&(k-P.lastTime>500?(P.keys=[],P.repeating=!0,P.previousKeyMatched=!0):P.repeating&&U!==P.keys[0]&&(P.repeating=!1)),P.lastTime=k,P.keys.push(U);const N=R&&!P.repeating&&S$(R,P);P.previousKeyMatched&&(N||Nv(C,R,!1,l,YC,P))?M.preventDefault():P.previousKeyMatched=!1}f&&f(M)},b=Ur(v,n);let y=-1;F.Children.forEach(a,(M,C)=>{if(!F.isValidElement(M)){y===C&&(y+=1,y>=a.length&&(y=-1));return}M.props.disabled||(p==="selectedMenu"&&M.props.selected||y===-1)&&(y=C),y===C&&(M.props.disabled||M.props.muiSkipListHighlight||M.type.muiSkipListHighlight)&&(y+=1,y>=a.length&&(y=-1))});const S=F.Children.map(a,(M,C)=>{if(C===y){const A={};return o&&(A.autoFocus=!0),M.props.tabIndex===void 0&&p==="selectedMenu"&&(A.tabIndex=0),F.cloneElement(M,A)}return M});return O.jsx(_$,j({role:"menu",ref:b,className:s,onKeyDown:_,tabIndex:i?0:-1},m,{children:S}))}),Ule=Fle;function Ble(t){return tn("MuiPopover",t)}Zt("MuiPopover",["root","paper"]);const zle=["onEntering"],$le=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],Hle=["slotProps"];function K5(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function Z5(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function Q5(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function KC(t){return typeof t=="function"?t():t}const Vle=t=>{const{classes:e}=t;return an({root:["root"],paper:["paper"]},Ble,e)},Wle=st(f$,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),M$=st(lp,{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}),Gle=F.forwardRef(function(e,n){var r,i,o;const a=ln({props:e,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:f,anchorReference:p="anchorEl",children:m,className:v,container:x,elevation:_=8,marginThreshold:b=16,open:y,PaperProps:S={},slots:M,slotProps:C,transformOrigin:A={vertical:"top",horizontal:"left"},TransitionComponent:R=tle,transitionDuration:P="auto",TransitionProps:{onEntering:U}={},disableScrollLock:k=!1}=a,N=ht(a.TransitionProps,zle),z=ht(a,$le),K=(r=C==null?void 0:C.paper)!=null?r:S,J=F.useRef(),G=Ur(J,K.ref),ne=j({},a,{anchorOrigin:c,anchorReference:p,elevation:_,marginThreshold:b,externalPaperSlotProps:K,transformOrigin:A,TransitionComponent:R,transitionDuration:P,TransitionProps:N}),ie=Vle(ne),se=F.useCallback(()=>{if(p==="anchorPosition")return f;const Ae=KC(l),ve=(Ae&&Ae.nodeType===1?Ae:Mo(J.current).body).getBoundingClientRect();return{top:ve.top+K5(ve,c.vertical),left:ve.left+Z5(ve,c.horizontal)}},[l,c.horizontal,c.vertical,f,p]),H=F.useCallback(Ae=>({vertical:K5(Ae,A.vertical),horizontal:Z5(Ae,A.horizontal)}),[A.horizontal,A.vertical]),Y=F.useCallback(Ae=>{const ge={width:Ae.offsetWidth,height:Ae.offsetHeight},ve=H(ge);if(p==="none")return{top:null,left:null,transformOrigin:Q5(ve)};const Ue=se();let We=Ue.top-ve.vertical,Je=Ue.left-ve.horizontal;const ot=We+ge.height,ft=Je+ge.width,lt=xc(KC(l)),Ht=lt.innerHeight-b,ee=lt.innerWidth-b;if(b!==null&&WeHt){const $=ot-Ht;We-=$,ve.vertical+=$}if(b!==null&&Jeee){const $=ft-ee;Je-=$,ve.horizontal+=$}return{top:`${Math.round(We)}px`,left:`${Math.round(Je)}px`,transformOrigin:Q5(ve)}},[l,p,se,H,b]),[te,Q]=F.useState(y),ae=F.useCallback(()=>{const Ae=J.current;if(!Ae)return;const ge=Y(Ae);ge.top!==null&&(Ae.style.top=ge.top),ge.left!==null&&(Ae.style.left=ge.left),Ae.style.transformOrigin=ge.transformOrigin,Q(!0)},[Y]);F.useEffect(()=>(k&&window.addEventListener("scroll",ae),()=>window.removeEventListener("scroll",ae)),[l,k,ae]);const xe=(Ae,ge)=>{U&&U(Ae,ge),ae()},we=()=>{Q(!1)};F.useEffect(()=>{y&&ae()}),F.useImperativeHandle(s,()=>y?{updatePosition:()=>{ae()}}:null,[y,ae]),F.useEffect(()=>{if(!y)return;const Ae=$M(()=>{ae()}),ge=xc(l);return ge.addEventListener("resize",Ae),()=>{Ae.clear(),ge.removeEventListener("resize",Ae)}},[l,y,ae]);let Te=P;P==="auto"&&!R.muiSupportAuto&&(Te=void 0);const Ve=x||(l?Mo(KC(l)).body:void 0),Ye=(i=M==null?void 0:M.root)!=null?i:Wle,et=(o=M==null?void 0:M.paper)!=null?o:M$,ct=Zh({elementType:et,externalSlotProps:j({},K,{style:te?K.style:j({},K.style,{opacity:0})}),additionalProps:{elevation:_,ref:G},ownerState:ne,className:gt(ie.paper,K==null?void 0:K.className)}),Lt=Zh({elementType:Ye,externalSlotProps:(C==null?void 0:C.root)||{},externalForwardedProps:z,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:Ve,open:y},ownerState:ne,className:gt(ie.root,v)}),{slotProps:$e}=Lt,oe=ht(Lt,Hle);return O.jsx(Ye,j({},oe,!Zg(Ye)&&{slotProps:$e,disableScrollLock:k},{children:O.jsx(R,j({appear:!0,in:y,onEntering:xe,onExited:we,timeout:Te},N,{children:O.jsx(et,j({},ct,{children:m}))}))}))}),E$=Gle;function jle(t){return tn("MuiMenu",t)}Zt("MuiMenu",["root","paper","list"]);const Xle=["onEntering"],qle=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Yle={vertical:"top",horizontal:"right"},Kle={vertical:"top",horizontal:"left"},Zle=t=>{const{classes:e}=t;return an({root:["root"],paper:["paper"],list:["list"]},jle,e)},Qle=st(E$,{shouldForwardProp:t=>ao(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Jle=st(M$,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),ece=st(Ule,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),tce=F.forwardRef(function(e,n){var r,i;const o=ln({props:e,name:"MuiMenu"}),{autoFocus:a=!0,children:s,className:l,disableAutoFocusItem:c=!1,MenuListProps:f={},onClose:p,open:m,PaperProps:v={},PopoverClasses:x,transitionDuration:_="auto",TransitionProps:{onEntering:b}={},variant:y="selectedMenu",slots:S={},slotProps:M={}}=o,C=ht(o.TransitionProps,Xle),A=ht(o,qle),R=ax(),P=R.direction==="rtl",U=j({},o,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:f,onEntering:b,PaperProps:v,transitionDuration:_,TransitionProps:C,variant:y}),k=Zle(U),N=a&&!c&&m,z=F.useRef(null),K=(Y,te)=>{z.current&&z.current.adjustStyleForScrollbar(Y,R),b&&b(Y,te)},J=Y=>{Y.key==="Tab"&&(Y.preventDefault(),p&&p(Y,"tabKeyDown"))};let G=-1;F.Children.map(s,(Y,te)=>{F.isValidElement(Y)&&(Y.props.disabled||(y==="selectedMenu"&&Y.props.selected||G===-1)&&(G=te))});const ne=(r=S.paper)!=null?r:Jle,ie=(i=M.paper)!=null?i:v,se=Zh({elementType:S.root,externalSlotProps:M.root,ownerState:U,className:[k.root,l]}),H=Zh({elementType:ne,externalSlotProps:ie,ownerState:U,className:k.paper});return O.jsx(Qle,j({onClose:p,anchorOrigin:{vertical:"bottom",horizontal:P?"right":"left"},transformOrigin:P?Yle:Kle,slots:{paper:ne,root:S.root},slotProps:{root:se,paper:H},open:m,ref:n,transitionDuration:_,TransitionProps:j({onEntering:K},C),ownerState:U},A,{classes:x,children:O.jsx(ece,j({onKeyDown:J,actions:z,autoFocus:a&&(G===-1||c),autoFocusItem:N,variant:y},f,{className:gt(k.list,f.className),children:s}))}))}),nce=tce;function rce(t){return tn("MuiMenuItem",t)}const ice=Zt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Dv=ice,oce=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],ace=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},sce=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=t,l=an({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},rce,a);return j({},a,l)},lce=st(Kh,{shouldForwardProp:t=>ao(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:ace})(({theme:t,ownerState:e})=>j({},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"}},[`&.${Dv.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Dv.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Dv.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Ln(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})`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Dv.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Dv.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${V5.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${V5.inset}`]:{marginLeft:52},[`& .${q5.root}`]:{marginTop:0,marginBottom:0},[`& .${q5.inset}`]:{paddingLeft:36},[`& .${X5.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&j({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${X5.root} svg`]:{fontSize:"1.25rem"}}))),cce=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:c,role:f="menuitem",tabIndex:p,className:m}=r,v=ht(r,oce),x=F.useContext(kh),_=F.useMemo(()=>({dense:a||x.dense||!1,disableGutters:l}),[x.dense,a,l]),b=F.useRef(null);Ws(()=>{i&&b.current&&b.current.focus()},[i]);const y=j({},r,{dense:_.dense,divider:s,disableGutters:l}),S=sce(r),M=Ur(b,n);let C;return r.disabled||(C=p!==void 0?p:-1),O.jsx(kh.Provider,{value:_,children:O.jsx(lce,j({ref:M,role:f,tabIndex:C,component:o,focusVisibleClassName:gt(S.focusVisible,c),className:gt(S.root,m)},v,{ownerState:y,classes:S}))})}),$i=cce;function uce(t){return tn("MuiNativeSelect",t)}const fce=Zt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),OI=fce,dce=["className","disabled","error","IconComponent","inputRef","variant"],hce=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${Qe(n)}`,o&&"iconOpen",r&&"disabled"]};return an(s,uce,e)},C$=({ownerState:t,theme:e})=>j({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":j({},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"},[`&.${OI.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}}),pce=st("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:ao,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${OI.multiple}`]:e.multiple}]}})(C$),T$=({ownerState:t,theme:e})=>j({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${OI.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),mce=st("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Qe(n.variant)}`],n.open&&e.iconOpen]}})(T$),gce=F.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:a,inputRef:s,variant:l="standard"}=e,c=ht(e,dce),f=j({},e,{disabled:i,variant:l,error:o}),p=hce(f);return O.jsxs(F.Fragment,{children:[O.jsx(pce,j({ownerState:f,className:gt(p.select,r),disabled:i,ref:s||n},c)),e.multiple?null:O.jsx(mce,{as:a,ownerState:f,className:p.icon})]})}),vce=gce;var J5;const yce=["children","classes","className","label","notched"],xce=st("fieldset",{shouldForwardProp:ao})({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%"}),bce=st("legend",{shouldForwardProp:ao})(({ownerState:t,theme:e})=>j({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&&j({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 _ce(t){const{className:e,label:n,notched:r}=t,i=ht(t,yce),o=n!=null&&n!=="",a=j({},t,{notched:r,withLabel:o});return O.jsx(xce,j({"aria-hidden":!0,className:e,ownerState:a},i,{children:O.jsx(bce,{ownerState:a,children:o?O.jsx("span",{children:n}):J5||(J5=O.jsx("span",{className:"notranslate",children:"​"}))})}))}const wce=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],Sce=t=>{const{classes:e}=t,r=an({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Eoe,e);return j({},e,r)},Mce=st(xE,{shouldForwardProp:t=>ao(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:vE})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return j({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${ec.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${ec.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${ec.focused} .${ec.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${ec.error} .${ec.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${ec.disabled} .${ec.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&j({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),Ece=st(_ce,{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}}),Cce=st(bE,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:yE})(({theme:t,ownerState:e})=>j({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})),A$=F.forwardRef(function(e,n){var r,i,o,a,s;const l=ln({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:f=!1,inputComponent:p="input",label:m,multiline:v=!1,notched:x,slots:_={},type:b="text"}=l,y=ht(l,wce),S=Sce(l),M=Lu(),C=cd({props:l,muiFormControl:M,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),A=j({},l,{color:C.color||"primary",disabled:C.disabled,error:C.error,focused:C.focused,formControl:M,fullWidth:f,hiddenLabel:C.hiddenLabel,multiline:v,size:C.size,type:b}),R=(r=(i=_.root)!=null?i:c.Root)!=null?r:Mce,P=(o=(a=_.input)!=null?a:c.Input)!=null?o:Cce;return O.jsx(II,j({slots:{root:R,input:P},renderSuffix:U=>O.jsx(Ece,{ownerState:A,className:S.notchedOutline,label:m!=null&&m!==""&&C.required?s||(s=O.jsxs(F.Fragment,{children:[m," ","*"]})):m,notched:typeof x<"u"?x:!!(U.startAdornment||U.filled||U.focused)}),fullWidth:f,inputComponent:p,multiline:v,ref:n,type:b},y,{classes:j({},S,{notchedOutline:null})}))});A$.muiName="Input";const R$=A$,Tce=Pu(O.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),Ace=Pu(O.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),Rce=st("span",{shouldForwardProp:ao})({position:"relative",display:"flex"}),Pce=st(Tce)({transform:"scale(1)"}),Ice=st(Ace)(({theme:t,ownerState:e})=>j({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest})},e.checked&&{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}));function P$(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i=j({},t,{checked:e});return O.jsxs(Rce,{className:n.root,ownerState:i,children:[O.jsx(Pce,{fontSize:r,className:n.background,ownerState:i}),O.jsx(Ice,{fontSize:r,className:n.dot,ownerState:i})]})}const Lce=F.createContext(void 0),I$=Lce;function Oce(){return F.useContext(I$)}function kce(t){return tn("MuiRadio",t)}const Nce=Zt("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),eN=Nce,Dce=["checked","checkedIcon","color","icon","name","onChange","size","className"],Fce=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${Qe(n)}`,r!=="medium"&&`size${Qe(r)}`]};return j({},e,an(i,kce,e))},Uce=st(u$,{shouldForwardProp:t=>ao(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${Qe(n.size)}`],e[`color${Qe(n.color)}`]]}})(({theme:t,ownerState:e})=>j({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})`:Ln(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${eN.checked}`]:{color:(t.vars||t).palette[e.color].main}},{[`&.${eN.disabled}`]:{color:(t.vars||t).palette.action.disabled}}));function Bce(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const tN=O.jsx(P$,{checked:!0}),nN=O.jsx(P$,{}),zce=F.forwardRef(function(e,n){var r,i;const o=ln({props:e,name:"MuiRadio"}),{checked:a,checkedIcon:s=tN,color:l="primary",icon:c=nN,name:f,onChange:p,size:m="medium",className:v}=o,x=ht(o,Dce),_=j({},o,{color:l,size:m}),b=Fce(_),y=Oce();let S=a;const M=CS(p,y&&y.onChange);let C=f;return y&&(typeof S>"u"&&(S=Bce(y.value,o.value)),typeof C>"u"&&(C=y.name)),O.jsx(Uce,j({type:"radio",icon:F.cloneElement(c,{fontSize:(r=nN.props.fontSize)!=null?r:m}),checkedIcon:F.cloneElement(s,{fontSize:(i=tN.props.fontSize)!=null?i:m}),ownerState:_,classes:b,name:C,checked:S,onChange:M,ref:n,className:gt(b.root,v)},x))}),Og=zce,$ce=["actions","children","defaultValue","name","onChange","value"],Hce=F.forwardRef(function(e,n){const{actions:r,children:i,defaultValue:o,name:a,onChange:s,value:l}=e,c=ht(e,$ce),f=F.useRef(null),[p,m]=$f({controlled:l,default:o,name:"RadioGroup"});F.useImperativeHandle(r,()=>({focus:()=>{let b=f.current.querySelector("input:not(:disabled):checked");b||(b=f.current.querySelector("input:not(:disabled)")),b&&b.focus()}}),[]);const v=Ur(n,f),x=nx(a),_=F.useMemo(()=>({name:x,onChange(b){m(b.target.value),s&&s(b,b.target.value)},value:p}),[x,s,m,p]);return O.jsx(I$.Provider,{value:_,children:O.jsx(v$,j({role:"radiogroup",ref:v},c,{children:i}))})}),L$=Hce;function Vce(t){return tn("MuiSelect",t)}const Wce=Zt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Fv=Wce;var rN;const Gce=["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"],jce=st("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${Fv.select}`]:e.select},{[`&.${Fv.select}`]:e[n.variant]},{[`&.${Fv.error}`]:e.error},{[`&.${Fv.multiple}`]:e.multiple}]}})(C$,{[`&.${Fv.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Xce=st("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Qe(n.variant)}`],n.open&&e.iconOpen]}})(T$),qce=st("input",{shouldForwardProp:t=>Qte(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 iN(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function Yce(t){return t==null||typeof t=="string"&&!t.trim()}const Kce=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${Qe(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return an(s,Vce,e)},Zce=F.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":o,autoFocus:a,autoWidth:s,children:l,className:c,defaultOpen:f,defaultValue:p,disabled:m,displayEmpty:v,error:x=!1,IconComponent:_,inputRef:b,labelId:y,MenuProps:S={},multiple:M,name:C,onBlur:A,onChange:R,onClose:P,onFocus:U,onOpen:k,open:N,readOnly:z,renderValue:K,SelectDisplayProps:J={},tabIndex:G,value:ne,variant:ie="standard"}=e,se=ht(e,Gce),[H,Y]=$f({controlled:ne,default:p,name:"Select"}),[te,Q]=$f({controlled:N,default:f,name:"Select"}),ae=F.useRef(null),xe=F.useRef(null),[we,Te]=F.useState(null),{current:Ve}=F.useRef(N!=null),[Ye,et]=F.useState(),ct=Ur(n,b),Lt=F.useCallback(Ze=>{xe.current=Ze,Ze&&Te(Ze)},[]),$e=we==null?void 0:we.parentNode;F.useImperativeHandle(ct,()=>({focus:()=>{xe.current.focus()},node:ae.current,value:H}),[H]),F.useEffect(()=>{f&&te&&we&&!Ve&&(et(s?null:$e.clientWidth),xe.current.focus())},[we,s]),F.useEffect(()=>{a&&xe.current.focus()},[a]),F.useEffect(()=>{if(!y)return;const Ze=Mo(xe.current).getElementById(y);if(Ze){const Oe=()=>{getSelection().isCollapsed&&xe.current.focus()};return Ze.addEventListener("click",Oe),()=>{Ze.removeEventListener("click",Oe)}}},[y]);const oe=(Ze,Oe)=>{Ze?k&&k(Oe):P&&P(Oe),Ve||(et(s?null:$e.clientWidth),Q(Ze))},Ae=Ze=>{Ze.button===0&&(Ze.preventDefault(),xe.current.focus(),oe(!0,Ze))},ge=Ze=>{oe(!1,Ze)},ve=F.Children.toArray(l),Ue=Ze=>{const Oe=ve.find(Ut=>Ut.props.value===Ze.target.value);Oe!==void 0&&(Y(Oe.props.value),R&&R(Ze,Oe))},We=Ze=>Oe=>{let Ut;if(Oe.currentTarget.hasAttribute("tabindex")){if(M){Ut=Array.isArray(H)?H.slice():[];const Et=H.indexOf(Ze.props.value);Et===-1?Ut.push(Ze.props.value):Ut.splice(Et,1)}else Ut=Ze.props.value;if(Ze.props.onClick&&Ze.props.onClick(Oe),H!==Ut&&(Y(Ut),R)){const Et=Oe.nativeEvent||Oe,Nt=new Et.constructor(Et.type,Et);Object.defineProperty(Nt,"target",{writable:!0,value:{value:Ut,name:C}}),R(Nt,Ze)}M||oe(!1,Oe)}},Je=Ze=>{z||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Ze.key)!==-1&&(Ze.preventDefault(),oe(!0,Ze))},ot=we!==null&&te,ft=Ze=>{!ot&&A&&(Object.defineProperty(Ze,"target",{writable:!0,value:{value:H,name:C}}),A(Ze))};delete se["aria-invalid"];let lt,Ht;const ee=[];let $=!1;(OS({value:H})||v)&&(K?lt=K(H):$=!0);const ye=ve.map(Ze=>{if(!F.isValidElement(Ze))return null;let Oe;if(M){if(!Array.isArray(H))throw new Error(Kf(2));Oe=H.some(Ut=>iN(Ut,Ze.props.value)),Oe&&$&&ee.push(Ze.props.children)}else Oe=iN(H,Ze.props.value),Oe&&$&&(Ht=Ze.props.children);return F.cloneElement(Ze,{"aria-selected":Oe?"true":"false",onClick:We(Ze),onKeyUp:Ut=>{Ut.key===" "&&Ut.preventDefault(),Ze.props.onKeyUp&&Ze.props.onKeyUp(Ut)},role:"option",selected:Oe,value:void 0,"data-value":Ze.props.value})});$&&(M?ee.length===0?lt=null:lt=ee.reduce((Ze,Oe,Ut)=>(Ze.push(Oe),Ut{const{classes:e}=t;return e},kI={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>ao(t)&&t!=="variant",slot:"Root"},nue=st(b$,kI)(""),rue=st(R$,kI)(""),iue=st(g$,kI)(""),O$=F.forwardRef(function(e,n){const r=ln({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:f=s$,id:p,input:m,inputProps:v,label:x,labelId:_,MenuProps:b,multiple:y=!1,native:S=!1,onClose:M,onOpen:C,open:A,renderValue:R,SelectDisplayProps:P,variant:U="outlined"}=r,k=ht(r,Jce),N=S?vce:Qce,z=Lu(),K=cd({props:r,muiFormControl:z,states:["variant","error"]}),J=K.variant||U,G=j({},r,{variant:J,classes:a}),ne=tue(G),ie=ht(ne,eue),se=m||{standard:O.jsx(nue,{ownerState:G}),outlined:O.jsx(rue,{label:x,ownerState:G}),filled:O.jsx(iue,{ownerState:G})}[J],H=Ur(n,se.ref);return O.jsx(F.Fragment,{children:F.cloneElement(se,j({inputComponent:N,inputProps:j({children:o,error:K.error,IconComponent:f,variant:J,type:void 0,multiple:y},S?{id:p}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:_,MenuProps:b,onClose:M,onOpen:C,open:A,renderValue:R,SelectDisplayProps:j({id:p},P)},v,{classes:v?So(ie,v.classes):ie},m?m.props.inputProps:{})},y&&S&&J==="outlined"?{notched:!0}:{},{ref:H,className:gt(se.props.className,s,ne.root)},!m&&{variant:J},k))})});O$.muiName="Select";const hc=O$,oue=F.createContext(),k$=oue;function aue(t){return tn("MuiTable",t)}Zt("MuiTable",["root","stickyHeader"]);const sue=["className","component","padding","size","stickyHeader"],lue=t=>{const{classes:e,stickyHeader:n}=t;return an({root:["root",n&&"stickyHeader"]},aue,e)},cue=st("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>j({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":j({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),oN="table",uue=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiTable"}),{className:i,component:o=oN,padding:a="normal",size:s="medium",stickyHeader:l=!1}=r,c=ht(r,sue),f=j({},r,{component:o,padding:a,size:s,stickyHeader:l}),p=lue(f),m=F.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return O.jsx(k$.Provider,{value:m,children:O.jsx(cue,j({as:o,role:o===oN?null:"table",ref:n,className:gt(p.root,i),ownerState:f},c))})}),fue=uue,due=F.createContext(),SE=due;function hue(t){return tn("MuiTableBody",t)}Zt("MuiTableBody",["root"]);const pue=["className","component"],mue=t=>{const{classes:e}=t;return an({root:["root"]},hue,e)},gue=st("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),vue={variant:"body"},aN="tbody",yue=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiTableBody"}),{className:i,component:o=aN}=r,a=ht(r,pue),s=j({},r,{component:o}),l=mue(s);return O.jsx(SE.Provider,{value:vue,children:O.jsx(gue,j({className:gt(l.root,i),as:o,ref:n,role:o===aN?null:"rowgroup",ownerState:s},a))})}),xue=yue;function bue(t){return tn("MuiTableCell",t)}const _ue=Zt("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),wue=_ue,Sue=["align","className","component","padding","scope","size","sortDirection","variant"],Mue=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:a}=t,s={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${Qe(r)}`,i!=="normal"&&`padding${Qe(i)}`,`size${Qe(o)}`]};return an(s,bue,e)},Eue=st("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${Qe(n.size)}`],n.padding!=="normal"&&e[`padding${Qe(n.padding)}`],n.align!=="inherit"&&e[`align${Qe(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>j({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid - ${t.palette.mode==="light"?Wz(Ln(t.palette.divider,1),.88):Vz(Ln(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",[`&.${wue.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})),Cue=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:a,padding:s,scope:l,size:c,sortDirection:f,variant:p}=r,m=ht(r,Sue),v=F.useContext(k$),x=F.useContext(SE),_=x&&x.variant==="head";let b;a?b=a:b=_?"th":"td";let y=l;b==="td"?y=void 0:!y&&_&&(y="col");const S=p||x&&x.variant,M=j({},r,{align:i,component:b,padding:s||(v&&v.padding?v.padding:"normal"),size:c||(v&&v.size?v.size:"medium"),sortDirection:f,stickyHeader:S==="head"&&v&&v.stickyHeader,variant:S}),C=Mue(M);let A=null;return f&&(A=f==="asc"?"ascending":"descending"),O.jsx(Eue,j({as:b,ref:n,className:gt(C.root,o),"aria-sort":A,scope:y,ownerState:M},m))}),vo=Cue;function Tue(t){return tn("MuiTableContainer",t)}Zt("MuiTableContainer",["root"]);const Aue=["className","component"],Rue=t=>{const{classes:e}=t;return an({root:["root"]},Tue,e)},Pue=st("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),Iue=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,a=ht(r,Aue),s=j({},r,{component:o}),l=Rue(s);return O.jsx(Pue,j({ref:n,as:o,className:gt(l.root,i),ownerState:s},a))}),Lue=Iue;function Oue(t){return tn("MuiTableHead",t)}Zt("MuiTableHead",["root"]);const kue=["className","component"],Nue=t=>{const{classes:e}=t;return an({root:["root"]},Oue,e)},Due=st("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),Fue={variant:"head"},sN="thead",Uue=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiTableHead"}),{className:i,component:o=sN}=r,a=ht(r,kue),s=j({},r,{component:o}),l=Nue(s);return O.jsx(SE.Provider,{value:Fue,children:O.jsx(Due,j({as:o,className:gt(l.root,i),ref:n,role:o===sN?null:"rowgroup",ownerState:s},a))})}),Bue=Uue;function zue(t){return tn("MuiToolbar",t)}Zt("MuiToolbar",["root","gutters","regular","dense"]);const $ue=["className","component","disableGutters","variant"],Hue=t=>{const{classes:e,disableGutters:n,variant:r}=t;return an({root:["root",!n&&"gutters",r]},zue,e)},Vue=st("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})=>j({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),Wue=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:a=!1,variant:s="regular"}=r,l=ht(r,$ue),c=j({},r,{component:o,disableGutters:a,variant:s}),f=Hue(c);return O.jsx(Vue,j({as:o,className:gt(f.root,i),ref:n,ownerState:c},l))}),Gue=Wue;function jue(t){return tn("MuiTableRow",t)}const Xue=Zt("MuiTableRow",["root","selected","hover","head","footer"]),lN=Xue,que=["className","component","hover","selected"],Yue=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return an({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},jue,e)},Kue=st("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,[`&.${lN.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${lN.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Ln(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}))`:Ln(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),cN="tr",Zue=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiTableRow"}),{className:i,component:o=cN,hover:a=!1,selected:s=!1}=r,l=ht(r,que),c=F.useContext(SE),f=j({},r,{component:o,hover:a,selected:s,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),p=Yue(f);return O.jsx(Kue,j({as:o,ref:n,className:gt(p.root,i),role:o===cN?null:"row",ownerState:f},l))}),p_=Zue;function Que(t){return tn("MuiTextField",t)}Zt("MuiTextField",["root"]);const Jue=["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"],efe={standard:b$,filled:g$,outlined:R$},tfe=t=>{const{classes:e}=t;return an({root:["root"]},Que,e)},nfe=st($s,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),rfe=F.forwardRef(function(e,n){const r=ln({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:f=!1,error:p=!1,FormHelperTextProps:m,fullWidth:v=!1,helperText:x,id:_,InputLabelProps:b,inputProps:y,InputProps:S,inputRef:M,label:C,maxRows:A,minRows:R,multiline:P=!1,name:U,onBlur:k,onChange:N,onFocus:z,placeholder:K,required:J=!1,rows:G,select:ne=!1,SelectProps:ie,type:se,value:H,variant:Y="outlined"}=r,te=ht(r,Jue),Q=j({},r,{autoFocus:o,color:l,disabled:f,error:p,fullWidth:v,multiline:P,required:J,select:ne,variant:Y}),ae=tfe(Q),xe={};Y==="outlined"&&(b&&typeof b.shrink<"u"&&(xe.notched=b.shrink),xe.label=C),ne&&((!ie||!ie.native)&&(xe.id=void 0),xe["aria-describedby"]=void 0);const we=nx(_),Te=x&&we?`${we}-helper-text`:void 0,Ve=C&&we?`${we}-label`:void 0,Ye=efe[Y],et=O.jsx(Ye,j({"aria-describedby":Te,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:v,multiline:P,name:U,rows:G,maxRows:A,minRows:R,type:se,value:H,id:we,inputRef:M,onBlur:k,onChange:N,onFocus:z,placeholder:K,inputProps:y},xe,S));return O.jsxs(nfe,j({className:gt(ae.root,s),disabled:f,error:p,fullWidth:v,ref:n,required:J,color:l,variant:Y,ownerState:Q},te,{children:[C!=null&&C!==""&&O.jsx(dc,j({htmlFor:we,id:Ve},b,{children:C})),ne?O.jsx(hc,j({"aria-describedby":Te,id:we,labelId:Ve,value:H,input:et},ie,{children:a})):et,x&&O.jsx(Gse,j({id:Te},m,{children:x}))]}))}),es=rfe,ife="μ",N$="Å";var ii=(t=>(t.millimetre="mm",t[t.micrometre=ife+"m"]="micrometre",t))(ii||{}),Os=(t=>(t.electronVolts="eV",t.kiloElectronVolts="keV",t))(Os||{}),Gn=(t=>(t.nanmometres="nm",t[t.angstroms=N$]="angstroms",t))(Gn||{}),au=(t=>(t.nanmometres="1/nm",t[t.angstroms=`1/${N$}`]="angstroms",t))(au||{}),pl=(t=>(t.radians="rad",t.degrees="deg",t))(pl||{});const D$=299792458,F$=662607015e-42,uN=t=>sfe(F$*D$/afe(t)),fN=t=>ofe(F$*D$/lfe(t)),ofe=t=>t/1602e-19,afe=t=>t*1602e-19,sfe=t=>t*1e9,lfe=t=>t*1e-9,kS=t=>1e3*t,Nh=t=>t*10,pu=t=>t/10,cfe=t=>t*1e3,ZC=t=>t/1e3,wl=t=>{const e=parseFloat(t.trim());return!e&&e!=0?null:e},dN=t=>{let e;const n=new Set,r=(l,c)=>{const f=typeof l=="function"?l(e):l;if(!Object.is(f,e)){const p=e;e=c??typeof f!="object"?f:Object.assign({},e,f),n.forEach(m=>m(e,p))}},i=()=>e,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return e=t(r,i,s),s},ufe=t=>t?dN(t):dN;var U$={exports:{}},B$={},z$={exports:{}},$$={};/** - * @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 n0=F;function ffe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var dfe=typeof Object.is=="function"?Object.is:ffe,hfe=n0.useState,pfe=n0.useEffect,mfe=n0.useLayoutEffect,gfe=n0.useDebugValue;function vfe(t,e){var n=e(),r=hfe({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return mfe(function(){i.value=n,i.getSnapshot=e,QC(i)&&o({inst:i})},[t,n,e]),pfe(function(){return QC(i)&&o({inst:i}),t(function(){QC(i)&&o({inst:i})})},[t]),gfe(n),n}function QC(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!dfe(t,n)}catch{return!0}}function yfe(t,e){return e()}var xfe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?yfe:vfe;$$.useSyncExternalStore=n0.useSyncExternalStore!==void 0?n0.useSyncExternalStore:xfe;z$.exports=$$;var bfe=z$.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 ME=F,_fe=bfe;function wfe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Sfe=typeof Object.is=="function"?Object.is:wfe,Mfe=_fe.useSyncExternalStore,Efe=ME.useRef,Cfe=ME.useEffect,Tfe=ME.useMemo,Afe=ME.useDebugValue;B$.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=Efe(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=Tfe(function(){function l(v){if(!c){if(c=!0,f=v,v=r(v),i!==void 0&&a.hasValue){var x=a.value;if(i(x,v))return p=x}return p=v}if(x=p,Sfe(f,v))return x;var _=r(v);return i!==void 0&&i(x,_)?x:(f=v,p=_)}var c=!1,f,p,m=n===void 0?null:n;return[function(){return l(e())},m===null?void 0:function(){return l(m())}]},[e,n,r,i]);var s=Mfe(t,o[0],o[1]);return Cfe(function(){a.hasValue=!0,a.value=s},[s]),Afe(s),s};U$.exports=B$;var Rfe=U$.exports;const H$=Au(Rfe),{useDebugValue:Pfe}=Z,{useSyncExternalStoreWithSelector:Ife}=H$;function Lfe(t,e=t.getState,n){const r=Ife(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return Pfe(r),r}const hN=t=>{const e=typeof t=="function"?ufe(t):t,n=(r,i)=>Lfe(e,r,i);return Object.assign(n,e),n},g0=t=>t?hN(t):hN,Ofe={"Pilatus P3-2M":{resolution:{width:1475,height:1679},pixelSize:{width:.172,height:.172}},"long boy":{resolution:{width:1475,height:679},pixelSize:{width:.2,height:.2}}},kfe={"I22 SAXS Isotropic":{detector:"Pilatus P3-2M",beamstop:{centre:{x:738,y:100},diameter:4,clearance:10},cameraTube:{centre:{x:738,y:840},diameter:310},angle:1.57,wavelength:null,cameraLength:1.9,minWavelength:.062,maxWavelength:.335,minCameraLength:1.9,maxCameraLength:9.9,cameraLengthStep:1},"I22 SAXS Anisotropic":{detector:"Pilatus P3-2M",beamstop:{centre:{x:738,y:840},diameter:4,clearance:10},cameraTube:{centre:{x:738,y:840},diameter:310},angle:1.57,wavelength:null,cameraLength:1.9,minWavelength:.062,maxWavelength:.335,minCameraLength:1.9,maxCameraLength:9.9,cameraLengthStep:2}},pN=Ofe,v1=kfe,la=v1[Object.keys(v1)[0]],tu=g0(t=>({...la.beamstop,clearance:la.beamstop.clearance,diameterUnits:ii.millimetre,updateCentre:e=>t(n=>({centre:{...n.centre,...e}})),updateUnits:e=>t({diameterUnits:e}),updateClearance:e=>t({clearance:e}),updateBeamstop:e=>t(e)})),tc=g0(t=>({name:la.detector,current:{...pN[la.detector]},pixelUnits:ii.millimetre,detectorList:pN,updateDetector:e=>t(n=>({current:n.detectorList[e],name:e})),updateUnits:e=>t({pixelUnits:e})}));function Nfe(){const t=tu(v=>v.centre),e=tu(v=>v.updateCentre),n=v=>{e({x:wl(v.target.value)})},r=v=>{e({y:wl(v.target.value)})},i=tu(v=>v.diameterUnits===ii.micrometre?kS(v.diameter):v.diameter),o=tu(v=>v.diameterUnits),a=tu(v=>v.updateUnits),s=tu(v=>v.clearance),l=tu(v=>v.updateClearance),c=v=>{l(wl(v.target.value))},f=tc(v=>v.current),p=()=>{e({x:f.resolution.width/2,y:f.resolution.height/2})},m=()=>{e({x:f.resolution.width/2,y:0})};return O.jsxs(Fn,{spacing:1,children:[O.jsx(yn,{variant:"h6",children:" Beamstop "}),O.jsxs(Fn,{direction:"row",children:[O.jsxs(yn,{flexGrow:2,children:[" Diameter: ",i," "]}),O.jsxs($s,{children:[O.jsx(dc,{children:"units "}),O.jsxs(hc,{size:"small",label:"units",value:o,onChange:v=>a(v.target.value),children:[O.jsx($i,{value:ii.millimetre,children:ii.millimetre}),O.jsx($i,{value:ii.micrometre,children:ii.micrometre})]})]})]}),O.jsx(yn,{children:"Position:"}),O.jsxs(Fn,{direction:"row",spacing:2,children:[O.jsx(yn,{flexGrow:2,children:"x: "}),O.jsx(es,{type:"number",size:"small",value:t.x,onChange:n}),O.jsxs(yn,{flexGrow:2,align:"center",children:[" ","px"]}),O.jsx(H5,{size:"small",variant:"outlined",onClick:p,children:"Centre detector"})]}),O.jsxs(Fn,{direction:"row",spacing:1,children:[O.jsx(yn,{flexGrow:2,children:"y: "}),O.jsx(es,{type:"number",size:"small",value:t.y,onChange:r}),O.jsxs(yn,{flexGrow:2,align:"center",children:[" ","px"]}),O.jsx(H5,{size:"small",variant:"outlined",onClick:m,children:"Centre top edge"})]}),O.jsx(Fn,{direction:"row",children:O.jsxs(Fn,{direction:"row",spacing:1,children:[O.jsx(yn,{flexGrow:1,children:"Clearance: "}),O.jsx(es,{type:"number",size:"small",value:s,onChange:c}),O.jsx(yn,{children:"px"})]})})]})}const vh=g0(t=>({centre:{x:la.cameraTube.centre.x,y:la.cameraTube.centre.y},diameter:la.cameraTube.diameter,diameterUnits:ii.millimetre,updateCentre:e=>t(n=>({centre:{...n.centre,...e}})),updateUnits:e=>t({diameterUnits:e}),updateCameraTube:e=>t(e)}));function Dfe(){const t=vh(s=>s.centre),e=vh(s=>s.updateCentre),n=s=>{e({x:wl(s.target.value)})},r=s=>{e({y:wl(s.target.value)})},i=vh(s=>s.diameterUnits===ii.micrometre?kS(s.diameter):s.diameter),o=vh(s=>s.diameterUnits),a=vh(s=>s.updateUnits);return O.jsxs(l_,{spacing:1,children:[O.jsx(yn,{variant:"h6",children:" CameraTube "}),O.jsxs(l_,{direction:"row",children:[O.jsxs(yn,{flexGrow:2,children:[" Diameter: ",i," "]}),O.jsxs($s,{children:[O.jsx(dc,{children:"units "}),O.jsxs(hc,{size:"small",label:"units",value:o,onChange:s=>a(s.target.value),children:[O.jsx($i,{value:ii.millimetre,children:ii.millimetre}),O.jsx($i,{value:ii.micrometre,children:ii.micrometre})]})]})]}),O.jsx(yn,{children:"Position:"}),O.jsxs(l_,{direction:"row",children:[O.jsx(yn,{flexGrow:2,children:"x: "}),O.jsx(es,{type:"number",size:"small",value:t.x,onChange:n}),O.jsxs(yn,{flexGrow:2,align:"center",children:[" ","px"]})]}),O.jsxs(l_,{direction:"row",children:[O.jsx(yn,{flexGrow:2,children:"y: "}),O.jsx(es,{type:"number",size:"small",value:t.y,onChange:r}),O.jsxs(yn,{flexGrow:2,align:"center",children:[" ","px"]})]})]})}const kg=g0(t=>({preset:Object.keys(v1)[0],angle:la.angle,cameraLength:la.cameraLength,minWavelength:la.minWavelength,maxWavelength:la.maxWavelength,minCameraLength:la.minCameraLength,maxCameraLength:la.maxCameraLength,cameraLengthStep:la.cameraLengthStep,energy:null,wavelength:null,beamEnergyUnits:Os.kiloElectronVolts,angleUnits:pl.radians,wavelengthUnits:Gn.nanmometres,update:e=>t({...e})})),yo=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let mN=1234567;const V$=Math.PI/180,W$=180/Math.PI;function Ffe(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(yo[t&255]+yo[t>>8&255]+yo[t>>16&255]+yo[t>>24&255]+"-"+yo[e&255]+yo[e>>8&255]+"-"+yo[e>>16&15|64]+yo[e>>24&255]+"-"+yo[n&63|128]+yo[n>>8&255]+"-"+yo[n>>16&255]+yo[n>>24&255]+yo[r&255]+yo[r>>8&255]+yo[r>>16&255]+yo[r>>24&255]).toLowerCase()}function Ufe(t,e,n){return Math.max(e,Math.min(n,t))}function G$(t,e){return(t%e+e)%e}function Bfe(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function zfe(t,e,n){return t!==e?(n-t)/(e-t):0}function j$(t,e,n){return(1-n)*t+n*e}function $fe(t,e,n,r){return j$(t,e,1-Math.exp(-n*r))}function Hfe(t,e=1){return e-Math.abs(G$(t,e*2)-e)}function Vfe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Wfe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function Gfe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function jfe(t,e){return t+Math.random()*(e-t)}function Xfe(t){return t*(.5-Math.random())}function qfe(t){t!==void 0&&(mN=t);let e=mN+=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 Yfe(t){return t*V$}function Kfe(t){return t*W$}function Zfe(t){return(t&t-1)===0&&t!==0}function Qfe(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Jfe(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function ede(t,e,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((e+r)/2),f=a((e+r)/2),p=o((e-r)/2),m=a((e-r)/2),v=o((r-e)/2),x=a((r-e)/2);switch(i){case"XYX":t.set(s*f,l*p,l*m,s*c);break;case"YZY":t.set(l*m,s*f,l*p,s*c);break;case"ZXZ":t.set(l*p,l*m,s*f,s*c);break;case"XZX":t.set(s*f,l*x,l*v,s*c);break;case"YXY":t.set(l*v,s*f,l*x,s*c);break;case"ZYZ":t.set(l*x,l*v,s*f,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function tde(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 nde(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 gN={DEG2RAD:V$,RAD2DEG:W$,generateUUID:Ffe,clamp:Ufe,euclideanModulo:G$,mapLinear:Bfe,inverseLerp:zfe,lerp:j$,damp:$fe,pingpong:Hfe,smoothstep:Vfe,smootherstep:Wfe,randInt:Gfe,randFloat:jfe,randFloatSpread:Xfe,seededRandom:qfe,degToRad:Yfe,radToDeg:Kfe,isPowerOfTwo:Zfe,ceilPowerOfTwo:Qfe,floorPowerOfTwo:Jfe,setQuaternionFromProperEuler:ede,normalize:nde,denormalize:tde};function rde(){const t=kg(),e=kg(f=>f.wavelengthUnits===Gn.angstroms?Nh(f.minWavelength):f.minWavelength),n=kg(f=>f.wavelengthUnits===Gn.angstroms?Nh(f.maxWavelength):f.maxWavelength),r=f=>{const p=f.target.value;let m=t.angle;m!==null&&p===pl.degrees&&t.angleUnits===pl.radians?m=gN.radToDeg(m):m!==null&&p===pl.radians&&t.angleUnits===pl.degrees&&(m=gN.degToRad(m)),t.update({angle:m,angleUnits:p})},i=f=>{t.update({angle:wl(f.target.value)})},o=f=>{const p=wl(f.target.value);let m=null;if(p===null){t.update({energy:m,wavelength:p});return}t.wavelengthUnits===Gn.angstroms?m=fN(pu(p)):m=fN(p),t.beamEnergyUnits===Os.electronVolts&&(m=ZC(m)),t.update({energy:m,wavelength:p})},a=f=>{const p=f.target.value;let m=t.wavelength;m!==null&&p===Gn.angstroms&&t.wavelengthUnits===Gn.nanmometres?m=Nh(m):m!==null&&p===Gn.nanmometres&&t.wavelengthUnits===Gn.angstroms&&(m=pu(m)),t.update({wavelength:m,wavelengthUnits:p})},s=f=>{const p=wl(f.target.value);let m=null;if(p===null){t.update({energy:p,wavelength:m});return}t.beamEnergyUnits===Os.electronVolts?m=uN(ZC(p)):m=uN(p),t.wavelengthUnits===Gn.angstroms&&(m=pu(m)),t.update({energy:p,wavelength:m})},l=f=>{const p=f.target.value;let m=t.energy;m!==null&&p===Os.electronVolts&&t.beamEnergyUnits===Os.kiloElectronVolts?m=cfe(m):m!=null&&p===Os.kiloElectronVolts&&t.beamEnergyUnits===Os.electronVolts&&(m=ZC(m)),t.update({energy:m,beamEnergyUnits:f.target.value})},c=f=>{t.update({cameraLength:wl(f.target.value)})};return O.jsxs(Fn,{spacing:2,children:[O.jsx(yn,{variant:"h6",children:"Beam properties"}),O.jsxs(Fn,{direction:"row",spacing:1,children:[O.jsx(yn,{flexGrow:1,children:"Energy: "}),O.jsx(es,{type:"number",size:"small",value:t.energy,onChange:s}),O.jsxs($s,{children:[O.jsx(dc,{children:"units"}),O.jsxs(hc,{size:"small",label:"units",value:t.beamEnergyUnits,onChange:l,children:[O.jsx($i,{value:Os.electronVolts,children:Os.electronVolts}),O.jsx($i,{value:Os.kiloElectronVolts,children:Os.kiloElectronVolts})]})]})]}),O.jsxs(Fn,{direction:"row",spacing:1,children:[O.jsx(yn,{flexGrow:1,children:"Wavelength: "}),O.jsx(es,{type:"number",size:"small",value:t.wavelength,onChange:o}),O.jsxs($s,{children:[O.jsx(dc,{children:"units"}),O.jsxs(hc,{size:"small",label:"units",value:t.wavelengthUnits,onChange:a,children:[O.jsx($i,{value:Gn.nanmometres,children:Gn.nanmometres}),O.jsx($i,{value:Gn.angstroms,children:Gn.angstroms})]})]})]}),O.jsxs(yn,{children:["Minimum allowed wavelength: ",e," ",t.wavelengthUnits," "]}),O.jsxs(yn,{children:["Maximum allowed wavelength: ",n," ",t.wavelengthUnits]}),O.jsxs(Fn,{direction:"row",spacing:1,children:[O.jsx(yn,{children:"Camera Length: "}),O.jsx(es,{type:"number",size:"small",value:t.cameraLength,InputProps:{inputProps:{max:t.maxCameraLength,min:t.minCameraLength,step:t.cameraLengthStep}},onChange:c}),O.jsx(yn,{children:"m"})]}),O.jsxs(Fn,{direction:"row",spacing:1,children:[O.jsx(yn,{flexGrow:2,children:"Angle:"}),O.jsx(es,{type:"number",size:"small",defaultValue:"",value:t.angle??"",onChange:i}),O.jsxs($s,{children:[O.jsx(dc,{children:"units"}),O.jsxs(hc,{size:"small",label:"units",value:t.angleUnits,onChange:r,children:[O.jsx($i,{value:pl.radians,children:pl.radians}),O.jsx($i,{value:pl.degrees,children:pl.degrees})]})]})]})]})}function ide(){const t=tc(s=>s.name),e=tc(s=>s.current.resolution),n=tc(s=>s.pixelUnits===ii.micrometre?{height:kS(s.current.pixelSize.height),width:kS(s.current.pixelSize.width)}:s.current.pixelSize),r=tc(s=>s.detectorList),i=tc(s=>s.pixelUnits),o=tc(s=>s.updateUnits),a=tc(s=>s.updateDetector);return O.jsx(_E,{sx:{height:1},children:O.jsx(wE,{children:O.jsxs(Fn,{spacing:1,children:[O.jsx(yn,{variant:"h6",children:"Detector"}),O.jsx(l$,{size:"small",disablePortal:!0,id:"combo-box-demo",options:Object.keys(r),sx:{width:300},renderInput:s=>O.jsx(es,{...s,label:"choose detector type"}),value:t,onChange:(s,l)=>{l&&a(l)}}),O.jsxs(yn,{children:["Resolution (hxw): ",e.height," x ",e.width]}),O.jsxs(Fn,{direction:"row",children:[O.jsxs(yn,{flexGrow:2,children:["Pixel size: ",n.height," x ",n.width," "]}),O.jsxs($s,{children:[O.jsx(dc,{children:"units"}),O.jsxs(hc,{size:"small",label:"units",value:i,onChange:s=>o(s.target.value),children:[O.jsxs($i,{value:ii.millimetre,children:[ii.millimetre," x ",ii.millimetre]}),O.jsxs($i,{value:ii.micrometre,children:[ii.micrometre," x ",ii.micrometre]})]})]})]}),O.jsx(Oh,{}),O.jsx(Nfe,{}),O.jsx(Oh,{}),O.jsx(Dfe,{}),O.jsx(Oh,{}),O.jsx(rde,{})]})})})}function Ya(t){const e=F.useRef(t);return e.current=t,F.useMemo(()=>Object.freeze({get current(){return e.current}}),[])}function X$(t){const e=Ya(t);F.useEffect(()=>()=>{e.current()},[])}const RR=typeof window<"u"&&typeof navigator<"u"&&typeof document<"u";function ode(t){const e=Ya(t),n=F.useRef(0),r=F.useCallback(()=>{RR&&n.current&&(cancelAnimationFrame(n.current),n.current=0)},[]);return X$(r),[F.useMemo(()=>{const i=(...o)=>{RR&&(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 ade(t,...e){var n;(n=t==null?void 0:t.addEventListener)==null||n.call(t,...e)}function sde(t,...e){var n;(n=t==null?void 0:t.removeEventListener)==null||n.call(t,...e)}const lde=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),cde=()=>!0,ude=()=>!1;function fde(t=!1){const e=F.useRef(t),n=F.useCallback(()=>e.current,[]);return F.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),n}const dde=t=>(t+1)%Number.MAX_SAFE_INTEGER;function hde(){const[,t]=F.useState(0);return F.useCallback(()=>{t(dde)},[])}function pde(t,e){return typeof t=="function"?t(e):t}function vN(t){const e=F.useRef();return F.useEffect(()=>{e.current=t}),e.current}function mde(t){const[e,n]=F.useState(t),[r,i]=ode(n);return X$(i),[e,r]}function gde(t=!1,e=!0){const[n,r]=F.useState(t),i=Ya(e);return[n,F.useCallback(o=>{r(a=>o===void 0||i.current&&typeof o=="object"&&(o.constructor.name==="SyntheticBaseEvent"||typeof o._reactName=="string")?!a:!!pde(o,a))},[])]}function Dh(t,...e){const n=fde(),r=Ya(e[1]),i=F.useMemo(()=>function(...o){n()&&(typeof r.current=="function"?r.current.apply(this,o):typeof r.current.handleEvent=="function"&&r.current.handleEvent.apply(this,o))},[]);F.useEffect(()=>{const o=t&&lde(t,"current")?t.current:t;if(!o)return;const a=e.slice(2);return ade(o,e[0],i,...a),()=>{sde(o,e[0],i,...a)}},[t,e[0]])}const vde=t=>typeof t=="function"?t:typeof t=="string"?e=>e.key===t:t?cde:ude,yde=RR?window:null;function xde(t,e,n,r={}){const{event:i="keydown",target:o=yde,eventOptions:a}=r,s=Ya(e),l=F.useMemo(()=>{const c=vde(t);return function(f){c(f)&&s.current.call(this,f)}},n);Dh(o,i,l,a)}var NS={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */NS.exports;(function(t,e){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",p=1,m=2,v=4,x=1,_=2,b=1,y=2,S=4,M=8,C=16,A=32,R=64,P=128,U=256,k=512,N=30,z="...",K=800,J=16,G=1,ne=2,ie=3,se=1/0,H=9007199254740991,Y=17976931348623157e292,te=0/0,Q=4294967295,ae=Q-1,xe=Q>>>1,we=[["ary",P],["bind",b],["bindKey",y],["curry",M],["curryRight",C],["flip",k],["partial",A],["partialRight",R],["rearg",U]],Te="[object Arguments]",Ve="[object Array]",Ye="[object AsyncFunction]",et="[object Boolean]",ct="[object Date]",Lt="[object DOMException]",$e="[object Error]",oe="[object Function]",Ae="[object GeneratorFunction]",ge="[object Map]",ve="[object Number]",Ue="[object Null]",We="[object Object]",Je="[object Promise]",ot="[object Proxy]",ft="[object RegExp]",lt="[object Set]",Ht="[object String]",ee="[object Symbol]",$="[object Undefined]",ye="[object WeakMap]",Ge="[object WeakSet]",Le="[object ArrayBuffer]",Me="[object DataView]",De="[object Float32Array]",je="[object Float64Array]",at="[object Int8Array]",At="[object Int16Array]",Ze="[object Int32Array]",Oe="[object Uint8Array]",Ut="[object Uint8ClampedArray]",Et="[object Uint16Array]",Nt="[object Uint32Array]",Ct=/\b__p \+= '';/g,dt=/\b(__p \+=) '' \+/g,Qt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,de=/&(?:amp|lt|gt|quot|#39);/g,ut=/[&<>"']/g,rt=RegExp(de.source),Ne=RegExp(ut.source),it=/<%-([\s\S]+?)%>/g,Bt=/<%([\s\S]+?)%>/g,xn=/<%=([\s\S]+?)%>/g,Zn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ar=/^\w*$/,nn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mn=/[\\^$.*+?()[\]{}|]/g,ur=RegExp(Mn.source),hs=/^\s+/,ps=/\s/,Ks=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ko=/\{\n\/\* \[wrapped with (.+)\] \*/,Sa=/,? & /,Zo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ma=/[()=,{}\[\]\/\s]/,Fe=/\\(\\)?/g,Ie=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ke=/\w*$/,V=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,be=/^\[object .+?Constructor\]$/,Se=/^0o[0-7]+$/i,Ee=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tt=/($^)/,Gt=/['\n\r\u2028\u2029\\]/g,zt="\\ud800-\\udfff",rn="\\u0300-\\u036f",en="\\ufe20-\\ufe2f",on="\\u20d0-\\u20ff",fr=rn+en+on,si="\\u2700-\\u27bf",tr="a-z\\xdf-\\xf6\\xf8-\\xff",li="\\xac\\xb1\\xd7\\xf7",Xt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Mt="\\u2000-\\u206f",Qo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",En="A-Z\\xc0-\\xd6\\xd8-\\xde",vr="\\ufe0e\\ufe0f",Ea=li+Xt+Mt+Qo,co="['’]",ci="["+zt+"]",Rr="["+Ea+"]",To="["+fr+"]",Ac="\\d+",ui="["+si+"]",Rc="["+tr+"]",uo="[^"+zt+Ea+Ac+si+tr+En+"]",Fu="\\ud83c[\\udffb-\\udfff]",R2="(?:"+To+"|"+Fu+")",Dx="[^"+zt+"]",Uu="(?:\\ud83c[\\udde6-\\uddff]){2}",Bu="[\\ud800-\\udbff][\\udc00-\\udfff]",ms="["+En+"]",vd="\\u200d",Fx="(?:"+Rc+"|"+uo+")",P2="(?:"+ms+"|"+uo+")",wp="(?:"+co+"(?:d|ll|m|re|s|t|ve))?",Sp="(?:"+co+"(?:D|LL|M|RE|S|T|VE))?",zu=R2+"?",Ux="["+vr+"]?",k0="(?:"+vd+"(?:"+[Dx,Uu,Bu].join("|")+")"+Ux+zu+")*",Dn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bx="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Mp=Ux+zu+k0,zx="(?:"+[ui,Uu,Bu].join("|")+")"+Mp,I2="(?:"+[Dx+To+"?",To,Uu,Bu,ci].join("|")+")",L2=RegExp(co,"g"),fi=RegExp(To,"g"),yd=RegExp(Fu+"(?="+Fu+")|"+I2+Mp,"g"),O2=RegExp([ms+"?"+Rc+"+"+wp+"(?="+[Rr,ms,"$"].join("|")+")",P2+"+"+Sp+"(?="+[Rr,ms+Fx,"$"].join("|")+")",ms+"?"+Fx+"+"+wp,ms+"+"+Sp,Bx,Dn,Ac,zx].join("|"),"g"),N0=RegExp("["+vd+zt+fr+vr+"]"),k2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ep=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],gs=-1,ir={};ir[De]=ir[je]=ir[at]=ir[At]=ir[Ze]=ir[Oe]=ir[Ut]=ir[Et]=ir[Nt]=!0,ir[Te]=ir[Ve]=ir[Le]=ir[et]=ir[Me]=ir[ct]=ir[$e]=ir[oe]=ir[ge]=ir[ve]=ir[We]=ir[ft]=ir[lt]=ir[Ht]=ir[ye]=!1;var nr={};nr[Te]=nr[Ve]=nr[Le]=nr[Me]=nr[et]=nr[ct]=nr[De]=nr[je]=nr[at]=nr[At]=nr[Ze]=nr[ge]=nr[ve]=nr[We]=nr[ft]=nr[lt]=nr[Ht]=nr[ee]=nr[Oe]=nr[Ut]=nr[Et]=nr[Nt]=!0,nr[$e]=nr[oe]=nr[ye]=!1;var vs={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Zs={"&":"&","<":"<",">":">",'"':""","'":"'"},Cp={"&":"&","<":"<",">":">",""":'"',"'":"'"},D0={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$x=parseFloat,N2=parseInt,Ca=typeof iu=="object"&&iu&&iu.Object===Object&&iu,D2=typeof self=="object"&&self&&self.Object===Object&&self,Br=Ca||D2||Function("return this")(),F0=e&&!e.nodeType&&e,yi=F0&&!0&&t&&!t.nodeType&&t,xd=yi&&yi.exports===F0,$u=xd&&Ca.process,xi=function(){try{var ue=yi&&yi.require&&yi.require("util").types;return ue||$u&&$u.binding&&$u.binding("util")}catch{}}(),Tp=xi&&xi.isArrayBuffer,Ap=xi&&xi.isDate,U0=xi&&xi.isMap,Rp=xi&&xi.isRegExp,Pp=xi&&xi.isSet,Pc=xi&&xi.isTypedArray;function dr(ue,ke,Ce){switch(Ce.length){case 0:return ue.call(ke);case 1:return ue.call(ke,Ce[0]);case 2:return ue.call(ke,Ce[0],Ce[1]);case 3:return ue.call(ke,Ce[0],Ce[1],Ce[2])}return ue.apply(ke,Ce)}function ys(ue,ke,Ce,bt){for(var Jt=-1,fn=ue==null?0:ue.length;++Jt-1}function Hu(ue,ke,Ce){for(var bt=-1,Jt=ue==null?0:ue.length;++bt-1;);return Ce}function Gu(ue,ke){for(var Ce=ue.length;Ce--&&Ra(ke,ue[Ce],0)>-1;);return Ce}function Ia(ue,ke){for(var Ce=ue.length,bt=0;Ce--;)ue[Ce]===ke&&++bt;return bt}var jx=ho(vs),Xx=ho(Zs);function H0(ue){return"\\"+D0[ue]}function V0(ue,ke){return ue==null?n:ue[ke]}function Ic(ue){return N0.test(ue)}function Sd(ue){return k2.test(ue)}function ju(ue){for(var ke,Ce=[];!(ke=ue.next()).done;)Ce.push(ke.value);return Ce}function Md(ue){var ke=-1,Ce=Array(ue.size);return ue.forEach(function(bt,Jt){Ce[++ke]=[Jt,bt]}),Ce}function Xu(ue,ke){return function(Ce){return ue(ke(Ce))}}function La(ue,ke){for(var Ce=-1,bt=ue.length,Jt=0,fn=[];++Ce-1}function Up(u,g){var E=this.__data__,L=$l(E,u);return L<0?(++this.size,E.push([u,g])):E[L][1]=g,this}Oa.prototype.clear=hb,Oa.prototype.delete=Q0,Oa.prototype.get=pb,Oa.prototype.has=mb,Oa.prototype.set=Up;function Jo(u){var g=-1,E=u==null?0:u.length;for(this.clear();++g=g?u:g)),u}function Po(u,g,E,L,B,X){var le,ce=g&p,me=g&m,ze=g&v;if(E&&(le=B?E(u,L,B,X):E(u)),le!==n)return le;if(!Or(u))return u;var He=hn(u);if(He){if(le=_G(u),!ce)return Ni(u,le)}else{var Xe=po(u),vt=Xe==oe||Xe==Ae;if(pf(u))return yv(u,ce);if(Xe==We||Xe==Te||vt&&!B){if(le=me||vt?{}:XO(u),!ce)return me?Ib(u,_b(le,u)):j2(u,iv(le,u))}else{if(!nr[Xe])return B?u:{};le=wG(u,Xe,ce)}}X||(X=new ei);var Ot=X.get(u);if(Ot)return Ot;X.set(u,le),w4(u)?u.forEach(function(Kt){le.add(Po(Kt,g,E,Kt,u,X))}):b4(u)&&u.forEach(function(Kt,Rn){le.set(Rn,Po(Kt,g,E,Rn,u,X))});var Yt=ze?me?In:Hr:me?ia:Fi,Cn=He?n:Yt(u);return Zr(Cn||u,function(Kt,Rn){Cn&&(Rn=Kt,Kt=u[Rn]),ka(le,Rn,Po(Kt,g,E,Rn,u,X))}),le}function ov(u){var g=Fi(u);return function(E){return Hp(E,u,g)}}function Hp(u,g,E){var L=E.length;if(u==null)return!L;for(u=qt(u);L--;){var B=E[L],X=g[B],le=u[B];if(le===n&&!(B in u)||!X(le))return!1}return!0}function av(u,g,E){if(typeof u!="function")throw new Zi(a);return wv(function(){u.apply(n,E)},g)}function Fc(u,g,E,L){var B=-1,X=Ta,le=!0,ce=u.length,me=[],ze=g.length;if(!ce)return me;E&&(g=or(g,Yi(E))),L?(X=Hu,le=!1):g.length>=i&&(X=bi,le=!1,g=new zl(g));e:for(;++BB?0:B+E),L=L===n||L>B?B:bn(L),L<0&&(L+=B),L=E>L?0:M4(L);E0&&E(ce)?g>1?pi(ce,g-1,E,L,B):Aa(B,ce):L||(B[B.length]=ce)}return B}var of=em(),Bd=em(!0);function Io(u,g){return u&&of(u,g,Fi)}function af(u,g){return u&&Bd(u,g,Fi)}function Uc(u,g){return Ai(g,function(E){return Vc(u[E])})}function Da(u,g){g=Xl(g,u);for(var E=0,L=g.length;u!=null&&Eg}function Mb(u,g){return u!=null&&Un.call(u,g)}function lv(u,g){return u!=null&&g in qt(u)}function W2(u,g,E){return u>=Ri(g,E)&&u=120&&He.length>=120)?new zl(le&&He):n}He=u[0];var Xe=-1,vt=ce[0];e:for(;++Xe-1;)ce!==u&&Ul.call(ce,me,1),Ul.call(u,me,1);return u}function Li(u,g){for(var E=u?g.length:0,L=E-1;E--;){var B=g[E];if(E==L||B!==X){var X=B;Hc(B)?Ul.call(u,B,1):mv(u,B)}}return u}function Es(u,g){return u+Ld(K0()*(g-u+1))}function ea(u,g,E,L){for(var B=-1,X=Jr(Id((g-u)/(E||1)),0),le=Ce(X);X--;)le[L?X:++B]=u,u+=E;return le}function hf(u,g){var E="";if(!u||g<1||g>H)return E;do g%2&&(E+=u),g=Ld(g/2),g&&(u+=u);while(g);return E}function $t(u,g){return J2(KO(u,g,oa),u+"")}function Eb(u){return Fd(im(u))}function dv(u,g){var E=im(u);return kb(E,Hl(g,0,E.length))}function zc(u,g,E,L){if(!Or(u))return u;g=Xl(g,u);for(var B=-1,X=g.length,le=X-1,ce=u;ce!=null&&++BB?0:B+g),E=E>B?B:E,E<0&&(E+=B),B=g>E?0:E-g>>>0,g>>>=0;for(var X=Ce(B);++L>>1,le=u[X];le!==null&&!Ua(le)&&(E?le<=g:le=i){var ze=g?null:Di(u);if(ze)return Ed(ze);le=!1,B=bi,me=new zl}else me=g?[]:ce;e:for(;++L=L?u:Oo(u,g,E)}var Rb=Pd||function(u){return Br.clearTimeout(u)};function yv(u,g){if(g)return u.slice();var E=u.length,L=j0?j0(E):new u.constructor(E);return u.copy(L),L}function Qp(u){var g=new u.constructor(u.byteLength);return new Ad(g).set(new Ad(u)),g}function G2(u,g){var E=g?Qp(u.buffer):u.buffer;return new u.constructor(E,u.byteOffset,u.byteLength)}function ta(u){var g=new u.constructor(u.source,Ke.exec(u));return g.lastIndex=u.lastIndex,g}function xv(u){return tl?qt(tl.call(u)):{}}function Pb(u,g){var E=g?Qp(u.buffer):u.buffer;return new u.constructor(E,u.byteOffset,u.length)}function il(u,g){if(u!==g){var E=u!==n,L=u===null,B=u===u,X=Ua(u),le=g!==n,ce=g===null,me=g===g,ze=Ua(g);if(!ce&&!ze&&!X&&u>g||X&&le&&me&&!ce&&!ze||L&&le&&me||!E&&me||!B)return 1;if(!L&&!X&&!ze&&u=ce)return me;var ze=E[L];return me*(ze=="desc"?-1:1)}}return u.index-g.index}function Yl(u,g,E,L){for(var B=-1,X=u.length,le=E.length,ce=-1,me=g.length,ze=Jr(X-le,0),He=Ce(me+ze),Xe=!L;++ce1?E[B-1]:n,le=B>2?E[2]:n;for(X=u.length>3&&typeof X=="function"?(B--,X):n,le&&No(E[0],E[1],le)&&(X=B<3?n:X,B=1),g=qt(g);++L-1?B[X?g[le]:le]:n}}function I(u){return vn(function(g){var E=g.length,L=E,B=Pi.prototype.thru;for(u&&g.reverse();L--;){var X=g[L];if(typeof X!="function")throw new Zi(a);if(B&&!le&&tm(X)=="wrapper")var le=new Pi([],!0)}for(L=le?L:E;++L1&&kn.reverse(),He&&mece))return!1;var ze=X.get(u),He=X.get(g);if(ze&&He)return ze==g&&He==u;var Xe=-1,vt=!0,Ot=E&_?new zl:n;for(X.set(u,g),X.set(g,u);++Xe1?"& ":"")+g[L],g=g.join(E>2?", ":" "),u.replace(Ks,`{ -/* [wrapped with `+g+`] */ -`)}function MG(u){return hn(u)||Kd(u)||!!(q0&&u&&u[q0])}function Hc(u,g){var E=typeof u;return g=g??H,!!g&&(E=="number"||E!="symbol"&&Ee.test(u))&&u>-1&&u%1==0&&u0){if(++g>=K)return arguments[0]}else g=0;return u.apply(n,arguments)}}function kb(u,g){var E=-1,L=u.length,B=L-1;for(g=g===n?L:g;++E1?u[g-1]:n;return E=typeof E=="function"?(u.pop(),E):n,l4(u,E)});function c4(u){var g=W(u);return g.__chain__=!0,g}function Nj(u,g){return g(u),u}function Nb(u,g){return g(u)}var Dj=vn(function(u){var g=u.length,E=g?u[0]:0,L=this.__wrapped__,B=function(X){return $p(X,u)};return g>1||this.__actions__.length||!(L instanceof Vt)||!Hc(E)?this.thru(B):(L=L.slice(E,+E+(g?1:0)),L.__actions__.push({func:Nb,args:[B],thisArg:n}),new Pi(L,this.__chain__).thru(function(X){return g&&!X.length&&X.push(n),X}))});function Fj(){return c4(this)}function Uj(){return new Pi(this.value(),this.__chain__)}function Bj(){this.__values__===n&&(this.__values__=S4(this.value()));var u=this.__index__>=this.__values__.length,g=u?n:this.__values__[this.__index__++];return{done:u,value:g}}function zj(){return this}function $j(u){for(var g,E=this;E instanceof Dd;){var L=n4(E);L.__index__=0,L.__values__=n,g?B.__wrapped__=L:g=L;var B=L;E=E.__wrapped__}return B.__wrapped__=u,g}function Hj(){var u=this.__wrapped__;if(u instanceof Vt){var g=u;return this.__actions__.length&&(g=new Vt(this)),g=g.reverse(),g.__actions__.push({func:Nb,args:[eC],thisArg:n}),new Pi(g,this.__chain__)}return this.thru(eC)}function Vj(){return Gl(this.__wrapped__,this.__actions__)}var Wj=Xd(function(u,g,E){Un.call(u,E)?++u[E]:Ms(u,E,1)});function Gj(u,g,E){var L=hn(u)?z0:V2;return E&&No(u,g,E)&&(g=n),L(u,jt(g,3))}function jj(u,g){var E=hn(u)?Ai:sv;return E(u,jt(g,3))}var Xj=T(r4),qj=T(i4);function Yj(u,g){return pi(Db(u,g),1)}function Kj(u,g){return pi(Db(u,g),se)}function Zj(u,g,E){return E=E===n?1:bn(E),pi(Db(u,g),E)}function u4(u,g){var E=hn(u)?Zr:Na;return E(u,jt(g,3))}function f4(u,g){var E=hn(u)?B0:wb;return E(u,jt(g,3))}var Qj=Xd(function(u,g,E){Un.call(u,E)?u[E].push(g):Ms(u,E,[g])});function Jj(u,g,E,L){u=ra(u)?u:im(u),E=E&&!L?bn(E):0;var B=u.length;return E<0&&(E=Jr(B+E,0)),$b(u)?E<=B&&u.indexOf(g,E)>-1:!!B&&Ra(u,g,E)>-1}var eX=$t(function(u,g,E){var L=-1,B=typeof g=="function",X=ra(u)?Ce(u.length):[];return Na(u,function(le){X[++L]=B?dr(g,le,E):sr(le,g,E)}),X}),tX=Xd(function(u,g,E){Ms(u,E,g)});function Db(u,g){var E=hn(u)?or:Bc;return E(u,jt(g,3))}function nX(u,g,E,L){return u==null?[]:(hn(g)||(g=g==null?[]:[g]),E=L?n:E,hn(E)||(E=E==null?[]:[E]),Vd(u,g,E))}var rX=Xd(function(u,g,E){u[E?0:1].push(g)},function(){return[[],[]]});function iX(u,g,E){var L=hn(u)?Ip:Nl,B=arguments.length<3;return L(u,jt(g,4),E,B,Na)}function oX(u,g,E){var L=hn(u)?Hx:Nl,B=arguments.length<3;return L(u,jt(g,4),E,B,wb)}function aX(u,g){var E=hn(u)?Ai:sv;return E(u,Bb(jt(g,3)))}function sX(u){var g=hn(u)?Fd:Eb;return g(u)}function lX(u,g,E){(E?No(u,g,E):g===n)?g=1:g=bn(g);var L=hn(u)?tv:dv;return L(u,g)}function cX(u){var g=hn(u)?bb:Tb;return g(u)}function uX(u){if(u==null)return 0;if(ra(u))return $b(u)?xs(u):u.length;var g=po(u);return g==ge||g==lt?u.size:Ii(u).length}function fX(u,g,E){var L=hn(u)?bd:hv;return E&&No(u,g,E)&&(g=n),L(u,jt(g,3))}var dX=$t(function(u,g){if(u==null)return[];var E=g.length;return E>1&&No(u,g[0],g[1])?g=[]:E>2&&No(g[0],g[1],g[2])&&(g=[g[0]]),Vd(u,pi(g,1),[])}),Fb=Zx||function(){return Br.Date.now()};function hX(u,g){if(typeof g!="function")throw new Zi(a);return u=bn(u),function(){if(--u<1)return g.apply(this,arguments)}}function d4(u,g,E){return g=E?n:g,g=u&&g==null?u.length:g,_e(u,P,n,n,n,n,g)}function h4(u,g){var E;if(typeof g!="function")throw new Zi(a);return u=bn(u),function(){return--u>0&&(E=g.apply(this,arguments)),u<=1&&(g=n),E}}var nC=$t(function(u,g,E){var L=b;if(E.length){var B=La(E,nm(nC));L|=A}return _e(u,L,g,E,B)}),p4=$t(function(u,g,E){var L=b|y;if(E.length){var B=La(E,nm(p4));L|=A}return _e(g,L,u,E,B)});function m4(u,g,E){g=E?n:g;var L=_e(u,M,n,n,n,n,n,g);return L.placeholder=m4.placeholder,L}function g4(u,g,E){g=E?n:g;var L=_e(u,C,n,n,n,n,n,g);return L.placeholder=g4.placeholder,L}function v4(u,g,E){var L,B,X,le,ce,me,ze=0,He=!1,Xe=!1,vt=!0;if(typeof u!="function")throw new Zi(a);g=Rs(g)||0,Or(E)&&(He=!!E.leading,Xe="maxWait"in E,X=Xe?Jr(Rs(E.maxWait)||0,g):X,vt="trailing"in E?!!E.trailing:vt);function Ot(ni){var al=L,Gc=B;return L=B=n,ze=ni,le=u.apply(Gc,al),le}function Yt(ni){return ze=ni,ce=wv(Rn,g),He?Ot(ni):le}function Cn(ni){var al=ni-me,Gc=ni-ze,D4=g-al;return Xe?Ri(D4,X-Gc):D4}function Kt(ni){var al=ni-me,Gc=ni-ze;return me===n||al>=g||al<0||Xe&&Gc>=X}function Rn(){var ni=Fb();if(Kt(ni))return kn(ni);ce=wv(Rn,Cn(ni))}function kn(ni){return ce=n,vt&&L?Ot(ni):(L=B=n,le)}function Ba(){ce!==n&&Rb(ce),ze=0,L=me=B=ce=n}function Do(){return ce===n?le:kn(Fb())}function za(){var ni=Fb(),al=Kt(ni);if(L=arguments,B=this,me=ni,al){if(ce===n)return Yt(me);if(Xe)return Rb(ce),ce=wv(Rn,g),Ot(me)}return ce===n&&(ce=wv(Rn,g)),le}return za.cancel=Ba,za.flush=Do,za}var pX=$t(function(u,g){return av(u,1,g)}),mX=$t(function(u,g,E){return av(u,Rs(g)||0,E)});function gX(u){return _e(u,k)}function Ub(u,g){if(typeof u!="function"||g!=null&&typeof g!="function")throw new Zi(a);var E=function(){var L=arguments,B=g?g.apply(this,L):L[0],X=E.cache;if(X.has(B))return X.get(B);var le=u.apply(this,L);return E.cache=X.set(B,le)||X,le};return E.cache=new(Ub.Cache||Jo),E}Ub.Cache=Jo;function Bb(u){if(typeof u!="function")throw new Zi(a);return function(){var g=arguments;switch(g.length){case 0:return!u.call(this);case 1:return!u.call(this,g[0]);case 2:return!u.call(this,g[0],g[1]);case 3:return!u.call(this,g[0],g[1],g[2])}return!u.apply(this,g)}}function vX(u){return h4(2,u)}var yX=Ab(function(u,g){g=g.length==1&&hn(g[0])?or(g[0],Yi(jt())):or(pi(g,1),Yi(jt()));var E=g.length;return $t(function(L){for(var B=-1,X=Ri(L.length,E);++B=g}),Kd=mn(function(){return arguments}())?mn:function(u){return Vr(u)&&Un.call(u,"callee")&&!Dp.call(u,"callee")},hn=Ce.isArray,OX=Tp?Yi(Tp):zr;function ra(u){return u!=null&&zb(u.length)&&!Vc(u)}function ti(u){return Vr(u)&&ra(u)}function kX(u){return u===!0||u===!1||Vr(u)&&_i(u)==et}var pf=Jx||pC,NX=Ap?Yi(Ap):$r;function DX(u){return Vr(u)&&u.nodeType===1&&!Sv(u)}function FX(u){if(u==null)return!0;if(ra(u)&&(hn(u)||typeof u=="string"||typeof u.splice=="function"||pf(u)||rm(u)||Kd(u)))return!u.length;var g=po(u);if(g==ge||g==lt)return!u.size;if(_v(u))return!Ii(u).length;for(var E in u)if(Un.call(u,E))return!1;return!0}function UX(u,g){return Ir(u,g)}function BX(u,g,E){E=typeof E=="function"?E:n;var L=E?E(u,g):n;return L===n?Ir(u,g,n,E):!!L}function iC(u){if(!Vr(u))return!1;var g=_i(u);return g==$e||g==Lt||typeof u.message=="string"&&typeof u.name=="string"&&!Sv(u)}function zX(u){return typeof u=="number"&&Y0(u)}function Vc(u){if(!Or(u))return!1;var g=_i(u);return g==oe||g==Ae||g==Ye||g==ot}function x4(u){return typeof u=="number"&&u==bn(u)}function zb(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=H}function Or(u){var g=typeof u;return u!=null&&(g=="object"||g=="function")}function Vr(u){return u!=null&&typeof u=="object"}var b4=U0?Yi(U0):lf;function $X(u,g){return u===g||Lr(u,g,q2(g))}function HX(u,g,E){return E=typeof E=="function"?E:n,Lr(u,g,q2(g),E)}function VX(u){return _4(u)&&u!=+u}function WX(u){if(TG(u))throw new Jt(o);return cf(u)}function GX(u){return u===null}function jX(u){return u==null}function _4(u){return typeof u=="number"||Vr(u)&&_i(u)==ve}function Sv(u){if(!Vr(u)||_i(u)!=We)return!1;var g=Rd(u);if(g===null)return!0;var E=Un.call(g,"constructor")&&g.constructor;return typeof E=="function"&&E instanceof E&&Ju.call(E)==Lc}var oC=Rp?Yi(Rp):uf;function XX(u){return x4(u)&&u>=-H&&u<=H}var w4=Pp?Yi(Pp):Wp;function $b(u){return typeof u=="string"||!hn(u)&&Vr(u)&&_i(u)==Ht}function Ua(u){return typeof u=="symbol"||Vr(u)&&_i(u)==ee}var rm=Pc?Yi(Pc):uv;function qX(u){return u===n}function YX(u){return Vr(u)&&po(u)==ye}function KX(u){return Vr(u)&&_i(u)==Ge}var ZX=Ft($d),QX=Ft(function(u,g){return u<=g});function S4(u){if(!u)return[];if(ra(u))return $b(u)?wr(u):Ni(u);if(Bl&&u[Bl])return ju(u[Bl]());var g=po(u),E=g==ge?Md:g==lt?Ed:im;return E(u)}function Wc(u){if(!u)return u===0?u:0;if(u=Rs(u),u===se||u===-se){var g=u<0?-1:1;return g*Y}return u===u?u:0}function bn(u){var g=Wc(u),E=g%1;return g===g?E?g-E:g:0}function M4(u){return u?Hl(bn(u),0,Q):0}function Rs(u){if(typeof u=="number")return u;if(Ua(u))return te;if(Or(u)){var g=typeof u.valueOf=="function"?u.valueOf():u;u=Or(g)?g+"":g}if(typeof u!="string")return u===0?u:+u;u=Op(u);var E=fe.test(u);return E||Se.test(u)?N2(u.slice(2),E?2:8):V.test(u)?te:+u}function E4(u){return na(u,ia(u))}function JX(u){return u?Hl(bn(u),-H,H):u===0?u:0}function qn(u){return u==null?"":Oi(u)}var eq=$c(function(u,g){if(_v(g)||ra(g)){na(g,Fi(g),u);return}for(var E in g)Un.call(g,E)&&ka(u,E,g[E])}),C4=$c(function(u,g){na(g,ia(g),u)}),Hb=$c(function(u,g,E,L){na(g,ia(g),u,L)}),tq=$c(function(u,g,E,L){na(g,Fi(g),u,L)}),nq=vn($p);function rq(u,g){var E=nl(u);return g==null?E:iv(E,g)}var iq=$t(function(u,g){u=qt(u);var E=-1,L=g.length,B=L>2?g[2]:n;for(B&&No(g[0],g[1],B)&&(L=1);++E1),X}),na(u,In(u),E),L&&(E=Po(E,p|m|v,xt));for(var B=g.length;B--;)mv(E,g[B]);return E});function wq(u,g){return A4(u,Bb(jt(g)))}var Sq=vn(function(u,g){return u==null?{}:Wd(u,g)});function A4(u,g){if(u==null)return{};var E=or(In(u),function(L){return[L]});return g=jt(g),Xp(u,E,function(L,B){return g(L,B[0])})}function Mq(u,g,E){g=Xl(g,u);var L=-1,B=g.length;for(B||(B=1,u=n);++Lg){var L=u;u=g,g=L}if(E||u%1||g%1){var B=K0();return Ri(u+B*(g-u+$x("1e-"+((B+"").length-1))),g)}return Es(u,g)}var Nq=d(function(u,g,E){return g=g.toLowerCase(),u+(E?I4(g):g)});function I4(u){return lC(qn(u).toLowerCase())}function L4(u){return u=qn(u),u&&u.replace(yt,jx).replace(fi,"")}function Dq(u,g,E){u=qn(u),g=Oi(g);var L=u.length;E=E===n?L:Hl(bn(E),0,L);var B=E;return E-=g.length,E>=0&&u.slice(E,B)==g}function Fq(u){return u=qn(u),u&&Ne.test(u)?u.replace(ut,Xx):u}function Uq(u){return u=qn(u),u&&ur.test(u)?u.replace(Mn,"\\$&"):u}var Bq=d(function(u,g,E){return u+(E?"-":"")+g.toLowerCase()}),zq=d(function(u,g,E){return u+(E?" ":"")+g.toLowerCase()}),$q=Lb("toLowerCase");function Hq(u,g,E){u=qn(u),g=bn(g);var L=g?xs(u):0;if(!g||L>=g)return u;var B=(g-L)/2;return tt(Ld(B),E)+u+tt(Id(B),E)}function Vq(u,g,E){u=qn(u),g=bn(g);var L=g?xs(u):0;return g&&L>>0,E?(u=qn(u),u&&(typeof g=="string"||g!=null&&!oC(g))&&(g=Oi(g),!g&&Ic(u))?ql(wr(u),0,E):u.split(g,E)):[]}var Kq=d(function(u,g,E){return u+(E?" ":"")+lC(g)});function Zq(u,g,E){return u=qn(u),E=E==null?0:Hl(bn(E),0,u.length),g=Oi(g),u.slice(E,E+g.length)==g}function Qq(u,g,E){var L=W.templateSettings;E&&No(u,g,E)&&(g=n),u=qn(u),g=Hb({},g,L,pe);var B=Hb({},g.imports,L.imports,pe),X=Fi(B),le=Ki(B,X),ce,me,ze=0,He=g.interpolate||Tt,Xe="__p += '",vt=di((g.escape||Tt).source+"|"+He.source+"|"+(He===xn?Ie:Tt).source+"|"+(g.evaluate||Tt).source+"|$","g"),Ot="//# sourceURL="+(Un.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++gs+"]")+` -`;u.replace(vt,function(Kt,Rn,kn,Ba,Do,za){return kn||(kn=Ba),Xe+=u.slice(ze,za).replace(Gt,H0),Rn&&(ce=!0,Xe+=`' + -__e(`+Rn+`) + -'`),Do&&(me=!0,Xe+=`'; -`+Do+`; -__p += '`),kn&&(Xe+=`' + -((__t = (`+kn+`)) == null ? '' : __t) + -'`),ze=za+Kt.length,Kt}),Xe+=`'; -`;var Yt=Un.call(g,"variable")&&g.variable;if(!Yt)Xe=`with (obj) { -`+Xe+` -} -`;else if(Ma.test(Yt))throw new Jt(s);Xe=(me?Xe.replace(Ct,""):Xe).replace(dt,"$1").replace(Qt,"$1;"),Xe="function("+(Yt||"obj")+`) { -`+(Yt?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(ce?", __e = _.escape":"")+(me?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+Xe+`return __p -}`;var Cn=k4(function(){return fn(X,Ot+"return "+Xe).apply(n,le)});if(Cn.source=Xe,iC(Cn))throw Cn;return Cn}function Jq(u){return qn(u).toLowerCase()}function eY(u){return qn(u).toUpperCase()}function tY(u,g,E){if(u=qn(u),u&&(E||g===n))return Op(u);if(!u||!(g=Oi(g)))return u;var L=wr(u),B=wr(g),X=ar(L,B),le=Gu(L,B)+1;return ql(L,X,le).join("")}function nY(u,g,E){if(u=qn(u),u&&(E||g===n))return u.slice(0,Yu(u)+1);if(!u||!(g=Oi(g)))return u;var L=wr(u),B=Gu(L,wr(g))+1;return ql(L,0,B).join("")}function rY(u,g,E){if(u=qn(u),u&&(E||g===n))return u.replace(hs,"");if(!u||!(g=Oi(g)))return u;var L=wr(u),B=ar(L,wr(g));return ql(L,B).join("")}function iY(u,g){var E=N,L=z;if(Or(g)){var B="separator"in g?g.separator:B;E="length"in g?bn(g.length):E,L="omission"in g?Oi(g.omission):L}u=qn(u);var X=u.length;if(Ic(u)){var le=wr(u);X=le.length}if(E>=X)return u;var ce=E-xs(L);if(ce<1)return L;var me=le?ql(le,0,ce).join(""):u.slice(0,ce);if(B===n)return me+L;if(le&&(ce+=me.length-ce),oC(B)){if(u.slice(ce).search(B)){var ze,He=me;for(B.global||(B=di(B.source,qn(Ke.exec(B))+"g")),B.lastIndex=0;ze=B.exec(He);)var Xe=ze.index;me=me.slice(0,Xe===n?ce:Xe)}}else if(u.indexOf(Oi(B),ce)!=ce){var vt=me.lastIndexOf(B);vt>-1&&(me=me.slice(0,vt))}return me+L}function oY(u){return u=qn(u),u&&rt.test(u)?u.replace(de,Ku):u}var aY=d(function(u,g,E){return u+(E?" ":"")+g.toUpperCase()}),lC=Lb("toUpperCase");function O4(u,g,E){return u=qn(u),g=E?n:g,g===n?Sd(u)?Zu(u):Wx(u):u.match(g)||[]}var k4=$t(function(u,g){try{return dr(u,n,g)}catch(E){return iC(E)?E:new Jt(E)}}),sY=vn(function(u,g){return Zr(g,function(E){E=Kl(E),Ms(u,E,nC(u[E],u))}),u});function lY(u){var g=u==null?0:u.length,E=jt();return u=g?or(u,function(L){if(typeof L[1]!="function")throw new Zi(a);return[E(L[0]),L[1]]}):[],$t(function(L){for(var B=-1;++BH)return[];var E=Q,L=Ri(u,Q);g=jt(g),u-=Q;for(var B=Js(L,g);++E0||g<0)?new Vt(E):(u<0?E=E.takeRight(-u):u&&(E=E.drop(u)),g!==n&&(g=bn(g),E=g<0?E.dropRight(-g):E.take(g-u)),E)},Vt.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Vt.prototype.toArray=function(){return this.take(Q)},Io(Vt.prototype,function(u,g){var E=/^(?:filter|find|map|reject)|While$/.test(g),L=/^(?:head|last)$/.test(g),B=W[L?"take"+(g=="last"?"Right":""):g],X=L||/^find/.test(g);B&&(W.prototype[g]=function(){var le=this.__wrapped__,ce=L?[1]:arguments,me=le instanceof Vt,ze=ce[0],He=me||hn(le),Xe=function(Rn){var kn=B.apply(W,Aa([Rn],ce));return L&&vt?kn[0]:kn};He&&E&&typeof ze=="function"&&ze.length!=1&&(me=He=!1);var vt=this.__chain__,Ot=!!this.__actions__.length,Yt=X&&!vt,Cn=me&&!Ot;if(!X&&He){le=Cn?le:new Vt(this);var Kt=u.apply(le,ce);return Kt.__actions__.push({func:Nb,args:[Xe],thisArg:n}),new Pi(Kt,vt)}return Yt&&Cn?u.apply(this,ce):(Kt=this.thru(Xe),Yt?L?Kt.value()[0]:Kt.value():Kt)})}),Zr(["pop","push","shift","sort","splice","unshift"],function(u){var g=Fl[u],E=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",L=/^(?:pop|shift)$/.test(u);W.prototype[u]=function(){var B=arguments;if(L&&!this.__chain__){var X=this.value();return g.apply(hn(X)?X:[],B)}return this[E](function(le){return g.apply(hn(le)?le:[],B)})}}),Io(Vt.prototype,function(u,g){var E=W[g];if(E){var L=E.name+"";Un.call(Nc,L)||(Nc[L]=[]),Nc[L].push({name:g,func:E})}}),Nc[D(n,y).name]=[{name:"wrapper",func:n}],Vt.prototype.clone=U2,Vt.prototype.reverse=B2,Vt.prototype.value=Ro,W.prototype.at=Dj,W.prototype.chain=Fj,W.prototype.commit=Uj,W.prototype.next=Bj,W.prototype.plant=$j,W.prototype.reverse=Hj,W.prototype.toJSON=W.prototype.valueOf=W.prototype.value=Vj,W.prototype.first=W.prototype.head,Bl&&(W.prototype[Bl]=zj),W},Dl=Kx();yi?((yi.exports=Dl)._=Dl,F0._=Dl):Br._=Dl}).call(iu)})(NS,NS.exports);var Co=NS.exports;/** - * @license - * Copyright 2010-2023 Three.js Authors - * SPDX-License-Identifier: MIT - */const EE="158",bde={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},_de={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},q$=0,PR=1,Y$=2,wde=3,K$=0,CE=1,ky=2,ml=3,Mu=0,jo=1,xl=2,Sde=2,mu=0,Fh=1,IR=2,LR=3,OR=4,Z$=5,Pf=100,Q$=101,J$=102,kR=103,NR=104,e7=200,t7=201,n7=202,r7=203,DS=204,FS=205,i7=206,o7=207,a7=208,s7=209,l7=210,c7=211,u7=212,f7=213,d7=214,h7=0,p7=1,m7=2,y1=3,g7=4,v7=5,y7=6,x7=7,cx=0,b7=1,_7=2,pc=0,w7=1,S7=2,M7=3,NI=4,E7=5,DR="attached",C7="detached",ux=300,Eu=301,Zf=302,x1=303,b1=304,v0=306,_1=1e3,Vi=1001,w1=1002,qr=1003,US=1004,Mde=1004,Ny=1005,Ede=1005,ai=1006,DI=1007,Cde=1007,Qf=1008,Tde=1008,os=1009,T7=1010,A7=1011,TE=1012,FI=1013,fu=1014,Sl=1015,Jh=1016,UI=1017,BI=1018,Hf=1020,R7=1021,Wo=1023,P7=1024,I7=1025,Vf=1026,ep=1027,zI=1028,$I=1029,L7=1030,HI=1031,VI=1033,Vw=33776,Ww=33777,Gw=33778,jw=33779,FR=35840,UR=35841,BR=35842,zR=35843,O7=36196,$R=37492,HR=37496,VR=37808,WR=37809,GR=37810,jR=37811,XR=37812,qR=37813,YR=37814,KR=37815,ZR=37816,QR=37817,JR=37818,e3=37819,t3=37820,n3=37821,Xw=36492,r3=36494,i3=36495,k7=36283,o3=36284,a3=36285,s3=36286,N7=2200,D7=2201,F7=2202,S1=2300,M1=2301,qw=2302,Mh=2400,Eh=2401,E1=2402,AE=2500,WI=2501,Ade=0,Rde=1,Pde=2,GI=3e3,Wf=3001,U7=3200,B7=3201,ud=0,z7=1,Za="",Mi="srgb",_c="srgb-linear",RE="display-p3",fx="display-p3-linear",C1="linear",mr="srgb",T1="rec709",A1="p3",Ide=0,dh=7680,Lde=7681,Ode=7682,kde=7683,Nde=34055,Dde=34056,Fde=5386,Ude=512,Bde=513,zde=514,$de=515,Hde=516,Vde=517,Wde=518,l3=519,$7=512,H7=513,V7=514,W7=515,G7=516,j7=517,X7=518,q7=519,R1=35044,Gde=35048,jde=35040,Xde=35045,qde=35049,Yde=35041,Kde=35046,Zde=35050,Qde=35042,Jde="100",c3="300 es",BS=1035,ac=2e3,P1=2001;class Ou{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,a=i.length;o>8&255]+xo[t>>16&255]+xo[t>>24&255]+"-"+xo[e&255]+xo[e>>8&255]+"-"+xo[e>>16&15|64]+xo[e>>24&255]+"-"+xo[n&63|128]+xo[n>>8&255]+"-"+xo[n>>16&255]+xo[n>>24&255]+xo[r&255]+xo[r>>8&255]+xo[r>>16&255]+xo[r>>24&255]).toLowerCase()}function Yr(t,e,n){return Math.max(e,Math.min(n,t))}function jI(t,e){return(t%e+e)%e}function ehe(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function the(t,e,n){return t!==e?(n-t)/(e-t):0}function Dy(t,e,n){return(1-n)*t+n*e}function nhe(t,e,n,r){return Dy(t,e,1-Math.exp(-n*r))}function rhe(t,e=1){return e-Math.abs(jI(t,e*2)-e)}function ihe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function ohe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function ahe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function she(t,e){return t+Math.random()*(e-t)}function lhe(t){return t*(.5-Math.random())}function che(t){t!==void 0&&(yN=t);let e=yN+=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 uhe(t){return t*Uh}function fhe(t){return t*r0}function u3(t){return(t&t-1)===0&&t!==0}function Y7(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function zS(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function dhe(t,e,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((e+r)/2),f=a((e+r)/2),p=o((e-r)/2),m=a((e-r)/2),v=o((r-e)/2),x=a((r-e)/2);switch(i){case"XYX":t.set(s*f,l*p,l*m,s*c);break;case"YZY":t.set(l*m,s*f,l*p,s*c);break;case"ZXZ":t.set(l*p,l*m,s*f,s*c);break;case"XZX":t.set(s*f,l*x,l*v,s*c);break;case"YXY":t.set(l*v,s*f,l*x,s*c);break;case"ZYZ":t.set(l*x,l*v,s*f,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function fa(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 wn(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 K7={DEG2RAD:Uh,RAD2DEG:r0,generateUUID:as,clamp:Yr,euclideanModulo:jI,mapLinear:ehe,inverseLerp:the,lerp:Dy,damp:nhe,pingpong:rhe,smoothstep:ihe,smootherstep:ohe,randInt:ahe,randFloat:she,randFloatSpread:lhe,seededRandom:che,degToRad:uhe,radToDeg:fhe,isPowerOfTwo:u3,ceilPowerOfTwo:Y7,floorPowerOfTwo:zS,setQuaternionFromProperEuler:dhe,normalize:wn,denormalize:fa};class Be{constructor(e=0,n=0){Be.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(Yr(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,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Tn{constructor(e,n,r,i,o,a,s,l,c){Tn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c)}set(e,n,r,i,o,a,s,l,c){const f=this.elements;return f[0]=e,f[1]=i,f[2]=s,f[3]=n,f[4]=o,f[5]=l,f[6]=r,f[7]=a,f[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,a=r[0],s=r[3],l=r[6],c=r[1],f=r[4],p=r[7],m=r[2],v=r[5],x=r[8],_=i[0],b=i[3],y=i[6],S=i[1],M=i[4],C=i[7],A=i[2],R=i[5],P=i[8];return o[0]=a*_+s*S+l*A,o[3]=a*b+s*M+l*R,o[6]=a*y+s*C+l*P,o[1]=c*_+f*S+p*A,o[4]=c*b+f*M+p*R,o[7]=c*y+f*C+p*P,o[2]=m*_+v*S+x*A,o[5]=m*b+v*M+x*R,o[8]=m*y+v*C+x*P,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],a=e[4],s=e[5],l=e[6],c=e[7],f=e[8];return n*a*f-n*s*c-r*o*f+r*s*l+i*o*c-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],f=e[8],p=f*a-s*c,m=s*l-f*o,v=c*o-a*l,x=n*p+r*m+i*v;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/x;return e[0]=p*_,e[1]=(i*c-f*r)*_,e[2]=(s*r-i*a)*_,e[3]=m*_,e[4]=(f*n-i*l)*_,e[5]=(i*o-s*n)*_,e[6]=v*_,e[7]=(r*l-c*n)*_,e[8]=(a*n-r*o)*_,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,a,s){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*a+c*s)+a+e,-i*c,i*l,-i*(-c*a+l*s)+s+n,0,0,1),this}scale(e,n){return this.premultiply(JC.makeScale(e,n)),this}rotate(e){return this.premultiply(JC.makeRotation(-e)),this}translate(e,n){return this.premultiply(JC.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 JC=new Tn;function Z7(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const hhe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function yg(t,e){return new hhe[t](e)}function I1(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Q7(){const t=I1("canvas");return t.style.display="block",t}const xN={};function Fy(t){t in xN||(xN[t]=!0,console.warn(t))}const bN=new Tn().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),_N=new Tn().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),m_={[_c]:{transfer:C1,primaries:T1,toReference:t=>t,fromReference:t=>t},[Mi]:{transfer:mr,primaries:T1,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[fx]:{transfer:C1,primaries:A1,toReference:t=>t.applyMatrix3(_N),fromReference:t=>t.applyMatrix3(bN)},[RE]:{transfer:mr,primaries:A1,toReference:t=>t.convertSRGBToLinear().applyMatrix3(_N),fromReference:t=>t.applyMatrix3(bN).convertLinearToSRGB()}},phe=new Set([_c,fx]),Qn={enabled:!0,_workingColorSpace:_c,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!phe.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=m_[e].toReference,i=m_[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 m_[t].primaries},getTransfer:function(t){return t===Za?C1:m_[t].transfer}};function Ng(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function eT(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let dm;class XI{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{dm===void 0&&(dm=I1("canvas")),dm.width=e.width,dm.height=e.height;const r=dm.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=dm}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=I1("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 a=0;a0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ux)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case _1:e.x=e.x-Math.floor(e.x);break;case Vi:e.x=e.x<0?0:1;break;case w1: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 _1:e.y=e.y-Math.floor(e.y);break;case Vi:e.y=e.y<0?0:1;break;case w1:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Fy("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Mi?Wf:GI}set encoding(e){Fy("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Wf?Mi:Za}}Kr.DEFAULT_IMAGE=null;Kr.DEFAULT_MAPPING=ux;Kr.DEFAULT_ANISOTROPY=1;class Yn{constructor(e=0,n=0,r=0,i=1){Yn.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,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[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],f=l[4],p=l[8],m=l[1],v=l[5],x=l[9],_=l[2],b=l[6],y=l[10];if(Math.abs(f-m)<.01&&Math.abs(p-_)<.01&&Math.abs(x-b)<.01){if(Math.abs(f+m)<.1&&Math.abs(p+_)<.1&&Math.abs(x+b)<.1&&Math.abs(c+v+y-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const M=(c+1)/2,C=(v+1)/2,A=(y+1)/2,R=(f+m)/4,P=(p+_)/4,U=(x+b)/4;return M>C&&M>A?M<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(M),i=R/r,o=P/r):C>A?C<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(C),r=R/i,o=U/i):A<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(A),r=P/o,i=U/o),this.set(r,i,o,n),this}let S=Math.sqrt((b-x)*(b-x)+(p-_)*(p-_)+(m-f)*(m-f));return Math.abs(S)<.001&&(S=1),this.x=(b-x)/S,this.y=(p-_)/S,this.z=(m-f)/S,this.w=Math.acos((c+v+y-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,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 J7 extends Ou{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Yn(0,0,e,n),this.scissorTest=!1,this.viewport=new Yn(0,0,e,n);const i={width:e,height:n,depth:1};r.encoding!==void 0&&(Fy("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===Wf?Mi:Za),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ai,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new Kr(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new Ch(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Rl extends J7{constructor(e=1,n=1,r={}){super(e,n,r),this.isWebGLRenderTarget=!0}}class PE extends Kr{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=qr,this.minFilter=qr,this.wrapR=Vi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class vhe extends Rl{constructor(e=1,n=1,r=1){super(e,n),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new PE(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class qI extends Kr{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=qr,this.minFilter=qr,this.wrapR=Vi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class yhe extends Rl{constructor(e=1,n=1,r=1){super(e,n),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new qI(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class xhe extends Rl{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isWebGLMultipleRenderTargets=!0;const o=this.texture;this.texture=[];for(let a=0;a=0?1:-1,M=1-y*y;if(M>Number.EPSILON){const A=Math.sqrt(M),R=Math.atan2(A,y*S);b=Math.sin(b*R)/A,s=Math.sin(s*R)/A}const C=s*S;if(l=l*b+m*C,c=c*b+v*C,f=f*b+x*C,p=p*b+_*C,b===1-s){const A=1/Math.sqrt(l*l+c*c+f*f+p*p);l*=A,c*=A,f*=A,p*=A}}e[n]=l,e[n+1]=c,e[n+2]=f,e[n+3]=p}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],c=r[i+2],f=r[i+3],p=o[a],m=o[a+1],v=o[a+2],x=o[a+3];return e[n]=s*x+f*p+l*v-c*m,e[n+1]=l*x+f*m+c*p-s*v,e[n+2]=c*x+f*v+s*m-l*p,e[n+3]=f*x-s*p-l*m-c*v,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){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,c=s(r/2),f=s(i/2),p=s(o/2),m=l(r/2),v=l(i/2),x=l(o/2);switch(a){case"XYZ":this._x=m*f*p+c*v*x,this._y=c*v*p-m*f*x,this._z=c*f*x+m*v*p,this._w=c*f*p-m*v*x;break;case"YXZ":this._x=m*f*p+c*v*x,this._y=c*v*p-m*f*x,this._z=c*f*x-m*v*p,this._w=c*f*p+m*v*x;break;case"ZXY":this._x=m*f*p-c*v*x,this._y=c*v*p+m*f*x,this._z=c*f*x+m*v*p,this._w=c*f*p-m*v*x;break;case"ZYX":this._x=m*f*p-c*v*x,this._y=c*v*p+m*f*x,this._z=c*f*x-m*v*p,this._w=c*f*p+m*v*x;break;case"YZX":this._x=m*f*p+c*v*x,this._y=c*v*p+m*f*x,this._z=c*f*x-m*v*p,this._w=c*f*p-m*v*x;break;case"XZY":this._x=m*f*p-c*v*x,this._y=c*v*p-m*f*x,this._z=c*f*x+m*v*p,this._w=c*f*p+m*v*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n!==!1&&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],a=n[1],s=n[5],l=n[9],c=n[2],f=n[6],p=n[10],m=r+s+p;if(m>0){const v=.5/Math.sqrt(m+1);this._w=.25/v,this._x=(f-l)*v,this._y=(o-c)*v,this._z=(a-i)*v}else if(r>s&&r>p){const v=2*Math.sqrt(1+r-s-p);this._w=(f-l)/v,this._x=.25*v,this._y=(i+a)/v,this._z=(o+c)/v}else if(s>p){const v=2*Math.sqrt(1+s-r-p);this._w=(o-c)/v,this._x=(i+a)/v,this._y=.25*v,this._z=(l+f)/v}else{const v=2*Math.sqrt(1+p-r-s);this._w=(a-i)/v,this._x=(o+c)/v,this._y=(l+f)/v,this._z=.25*v}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(Yr(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,a=e._w,s=n._x,l=n._y,c=n._z,f=n._w;return this._x=r*f+a*s+i*c-o*l,this._y=i*f+a*l+o*s-r*c,this._z=o*f+a*c+r*l-i*s,this._w=a*f-r*s-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,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const v=1-n;return this._w=v*a+n*this._w,this._x=v*r+n*this._x,this._y=v*i+n*this._y,this._z=v*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),f=Math.atan2(c,s),p=Math.sin((1-n)*f)/c,m=Math.sin(n*f)/c;return this._w=a*p+this._w*m,this._x=r*p+this._x*m,this._y=i*p+this._y*m,this._z=o*p+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}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}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 q{constructor(e=0,n=0,r=0){q.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(wN.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(wN.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,a=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])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,c=2*(a*i-s*r),f=2*(s*n-o*i),p=2*(o*r-a*n);return this.x=n+l*c+a*p-s*f,this.y=r+l*f+s*c-o*p,this.z=i+l*p+o*f-a*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,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,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 nT.copy(this).projectOnVector(e),this.sub(nT)}reflect(e){return this.sub(nT.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(Yr(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()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const nT=new q,wN=new ya;class Ys{constructor(e=new q(1/0,1/0,1/0),n=new q(-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;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,ll),ll.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(Uv),v_.subVectors(this.max,Uv),hm.subVectors(e.a,Uv),pm.subVectors(e.b,Uv),mm.subVectors(e.c,Uv),gf.subVectors(pm,hm),vf.subVectors(mm,pm),Qd.subVectors(hm,mm);let n=[0,-gf.z,gf.y,0,-vf.z,vf.y,0,-Qd.z,Qd.y,gf.z,0,-gf.x,vf.z,0,-vf.x,Qd.z,0,-Qd.x,-gf.y,gf.x,0,-vf.y,vf.x,0,-Qd.y,Qd.x,0];return!rT(n,hm,pm,mm,v_)||(n=[1,0,0,0,1,0,0,0,1],!rT(n,hm,pm,mm,v_))?!1:(y_.crossVectors(gf,vf),n=[y_.x,y_.y,y_.z],rT(n,hm,pm,mm,v_))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ll).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ll).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:(Xc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Xc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Xc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Xc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Xc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Xc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Xc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Xc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Xc),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 Xc=[new q,new q,new q,new q,new q,new q,new q,new q],ll=new q,g_=new Ys,hm=new q,pm=new q,mm=new q,gf=new q,vf=new q,Qd=new q,Uv=new q,v_=new q,y_=new q,Jd=new q;function rT(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Jd.fromArray(t,o);const s=i.x*Math.abs(Jd.x)+i.y*Math.abs(Jd.y)+i.z*Math.abs(Jd.z),l=e.dot(Jd),c=n.dot(Jd),f=r.dot(Jd);if(Math.max(-Math.max(l,c,f),Math.min(l,c,f))>s)return!1}return!0}const bhe=new Ys,Bv=new q,iT=new q;class Pl{constructor(e=new q,n=-1){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):bhe.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=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;Bv.subVectors(e,this.center);const n=Bv.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(Bv,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):(iT.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Bv.copy(e.center).add(iT)),this.expandByPoint(Bv.copy(e.center).sub(iT))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const qc=new q,oT=new q,x_=new q,yf=new q,aT=new q,b_=new q,sT=new q;let y0=class{constructor(e=new q,n=new q(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,qc)),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=qc.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(qc.copy(this.origin).addScaledVector(this.direction,n),qc.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){oT.copy(e).add(n).multiplyScalar(.5),x_.copy(n).sub(e).normalize(),yf.copy(this.origin).sub(oT);const o=e.distanceTo(n)*.5,a=-this.direction.dot(x_),s=yf.dot(this.direction),l=-yf.dot(x_),c=yf.lengthSq(),f=Math.abs(1-a*a);let p,m,v,x;if(f>0)if(p=a*l-s,m=a*s-l,x=o*f,p>=0)if(m>=-x)if(m<=x){const _=1/f;p*=_,m*=_,v=p*(p+a*m+2*s)+m*(a*p+m+2*l)+c}else m=o,p=Math.max(0,-(a*m+s)),v=-p*p+m*(m+2*l)+c;else m=-o,p=Math.max(0,-(a*m+s)),v=-p*p+m*(m+2*l)+c;else m<=-x?(p=Math.max(0,-(-a*o+s)),m=p>0?-o:Math.min(Math.max(-o,-l),o),v=-p*p+m*(m+2*l)+c):m<=x?(p=0,m=Math.min(Math.max(-o,-l),o),v=m*(m+2*l)+c):(p=Math.max(0,-(a*o+s)),m=p>0?o:Math.min(Math.max(-o,-l),o),v=-p*p+m*(m+2*l)+c);else m=a>0?-o:o,p=Math.max(0,-(a*m+s)),v=-p*p+m*(m+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,p),i&&i.copy(oT).addScaledVector(x_,m),v}intersectSphere(e,n){qc.subVectors(e.center,this.origin);const r=qc.dot(this.direction),i=qc.dot(qc)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return l<0?null:s<0?this.at(l,n):this.at(s,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,a,s,l;const c=1/this.direction.x,f=1/this.direction.y,p=1/this.direction.z,m=this.origin;return c>=0?(r=(e.min.x-m.x)*c,i=(e.max.x-m.x)*c):(r=(e.max.x-m.x)*c,i=(e.min.x-m.x)*c),f>=0?(o=(e.min.y-m.y)*f,a=(e.max.y-m.y)*f):(o=(e.max.y-m.y)*f,a=(e.min.y-m.y)*f),r>a||o>i||((o>r||isNaN(r))&&(r=o),(a=0?(s=(e.min.z-m.z)*p,l=(e.max.z-m.z)*p):(s=(e.max.z-m.z)*p,l=(e.min.z-m.z)*p),r>l||s>i)||((s>r||r!==r)&&(r=s),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,qc)!==null}intersectTriangle(e,n,r,i,o){aT.subVectors(n,e),b_.subVectors(r,e),sT.crossVectors(aT,b_);let a=this.direction.dot(sT),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;yf.subVectors(this.origin,e);const l=s*this.direction.dot(b_.crossVectors(yf,b_));if(l<0)return null;const c=s*this.direction.dot(aT.cross(yf));if(c<0||l+c>a)return null;const f=-s*yf.dot(sT);return f<0?null:this.at(f/a,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 dn{constructor(e,n,r,i,o,a,s,l,c,f,p,m,v,x,_,b){dn.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,a,s,l,c,f,p,m,v,x,_,b)}set(e,n,r,i,o,a,s,l,c,f,p,m,v,x,_,b){const y=this.elements;return y[0]=e,y[4]=n,y[8]=r,y[12]=i,y[1]=o,y[5]=a,y[9]=s,y[13]=l,y[2]=c,y[6]=f,y[10]=p,y[14]=m,y[3]=v,y[7]=x,y[11]=_,y[15]=b,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 dn().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/gm.setFromMatrixColumn(e,0).length(),o=1/gm.setFromMatrixColumn(e,1).length(),a=1/gm.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]*a,n[9]=r[9]*a,n[10]=r[10]*a,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,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),c=Math.sin(i),f=Math.cos(o),p=Math.sin(o);if(e.order==="XYZ"){const m=a*f,v=a*p,x=s*f,_=s*p;n[0]=l*f,n[4]=-l*p,n[8]=c,n[1]=v+x*c,n[5]=m-_*c,n[9]=-s*l,n[2]=_-m*c,n[6]=x+v*c,n[10]=a*l}else if(e.order==="YXZ"){const m=l*f,v=l*p,x=c*f,_=c*p;n[0]=m+_*s,n[4]=x*s-v,n[8]=a*c,n[1]=a*p,n[5]=a*f,n[9]=-s,n[2]=v*s-x,n[6]=_+m*s,n[10]=a*l}else if(e.order==="ZXY"){const m=l*f,v=l*p,x=c*f,_=c*p;n[0]=m-_*s,n[4]=-a*p,n[8]=x+v*s,n[1]=v+x*s,n[5]=a*f,n[9]=_-m*s,n[2]=-a*c,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const m=a*f,v=a*p,x=s*f,_=s*p;n[0]=l*f,n[4]=x*c-v,n[8]=m*c+_,n[1]=l*p,n[5]=_*c+m,n[9]=v*c-x,n[2]=-c,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const m=a*l,v=a*c,x=s*l,_=s*c;n[0]=l*f,n[4]=_-m*p,n[8]=x*p+v,n[1]=p,n[5]=a*f,n[9]=-s*f,n[2]=-c*f,n[6]=v*p+x,n[10]=m-_*p}else if(e.order==="XZY"){const m=a*l,v=a*c,x=s*l,_=s*c;n[0]=l*f,n[4]=-p,n[8]=c*f,n[1]=m*p+_,n[5]=a*f,n[9]=v*p-x,n[2]=x*p-v,n[6]=s*f,n[10]=_*p+m}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(_he,e,whe)}lookAt(e,n,r){const i=this.elements;return $a.subVectors(e,n),$a.lengthSq()===0&&($a.z=1),$a.normalize(),xf.crossVectors(r,$a),xf.lengthSq()===0&&(Math.abs(r.z)===1?$a.x+=1e-4:$a.z+=1e-4,$a.normalize(),xf.crossVectors(r,$a)),xf.normalize(),__.crossVectors($a,xf),i[0]=xf.x,i[4]=__.x,i[8]=$a.x,i[1]=xf.y,i[5]=__.y,i[9]=$a.y,i[2]=xf.z,i[6]=__.z,i[10]=$a.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,a=r[0],s=r[4],l=r[8],c=r[12],f=r[1],p=r[5],m=r[9],v=r[13],x=r[2],_=r[6],b=r[10],y=r[14],S=r[3],M=r[7],C=r[11],A=r[15],R=i[0],P=i[4],U=i[8],k=i[12],N=i[1],z=i[5],K=i[9],J=i[13],G=i[2],ne=i[6],ie=i[10],se=i[14],H=i[3],Y=i[7],te=i[11],Q=i[15];return o[0]=a*R+s*N+l*G+c*H,o[4]=a*P+s*z+l*ne+c*Y,o[8]=a*U+s*K+l*ie+c*te,o[12]=a*k+s*J+l*se+c*Q,o[1]=f*R+p*N+m*G+v*H,o[5]=f*P+p*z+m*ne+v*Y,o[9]=f*U+p*K+m*ie+v*te,o[13]=f*k+p*J+m*se+v*Q,o[2]=x*R+_*N+b*G+y*H,o[6]=x*P+_*z+b*ne+y*Y,o[10]=x*U+_*K+b*ie+y*te,o[14]=x*k+_*J+b*se+y*Q,o[3]=S*R+M*N+C*G+A*H,o[7]=S*P+M*z+C*ne+A*Y,o[11]=S*U+M*K+C*ie+A*te,o[15]=S*k+M*J+C*se+A*Q,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],a=e[1],s=e[5],l=e[9],c=e[13],f=e[2],p=e[6],m=e[10],v=e[14],x=e[3],_=e[7],b=e[11],y=e[15];return x*(+o*l*p-i*c*p-o*s*m+r*c*m+i*s*v-r*l*v)+_*(+n*l*v-n*c*m+o*a*m-i*a*v+i*c*f-o*l*f)+b*(+n*c*p-n*s*v-o*a*p+r*a*v+o*s*f-r*c*f)+y*(-i*s*f-n*l*p+n*s*m+i*a*p-r*a*m+r*l*f)}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],a=e[4],s=e[5],l=e[6],c=e[7],f=e[8],p=e[9],m=e[10],v=e[11],x=e[12],_=e[13],b=e[14],y=e[15],S=p*b*c-_*m*c+_*l*v-s*b*v-p*l*y+s*m*y,M=x*m*c-f*b*c-x*l*v+a*b*v+f*l*y-a*m*y,C=f*_*c-x*p*c+x*s*v-a*_*v-f*s*y+a*p*y,A=x*p*l-f*_*l-x*s*m+a*_*m+f*s*b-a*p*b,R=n*S+r*M+i*C+o*A;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/R;return e[0]=S*P,e[1]=(_*m*o-p*b*o-_*i*v+r*b*v+p*i*y-r*m*y)*P,e[2]=(s*b*o-_*l*o+_*i*c-r*b*c-s*i*y+r*l*y)*P,e[3]=(p*l*o-s*m*o-p*i*c+r*m*c+s*i*v-r*l*v)*P,e[4]=M*P,e[5]=(f*b*o-x*m*o+x*i*v-n*b*v-f*i*y+n*m*y)*P,e[6]=(x*l*o-a*b*o-x*i*c+n*b*c+a*i*y-n*l*y)*P,e[7]=(a*m*o-f*l*o+f*i*c-n*m*c-a*i*v+n*l*v)*P,e[8]=C*P,e[9]=(x*p*o-f*_*o-x*r*v+n*_*v+f*r*y-n*p*y)*P,e[10]=(a*_*o-x*s*o+x*r*c-n*_*c-a*r*y+n*s*y)*P,e[11]=(f*s*o-a*p*o-f*r*c+n*p*c+a*r*v-n*s*v)*P,e[12]=A*P,e[13]=(f*_*i-x*p*i+x*r*m-n*_*m-f*r*b+n*p*b)*P,e[14]=(x*s*i-a*_*i-x*r*l+n*_*l+a*r*b-n*s*b)*P,e[15]=(a*p*i-f*s*i+f*r*l-n*p*l-a*r*m+n*s*m)*P,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,a=e.x,s=e.y,l=e.z,c=o*a,f=o*s;return this.set(c*a+r,c*s-i*l,c*l+i*s,0,c*s+i*l,f*s+r,f*l-i*a,0,c*l-i*s,f*l+i*a,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,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,c=o+o,f=a+a,p=s+s,m=o*c,v=o*f,x=o*p,_=a*f,b=a*p,y=s*p,S=l*c,M=l*f,C=l*p,A=r.x,R=r.y,P=r.z;return i[0]=(1-(_+y))*A,i[1]=(v+C)*A,i[2]=(x-M)*A,i[3]=0,i[4]=(v-C)*R,i[5]=(1-(m+y))*R,i[6]=(b+S)*R,i[7]=0,i[8]=(x+M)*P,i[9]=(b-S)*P,i[10]=(1-(m+_))*P,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=gm.set(i[0],i[1],i[2]).length();const a=gm.set(i[4],i[5],i[6]).length(),s=gm.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],cl.copy(this);const c=1/o,f=1/a,p=1/s;return cl.elements[0]*=c,cl.elements[1]*=c,cl.elements[2]*=c,cl.elements[4]*=f,cl.elements[5]*=f,cl.elements[6]*=f,cl.elements[8]*=p,cl.elements[9]*=p,cl.elements[10]*=p,n.setFromRotationMatrix(cl),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a,s=ac){const l=this.elements,c=2*o/(n-e),f=2*o/(r-i),p=(n+e)/(n-e),m=(r+i)/(r-i);let v,x;if(s===ac)v=-(a+o)/(a-o),x=-2*a*o/(a-o);else if(s===P1)v=-a/(a-o),x=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=c,l[4]=0,l[8]=p,l[12]=0,l[1]=0,l[5]=f,l[9]=m,l[13]=0,l[2]=0,l[6]=0,l[10]=v,l[14]=x,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,a,s=ac){const l=this.elements,c=1/(n-e),f=1/(r-i),p=1/(a-o),m=(n+e)*c,v=(r+i)*f;let x,_;if(s===ac)x=(a+o)*p,_=-2*p;else if(s===P1)x=o*p,_=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-m,l[1]=0,l[5]=2*f,l[9]=0,l[13]=-v,l[2]=0,l[6]=0,l[10]=_,l[14]=-x,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 gm=new q,cl=new dn,_he=new q(0,0,0),whe=new q(1,1,1),xf=new q,__=new q,$a=new q,SN=new dn,MN=new ya;class dx{constructor(e=0,n=0,r=0,i=dx.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],a=i[4],s=i[8],l=i[1],c=i[5],f=i[9],p=i[2],m=i[6],v=i[10];switch(n){case"XYZ":this._y=Math.asin(Yr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-f,v),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(m,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Yr(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(s,v),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-p,o),this._z=0);break;case"ZXY":this._x=Math.asin(Yr(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,v),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Yr(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,v),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Yr(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,c),this._y=Math.atan2(-p,o)):(this._x=0,this._y=Math.atan2(s,v));break;case"XZY":this._z=Math.asin(-Yr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(m,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-f,v),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 SN.makeRotationFromQuaternion(e),this.setFromRotationMatrix(SN,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return MN.setFromEuler(this),this.setFromQuaternion(MN,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}}dx.DEFAULT_ORDER="XYZ";class Bh{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&&(r=r.concat(a))}return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(zv,e,Mhe),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(zv,Ehe,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let r=0,i=n.length;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()));function o(s,l){return s[l.uuid]===void 0&&(s[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 s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l))for(let c=0,f=l.length;c0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(r.geometries=s),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),f.length>0&&(r.images=f),p.length>0&&(r.shapes=p),m.length>0&&(r.skeletons=m),v.length>0&&(r.animations=v),x.length>0&&(r.nodes=x)}return r.object=i,r;function a(s){const l=[];for(const c in s){const f=s[c];delete f.metadata,l.push(f)}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.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.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){ul.subVectors(i,n),Kc.subVectors(r,n),lT.subVectors(e,n);const a=ul.dot(ul),s=ul.dot(Kc),l=ul.dot(lT),c=Kc.dot(Kc),f=Kc.dot(lT),p=a*c-s*s;if(p===0)return o.set(-2,-1,-1);const m=1/p,v=(c*l-s*f)*m,x=(a*f-s*l)*m;return o.set(1-v-x,x,v)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Zc),Zc.x>=0&&Zc.y>=0&&Zc.x+Zc.y<=1}static getUV(e,n,r,i,o,a,s,l){return S_===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),S_=!0),this.getInterpolation(e,n,r,i,o,a,s,l)}static getInterpolation(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Zc),l.setScalar(0),l.addScaledVector(o,Zc.x),l.addScaledVector(a,Zc.y),l.addScaledVector(s,Zc.z),l}static isFrontFacing(e,n,r,i){return ul.subVectors(r,n),Kc.subVectors(e,n),ul.cross(Kc).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 ul.subVectors(this.c,this.b),Kc.subVectors(this.a,this.b),ul.cross(Kc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ua.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return ua.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return S_===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),S_=!0),ua.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}getInterpolation(e,n,r,i,o){return ua.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return ua.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ua.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 a,s;ym.subVectors(i,r),xm.subVectors(o,r),cT.subVectors(e,r);const l=ym.dot(cT),c=xm.dot(cT);if(l<=0&&c<=0)return n.copy(r);uT.subVectors(e,i);const f=ym.dot(uT),p=xm.dot(uT);if(f>=0&&p<=f)return n.copy(i);const m=l*p-f*c;if(m<=0&&l>=0&&f<=0)return a=l/(l-f),n.copy(r).addScaledVector(ym,a);fT.subVectors(e,o);const v=ym.dot(fT),x=xm.dot(fT);if(x>=0&&v<=x)return n.copy(o);const _=v*c-l*x;if(_<=0&&c>=0&&x<=0)return s=c/(c-x),n.copy(r).addScaledVector(xm,s);const b=f*x-v*p;if(b<=0&&p-f>=0&&v-x>=0)return RN.subVectors(o,i),s=(p-f)/(p-f+(v-x)),n.copy(i).addScaledVector(RN,s);const y=1/(b+_+m);return a=_*y,s=m*y,n.copy(r).addScaledVector(ym,a).addScaledVector(xm,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const e9={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},bf={h:0,s:0,l:0},M_={h:0,s:0,l:0};function dT(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 _t=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=Mi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Qn.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Qn.workingColorSpace){return this.r=e,this.g=n,this.b=r,Qn.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Qn.workingColorSpace){if(e=jI(e,1),n=Yr(n,0,1),r=Yr(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=dT(a,o,e+1/3),this.g=dT(a,o,e),this.b=dT(a,o,e-1/3)}return Qn.toWorkingColorSpace(this,i),this}setStyle(e,n=Mi){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 a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))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(s))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(s))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],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(a===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=Mi){const r=e9[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=Ng(e.r),this.g=Ng(e.g),this.b=Ng(e.b),this}copyLinearToSRGB(e){return this.r=eT(e.r),this.g=eT(e.g),this.b=eT(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Mi){return Qn.fromWorkingColorSpace(bo.copy(this),e),Math.round(Yr(bo.r*255,0,255))*65536+Math.round(Yr(bo.g*255,0,255))*256+Math.round(Yr(bo.b*255,0,255))}getHexString(e=Mi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Qn.workingColorSpace){Qn.fromWorkingColorSpace(bo.copy(this),n);const r=bo.r,i=bo.g,o=bo.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,c;const f=(s+a)/2;if(s===a)l=0,c=0;else{const p=a-s;switch(c=f<=.5?p/(a+s):p/(2-a-s),a){case r:l=(i-o)/p+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}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&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.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.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!==Fh&&(r.blending=this.blending),this.side!==Mu&&(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!==DS&&(r.blendSrc=this.blendSrc),this.blendDst!==FS&&(r.blendDst=this.blendDst),this.blendEquation!==Pf&&(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!==y1&&(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!==l3&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==dh&&(r.stencilFail=this.stencilFail),this.stencilZFail!==dh&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==dh&&(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 a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}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++}};class fd extends so{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new _t(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=cx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const su=Rhe();function Rhe(){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),a=new Uint32Array(64),s=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,f=0;for(;!(c&8388608);)c<<=1,f-=8388608;c&=-8388609,f+=947912704,o[l]=c|f}for(let l=1024;l<2048;++l)o[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(s[l]=1024);return{floatView:e,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:o,exponentTable:a,offsetTable:s}}function aa(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Yr(t,-65504,65504),su.floatView[0]=t;const e=su.uint32View[0],n=e>>23&511;return su.baseTable[n]+((e&8388607)>>su.shiftTable[n])}function fy(t){const e=t>>10;return su.uint32View[0]=su.mantissaTable[su.offsetTable[e]+(t&1023)]+su.exponentTable[e],su.floatView[0]}const Phe={toHalfFloat:aa,fromHalfFloat:fy},mi=new q,E_=new Be;class lr{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=R1,this.updateRange={offset:0,count:-1},this.gpuType=Sl,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,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],f=[];for(let p=0,m=c.length;p0&&(i[l]=f,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.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 f=i[c];this.setAttribute(c,f.clone(n))}const o=e.morphAttributes;for(const c in o){const f=[],p=o[c];for(let m=0,v=p.length;m0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o(e.far-e.near)**2))&&(PN.copy(o).invert(),eh.copy(e.ray).applyMatrix4(PN),!(r.boundingBox!==null&&eh.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,eh)))}_computeIntersections(e,n,r){let i;const o=this.geometry,a=this.material,s=o.index,l=o.attributes.position,c=o.attributes.uv,f=o.attributes.uv1,p=o.attributes.normal,m=o.groups,v=o.drawRange;if(s!==null)if(Array.isArray(a))for(let x=0,_=m.length;x<_;x++){const b=m[x],y=a[b.materialIndex],S=Math.max(b.start,v.start),M=Math.min(s.count,Math.min(b.start+b.count,v.start+v.count));for(let C=S,A=M;Cn.far?null:{distance:c,point:L_.clone(),object:t}}function O_(t,e,n,r,i,o,a,s,l,c){t.getVertexPosition(s,_m),t.getVertexPosition(l,wm),t.getVertexPosition(c,Sm);const f=Bhe(t,e,n,r,_m,wm,Sm,I_);if(f){i&&(A_.fromBufferAttribute(i,s),R_.fromBufferAttribute(i,l),P_.fromBufferAttribute(i,c),f.uv=ua.getInterpolation(I_,_m,wm,Sm,A_,R_,P_,new Be)),o&&(A_.fromBufferAttribute(o,s),R_.fromBufferAttribute(o,l),P_.fromBufferAttribute(o,c),f.uv1=ua.getInterpolation(I_,_m,wm,Sm,A_,R_,P_,new Be),f.uv2=f.uv1),a&&(LN.fromBufferAttribute(a,s),ON.fromBufferAttribute(a,l),kN.fromBufferAttribute(a,c),f.normal=ua.getInterpolation(I_,_m,wm,Sm,LN,ON,kN,new q),f.normal.dot(r.direction)>0&&f.normal.multiplyScalar(-1));const p={a:s,b:l,c,normal:new q,materialIndex:0};ua.getNormal(_m,wm,Sm,p.normal),f.face=p}return f}class cp extends An{constructor(e=1,n=1,r=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};const s=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const l=[],c=[],f=[],p=[];let m=0,v=0;x("z","y","x",-1,-1,r,n,e,a,o,0),x("z","y","x",1,-1,r,n,-e,a,o,1),x("x","z","y",1,1,e,r,n,i,a,2),x("x","z","y",1,-1,e,r,-n,i,a,3),x("x","y","z",1,-1,e,n,r,i,o,4),x("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new It(c,3)),this.setAttribute("normal",new It(f,3)),this.setAttribute("uv",new It(p,2));function x(_,b,y,S,M,C,A,R,P,U,k){const N=C/P,z=A/U,K=C/2,J=A/2,G=R/2,ne=P+1,ie=U+1;let se=0,H=0;const Y=new q;for(let te=0;te0?1:-1,f.push(Y.x,Y.y,Y.z),p.push(ae/P),p.push(1-te/U),se+=1}}for(let te=0;te0&&(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 hx extends Hn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new dn,this.projectionMatrix=new dn,this.projectionMatrixInverse=new dn,this.coordinateSystem=ac}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)}}class Hi extends hx{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=r0*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Uh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return r0*2*Math.atan(Math.tan(Uh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,o,a){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=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Uh*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/c,i*=a.width/l,r*=a.height/c}const s=this.filmOffset;s!==0&&(o+=e*s/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 Mm=-90,Em=1;class r9 extends Hn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Hi(Mm,Em,e,n);i.layers=this.layers,this.add(i);const o=new Hi(Mm,Em,e,n);o.layers=this.layers,this.add(o);const a=new Hi(Mm,Em,e,n);a.layers=this.layers,this.add(a);const s=new Hi(Mm,Em,e,n);s.layers=this.layers,this.add(s);const l=new Hi(Mm,Em,e,n);l.layers=this.layers,this.add(l);const c=new Hi(Mm,Em,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,a,s,l]=n;for(const c of n)this.remove(c);if(e===ac)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),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===P1)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),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.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,a,s,l,c,f]=this.children,p=e.getRenderTarget(),m=e.getActiveCubeFace(),v=e.getActiveMipmapLevel(),x=e.xr.enabled;e.xr.enabled=!1;const _=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,a),e.setRenderTarget(r,2,i),e.render(n,s),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,c),r.texture.generateMipmaps=_,e.setRenderTarget(r,5,i),e.render(n,f),e.setRenderTarget(p,m,v),e.xr.enabled=x,r.texture.needsPMREMUpdate=!0}}class px extends Kr{constructor(e,n,r,i,o,a,s,l,c,f){e=e!==void 0?e:[],n=n!==void 0?n:Eu,super(e,n,r,i,o,a,s,l,c,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class i9 extends Rl{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];n.encoding!==void 0&&(Fy("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Wf?Mi:Za),this.texture=new px(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:ai}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 cp(5,5,5),o=new wc({name:"CubemapFromEquirect",uniforms:i0(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:jo,blending:mu});o.uniforms.tEquirect.value=n;const a=new no(i,o),s=n.minFilter;return n.minFilter===Qf&&(n.minFilter=ai),new r9(1,10,this).update(e,a),n.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,n,r,i){const o=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,r,i);e.setRenderTarget(o)}}const mT=new q,Vhe=new q,Whe=new Tn;class Cf{constructor(e=new q(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=mT.subVectors(r,n).cross(Vhe.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(mT),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||Whe.getNormalMatrix(e),i=this.coplanarPoint(mT).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 th=new Pl,k_=new q;class IE{constructor(e=new Cf,n=new Cf,r=new Cf,i=new Cf,o=new Cf,a=new Cf){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),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=ac){const r=this.planes,i=e.elements,o=i[0],a=i[1],s=i[2],l=i[3],c=i[4],f=i[5],p=i[6],m=i[7],v=i[8],x=i[9],_=i[10],b=i[11],y=i[12],S=i[13],M=i[14],C=i[15];if(r[0].setComponents(l-o,m-c,b-v,C-y).normalize(),r[1].setComponents(l+o,m+c,b+v,C+y).normalize(),r[2].setComponents(l+a,m+f,b+x,C+S).normalize(),r[3].setComponents(l-a,m-f,b-x,C-S).normalize(),r[4].setComponents(l-s,m-p,b-_,C-M).normalize(),n===ac)r[5].setComponents(l+s,m+p,b+_,C+M).normalize();else if(n===P1)r[5].setComponents(s,p,_,M).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(),th.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),th.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(th)}intersectsSprite(e){return th.center.set(0,0,0),th.radius=.7071067811865476,th.applyMatrix4(e.matrixWorld),this.intersectsSphere(th)}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,k_.y=i.normal.y>0?e.max.y:e.min.y,k_.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(k_)<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 o9(){let t=null,e=!1,n=null,r=null;function i(o,a){n(o,a),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 Ghe(t,e){const n=e.isWebGL2,r=new WeakMap;function i(c,f){const p=c.array,m=c.usage,v=t.createBuffer();t.bindBuffer(f,v),t.bufferData(f,p,m),c.onUploadCallback();let x;if(p instanceof Float32Array)x=t.FLOAT;else if(p instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)x=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else x=t.UNSIGNED_SHORT;else if(p instanceof Int16Array)x=t.SHORT;else if(p instanceof Uint32Array)x=t.UNSIGNED_INT;else if(p instanceof Int32Array)x=t.INT;else if(p instanceof Int8Array)x=t.BYTE;else if(p instanceof Uint8Array)x=t.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)x=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:v,type:x,bytesPerElement:p.BYTES_PER_ELEMENT,version:c.version}}function o(c,f,p){const m=f.array,v=f.updateRange;t.bindBuffer(p,c),v.count===-1?t.bufferSubData(p,0,m):(n?t.bufferSubData(p,v.offset*m.BYTES_PER_ELEMENT,m,v.offset,v.count):t.bufferSubData(p,v.offset*m.BYTES_PER_ELEMENT,m.subarray(v.offset,v.offset+v.count)),v.count=-1),f.onUploadCallback()}function a(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function s(c){c.isInterleavedBufferAttribute&&(c=c.data);const f=r.get(c);f&&(t.deleteBuffer(f.buffer),r.delete(c))}function l(c,f){if(c.isGLBufferAttribute){const m=r.get(c);(!m||m.version 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,ape=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,spe=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,lpe=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,cpe=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,upe=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,fpe=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,dpe=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,hpe=`#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; -} -float luminance( const in vec3 rgb ) { - const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); - return dot( weights, rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,ppe=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_v0 0.339 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_v1 0.276 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_v4 0.046 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_v5 0.016 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_v6 0.0038 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,mpe=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,gpe=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,vpe=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,ype=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,xpe=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,bpe="gl_FragColor = linearToOutputTexel( gl_FragColor );",_pe=` -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 ); -} -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 LinearTosRGB( in vec4 value ) { - return sRGBTransferOETF( value ); -}`,wpe=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,Spe=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,Mpe=`#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`,Epe=`#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`,Cpe=`#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`,Tpe=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,Ape=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,Rpe=`#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`,Ppe=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Ipe=`#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 -}`,Lpe=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,Ope=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,kpe=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,Npe=`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`,Dpe=`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 ) { - #if defined ( LEGACY_LIGHTS ) - if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; - #else - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; - #endif -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, 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`,Fpe=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,Upe=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,Bpe=`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`,zpe=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,$pe=`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`,Hpe=`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_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y; -#endif`,Vpe=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 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 ); -}`,Wpe=` -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.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.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.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`,Gpe=`#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`,jpe=`#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`,Xpe=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,qpe=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,Ype=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,Kpe=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,Zpe=`#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`,Qpe=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,Jpe=`#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`,eme=`#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`,tme=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,nme=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,rme=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,ime=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } - #else - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; - #endif -#endif`,ome=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } - #else - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif - #endif -#endif`,ame=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } - #else - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif - #endif -#endif`,sme=`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;`,lme=`#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`,cme=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,ume=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,fme=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,dme=`#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`,hme=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,pme=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,mme=`#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`,gme=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,vme=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,yme=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec2 packDepthToRG( in highp float v ) { - return packDepthToRGBA( v ).yx; -} -float unpackRGToDepth( const in highp vec2 v ) { - return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,xme=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,bme=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,_me=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,wme=`#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`,Sme=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,Mme=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,Eme=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,Cme=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,Tme=`#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`,Ame=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,Rme=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,Pme=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } -#endif`,Ime=`#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`,Lme=`#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`,Ome=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,kme=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,Nme=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,Dme=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,Fme=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,Ume=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,Bme=`#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`,zme=`#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`,$me=`#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`,Hme=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const Vme=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,Wme=`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 -}`,Gme=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,jme=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,Xme=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,qme=`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 -}`,Yme=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,Kme=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,Zme=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,Qme=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,Jme=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,ege=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,tge=`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 -}`,nge=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,rge=`#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #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 -}`,ige=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #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 -}`,oge=`#define LAMBERT -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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,age=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,sge=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,lge=`#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() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #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 -}`,cge=`#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 -void main() { - #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 -}`,uge=`#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() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,fge=`#define PHONG -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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,dge=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,hge=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,pge=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #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 -}`,mge=`#define TOON -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 - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,gge=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,vge=`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 - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,yge=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,xge=`#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bge=`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 -}`,_ge=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,wge=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,_n={alphahash_fragment:jhe,alphahash_pars_fragment:Xhe,alphamap_fragment:qhe,alphamap_pars_fragment:Yhe,alphatest_fragment:Khe,alphatest_pars_fragment:Zhe,aomap_fragment:Qhe,aomap_pars_fragment:Jhe,begin_vertex:epe,beginnormal_vertex:tpe,bsdfs:npe,iridescence_fragment:rpe,bumpmap_pars_fragment:ipe,clipping_planes_fragment:ope,clipping_planes_pars_fragment:ape,clipping_planes_pars_vertex:spe,clipping_planes_vertex:lpe,color_fragment:cpe,color_pars_fragment:upe,color_pars_vertex:fpe,color_vertex:dpe,common:hpe,cube_uv_reflection_fragment:ppe,defaultnormal_vertex:mpe,displacementmap_pars_vertex:gpe,displacementmap_vertex:vpe,emissivemap_fragment:ype,emissivemap_pars_fragment:xpe,colorspace_fragment:bpe,colorspace_pars_fragment:_pe,envmap_fragment:wpe,envmap_common_pars_fragment:Spe,envmap_pars_fragment:Mpe,envmap_pars_vertex:Epe,envmap_physical_pars_fragment:Fpe,envmap_vertex:Cpe,fog_vertex:Tpe,fog_pars_vertex:Ape,fog_fragment:Rpe,fog_pars_fragment:Ppe,gradientmap_pars_fragment:Ipe,lightmap_fragment:Lpe,lightmap_pars_fragment:Ope,lights_lambert_fragment:kpe,lights_lambert_pars_fragment:Npe,lights_pars_begin:Dpe,lights_toon_fragment:Upe,lights_toon_pars_fragment:Bpe,lights_phong_fragment:zpe,lights_phong_pars_fragment:$pe,lights_physical_fragment:Hpe,lights_physical_pars_fragment:Vpe,lights_fragment_begin:Wpe,lights_fragment_maps:Gpe,lights_fragment_end:jpe,logdepthbuf_fragment:Xpe,logdepthbuf_pars_fragment:qpe,logdepthbuf_pars_vertex:Ype,logdepthbuf_vertex:Kpe,map_fragment:Zpe,map_pars_fragment:Qpe,map_particle_fragment:Jpe,map_particle_pars_fragment:eme,metalnessmap_fragment:tme,metalnessmap_pars_fragment:nme,morphcolor_vertex:rme,morphnormal_vertex:ime,morphtarget_pars_vertex:ome,morphtarget_vertex:ame,normal_fragment_begin:sme,normal_fragment_maps:lme,normal_pars_fragment:cme,normal_pars_vertex:ume,normal_vertex:fme,normalmap_pars_fragment:dme,clearcoat_normal_fragment_begin:hme,clearcoat_normal_fragment_maps:pme,clearcoat_pars_fragment:mme,iridescence_pars_fragment:gme,opaque_fragment:vme,packing:yme,premultiplied_alpha_fragment:xme,project_vertex:bme,dithering_fragment:_me,dithering_pars_fragment:wme,roughnessmap_fragment:Sme,roughnessmap_pars_fragment:Mme,shadowmap_pars_fragment:Eme,shadowmap_pars_vertex:Cme,shadowmap_vertex:Tme,shadowmask_pars_fragment:Ame,skinbase_vertex:Rme,skinning_pars_vertex:Pme,skinning_vertex:Ime,skinnormal_vertex:Lme,specularmap_fragment:Ome,specularmap_pars_fragment:kme,tonemapping_fragment:Nme,tonemapping_pars_fragment:Dme,transmission_fragment:Fme,transmission_pars_fragment:Ume,uv_pars_fragment:Bme,uv_pars_vertex:zme,uv_vertex:$me,worldpos_vertex:Hme,background_vert:Vme,background_frag:Wme,backgroundCube_vert:Gme,backgroundCube_frag:jme,cube_vert:Xme,cube_frag:qme,depth_vert:Yme,depth_frag:Kme,distanceRGBA_vert:Zme,distanceRGBA_frag:Qme,equirect_vert:Jme,equirect_frag:ege,linedashed_vert:tge,linedashed_frag:nge,meshbasic_vert:rge,meshbasic_frag:ige,meshlambert_vert:oge,meshlambert_frag:age,meshmatcap_vert:sge,meshmatcap_frag:lge,meshnormal_vert:cge,meshnormal_frag:uge,meshphong_vert:fge,meshphong_frag:dge,meshphysical_vert:hge,meshphysical_frag:pge,meshtoon_vert:mge,meshtoon_frag:gge,points_vert:vge,points_frag:yge,shadow_vert:xge,shadow_frag:bge,sprite_vert:_ge,sprite_frag:wge},pt={common:{diffuse:{value:new _t(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Tn},alphaMap:{value:null},alphaMapTransform:{value:new Tn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Tn}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Tn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Tn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Tn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Tn},normalScale:{value:new Be(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Tn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Tn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Tn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Tn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new _t(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new _t(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Tn},alphaTest:{value:0},uvTransform:{value:new Tn}},sprite:{diffuse:{value:new _t(16777215)},opacity:{value:1},center:{value:new Be(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Tn},alphaMap:{value:null},alphaMapTransform:{value:new Tn},alphaTest:{value:0}}},yl={basic:{uniforms:Bo([pt.common,pt.specularmap,pt.envmap,pt.aomap,pt.lightmap,pt.fog]),vertexShader:_n.meshbasic_vert,fragmentShader:_n.meshbasic_frag},lambert:{uniforms:Bo([pt.common,pt.specularmap,pt.envmap,pt.aomap,pt.lightmap,pt.emissivemap,pt.bumpmap,pt.normalmap,pt.displacementmap,pt.fog,pt.lights,{emissive:{value:new _t(0)}}]),vertexShader:_n.meshlambert_vert,fragmentShader:_n.meshlambert_frag},phong:{uniforms:Bo([pt.common,pt.specularmap,pt.envmap,pt.aomap,pt.lightmap,pt.emissivemap,pt.bumpmap,pt.normalmap,pt.displacementmap,pt.fog,pt.lights,{emissive:{value:new _t(0)},specular:{value:new _t(1118481)},shininess:{value:30}}]),vertexShader:_n.meshphong_vert,fragmentShader:_n.meshphong_frag},standard:{uniforms:Bo([pt.common,pt.envmap,pt.aomap,pt.lightmap,pt.emissivemap,pt.bumpmap,pt.normalmap,pt.displacementmap,pt.roughnessmap,pt.metalnessmap,pt.fog,pt.lights,{emissive:{value:new _t(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_n.meshphysical_vert,fragmentShader:_n.meshphysical_frag},toon:{uniforms:Bo([pt.common,pt.aomap,pt.lightmap,pt.emissivemap,pt.bumpmap,pt.normalmap,pt.displacementmap,pt.gradientmap,pt.fog,pt.lights,{emissive:{value:new _t(0)}}]),vertexShader:_n.meshtoon_vert,fragmentShader:_n.meshtoon_frag},matcap:{uniforms:Bo([pt.common,pt.bumpmap,pt.normalmap,pt.displacementmap,pt.fog,{matcap:{value:null}}]),vertexShader:_n.meshmatcap_vert,fragmentShader:_n.meshmatcap_frag},points:{uniforms:Bo([pt.points,pt.fog]),vertexShader:_n.points_vert,fragmentShader:_n.points_frag},dashed:{uniforms:Bo([pt.common,pt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_n.linedashed_vert,fragmentShader:_n.linedashed_frag},depth:{uniforms:Bo([pt.common,pt.displacementmap]),vertexShader:_n.depth_vert,fragmentShader:_n.depth_frag},normal:{uniforms:Bo([pt.common,pt.bumpmap,pt.normalmap,pt.displacementmap,{opacity:{value:1}}]),vertexShader:_n.meshnormal_vert,fragmentShader:_n.meshnormal_frag},sprite:{uniforms:Bo([pt.sprite,pt.fog]),vertexShader:_n.sprite_vert,fragmentShader:_n.sprite_frag},background:{uniforms:{uvTransform:{value:new Tn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_n.background_vert,fragmentShader:_n.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:_n.backgroundCube_vert,fragmentShader:_n.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_n.cube_vert,fragmentShader:_n.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_n.equirect_vert,fragmentShader:_n.equirect_frag},distanceRGBA:{uniforms:Bo([pt.common,pt.displacementmap,{referencePosition:{value:new q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_n.distanceRGBA_vert,fragmentShader:_n.distanceRGBA_frag},shadow:{uniforms:Bo([pt.lights,pt.fog,{color:{value:new _t(0)},opacity:{value:1}}]),vertexShader:_n.shadow_vert,fragmentShader:_n.shadow_frag}};yl.physical={uniforms:Bo([yl.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Tn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Tn},clearcoatNormalScale:{value:new Be(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Tn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Tn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Tn},sheen:{value:0},sheenColor:{value:new _t(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Tn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Tn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Tn},transmissionSamplerSize:{value:new Be},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Tn},attenuationDistance:{value:0},attenuationColor:{value:new _t(0)},specularColor:{value:new _t(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Tn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Tn},anisotropyVector:{value:new Be},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Tn}}]),vertexShader:_n.meshphysical_vert,fragmentShader:_n.meshphysical_frag};const N_={r:0,b:0,g:0};function Sge(t,e,n,r,i,o,a){const s=new _t(0);let l=o===!0?0:1,c,f,p=null,m=0,v=null;function x(b,y){let S=!1,M=y.isScene===!0?y.background:null;M&&M.isTexture&&(M=(y.backgroundBlurriness>0?n:e).get(M)),M===null?_(s,l):M&&M.isColor&&(_(M,1),S=!0);const C=t.xr.getEnvironmentBlendMode();C==="additive"?r.buffers.color.setClear(0,0,0,1,a):C==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,a),(t.autoClear||S)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),M&&(M.isCubeTexture||M.mapping===v0)?(f===void 0&&(f=new no(new cp(1,1,1),new wc({name:"BackgroundCubeMaterial",uniforms:i0(yl.backgroundCube.uniforms),vertexShader:yl.backgroundCube.vertexShader,fragmentShader:yl.backgroundCube.fragmentShader,side:jo,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(A,R,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),f.material.uniforms.envMap.value=M,f.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,f.material.toneMapped=Qn.getTransfer(M.colorSpace)!==mr,(p!==M||m!==M.version||v!==t.toneMapping)&&(f.material.needsUpdate=!0,p=M,m=M.version,v=t.toneMapping),f.layers.enableAll(),b.unshift(f,f.geometry,f.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new no(new mx(2,2),new wc({name:"BackgroundMaterial",uniforms:i0(yl.background.uniforms),vertexShader:yl.background.vertexShader,fragmentShader:yl.background.fragmentShader,side:Mu,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=M,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=Qn.getTransfer(M.colorSpace)!==mr,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(p!==M||m!==M.version||v!==t.toneMapping)&&(c.material.needsUpdate=!0,p=M,m=M.version,v=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function _(b,y){b.getRGB(N_,t9(t)),r.buffers.color.setClear(N_.r,N_.g,N_.b,y,a)}return{getClearColor:function(){return s},setClearColor:function(b,y=1){s.set(b),l=y,_(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,_(s,l)},render:x}}function Mge(t,e,n,r){const i=t.getParameter(t.MAX_VERTEX_ATTRIBS),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||o!==null,s={},l=b(null);let c=l,f=!1;function p(G,ne,ie,se,H){let Y=!1;if(a){const te=_(se,ie,ne);c!==te&&(c=te,v(c.object)),Y=y(G,se,ie,H),Y&&S(G,se,ie,H)}else{const te=ne.wireframe===!0;(c.geometry!==se.id||c.program!==ie.id||c.wireframe!==te)&&(c.geometry=se.id,c.program=ie.id,c.wireframe=te,Y=!0)}H!==null&&n.update(H,t.ELEMENT_ARRAY_BUFFER),(Y||f)&&(f=!1,U(G,ne,ie,se),H!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(H).buffer))}function m(){return r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function v(G){return r.isWebGL2?t.bindVertexArray(G):o.bindVertexArrayOES(G)}function x(G){return r.isWebGL2?t.deleteVertexArray(G):o.deleteVertexArrayOES(G)}function _(G,ne,ie){const se=ie.wireframe===!0;let H=s[G.id];H===void 0&&(H={},s[G.id]=H);let Y=H[ne.id];Y===void 0&&(Y={},H[ne.id]=Y);let te=Y[se];return te===void 0&&(te=b(m()),Y[se]=te),te}function b(G){const ne=[],ie=[],se=[];for(let H=0;H=0){const we=H[ae];let Te=Y[ae];if(Te===void 0&&(ae==="instanceMatrix"&&G.instanceMatrix&&(Te=G.instanceMatrix),ae==="instanceColor"&&G.instanceColor&&(Te=G.instanceColor)),we===void 0||we.attribute!==Te||Te&&we.data!==Te.data)return!0;te++}return c.attributesNum!==te||c.index!==se}function S(G,ne,ie,se){const H={},Y=ne.attributes;let te=0;const Q=ie.getAttributes();for(const ae in Q)if(Q[ae].location>=0){let we=Y[ae];we===void 0&&(ae==="instanceMatrix"&&G.instanceMatrix&&(we=G.instanceMatrix),ae==="instanceColor"&&G.instanceColor&&(we=G.instanceColor));const Te={};Te.attribute=we,we&&we.data&&(Te.data=we.data),H[ae]=Te,te++}c.attributes=H,c.attributesNum=te,c.index=se}function M(){const G=c.newAttributes;for(let ne=0,ie=G.length;ne=0){let xe=H[Q];if(xe===void 0&&(Q==="instanceMatrix"&&G.instanceMatrix&&(xe=G.instanceMatrix),Q==="instanceColor"&&G.instanceColor&&(xe=G.instanceColor)),xe!==void 0){const we=xe.normalized,Te=xe.itemSize,Ve=n.get(xe);if(Ve===void 0)continue;const Ye=Ve.buffer,et=Ve.type,ct=Ve.bytesPerElement,Lt=r.isWebGL2===!0&&(et===t.INT||et===t.UNSIGNED_INT||xe.gpuType===FI);if(xe.isInterleavedBufferAttribute){const $e=xe.data,oe=$e.stride,Ae=xe.offset;if($e.isInstancedInterleavedBuffer){for(let ge=0;ge0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let s=n.precision!==void 0?n.precision:"highp";const l=o(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);const c=a||e.has("WEBGL_draw_buffers"),f=n.logarithmicDepthBuffer===!0,p=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),m=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),x=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),_=t.getParameter(t.MAX_VERTEX_ATTRIBS),b=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),y=t.getParameter(t.MAX_VARYING_VECTORS),S=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),M=m>0,C=a||e.has("OES_texture_float"),A=M&&C,R=a?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:a,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:s,logarithmicDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:v,maxCubemapSize:x,maxAttributes:_,maxVertexUniforms:b,maxVaryings:y,maxFragmentUniforms:S,vertexTextures:M,floatFragmentTextures:C,floatVertexTextures:A,maxSamples:R}}function Tge(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new Cf,s=new Tn,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m){const v=p.length!==0||m||r!==0||i;return i=m,r=p.length,v},this.beginShadows=function(){o=!0,f(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(p,m){n=f(p,m,0)},this.setState=function(p,m,v){const x=p.clippingPlanes,_=p.clipIntersection,b=p.clipShadows,y=t.get(p);if(!i||x===null||x.length===0||o&&!b)o?f(null):c();else{const S=o?0:r,M=S*4;let C=y.clippingState||null;l.value=C,C=f(x,m,M,v);for(let A=0;A!==M;++A)C[A]=n[A];y.clippingState=C,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function f(p,m,v,x){const _=p!==null?p.length:0;let b=null;if(_!==0){if(b=l.value,x!==!0||b===null){const y=v+_*4,S=m.matrixWorldInverse;s.getNormalMatrix(S),(b===null||b.length0){const c=new i9(l.height/2);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",i),n(c.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class gx extends hx{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=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=a,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,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,a=o+c*this.view.width,s-=f*this.view.offsetY,l=s-f*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,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 xg=4,NN=[.125,.215,.35,.446,.526,.582],yh=20,gT=new gx,DN=new _t;let vT=null,yT=0,xT=0;const hh=(1+Math.sqrt(5))/2,Cm=1/hh,FN=[new q(1,1,1),new q(-1,1,1),new q(1,1,-1),new q(-1,1,-1),new q(0,hh,Cm),new q(0,hh,-Cm),new q(Cm,0,hh),new q(-Cm,0,hh),new q(hh,Cm,0),new q(-hh,Cm,0)];class f3{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){vT=this._renderer.getRenderTarget(),yT=this._renderer.getActiveCubeFace(),xT=this._renderer.getActiveMipmapLevel(),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=zN(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=BN(),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?M:0,M,M),f.setRenderTarget(i),_&&f.render(x,s),f.render(e,s)}x.geometry.dispose(),x.material.dispose(),f.toneMapping=m,f.autoClear=p,e.background=b}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Eu||e.mapping===Zf;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=zN()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=BN());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new no(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;D_(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,gT)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iyh&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${yh}`);const y=[];let S=0;for(let P=0;PM-xg?i-M+xg:0),R=4*(this._cubeSize-C);D_(n,A,R,3*C,2*C),l.setRenderTarget(n),l.render(p,gT)}}function Rge(t){const e=[],n=[],r=[];let i=t;const o=t-xg+1+NN.length;for(let a=0;at-xg?l=NN[a-t+xg-1]:a===0&&(l=0),r.push(l);const c=1/(s-2),f=-c,p=1+c,m=[f,f,p,f,p,p,f,f,p,p,f,p],v=6,x=6,_=3,b=2,y=1,S=new Float32Array(_*x*v),M=new Float32Array(b*x*v),C=new Float32Array(y*x*v);for(let R=0;R2?0:-1,k=[P,U,0,P+2/3,U,0,P+2/3,U+1,0,P,U,0,P+2/3,U+1,0,P,U+1,0];S.set(k,_*x*R),M.set(m,b*x*R);const N=[R,R,R,R,R,R];C.set(N,y*x*R)}const A=new An;A.setAttribute("position",new lr(S,_)),A.setAttribute("uv",new lr(M,b)),A.setAttribute("faceIndex",new lr(C,y)),e.push(A),i>xg&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function UN(t,e,n){const r=new Rl(t,e,n);return r.texture.mapping=v0,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function D_(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Pge(t,e,n){const r=new Float32Array(yh),i=new q(0,1,0);return new wc({name:"SphericalGaussianBlur",defines:{n:yh,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:ZI(),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:mu,depthTest:!1,depthWrite:!1})}function BN(){return new wc({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ZI(),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:mu,depthTest:!1,depthWrite:!1})}function zN(){return new wc({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ZI(),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:mu,depthTest:!1,depthWrite:!1})}function ZI(){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 Ige(t){let e=new WeakMap,n=null;function r(s){if(s&&s.isTexture){const l=s.mapping,c=l===x1||l===b1,f=l===Eu||l===Zf;if(c||f)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let p=e.get(s);return n===null&&(n=new f3(t)),p=c?n.fromEquirectangular(s,p):n.fromCubemap(s,p),e.set(s,p),p.texture}else{if(e.has(s))return e.get(s).texture;{const p=s.image;if(c&&p&&p.height>0||f&&p&&i(p)){n===null&&(n=new f3(t));const m=c?n.fromEquirectangular(s):n.fromCubemap(s);return e.set(s,m),s.addEventListener("dispose",o),m.texture}else return null}}}return s}function i(s){let l=0;const c=6;for(let f=0;fe.maxTextureSize&&(z=Math.ceil(N/e.maxTextureSize),N=e.maxTextureSize);const K=new Float32Array(N*z*4*_),J=new PE(K,N,z,_);J.type=Sl,J.needsUpdate=!0;const G=k*4;for(let ie=0;ie<_;ie++){const se=R[ie],H=P[ie],Y=U[ie],te=N*z*4*ie;for(let Q=0;Q0)return t;const i=e*n;let o=$N[i];if(o===void 0&&(o=new Float32Array(i),$N[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Ci(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${s}: ${n[a]}`)}return r.join(` -`)}function O0e(t){const e=Qn.getPrimaries(Qn.workingColorSpace),n=Qn.getPrimaries(t);let r;switch(e===n?r="":e===A1&&n===T1?r="LinearDisplayP3ToLinearSRGB":e===T1&&n===A1&&(r="LinearSRGBToLinearDisplayP3"),t){case _c:case fx:return[r,"LinearTransferOETF"];case Mi:case RE:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}function qN(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 a=parseInt(o[1]);return n.toUpperCase()+` - -`+i+` - -`+L0e(t.getShaderSource(e),a)}else return i}function k0e(t,e){const n=O0e(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function N0e(t,e){let n;switch(e){case w7:n="Linear";break;case S7:n="Reinhard";break;case M7:n="OptimizedCineon";break;case NI:n="ACESFilmic";break;case E7:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function D0e(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(dy).join(` -`)}function F0e(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` -`)}function U0e(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function d3(t){return t.replace(B0e,$0e)}const z0e=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function $0e(t,e){let n=_n[e];if(n===void 0){const r=z0e.get(e);if(r!==void 0)n=_n[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 d3(n)}const H0e=/#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 ZN(t){return t.replace(H0e,V0e)}function V0e(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(b+=` -`),y=[v,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(dy).join(` -`),y.length>0&&(y+=` -`)):(b=[QN(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",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 "+f:"",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&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#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.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(dy).join(` -`),y=[v,QN(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+f:"",n.envMap?"#define "+p:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.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.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?"#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.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==pc?"#define TONE_MAPPING":"",n.toneMapping!==pc?_n.tonemapping_pars_fragment:"",n.toneMapping!==pc?N0e("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",_n.colorspace_pars_fragment,k0e("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` -`].filter(dy).join(` -`)),a=d3(a),a=YN(a,n),a=KN(a,n),s=d3(s),s=YN(s,n),s=KN(s,n),a=ZN(a),s=ZN(s),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(S=`#version 300 es -`,b=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+b,y=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===c3?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===c3?"":"#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(` -`)+` -`+y);const M=S+b+a,C=S+y+s,A=XN(i,i.VERTEX_SHADER,M),R=XN(i,i.FRAGMENT_SHADER,C);i.attachShader(_,A),i.attachShader(_,R),n.index0AttributeName!==void 0?i.bindAttribLocation(_,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function P(z){if(t.debug.checkShaderErrors){const K=i.getProgramInfoLog(_).trim(),J=i.getShaderInfoLog(A).trim(),G=i.getShaderInfoLog(R).trim();let ne=!0,ie=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(ne=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,_,A,R);else{const se=qN(i,A,"vertex"),H=qN(i,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+` - -Program Info Log: `+K+` -`+se+` -`+H)}else K!==""?console.warn("THREE.WebGLProgram: Program Info Log:",K):(J===""||G==="")&&(ie=!1);ie&&(z.diagnostics={runnable:ne,programLog:K,vertexShader:{log:J,prefix:b},fragmentShader:{log:G,prefix:y}})}i.deleteShader(A),i.deleteShader(R),U=new Yw(i,_),k=U0e(i,_)}let U;this.getUniforms=function(){return U===void 0&&P(this),U};let k;this.getAttributes=function(){return k===void 0&&P(this),k};let N=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return N===!1&&(N=i.getProgramParameter(_,P0e)),N},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=I0e++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=A,this.fragmentShader=R,this}let K0e=0;class Z0e{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),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.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 Q0e(e),n.set(e,r)),r}}class Q0e{constructor(e){this.id=K0e++,this.code=e,this.usedTimes=0}}function J0e(t,e,n,r,i,o,a){const s=new Bh,l=new Z0e,c=[],f=i.isWebGL2,p=i.logarithmicDepthBuffer,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 _(k){return k===0?"uv":`uv${k}`}function b(k,N,z,K,J){const G=K.fog,ne=J.geometry,ie=k.isMeshStandardMaterial?K.environment:null,se=(k.isMeshStandardMaterial?n:e).get(k.envMap||ie),H=se&&se.mapping===v0?se.image.height:null,Y=x[k.type];k.precision!==null&&(v=i.getMaxPrecision(k.precision),v!==k.precision&&console.warn("THREE.WebGLProgram.getParameters:",k.precision,"not supported, using",v,"instead."));const te=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,Q=te!==void 0?te.length:0;let ae=0;ne.morphAttributes.position!==void 0&&(ae=1),ne.morphAttributes.normal!==void 0&&(ae=2),ne.morphAttributes.color!==void 0&&(ae=3);let xe,we,Te,Ve;if(Y){const Zn=yl[Y];xe=Zn.vertexShader,we=Zn.fragmentShader}else xe=k.vertexShader,we=k.fragmentShader,l.update(k),Te=l.getVertexShaderID(k),Ve=l.getFragmentShaderID(k);const Ye=t.getRenderTarget(),et=J.isInstancedMesh===!0,ct=!!k.map,Lt=!!k.matcap,$e=!!se,oe=!!k.aoMap,Ae=!!k.lightMap,ge=!!k.bumpMap,ve=!!k.normalMap,Ue=!!k.displacementMap,We=!!k.emissiveMap,Je=!!k.metalnessMap,ot=!!k.roughnessMap,ft=k.anisotropy>0,lt=k.clearcoat>0,Ht=k.iridescence>0,ee=k.sheen>0,$=k.transmission>0,ye=ft&&!!k.anisotropyMap,Ge=lt&&!!k.clearcoatMap,Le=lt&&!!k.clearcoatNormalMap,Me=lt&&!!k.clearcoatRoughnessMap,De=Ht&&!!k.iridescenceMap,je=Ht&&!!k.iridescenceThicknessMap,at=ee&&!!k.sheenColorMap,At=ee&&!!k.sheenRoughnessMap,Ze=!!k.specularMap,Oe=!!k.specularColorMap,Ut=!!k.specularIntensityMap,Et=$&&!!k.transmissionMap,Nt=$&&!!k.thicknessMap,Ct=!!k.gradientMap,dt=!!k.alphaMap,Qt=k.alphaTest>0,de=!!k.alphaHash,ut=!!k.extensions,rt=!!ne.attributes.uv1,Ne=!!ne.attributes.uv2,it=!!ne.attributes.uv3;let Bt=pc;return k.toneMapped&&(Ye===null||Ye.isXRRenderTarget===!0)&&(Bt=t.toneMapping),{isWebGL2:f,shaderID:Y,shaderType:k.type,shaderName:k.name,vertexShader:xe,fragmentShader:we,defines:k.defines,customVertexShaderID:Te,customFragmentShaderID:Ve,isRawShaderMaterial:k.isRawShaderMaterial===!0,glslVersion:k.glslVersion,precision:v,instancing:et,instancingColor:et&&J.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:Ye===null?t.outputColorSpace:Ye.isXRRenderTarget===!0?Ye.texture.colorSpace:_c,map:ct,matcap:Lt,envMap:$e,envMapMode:$e&&se.mapping,envMapCubeUVHeight:H,aoMap:oe,lightMap:Ae,bumpMap:ge,normalMap:ve,displacementMap:m&&Ue,emissiveMap:We,normalMapObjectSpace:ve&&k.normalMapType===z7,normalMapTangentSpace:ve&&k.normalMapType===ud,metalnessMap:Je,roughnessMap:ot,anisotropy:ft,anisotropyMap:ye,clearcoat:lt,clearcoatMap:Ge,clearcoatNormalMap:Le,clearcoatRoughnessMap:Me,iridescence:Ht,iridescenceMap:De,iridescenceThicknessMap:je,sheen:ee,sheenColorMap:at,sheenRoughnessMap:At,specularMap:Ze,specularColorMap:Oe,specularIntensityMap:Ut,transmission:$,transmissionMap:Et,thicknessMap:Nt,gradientMap:Ct,opaque:k.transparent===!1&&k.blending===Fh,alphaMap:dt,alphaTest:Qt,alphaHash:de,combine:k.combine,mapUv:ct&&_(k.map.channel),aoMapUv:oe&&_(k.aoMap.channel),lightMapUv:Ae&&_(k.lightMap.channel),bumpMapUv:ge&&_(k.bumpMap.channel),normalMapUv:ve&&_(k.normalMap.channel),displacementMapUv:Ue&&_(k.displacementMap.channel),emissiveMapUv:We&&_(k.emissiveMap.channel),metalnessMapUv:Je&&_(k.metalnessMap.channel),roughnessMapUv:ot&&_(k.roughnessMap.channel),anisotropyMapUv:ye&&_(k.anisotropyMap.channel),clearcoatMapUv:Ge&&_(k.clearcoatMap.channel),clearcoatNormalMapUv:Le&&_(k.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Me&&_(k.clearcoatRoughnessMap.channel),iridescenceMapUv:De&&_(k.iridescenceMap.channel),iridescenceThicknessMapUv:je&&_(k.iridescenceThicknessMap.channel),sheenColorMapUv:at&&_(k.sheenColorMap.channel),sheenRoughnessMapUv:At&&_(k.sheenRoughnessMap.channel),specularMapUv:Ze&&_(k.specularMap.channel),specularColorMapUv:Oe&&_(k.specularColorMap.channel),specularIntensityMapUv:Ut&&_(k.specularIntensityMap.channel),transmissionMapUv:Et&&_(k.transmissionMap.channel),thicknessMapUv:Nt&&_(k.thicknessMap.channel),alphaMapUv:dt&&_(k.alphaMap.channel),vertexTangents:!!ne.attributes.tangent&&(ve||ft),vertexColors:k.vertexColors,vertexAlphas:k.vertexColors===!0&&!!ne.attributes.color&&ne.attributes.color.itemSize===4,vertexUv1s:rt,vertexUv2s:Ne,vertexUv3s:it,pointsUvs:J.isPoints===!0&&!!ne.attributes.uv&&(ct||dt),fog:!!G,useFog:k.fog===!0,fogExp2:G&&G.isFogExp2,flatShading:k.flatShading===!0,sizeAttenuation:k.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:J.isSkinnedMesh===!0,morphTargets:ne.morphAttributes.position!==void 0,morphNormals:ne.morphAttributes.normal!==void 0,morphColors:ne.morphAttributes.color!==void 0,morphTargetsCount:Q,morphTextureStride:ae,numDirLights:N.directional.length,numPointLights:N.point.length,numSpotLights:N.spot.length,numSpotLightMaps:N.spotLightMap.length,numRectAreaLights:N.rectArea.length,numHemiLights:N.hemi.length,numDirLightShadows:N.directionalShadowMap.length,numPointLightShadows:N.pointShadowMap.length,numSpotLightShadows:N.spotShadowMap.length,numSpotLightShadowsWithMaps:N.numSpotLightShadowsWithMaps,numLightProbes:N.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:k.dithering,shadowMapEnabled:t.shadowMap.enabled&&z.length>0,shadowMapType:t.shadowMap.type,toneMapping:Bt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:ct&&k.map.isVideoTexture===!0&&Qn.getTransfer(k.map.colorSpace)===mr,premultipliedAlpha:k.premultipliedAlpha,doubleSided:k.side===xl,flipSided:k.side===jo,useDepthPacking:k.depthPacking>=0,depthPacking:k.depthPacking||0,index0AttributeName:k.index0AttributeName,extensionDerivatives:ut&&k.extensions.derivatives===!0,extensionFragDepth:ut&&k.extensions.fragDepth===!0,extensionDrawBuffers:ut&&k.extensions.drawBuffers===!0,extensionShaderTextureLOD:ut&&k.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:f||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:f||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:f||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:k.customProgramCacheKey()}}function y(k){const N=[];if(k.shaderID?N.push(k.shaderID):(N.push(k.customVertexShaderID),N.push(k.customFragmentShaderID)),k.defines!==void 0)for(const z in k.defines)N.push(z),N.push(k.defines[z]);return k.isRawShaderMaterial===!1&&(S(N,k),M(N,k),N.push(t.outputColorSpace)),N.push(k.customProgramCacheKey),N.join()}function S(k,N){k.push(N.precision),k.push(N.outputColorSpace),k.push(N.envMapMode),k.push(N.envMapCubeUVHeight),k.push(N.mapUv),k.push(N.alphaMapUv),k.push(N.lightMapUv),k.push(N.aoMapUv),k.push(N.bumpMapUv),k.push(N.normalMapUv),k.push(N.displacementMapUv),k.push(N.emissiveMapUv),k.push(N.metalnessMapUv),k.push(N.roughnessMapUv),k.push(N.anisotropyMapUv),k.push(N.clearcoatMapUv),k.push(N.clearcoatNormalMapUv),k.push(N.clearcoatRoughnessMapUv),k.push(N.iridescenceMapUv),k.push(N.iridescenceThicknessMapUv),k.push(N.sheenColorMapUv),k.push(N.sheenRoughnessMapUv),k.push(N.specularMapUv),k.push(N.specularColorMapUv),k.push(N.specularIntensityMapUv),k.push(N.transmissionMapUv),k.push(N.thicknessMapUv),k.push(N.combine),k.push(N.fogExp2),k.push(N.sizeAttenuation),k.push(N.morphTargetsCount),k.push(N.morphAttributeCount),k.push(N.numDirLights),k.push(N.numPointLights),k.push(N.numSpotLights),k.push(N.numSpotLightMaps),k.push(N.numHemiLights),k.push(N.numRectAreaLights),k.push(N.numDirLightShadows),k.push(N.numPointLightShadows),k.push(N.numSpotLightShadows),k.push(N.numSpotLightShadowsWithMaps),k.push(N.numLightProbes),k.push(N.shadowMapType),k.push(N.toneMapping),k.push(N.numClippingPlanes),k.push(N.numClipIntersection),k.push(N.depthPacking)}function M(k,N){s.disableAll(),N.isWebGL2&&s.enable(0),N.supportsVertexTextures&&s.enable(1),N.instancing&&s.enable(2),N.instancingColor&&s.enable(3),N.matcap&&s.enable(4),N.envMap&&s.enable(5),N.normalMapObjectSpace&&s.enable(6),N.normalMapTangentSpace&&s.enable(7),N.clearcoat&&s.enable(8),N.iridescence&&s.enable(9),N.alphaTest&&s.enable(10),N.vertexColors&&s.enable(11),N.vertexAlphas&&s.enable(12),N.vertexUv1s&&s.enable(13),N.vertexUv2s&&s.enable(14),N.vertexUv3s&&s.enable(15),N.vertexTangents&&s.enable(16),N.anisotropy&&s.enable(17),N.alphaHash&&s.enable(18),k.push(s.mask),s.disableAll(),N.fog&&s.enable(0),N.useFog&&s.enable(1),N.flatShading&&s.enable(2),N.logarithmicDepthBuffer&&s.enable(3),N.skinning&&s.enable(4),N.morphTargets&&s.enable(5),N.morphNormals&&s.enable(6),N.morphColors&&s.enable(7),N.premultipliedAlpha&&s.enable(8),N.shadowMapEnabled&&s.enable(9),N.useLegacyLights&&s.enable(10),N.doubleSided&&s.enable(11),N.flipSided&&s.enable(12),N.useDepthPacking&&s.enable(13),N.dithering&&s.enable(14),N.transmission&&s.enable(15),N.sheen&&s.enable(16),N.opaque&&s.enable(17),N.pointsUvs&&s.enable(18),N.decodeVideoTexture&&s.enable(19),k.push(s.mask)}function C(k){const N=x[k.type];let z;if(N){const K=yl[N];z=n9.clone(K.uniforms)}else z=k.uniforms;return z}function A(k,N){let z;for(let K=0,J=c.length;K0?r.push(y):v.transparent===!0?i.push(y):n.push(y)}function l(p,m,v,x,_,b){const y=a(p,m,v,x,_,b);v.transmission>0?r.unshift(y):v.transparent===!0?i.unshift(y):n.unshift(y)}function c(p,m){n.length>1&&n.sort(p||tve),r.length>1&&r.sort(m||JN),i.length>1&&i.sort(m||JN)}function f(){for(let p=e,m=t.length;p=o.length?(a=new eD,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function rve(){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 q,color:new _t};break;case"SpotLight":n={position:new q,direction:new q,color:new _t,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new q,color:new _t,distance:0,decay:0};break;case"HemisphereLight":n={direction:new q,skyColor:new _t,groundColor:new _t};break;case"RectAreaLight":n={color:new _t,position:new q,halfWidth:new q,halfHeight:new q};break}return t[e.id]=n,n}}}function ive(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let ove=0;function ave(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function sve(t,e){const n=new rve,r=ive(),i={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 f=0;f<9;f++)i.probe.push(new q);const o=new q,a=new dn,s=new dn;function l(f,p){let m=0,v=0,x=0;for(let K=0;K<9;K++)i.probe[K].set(0,0,0);let _=0,b=0,y=0,S=0,M=0,C=0,A=0,R=0,P=0,U=0,k=0;f.sort(ave);const N=p===!0?Math.PI:1;for(let K=0,J=f.length;K0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=pt.LTC_FLOAT_1,i.rectAreaLTC2=pt.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=pt.LTC_HALF_1,i.rectAreaLTC2=pt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=m,i.ambient[1]=v,i.ambient[2]=x;const z=i.hash;(z.directionalLength!==_||z.pointLength!==b||z.spotLength!==y||z.rectAreaLength!==S||z.hemiLength!==M||z.numDirectionalShadows!==C||z.numPointShadows!==A||z.numSpotShadows!==R||z.numSpotMaps!==P||z.numLightProbes!==k)&&(i.directional.length=_,i.spot.length=y,i.rectArea.length=S,i.point.length=b,i.hemi.length=M,i.directionalShadow.length=C,i.directionalShadowMap.length=C,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=R,i.spotShadowMap.length=R,i.directionalShadowMatrix.length=C,i.pointShadowMatrix.length=A,i.spotLightMatrix.length=R+P-U,i.spotLightMap.length=P,i.numSpotLightShadowsWithMaps=U,i.numLightProbes=k,z.directionalLength=_,z.pointLength=b,z.spotLength=y,z.rectAreaLength=S,z.hemiLength=M,z.numDirectionalShadows=C,z.numPointShadows=A,z.numSpotShadows=R,z.numSpotMaps=P,z.numLightProbes=k,i.version=ove++)}function c(f,p){let m=0,v=0,x=0,_=0,b=0;const y=p.matrixWorldInverse;for(let S=0,M=f.length;S=s.length?(l=new tD(t,e),s.push(l)):l=s[a],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class QI extends so{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=U7,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 JI extends so{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 cve=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,uve=`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 fve(t,e,n){let r=new IE;const i=new Be,o=new Be,a=new Yn,s=new QI({depthPacking:B7}),l=new JI,c={},f=n.maxTextureSize,p={[Mu]:jo,[jo]:Mu,[xl]:xl},m=new wc({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Be},radius:{value:4}},vertexShader:cve,fragmentShader:uve}),v=m.clone();v.defines.HORIZONTAL_PASS=1;const x=new An;x.setAttribute("position",new lr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new no(x,m),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=CE;let y=this.type;this.render=function(A,R,P){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||A.length===0)return;const U=t.getRenderTarget(),k=t.getActiveCubeFace(),N=t.getActiveMipmapLevel(),z=t.state;z.setBlending(mu),z.buffers.color.setClear(1,1,1,1),z.buffers.depth.setTest(!0),z.setScissorTest(!1);const K=y!==ml&&this.type===ml,J=y===ml&&this.type!==ml;for(let G=0,ne=A.length;Gf||i.y>f)&&(i.x>f&&(o.x=Math.floor(f/H.x),i.x=o.x*H.x,se.mapSize.x=o.x),i.y>f&&(o.y=Math.floor(f/H.y),i.y=o.y*H.y,se.mapSize.y=o.y)),se.map===null||K===!0||J===!0){const te=this.type!==ml?{minFilter:qr,magFilter:qr}:{};se.map!==null&&se.map.dispose(),se.map=new Rl(i.x,i.y,te),se.map.texture.name=ie.name+".shadowMap",se.camera.updateProjectionMatrix()}t.setRenderTarget(se.map),t.clear();const Y=se.getViewportCount();for(let te=0;te0||R.map&&R.alphaTest>0){const z=k.uuid,K=R.uuid;let J=c[z];J===void 0&&(J={},c[z]=J);let G=J[K];G===void 0&&(G=k.clone(),J[K]=G),k=G}if(k.visible=R.visible,k.wireframe=R.wireframe,U===ml?k.side=R.shadowSide!==null?R.shadowSide:R.side:k.side=R.shadowSide!==null?R.shadowSide:p[R.side],k.alphaMap=R.alphaMap,k.alphaTest=R.alphaTest,k.map=R.map,k.clipShadows=R.clipShadows,k.clippingPlanes=R.clippingPlanes,k.clipIntersection=R.clipIntersection,k.displacementMap=R.displacementMap,k.displacementScale=R.displacementScale,k.displacementBias=R.displacementBias,k.wireframeLinewidth=R.wireframeLinewidth,k.linewidth=R.linewidth,P.isPointLight===!0&&k.isMeshDistanceMaterial===!0){const z=t.properties.get(k);z.light=P}return k}function C(A,R,P,U,k){if(A.visible===!1)return;if(A.layers.test(R.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&k===ml)&&(!A.frustumCulled||r.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,A.matrixWorld);const K=e.update(A),J=A.material;if(Array.isArray(J)){const G=K.groups;for(let ne=0,ie=G.length;ne=1):te.indexOf("OpenGL ES")!==-1&&(Y=parseFloat(/^OpenGL ES (\d)/.exec(te)[1]),H=Y>=2);let Q=null,ae={};const xe=t.getParameter(t.SCISSOR_BOX),we=t.getParameter(t.VIEWPORT),Te=new Yn().fromArray(xe),Ve=new Yn().fromArray(we);function Ye(de,ut,rt,Ne){const it=new Uint8Array(4),Bt=t.createTexture();t.bindTexture(de,Bt),t.texParameteri(de,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(de,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let xn=0;xn"u"?!1:/OculusBrowser/g.test(navigator.userAgent),x=new WeakMap;let _;const b=new WeakMap;let y=!1;try{y=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(ee,$){return y?new OffscreenCanvas(ee,$):I1("canvas")}function M(ee,$,ye,Ge){let Le=1;if((ee.width>Ge||ee.height>Ge)&&(Le=Ge/Math.max(ee.width,ee.height)),Le<1||$===!0)if(typeof HTMLImageElement<"u"&&ee instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ee instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ee instanceof ImageBitmap){const Me=$?zS:Math.floor,De=Me(Le*ee.width),je=Me(Le*ee.height);_===void 0&&(_=S(De,je));const at=ye?S(De,je):_;return at.width=De,at.height=je,at.getContext("2d").drawImage(ee,0,0,De,je),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ee.width+"x"+ee.height+") to ("+De+"x"+je+")."),at}else return"data"in ee&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ee.width+"x"+ee.height+")."),ee;return ee}function C(ee){return u3(ee.width)&&u3(ee.height)}function A(ee){return s?!1:ee.wrapS!==Vi||ee.wrapT!==Vi||ee.minFilter!==qr&&ee.minFilter!==ai}function R(ee,$){return ee.generateMipmaps&&$&&ee.minFilter!==qr&&ee.minFilter!==ai}function P(ee){t.generateMipmap(ee)}function U(ee,$,ye,Ge,Le=!1){if(s===!1)return $;if(ee!==null){if(t[ee]!==void 0)return t[ee];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ee+"'")}let Me=$;if($===t.RED&&(ye===t.FLOAT&&(Me=t.R32F),ye===t.HALF_FLOAT&&(Me=t.R16F),ye===t.UNSIGNED_BYTE&&(Me=t.R8)),$===t.RED_INTEGER&&(ye===t.UNSIGNED_BYTE&&(Me=t.R8UI),ye===t.UNSIGNED_SHORT&&(Me=t.R16UI),ye===t.UNSIGNED_INT&&(Me=t.R32UI),ye===t.BYTE&&(Me=t.R8I),ye===t.SHORT&&(Me=t.R16I),ye===t.INT&&(Me=t.R32I)),$===t.RG&&(ye===t.FLOAT&&(Me=t.RG32F),ye===t.HALF_FLOAT&&(Me=t.RG16F),ye===t.UNSIGNED_BYTE&&(Me=t.RG8)),$===t.RGBA){const De=Le?C1:Qn.getTransfer(Ge);ye===t.FLOAT&&(Me=t.RGBA32F),ye===t.HALF_FLOAT&&(Me=t.RGBA16F),ye===t.UNSIGNED_BYTE&&(Me=De===mr?t.SRGB8_ALPHA8:t.RGBA8),ye===t.UNSIGNED_SHORT_4_4_4_4&&(Me=t.RGBA4),ye===t.UNSIGNED_SHORT_5_5_5_1&&(Me=t.RGB5_A1)}return(Me===t.R16F||Me===t.R32F||Me===t.RG16F||Me===t.RG32F||Me===t.RGBA16F||Me===t.RGBA32F)&&e.get("EXT_color_buffer_float"),Me}function k(ee,$,ye){return R(ee,ye)===!0||ee.isFramebufferTexture&&ee.minFilter!==qr&&ee.minFilter!==ai?Math.log2(Math.max($.width,$.height))+1:ee.mipmaps!==void 0&&ee.mipmaps.length>0?ee.mipmaps.length:ee.isCompressedTexture&&Array.isArray(ee.image)?$.mipmaps.length:1}function N(ee){return ee===qr||ee===US||ee===Ny?t.NEAREST:t.LINEAR}function z(ee){const $=ee.target;$.removeEventListener("dispose",z),J($),$.isVideoTexture&&x.delete($)}function K(ee){const $=ee.target;$.removeEventListener("dispose",K),ne($)}function J(ee){const $=r.get(ee);if($.__webglInit===void 0)return;const ye=ee.source,Ge=b.get(ye);if(Ge){const Le=Ge[$.__cacheKey];Le.usedTimes--,Le.usedTimes===0&&G(ee),Object.keys(Ge).length===0&&b.delete(ye)}r.remove(ee)}function G(ee){const $=r.get(ee);t.deleteTexture($.__webglTexture);const ye=ee.source,Ge=b.get(ye);delete Ge[$.__cacheKey],a.memory.textures--}function ne(ee){const $=ee.texture,ye=r.get(ee),Ge=r.get($);if(Ge.__webglTexture!==void 0&&(t.deleteTexture(Ge.__webglTexture),a.memory.textures--),ee.depthTexture&&ee.depthTexture.dispose(),ee.isWebGLCubeRenderTarget)for(let Le=0;Le<6;Le++){if(Array.isArray(ye.__webglFramebuffer[Le]))for(let Me=0;Me=l&&console.warn("THREE.WebGLTextures: Trying to use "+ee+" texture units while this GPU supports only "+l),ie+=1,ee}function Y(ee){const $=[];return $.push(ee.wrapS),$.push(ee.wrapT),$.push(ee.wrapR||0),$.push(ee.magFilter),$.push(ee.minFilter),$.push(ee.anisotropy),$.push(ee.internalFormat),$.push(ee.format),$.push(ee.type),$.push(ee.generateMipmaps),$.push(ee.premultiplyAlpha),$.push(ee.flipY),$.push(ee.unpackAlignment),$.push(ee.colorSpace),$.join()}function te(ee,$){const ye=r.get(ee);if(ee.isVideoTexture&<(ee),ee.isRenderTargetTexture===!1&&ee.version>0&&ye.__version!==ee.version){const Ge=ee.image;if(Ge===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ge.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ct(ye,ee,$);return}}n.bindTexture(t.TEXTURE_2D,ye.__webglTexture,t.TEXTURE0+$)}function Q(ee,$){const ye=r.get(ee);if(ee.version>0&&ye.__version!==ee.version){ct(ye,ee,$);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ye.__webglTexture,t.TEXTURE0+$)}function ae(ee,$){const ye=r.get(ee);if(ee.version>0&&ye.__version!==ee.version){ct(ye,ee,$);return}n.bindTexture(t.TEXTURE_3D,ye.__webglTexture,t.TEXTURE0+$)}function xe(ee,$){const ye=r.get(ee);if(ee.version>0&&ye.__version!==ee.version){Lt(ye,ee,$);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ye.__webglTexture,t.TEXTURE0+$)}const we={[_1]:t.REPEAT,[Vi]:t.CLAMP_TO_EDGE,[w1]:t.MIRRORED_REPEAT},Te={[qr]:t.NEAREST,[US]:t.NEAREST_MIPMAP_NEAREST,[Ny]:t.NEAREST_MIPMAP_LINEAR,[ai]:t.LINEAR,[DI]:t.LINEAR_MIPMAP_NEAREST,[Qf]:t.LINEAR_MIPMAP_LINEAR},Ve={[$7]:t.NEVER,[q7]:t.ALWAYS,[H7]:t.LESS,[W7]:t.LEQUAL,[V7]:t.EQUAL,[X7]:t.GEQUAL,[G7]:t.GREATER,[j7]:t.NOTEQUAL};function Ye(ee,$,ye){if(ye?(t.texParameteri(ee,t.TEXTURE_WRAP_S,we[$.wrapS]),t.texParameteri(ee,t.TEXTURE_WRAP_T,we[$.wrapT]),(ee===t.TEXTURE_3D||ee===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ee,t.TEXTURE_WRAP_R,we[$.wrapR]),t.texParameteri(ee,t.TEXTURE_MAG_FILTER,Te[$.magFilter]),t.texParameteri(ee,t.TEXTURE_MIN_FILTER,Te[$.minFilter])):(t.texParameteri(ee,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(ee,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(ee===t.TEXTURE_3D||ee===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ee,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),($.wrapS!==Vi||$.wrapT!==Vi)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(ee,t.TEXTURE_MAG_FILTER,N($.magFilter)),t.texParameteri(ee,t.TEXTURE_MIN_FILTER,N($.minFilter)),$.minFilter!==qr&&$.minFilter!==ai&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),$.compareFunction&&(t.texParameteri(ee,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(ee,t.TEXTURE_COMPARE_FUNC,Ve[$.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const Ge=e.get("EXT_texture_filter_anisotropic");if($.magFilter===qr||$.minFilter!==Ny&&$.minFilter!==Qf||$.type===Sl&&e.has("OES_texture_float_linear")===!1||s===!1&&$.type===Jh&&e.has("OES_texture_half_float_linear")===!1)return;($.anisotropy>1||r.get($).__currentAnisotropy)&&(t.texParameterf(ee,Ge.TEXTURE_MAX_ANISOTROPY_EXT,Math.min($.anisotropy,i.getMaxAnisotropy())),r.get($).__currentAnisotropy=$.anisotropy)}}function et(ee,$){let ye=!1;ee.__webglInit===void 0&&(ee.__webglInit=!0,$.addEventListener("dispose",z));const Ge=$.source;let Le=b.get(Ge);Le===void 0&&(Le={},b.set(Ge,Le));const Me=Y($);if(Me!==ee.__cacheKey){Le[Me]===void 0&&(Le[Me]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,ye=!0),Le[Me].usedTimes++;const De=Le[ee.__cacheKey];De!==void 0&&(Le[ee.__cacheKey].usedTimes--,De.usedTimes===0&&G($)),ee.__cacheKey=Me,ee.__webglTexture=Le[Me].texture}return ye}function ct(ee,$,ye){let Ge=t.TEXTURE_2D;($.isDataArrayTexture||$.isCompressedArrayTexture)&&(Ge=t.TEXTURE_2D_ARRAY),$.isData3DTexture&&(Ge=t.TEXTURE_3D);const Le=et(ee,$),Me=$.source;n.bindTexture(Ge,ee.__webglTexture,t.TEXTURE0+ye);const De=r.get(Me);if(Me.version!==De.__version||Le===!0){n.activeTexture(t.TEXTURE0+ye);const je=Qn.getPrimaries(Qn.workingColorSpace),at=$.colorSpace===Za?null:Qn.getPrimaries($.colorSpace),At=$.colorSpace===Za||je===at?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,$.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,$.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,$.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,At);const Ze=A($)&&C($.image)===!1;let Oe=M($.image,Ze,!1,f);Oe=Ht($,Oe);const Ut=C(Oe)||s,Et=o.convert($.format,$.colorSpace);let Nt=o.convert($.type),Ct=U($.internalFormat,Et,Nt,$.colorSpace,$.isVideoTexture);Ye(Ge,$,Ut);let dt;const Qt=$.mipmaps,de=s&&$.isVideoTexture!==!0,ut=De.__version===void 0||Le===!0,rt=k($,Oe,Ut);if($.isDepthTexture)Ct=t.DEPTH_COMPONENT,s?$.type===Sl?Ct=t.DEPTH_COMPONENT32F:$.type===fu?Ct=t.DEPTH_COMPONENT24:$.type===Hf?Ct=t.DEPTH24_STENCIL8:Ct=t.DEPTH_COMPONENT16:$.type===Sl&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),$.format===Vf&&Ct===t.DEPTH_COMPONENT&&$.type!==TE&&$.type!==fu&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),$.type=fu,Nt=o.convert($.type)),$.format===ep&&Ct===t.DEPTH_COMPONENT&&(Ct=t.DEPTH_STENCIL,$.type!==Hf&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),$.type=Hf,Nt=o.convert($.type))),ut&&(de?n.texStorage2D(t.TEXTURE_2D,1,Ct,Oe.width,Oe.height):n.texImage2D(t.TEXTURE_2D,0,Ct,Oe.width,Oe.height,0,Et,Nt,null));else if($.isDataTexture)if(Qt.length>0&&Ut){de&&ut&&n.texStorage2D(t.TEXTURE_2D,rt,Ct,Qt[0].width,Qt[0].height);for(let Ne=0,it=Qt.length;Ne>=1,it>>=1}}else if(Qt.length>0&&Ut){de&&ut&&n.texStorage2D(t.TEXTURE_2D,rt,Ct,Qt[0].width,Qt[0].height);for(let Ne=0,it=Qt.length;Ne0&&ut++,n.texStorage2D(t.TEXTURE_CUBE_MAP,ut,dt,Oe[0].width,Oe[0].height));for(let Ne=0;Ne<6;Ne++)if(Ze){Qt?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,Oe[Ne].width,Oe[Ne].height,Nt,Ct,Oe[Ne].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,dt,Oe[Ne].width,Oe[Ne].height,0,Nt,Ct,Oe[Ne].data);for(let it=0;it>Me),Oe=Math.max(1,$.height>>Me);Le===t.TEXTURE_3D||Le===t.TEXTURE_2D_ARRAY?n.texImage3D(Le,Me,at,Ze,Oe,$.depth,0,De,je,null):n.texImage2D(Le,Me,at,Ze,Oe,0,De,je,null)}n.bindFramebuffer(t.FRAMEBUFFER,ee),ft($)?m.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,Ge,Le,r.get(ye).__webglTexture,0,ot($)):(Le===t.TEXTURE_2D||Le>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&Le<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,Ge,Le,r.get(ye).__webglTexture,Me),n.bindFramebuffer(t.FRAMEBUFFER,null)}function oe(ee,$,ye){if(t.bindRenderbuffer(t.RENDERBUFFER,ee),$.depthBuffer&&!$.stencilBuffer){let Ge=s===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(ye||ft($)){const Le=$.depthTexture;Le&&Le.isDepthTexture&&(Le.type===Sl?Ge=t.DEPTH_COMPONENT32F:Le.type===fu&&(Ge=t.DEPTH_COMPONENT24));const Me=ot($);ft($)?m.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Me,Ge,$.width,$.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,Me,Ge,$.width,$.height)}else t.renderbufferStorage(t.RENDERBUFFER,Ge,$.width,$.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,ee)}else if($.depthBuffer&&$.stencilBuffer){const Ge=ot($);ye&&ft($)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ge,t.DEPTH24_STENCIL8,$.width,$.height):ft($)?m.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ge,t.DEPTH24_STENCIL8,$.width,$.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,$.width,$.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,ee)}else{const Ge=$.isWebGLMultipleRenderTargets===!0?$.texture:[$.texture];for(let Le=0;Le0){ye.__webglFramebuffer[je]=[];for(let at=0;at<$.mipmaps.length;at++)ye.__webglFramebuffer[je][at]=t.createFramebuffer()}else ye.__webglFramebuffer[je]=t.createFramebuffer()}else{if(s&&$.mipmaps&&$.mipmaps.length>0){ye.__webglFramebuffer=[];for(let je=0;je<$.mipmaps.length;je++)ye.__webglFramebuffer[je]=t.createFramebuffer()}else ye.__webglFramebuffer=t.createFramebuffer();if(Me)if(i.drawBuffers){const je=ee.texture;for(let at=0,At=je.length;at0&&ft(ee)===!1){const je=Me?$:[$];ye.__webglMultisampledFramebuffer=t.createFramebuffer(),ye.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ye.__webglMultisampledFramebuffer);for(let at=0;at0)for(let at=0;at<$.mipmaps.length;at++)$e(ye.__webglFramebuffer[je][at],ee,$,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+je,at);else $e(ye.__webglFramebuffer[je],ee,$,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+je,0);R($,De)&&P(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(Me){const je=ee.texture;for(let at=0,At=je.length;at0)for(let at=0;at<$.mipmaps.length;at++)$e(ye.__webglFramebuffer[at],ee,$,t.COLOR_ATTACHMENT0,je,at);else $e(ye.__webglFramebuffer,ee,$,t.COLOR_ATTACHMENT0,je,0);R($,De)&&P(je),n.unbindTexture()}ee.depthBuffer&&ge(ee)}function We(ee){const $=C(ee)||s,ye=ee.isWebGLMultipleRenderTargets===!0?ee.texture:[ee.texture];for(let Ge=0,Le=ye.length;Ge0&&ft(ee)===!1){const $=ee.isWebGLMultipleRenderTargets?ee.texture:[ee.texture],ye=ee.width,Ge=ee.height;let Le=t.COLOR_BUFFER_BIT;const Me=[],De=ee.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,je=r.get(ee),at=ee.isWebGLMultipleRenderTargets===!0;if(at)for(let At=0;At<$.length;At++)n.bindFramebuffer(t.FRAMEBUFFER,je.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+At,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,je.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+At,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,je.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,je.__webglFramebuffer);for(let At=0;At<$.length;At++){Me.push(t.COLOR_ATTACHMENT0+At),ee.depthBuffer&&Me.push(De);const Ze=je.__ignoreDepthValues!==void 0?je.__ignoreDepthValues:!1;if(Ze===!1&&(ee.depthBuffer&&(Le|=t.DEPTH_BUFFER_BIT),ee.stencilBuffer&&(Le|=t.STENCIL_BUFFER_BIT)),at&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,je.__webglColorRenderbuffer[At]),Ze===!0&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[De]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[De])),at){const Oe=r.get($[At]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Oe,0)}t.blitFramebuffer(0,0,ye,Ge,0,0,ye,Ge,Le,t.NEAREST),v&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,Me)}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),at)for(let At=0;At<$.length;At++){n.bindFramebuffer(t.FRAMEBUFFER,je.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+At,t.RENDERBUFFER,je.__webglColorRenderbuffer[At]);const Ze=r.get($[At]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,je.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+At,t.TEXTURE_2D,Ze,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,je.__webglMultisampledFramebuffer)}}function ot(ee){return Math.min(p,ee.samples)}function ft(ee){const $=r.get(ee);return s&&ee.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&$.__useRenderToTexture!==!1}function lt(ee){const $=a.render.frame;x.get(ee)!==$&&(x.set(ee,$),ee.update())}function Ht(ee,$){const ye=ee.colorSpace,Ge=ee.format,Le=ee.type;return ee.isCompressedTexture===!0||ee.isVideoTexture===!0||ee.format===BS||ye!==_c&&ye!==Za&&(Qn.getTransfer(ye)===mr?s===!1?e.has("EXT_sRGB")===!0&&Ge===Wo?(ee.format=BS,ee.minFilter=ai,ee.generateMipmaps=!1):$=XI.sRGBToLinear($):(Ge!==Wo||Le!==os)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ye)),$}this.allocateTextureUnit=H,this.resetTextureUnits=se,this.setTexture2D=te,this.setTexture2DArray=Q,this.setTexture3D=ae,this.setTextureCube=xe,this.rebindTextures=ve,this.setupRenderTarget=Ue,this.updateRenderTargetMipmap=We,this.updateMultisampleRenderTarget=Je,this.setupDepthRenderbuffer=ge,this.setupFrameBufferTexture=$e,this.useMultisampledRTT=ft}function u9(t,e,n){const r=n.isWebGL2;function i(o,a=Za){let s;const l=Qn.getTransfer(a);if(o===os)return t.UNSIGNED_BYTE;if(o===UI)return t.UNSIGNED_SHORT_4_4_4_4;if(o===BI)return t.UNSIGNED_SHORT_5_5_5_1;if(o===T7)return t.BYTE;if(o===A7)return t.SHORT;if(o===TE)return t.UNSIGNED_SHORT;if(o===FI)return t.INT;if(o===fu)return t.UNSIGNED_INT;if(o===Sl)return t.FLOAT;if(o===Jh)return r?t.HALF_FLOAT:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(o===R7)return t.ALPHA;if(o===Wo)return t.RGBA;if(o===P7)return t.LUMINANCE;if(o===I7)return t.LUMINANCE_ALPHA;if(o===Vf)return t.DEPTH_COMPONENT;if(o===ep)return t.DEPTH_STENCIL;if(o===BS)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(o===zI)return t.RED;if(o===$I)return t.RED_INTEGER;if(o===L7)return t.RG;if(o===HI)return t.RG_INTEGER;if(o===VI)return t.RGBA_INTEGER;if(o===Vw||o===Ww||o===Gw||o===jw)if(l===mr)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(o===Vw)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===Ww)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===Gw)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===jw)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(o===Vw)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===Ww)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===Gw)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===jw)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===FR||o===UR||o===BR||o===zR)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(o===FR)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===UR)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===BR)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===zR)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===O7)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===$R||o===HR)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(o===$R)return l===mr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(o===HR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===VR||o===WR||o===GR||o===jR||o===XR||o===qR||o===YR||o===KR||o===ZR||o===QR||o===JR||o===e3||o===t3||o===n3)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(o===VR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===WR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===GR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===jR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===XR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===qR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===YR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===KR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===ZR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===QR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===JR)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===e3)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===t3)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===n3)return l===mr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===Xw||o===r3||o===i3)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(o===Xw)return l===mr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(o===r3)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(o===i3)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(o===k7||o===o3||o===a3||o===s3)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(o===Xw)return s.COMPRESSED_RED_RGTC1_EXT;if(o===o3)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(o===a3)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(o===s3)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return o===Hf?r?t.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class f9 extends Hi{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let bg=class extends Hn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const pve={type:"move"};class _T{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new bg,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 bg,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new bg,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new q),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,a=null;const s=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const _ of e.hand.values()){const b=n.getJointPose(_,r),y=this._getHandJoint(c,_);b!==null&&(y.matrix.fromArray(b.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,y.jointRadius=b.radius),y.visible=b!==null}const f=c.joints["index-finger-tip"],p=c.joints["thumb-tip"],m=f.position.distanceTo(p.position),v=.02,x=.005;c.inputState.pinching&&m>v+x?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&m<=v-x&&(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));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(pve)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new bg;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class d9 extends Kr{constructor(e,n,r,i,o,a,s,l,c,f){if(f=f!==void 0?f:Vf,f!==Vf&&f!==ep)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&f===Vf&&(r=fu),r===void 0&&f===ep&&(r=Hf),super(null,i,o,a,s,l,f,r,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=s!==void 0?s:qr,this.minFilter=l!==void 0?l:qr,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class mve extends Ou{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=1,c=null,f=null,p=null,m=null,v=null,x=null;const _=n.getContextAttributes();let b=null,y=null;const S=[],M=[],C=new Hi;C.layers.enable(1),C.viewport=new Yn;const A=new Hi;A.layers.enable(2),A.viewport=new Yn;const R=[C,A],P=new f9;P.layers.enable(1),P.layers.enable(2);let U=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Q){let ae=S[Q];return ae===void 0&&(ae=new _T,S[Q]=ae),ae.getTargetRaySpace()},this.getControllerGrip=function(Q){let ae=S[Q];return ae===void 0&&(ae=new _T,S[Q]=ae),ae.getGripSpace()},this.getHand=function(Q){let ae=S[Q];return ae===void 0&&(ae=new _T,S[Q]=ae),ae.getHandSpace()};function N(Q){const ae=M.indexOf(Q.inputSource);if(ae===-1)return;const xe=S[ae];xe!==void 0&&(xe.update(Q.inputSource,Q.frame,c||a),xe.dispatchEvent({type:Q.type,data:Q.inputSource}))}function z(){i.removeEventListener("select",N),i.removeEventListener("selectstart",N),i.removeEventListener("selectend",N),i.removeEventListener("squeeze",N),i.removeEventListener("squeezestart",N),i.removeEventListener("squeezeend",N),i.removeEventListener("end",z),i.removeEventListener("inputsourceschange",K);for(let Q=0;Q=0&&(M[we]=null,S[we].disconnect(xe))}for(let ae=0;ae=M.length){M.push(xe),we=Ve;break}else if(M[Ve]===null){M[Ve]=xe,we=Ve;break}if(we===-1)break}const Te=S[we];Te&&Te.connect(xe)}}const J=new q,G=new q;function ne(Q,ae,xe){J.setFromMatrixPosition(ae.matrixWorld),G.setFromMatrixPosition(xe.matrixWorld);const we=J.distanceTo(G),Te=ae.projectionMatrix.elements,Ve=xe.projectionMatrix.elements,Ye=Te[14]/(Te[10]-1),et=Te[14]/(Te[10]+1),ct=(Te[9]+1)/Te[5],Lt=(Te[9]-1)/Te[5],$e=(Te[8]-1)/Te[0],oe=(Ve[8]+1)/Ve[0],Ae=Ye*$e,ge=Ye*oe,ve=we/(-$e+oe),Ue=ve*-$e;ae.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Q.translateX(Ue),Q.translateZ(ve),Q.matrixWorld.compose(Q.position,Q.quaternion,Q.scale),Q.matrixWorldInverse.copy(Q.matrixWorld).invert();const We=Ye+ve,Je=et+ve,ot=Ae-Ue,ft=ge+(we-Ue),lt=ct*et/Je*We,Ht=Lt*et/Je*We;Q.projectionMatrix.makePerspective(ot,ft,lt,Ht,We,Je),Q.projectionMatrixInverse.copy(Q.projectionMatrix).invert()}function ie(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;P.near=A.near=C.near=Q.near,P.far=A.far=C.far=Q.far,(U!==P.near||k!==P.far)&&(i.updateRenderState({depthNear:P.near,depthFar:P.far}),U=P.near,k=P.far);const ae=Q.parent,xe=P.cameras;ie(P,ae);for(let we=0;we0&&(b.alphaTest.value=y.alphaTest);const S=e.get(y).envMap;if(S&&(b.envMap.value=S,b.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,b.reflectivity.value=y.reflectivity,b.ior.value=y.ior,b.refractionRatio.value=y.refractionRatio),y.lightMap){b.lightMap.value=y.lightMap;const M=t._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=y.lightMapIntensity*M,n(y.lightMap,b.lightMapTransform)}y.aoMap&&(b.aoMap.value=y.aoMap,b.aoMapIntensity.value=y.aoMapIntensity,n(y.aoMap,b.aoMapTransform))}function a(b,y){b.diffuse.value.copy(y.color),b.opacity.value=y.opacity,y.map&&(b.map.value=y.map,n(y.map,b.mapTransform))}function s(b,y){b.dashSize.value=y.dashSize,b.totalSize.value=y.dashSize+y.gapSize,b.scale.value=y.scale}function l(b,y,S,M){b.diffuse.value.copy(y.color),b.opacity.value=y.opacity,b.size.value=y.size*S,b.scale.value=M*.5,y.map&&(b.map.value=y.map,n(y.map,b.uvTransform)),y.alphaMap&&(b.alphaMap.value=y.alphaMap,n(y.alphaMap,b.alphaMapTransform)),y.alphaTest>0&&(b.alphaTest.value=y.alphaTest)}function c(b,y){b.diffuse.value.copy(y.color),b.opacity.value=y.opacity,b.rotation.value=y.rotation,y.map&&(b.map.value=y.map,n(y.map,b.mapTransform)),y.alphaMap&&(b.alphaMap.value=y.alphaMap,n(y.alphaMap,b.alphaMapTransform)),y.alphaTest>0&&(b.alphaTest.value=y.alphaTest)}function f(b,y){b.specular.value.copy(y.specular),b.shininess.value=Math.max(y.shininess,1e-4)}function p(b,y){y.gradientMap&&(b.gradientMap.value=y.gradientMap)}function m(b,y){b.metalness.value=y.metalness,y.metalnessMap&&(b.metalnessMap.value=y.metalnessMap,n(y.metalnessMap,b.metalnessMapTransform)),b.roughness.value=y.roughness,y.roughnessMap&&(b.roughnessMap.value=y.roughnessMap,n(y.roughnessMap,b.roughnessMapTransform)),e.get(y).envMap&&(b.envMapIntensity.value=y.envMapIntensity)}function v(b,y,S){b.ior.value=y.ior,y.sheen>0&&(b.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),b.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(b.sheenColorMap.value=y.sheenColorMap,n(y.sheenColorMap,b.sheenColorMapTransform)),y.sheenRoughnessMap&&(b.sheenRoughnessMap.value=y.sheenRoughnessMap,n(y.sheenRoughnessMap,b.sheenRoughnessMapTransform))),y.clearcoat>0&&(b.clearcoat.value=y.clearcoat,b.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(b.clearcoatMap.value=y.clearcoatMap,n(y.clearcoatMap,b.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,n(y.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(b.clearcoatNormalMap.value=y.clearcoatNormalMap,n(y.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===jo&&b.clearcoatNormalScale.value.negate())),y.iridescence>0&&(b.iridescence.value=y.iridescence,b.iridescenceIOR.value=y.iridescenceIOR,b.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(b.iridescenceMap.value=y.iridescenceMap,n(y.iridescenceMap,b.iridescenceMapTransform)),y.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=y.iridescenceThicknessMap,n(y.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),y.transmission>0&&(b.transmission.value=y.transmission,b.transmissionSamplerMap.value=S.texture,b.transmissionSamplerSize.value.set(S.width,S.height),y.transmissionMap&&(b.transmissionMap.value=y.transmissionMap,n(y.transmissionMap,b.transmissionMapTransform)),b.thickness.value=y.thickness,y.thicknessMap&&(b.thicknessMap.value=y.thicknessMap,n(y.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=y.attenuationDistance,b.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(b.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(b.anisotropyMap.value=y.anisotropyMap,n(y.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=y.specularIntensity,b.specularColor.value.copy(y.specularColor),y.specularColorMap&&(b.specularColorMap.value=y.specularColorMap,n(y.specularColorMap,b.specularColorMapTransform)),y.specularIntensityMap&&(b.specularIntensityMap.value=y.specularIntensityMap,n(y.specularIntensityMap,b.specularIntensityMapTransform))}function x(b,y){y.matcap&&(b.matcap.value=y.matcap)}function _(b,y){const S=e.get(y).light;b.referencePosition.value.setFromMatrixPosition(S.matrixWorld),b.nearDistance.value=S.shadow.camera.near,b.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function vve(t,e,n,r){let i={},o={},a=[];const s=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(S,M){const C=M.program;r.uniformBlockBinding(S,C)}function c(S,M){let C=i[S.id];C===void 0&&(x(S),C=f(S),i[S.id]=C,S.addEventListener("dispose",b));const A=M.program;r.updateUBOMapping(S,A);const R=e.render.frame;o[S.id]!==R&&(m(S),o[S.id]=R)}function f(S){const M=p();S.__bindingPointIndex=M;const C=t.createBuffer(),A=S.__size,R=S.usage;return t.bindBuffer(t.UNIFORM_BUFFER,C),t.bufferData(t.UNIFORM_BUFFER,A,R),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,M,C),C}function p(){for(let S=0;S0){R=C%A;const K=A-R;R!==0&&K-N.boundary<0&&(C+=A-R,k.__offset=C)}C+=N.storage}return R=C%A,R>0&&(C+=A-R),S.__size=C,S.__cache={},this}function _(S){const M={boundary:0,storage:0};return typeof S=="number"?(M.boundary=4,M.storage=4):S.isVector2?(M.boundary=8,M.storage=8):S.isVector3||S.isColor?(M.boundary=16,M.storage=12):S.isVector4?(M.boundary=16,M.storage=16):S.isMatrix3?(M.boundary=48,M.storage=48):S.isMatrix4?(M.boundary=64,M.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),M}function b(S){const M=S.target;M.removeEventListener("dispose",b);const C=a.indexOf(M.__bindingPointIndex);a.splice(C,1),t.deleteBuffer(i[M.id]),delete i[M.id],delete o[M.id]}function y(){for(const S in i)t.deleteBuffer(i[S]);a=[],i={},o={}}return{bind:l,update:c,dispose:y}}class eL{constructor(e={}){const{canvas:n=Q7(),context:r=null,depth:i=!0,stencil:o=!0,alpha:a=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:p=!1}=e;this.isWebGLRenderer=!0;let m;r!==null?m=r.getContextAttributes().alpha:m=a;const v=new Uint32Array(4),x=new Int32Array(4);let _=null,b=null;const y=[],S=[];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=Mi,this._useLegacyLights=!1,this.toneMapping=pc,this.toneMappingExposure=1;const M=this;let C=!1,A=0,R=0,P=null,U=-1,k=null;const N=new Yn,z=new Yn;let K=null;const J=new _t(0);let G=0,ne=n.width,ie=n.height,se=1,H=null,Y=null;const te=new Yn(0,0,ne,ie),Q=new Yn(0,0,ne,ie);let ae=!1;const xe=new IE;let we=!1,Te=!1,Ve=null;const Ye=new dn,et=new Be,ct=new q,Lt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function $e(){return P===null?se:1}let oe=r;function Ae(V,fe){for(let be=0;be{function yt(){if(Se.forEach(function(Tt){Je.get(Tt).currentProgram.isReady()&&Se.delete(Tt)}),Se.size===0){Ee(V);return}setTimeout(yt,10)}ge.get("KHR_parallel_shader_compile")!==null?yt():setTimeout(yt,10)})};let xn=null;function Zn(V){xn&&xn(V)}function Ar(){Mn.stop()}function nn(){Mn.start()}const Mn=new o9;Mn.setAnimationLoop(Zn),typeof self<"u"&&Mn.setContext(self),this.setAnimationLoop=function(V){xn=V,dt.setAnimationLoop(V),V===null?Mn.stop():Mn.start()},dt.addEventListener("sessionstart",Ar),dt.addEventListener("sessionend",nn),this.render=function(V,fe){if(fe!==void 0&&fe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(C===!0)return;V.matrixWorldAutoUpdate===!0&&V.updateMatrixWorld(),fe.parent===null&&fe.matrixWorldAutoUpdate===!0&&fe.updateMatrixWorld(),dt.enabled===!0&&dt.isPresenting===!0&&(dt.cameraAutoUpdate===!0&&dt.updateCamera(fe),fe=dt.getCamera()),V.isScene===!0&&V.onBeforeRender(M,V,fe,P),b=Me.get(V,S.length),b.init(),S.push(b),Ye.multiplyMatrices(fe.projectionMatrix,fe.matrixWorldInverse),xe.setFromProjectionMatrix(Ye),Te=this.localClippingEnabled,we=De.init(this.clippingPlanes,Te),_=Le.get(V,y.length),_.init(),y.push(_),ur(V,fe,0,M.sortObjects),_.finish(),M.sortObjects===!0&&_.sort(H,Y),this.info.render.frame++,we===!0&&De.beginShadows();const be=b.state.shadowsArray;if(je.render(be,V,fe),we===!0&&De.endShadows(),this.info.autoReset===!0&&this.info.reset(),at.render(_,V),b.setupLights(M._useLegacyLights),fe.isArrayCamera){const Se=fe.cameras;for(let Ee=0,yt=Se.length;Ee0?b=S[S.length-1]:b=null,y.pop(),y.length>0?_=y[y.length-1]:_=null};function ur(V,fe,be,Se){if(V.visible===!1)return;if(V.layers.test(fe.layers)){if(V.isGroup)be=V.renderOrder;else if(V.isLOD)V.autoUpdate===!0&&V.update(fe);else if(V.isLight)b.pushLight(V),V.castShadow&&b.pushShadow(V);else if(V.isSprite){if(!V.frustumCulled||xe.intersectsSprite(V)){Se&&ct.setFromMatrixPosition(V.matrixWorld).applyMatrix4(Ye);const Tt=$.update(V),Gt=V.material;Gt.visible&&_.push(V,Tt,Gt,be,ct.z,null)}}else if((V.isMesh||V.isLine||V.isPoints)&&(!V.frustumCulled||xe.intersectsObject(V))){const Tt=$.update(V),Gt=V.material;if(Se&&(V.boundingSphere!==void 0?(V.boundingSphere===null&&V.computeBoundingSphere(),ct.copy(V.boundingSphere.center)):(Tt.boundingSphere===null&&Tt.computeBoundingSphere(),ct.copy(Tt.boundingSphere.center)),ct.applyMatrix4(V.matrixWorld).applyMatrix4(Ye)),Array.isArray(Gt)){const zt=Tt.groups;for(let rn=0,en=zt.length;rn0&&ps(Ee,yt,fe,be),Se&&Ue.viewport(N.copy(Se)),Ee.length>0&&Ks(Ee,fe,be),yt.length>0&&Ks(yt,fe,be),Tt.length>0&&Ks(Tt,fe,be),Ue.buffers.depth.setTest(!0),Ue.buffers.depth.setMask(!0),Ue.buffers.color.setMask(!0),Ue.setPolygonOffset(!1)}function ps(V,fe,be,Se){if((be.isScene===!0?be.overrideMaterial:null)!==null)return;const yt=ve.isWebGL2;Ve===null&&(Ve=new Rl(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")?Jh:os,minFilter:Qf,samples:yt?4:0})),M.getDrawingBufferSize(et),yt?Ve.setSize(et.x,et.y):Ve.setSize(zS(et.x),zS(et.y));const Tt=M.getRenderTarget();M.setRenderTarget(Ve),M.getClearColor(J),G=M.getClearAlpha(),G<1&&M.setClearColor(16777215,.5),M.clear();const Gt=M.toneMapping;M.toneMapping=pc,Ks(V,be,Se),ot.updateMultisampleRenderTarget(Ve),ot.updateRenderTargetMipmap(Ve);let zt=!1;for(let rn=0,en=fe.length;rn0),on=!!be.morphAttributes.position,fr=!!be.morphAttributes.normal,si=!!be.morphAttributes.color;let tr=pc;Se.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(tr=M.toneMapping);const li=be.morphAttributes.position||be.morphAttributes.normal||be.morphAttributes.color,Xt=li!==void 0?li.length:0,Mt=Je.get(Se),Qo=b.state.lights;if(we===!0&&(Te===!0||V!==k)){const ui=V===k&&Se.id===U;De.setState(Se,V,ui)}let En=!1;Se.version===Mt.__version?(Mt.needsLights&&Mt.lightsStateVersion!==Qo.state.version||Mt.outputColorSpace!==Gt||Ee.isInstancedMesh&&Mt.instancing===!1||!Ee.isInstancedMesh&&Mt.instancing===!0||Ee.isSkinnedMesh&&Mt.skinning===!1||!Ee.isSkinnedMesh&&Mt.skinning===!0||Ee.isInstancedMesh&&Mt.instancingColor===!0&&Ee.instanceColor===null||Ee.isInstancedMesh&&Mt.instancingColor===!1&&Ee.instanceColor!==null||Mt.envMap!==zt||Se.fog===!0&&Mt.fog!==yt||Mt.numClippingPlanes!==void 0&&(Mt.numClippingPlanes!==De.numPlanes||Mt.numIntersection!==De.numIntersection)||Mt.vertexAlphas!==rn||Mt.vertexTangents!==en||Mt.morphTargets!==on||Mt.morphNormals!==fr||Mt.morphColors!==si||Mt.toneMapping!==tr||ve.isWebGL2===!0&&Mt.morphTargetsCount!==Xt)&&(En=!0):(En=!0,Mt.__version=Se.version);let vr=Mt.currentProgram;En===!0&&(vr=Sa(Se,fe,Ee));let Ea=!1,co=!1,ci=!1;const Rr=vr.getUniforms(),To=Mt.uniforms;if(Ue.useProgram(vr.program)&&(Ea=!0,co=!0,ci=!0),Se.id!==U&&(U=Se.id,co=!0),Ea||k!==V){Rr.setValue(oe,"projectionMatrix",V.projectionMatrix),Rr.setValue(oe,"viewMatrix",V.matrixWorldInverse);const ui=Rr.map.cameraPosition;ui!==void 0&&ui.setValue(oe,ct.setFromMatrixPosition(V.matrixWorld)),ve.logarithmicDepthBuffer&&Rr.setValue(oe,"logDepthBufFC",2/(Math.log(V.far+1)/Math.LN2)),(Se.isMeshPhongMaterial||Se.isMeshToonMaterial||Se.isMeshLambertMaterial||Se.isMeshBasicMaterial||Se.isMeshStandardMaterial||Se.isShaderMaterial)&&Rr.setValue(oe,"isOrthographic",V.isOrthographicCamera===!0),k!==V&&(k=V,co=!0,ci=!0)}if(Ee.isSkinnedMesh){Rr.setOptional(oe,Ee,"bindMatrix"),Rr.setOptional(oe,Ee,"bindMatrixInverse");const ui=Ee.skeleton;ui&&(ve.floatVertexTextures?(ui.boneTexture===null&&ui.computeBoneTexture(),Rr.setValue(oe,"boneTexture",ui.boneTexture,ot),Rr.setValue(oe,"boneTextureSize",ui.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const Ac=be.morphAttributes;if((Ac.position!==void 0||Ac.normal!==void 0||Ac.color!==void 0&&ve.isWebGL2===!0)&&At.update(Ee,be,vr),(co||Mt.receiveShadow!==Ee.receiveShadow)&&(Mt.receiveShadow=Ee.receiveShadow,Rr.setValue(oe,"receiveShadow",Ee.receiveShadow)),Se.isMeshGouraudMaterial&&Se.envMap!==null&&(To.envMap.value=zt,To.flipEnvMap.value=zt.isCubeTexture&&zt.isRenderTargetTexture===!1?-1:1),co&&(Rr.setValue(oe,"toneMappingExposure",M.toneMappingExposure),Mt.needsLights&&Ie(To,ci),yt&&Se.fog===!0&&Ge.refreshFogUniforms(To,yt),Ge.refreshMaterialUniforms(To,Se,se,ie,Ve),Yw.upload(oe,Zo(Mt),To,ot)),Se.isShaderMaterial&&Se.uniformsNeedUpdate===!0&&(Yw.upload(oe,Zo(Mt),To,ot),Se.uniformsNeedUpdate=!1),Se.isSpriteMaterial&&Rr.setValue(oe,"center",Ee.center),Rr.setValue(oe,"modelViewMatrix",Ee.modelViewMatrix),Rr.setValue(oe,"normalMatrix",Ee.normalMatrix),Rr.setValue(oe,"modelMatrix",Ee.matrixWorld),Se.isShaderMaterial||Se.isRawShaderMaterial){const ui=Se.uniformsGroups;for(let Rc=0,uo=ui.length;Rc0&&ot.useMultisampledRTT(V)===!1?Ee=Je.get(V).__webglMultisampledFramebuffer:Array.isArray(en)?Ee=en[be]:Ee=en,N.copy(V.viewport),z.copy(V.scissor),K=V.scissorTest}else N.copy(te).multiplyScalar(se).floor(),z.copy(Q).multiplyScalar(se).floor(),K=ae;if(Ue.bindFramebuffer(oe.FRAMEBUFFER,Ee)&&ve.drawBuffers&&Se&&Ue.drawBuffers(V,Ee),Ue.viewport(N),Ue.scissor(z),Ue.setScissorTest(K),yt){const zt=Je.get(V.texture);oe.framebufferTexture2D(oe.FRAMEBUFFER,oe.COLOR_ATTACHMENT0,oe.TEXTURE_CUBE_MAP_POSITIVE_X+fe,zt.__webglTexture,be)}else if(Tt){const zt=Je.get(V.texture),rn=fe||0;oe.framebufferTextureLayer(oe.FRAMEBUFFER,oe.COLOR_ATTACHMENT0,zt.__webglTexture,be||0,rn)}U=-1},this.readRenderTargetPixels=function(V,fe,be,Se,Ee,yt,Tt){if(!(V&&V.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Gt=Je.get(V).__webglFramebuffer;if(V.isWebGLCubeRenderTarget&&Tt!==void 0&&(Gt=Gt[Tt]),Gt){Ue.bindFramebuffer(oe.FRAMEBUFFER,Gt);try{const zt=V.texture,rn=zt.format,en=zt.type;if(rn!==Wo&&Ut.convert(rn)!==oe.getParameter(oe.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const on=en===Jh&&(ge.has("EXT_color_buffer_half_float")||ve.isWebGL2&&ge.has("EXT_color_buffer_float"));if(en!==os&&Ut.convert(en)!==oe.getParameter(oe.IMPLEMENTATION_COLOR_READ_TYPE)&&!(en===Sl&&(ve.isWebGL2||ge.has("OES_texture_float")||ge.has("WEBGL_color_buffer_float")))&&!on){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}fe>=0&&fe<=V.width-Se&&be>=0&&be<=V.height-Ee&&oe.readPixels(fe,be,Se,Ee,Ut.convert(rn),Ut.convert(en),yt)}finally{const zt=P!==null?Je.get(P).__webglFramebuffer:null;Ue.bindFramebuffer(oe.FRAMEBUFFER,zt)}}},this.copyFramebufferToTexture=function(V,fe,be=0){const Se=Math.pow(2,-be),Ee=Math.floor(fe.image.width*Se),yt=Math.floor(fe.image.height*Se);ot.setTexture2D(fe,0),oe.copyTexSubImage2D(oe.TEXTURE_2D,be,0,0,V.x,V.y,Ee,yt),Ue.unbindTexture()},this.copyTextureToTexture=function(V,fe,be,Se=0){const Ee=fe.image.width,yt=fe.image.height,Tt=Ut.convert(be.format),Gt=Ut.convert(be.type);ot.setTexture2D(be,0),oe.pixelStorei(oe.UNPACK_FLIP_Y_WEBGL,be.flipY),oe.pixelStorei(oe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,be.premultiplyAlpha),oe.pixelStorei(oe.UNPACK_ALIGNMENT,be.unpackAlignment),fe.isDataTexture?oe.texSubImage2D(oe.TEXTURE_2D,Se,V.x,V.y,Ee,yt,Tt,Gt,fe.image.data):fe.isCompressedTexture?oe.compressedTexSubImage2D(oe.TEXTURE_2D,Se,V.x,V.y,fe.mipmaps[0].width,fe.mipmaps[0].height,Tt,fe.mipmaps[0].data):oe.texSubImage2D(oe.TEXTURE_2D,Se,V.x,V.y,Tt,Gt,fe.image),Se===0&&be.generateMipmaps&&oe.generateMipmap(oe.TEXTURE_2D),Ue.unbindTexture()},this.copyTextureToTexture3D=function(V,fe,be,Se,Ee=0){if(M.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const yt=V.max.x-V.min.x+1,Tt=V.max.y-V.min.y+1,Gt=V.max.z-V.min.z+1,zt=Ut.convert(Se.format),rn=Ut.convert(Se.type);let en;if(Se.isData3DTexture)ot.setTexture3D(Se,0),en=oe.TEXTURE_3D;else if(Se.isDataArrayTexture)ot.setTexture2DArray(Se,0),en=oe.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}oe.pixelStorei(oe.UNPACK_FLIP_Y_WEBGL,Se.flipY),oe.pixelStorei(oe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Se.premultiplyAlpha),oe.pixelStorei(oe.UNPACK_ALIGNMENT,Se.unpackAlignment);const on=oe.getParameter(oe.UNPACK_ROW_LENGTH),fr=oe.getParameter(oe.UNPACK_IMAGE_HEIGHT),si=oe.getParameter(oe.UNPACK_SKIP_PIXELS),tr=oe.getParameter(oe.UNPACK_SKIP_ROWS),li=oe.getParameter(oe.UNPACK_SKIP_IMAGES),Xt=be.isCompressedTexture?be.mipmaps[0]:be.image;oe.pixelStorei(oe.UNPACK_ROW_LENGTH,Xt.width),oe.pixelStorei(oe.UNPACK_IMAGE_HEIGHT,Xt.height),oe.pixelStorei(oe.UNPACK_SKIP_PIXELS,V.min.x),oe.pixelStorei(oe.UNPACK_SKIP_ROWS,V.min.y),oe.pixelStorei(oe.UNPACK_SKIP_IMAGES,V.min.z),be.isDataTexture||be.isData3DTexture?oe.texSubImage3D(en,Ee,fe.x,fe.y,fe.z,yt,Tt,Gt,zt,rn,Xt.data):be.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),oe.compressedTexSubImage3D(en,Ee,fe.x,fe.y,fe.z,yt,Tt,Gt,zt,Xt.data)):oe.texSubImage3D(en,Ee,fe.x,fe.y,fe.z,yt,Tt,Gt,zt,rn,Xt),oe.pixelStorei(oe.UNPACK_ROW_LENGTH,on),oe.pixelStorei(oe.UNPACK_IMAGE_HEIGHT,fr),oe.pixelStorei(oe.UNPACK_SKIP_PIXELS,si),oe.pixelStorei(oe.UNPACK_SKIP_ROWS,tr),oe.pixelStorei(oe.UNPACK_SKIP_IMAGES,li),Ee===0&&Se.generateMipmaps&&oe.generateMipmap(en),Ue.unbindTexture()},this.initTexture=function(V){V.isCubeTexture?ot.setTextureCube(V,0):V.isData3DTexture?ot.setTexture3D(V,0):V.isDataArrayTexture||V.isCompressedArrayTexture?ot.setTexture2DArray(V,0):ot.setTexture2D(V,0),Ue.unbindTexture()},this.resetState=function(){A=0,R=0,P=null,Ue.reset(),Et.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ac}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===RE?"display-p3":"srgb",n.unpackColorSpace=Qn.workingColorSpace===fx?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Mi?Wf:GI}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Wf?Mi:_c}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class h9 extends eL{}h9.prototype.isWebGL1Renderer=!0;class OE{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new _t(e),this.density=n}clone(){return new OE(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class kE{constructor(e,n=1,r=1e3){this.isFog=!0,this.name="",this.color=new _t(e),this.near=n,this.far=r}clone(){return new kE(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class $S extends Hn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,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,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}}class NE{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=R1,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=as()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;ie.far||n.push({distance:l,point:Hv.clone(),uv:ua.getInterpolation(Hv,F_,Wv,U_,nD,wT,rD,new Be),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 B_(t,e,n,r,i,o){Pm.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(Vv.x=o*Pm.x-i*Pm.y,Vv.y=i*Pm.x+o*Pm.y):Vv.copy(Pm),t.copy(e),t.x+=Vv.x,t.y+=Vv.y,t.applyMatrix4(p9)}const z_=new q,iD=new q;class g9 extends Hn{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){z_.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(z_);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){z_.setFromMatrixPosition(e.matrixWorld),iD.setFromMatrixPosition(this.matrixWorld);const r=z_.distanceTo(iD)/e.zoom;n[0].object.visible=!0;let i,o;for(i=1,o=n.length;i=a)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;il)continue;m.applyMatrix4(this.matrixWorld);const U=e.ray.origin.distanceTo(m);Ue.far||n.push({distance:U,point:p.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const y=Math.max(0,a.start),S=Math.min(b.count,a.start+a.count);for(let M=y,C=S-1;Ml)continue;m.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(m);Re.far||n.push({distance:R,point:p.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;oi.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,object:a})}}class _ve extends Kr{constructor(e,n,r,i,o,a,s,l,c){super(e,n,r,i,o,a,s,l,c),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:ai,this.magFilter=o!==void 0?o:ai,this.generateMipmaps=!1;const f=this;function p(){f.needsUpdate=!0,e.requestVideoFrameCallback(p)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(p)}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 wve extends Kr{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=qr,this.minFilter=qr,this.generateMipmaps=!1,this.needsUpdate=!0}}class FE extends Kr{constructor(e,n,r,i,o,a,s,l,c,f,p,m){super(null,a,s,l,c,f,i,o,p,m),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Sve extends FE{constructor(e,n,r,i,o,a){super(e,n,r,o,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Vi}}class Mve extends FE{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,Eu),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class Eve extends Kr{constructor(e,n,r,i,o,a,s,l,c){super(e,n,r,i,o,a,s,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Il{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 a=1;a<=e;a++)r=this.getPoint(a/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 a;n?a=n:a=e*r[o-1];let s=0,l=o-1,c;for(;s<=l;)if(i=Math.floor(s+(l-s)/2),c=r[i]-a,c<0)s=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,r[i]===a)return i/(o-1);const f=r[i],m=r[i+1]-f,v=(a-f)/m;return(i+v)/(o-1)}getTangent(e,n){let i=e-1e-4,o=e+1e-4;i<0&&(i=0),o>1&&(o=1);const a=this.getPoint(i),s=this.getPoint(o),l=n||(a.isVector2?new Be:new q);return l.copy(s).sub(a).normalize(),l}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n){const r=new q,i=[],o=[],a=[],s=new q,l=new dn;for(let v=0;v<=e;v++){const x=v/e;i[v]=this.getTangentAt(x,new q)}o[0]=new q,a[0]=new q;let c=Number.MAX_VALUE;const f=Math.abs(i[0].x),p=Math.abs(i[0].y),m=Math.abs(i[0].z);f<=c&&(c=f,r.set(1,0,0)),p<=c&&(c=p,r.set(0,1,0)),m<=c&&r.set(0,0,1),s.crossVectors(i[0],r).normalize(),o[0].crossVectors(i[0],s),a[0].crossVectors(i[0],o[0]);for(let v=1;v<=e;v++){if(o[v]=o[v-1].clone(),a[v]=a[v-1].clone(),s.crossVectors(i[v-1],i[v]),s.length()>Number.EPSILON){s.normalize();const x=Math.acos(Yr(i[v-1].dot(i[v]),-1,1));o[v].applyMatrix4(l.makeRotationAxis(s,x))}a[v].crossVectors(i[v],o[v])}if(n===!0){let v=Math.acos(Yr(o[0].dot(o[e]),-1,1));v/=e,i[0].dot(s.crossVectors(o[0],o[e]))>0&&(v=-v);for(let x=1;x<=e;x++)o[x].applyMatrix4(l.makeRotationAxis(i[x],v*x)),a[x].crossVectors(i[x],o[x])}return{tangents:i,normals:o,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class UE extends Il{constructor(e=0,n=0,r=1,i=1,o=0,a=Math.PI*2,s=!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=a,this.aClockwise=s,this.aRotation=l}getPoint(e,n){const r=n||new Be,i=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const a=Math.abs(o)i;)o-=i;o0?0:(Math.floor(Math.abs(s)/o)+1)*o:l===0&&s===o-1&&(s=o-2,l=1);let c,f;this.closed||s>0?c=i[(s-1)%o]:(j_.subVectors(i[0],i[1]).add(i[0]),c=j_);const p=i[s%o],m=i[(s+1)%o];if(this.closed||s+2i.length-2?i.length-1:a+1],p=i[a>i.length-3?i.length-1:a+2];return r.set(bD(s,l.x,c.x,f.x,p.x),bD(s,l.y,c.y,f.y,p.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n=r){const a=i[o]-r,s=this.curves[o],l=s.getLength(),c=l===0?0:1-a/l;return s.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 p=c.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),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 vx extends An{constructor(e=[new Be(0,-.5),new Be(.5,0),new Be(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=Yr(i,0,Math.PI*2);const o=[],a=[],s=[],l=[],c=[],f=1/n,p=new q,m=new Be,v=new q,x=new q,_=new q;let b=0,y=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:b=e[S+1].x-e[S].x,y=e[S+1].y-e[S].y,v.x=y*1,v.y=-b,v.z=y*0,_.copy(v),v.normalize(),l.push(v.x,v.y,v.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:b=e[S+1].x-e[S].x,y=e[S+1].y-e[S].y,v.x=y*1,v.y=-b,v.z=y*0,x.copy(v),v.x+=_.x,v.y+=_.y,v.z+=_.z,v.normalize(),l.push(v.x,v.y,v.z),_.copy(x)}for(let S=0;S<=n;S++){const M=r+S*f*i,C=Math.sin(M),A=Math.cos(M);for(let R=0;R<=e.length-1;R++){p.x=e[R].x*C,p.y=e[R].y,p.z=e[R].x*A,a.push(p.x,p.y,p.z),m.x=S/n,m.y=R/(e.length-1),s.push(m.x,m.y);const P=l[3*R+0]*C,U=l[3*R+1],k=l[3*R+0]*A;c.push(P,U,k)}}for(let S=0;S0&&M(!0),n>0&&M(!1)),this.setIndex(f),this.setAttribute("position",new It(p,3)),this.setAttribute("normal",new It(m,3)),this.setAttribute("uv",new It(v,2));function S(){const C=new q,A=new q;let R=0;const P=(n-e)/r;for(let U=0;U<=o;U++){const k=[],N=U/o,z=N*(n-e)+e;for(let K=0;K<=i;K++){const J=K/i,G=J*l+s,ne=Math.sin(G),ie=Math.cos(G);A.x=z*ne,A.y=-N*r+b,A.z=z*ie,p.push(A.x,A.y,A.z),C.set(ne,P,ie).normalize(),m.push(C.x,C.y,C.z),v.push(J,1-N),k.push(x++)}_.push(k)}for(let U=0;U.9&&P<.1&&(M<.2&&(a[S+0]+=1),C<.2&&(a[S+2]+=1),A<.2&&(a[S+4]+=1))}}function m(S){o.push(S.x,S.y,S.z)}function v(S,M){const C=S*3;M.x=e[C+0],M.y=e[C+1],M.z=e[C+2]}function x(){const S=new q,M=new q,C=new q,A=new q,R=new Be,P=new Be,U=new Be;for(let k=0,N=0;k80*n){s=c=t[0],l=f=t[1];for(let x=n;xc&&(c=p),m>f&&(f=m);v=Math.max(c-s,f-l),v=v!==0?32767/v:0}return O1(o,a,n,s,l,v,0),a}};function T9(t,e,n,r,i){let o,a;if(i===Yve(t,e,n,r)>0)for(o=e;o=e;o-=r)a=_D(o,t[o],t[o+1],a);return a&&VE(a,a.next)&&(N1(a),a=a.next),a}function np(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(VE(n,n.next)||Nr(n.prev,n,n.next)===0)){if(N1(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function O1(t,e,n,r,i,o,a){if(!t)return;!a&&o&&Vve(t,r,i,o);let s=t,l,c;for(;t.prev!==t.next;){if(l=t.prev,c=t.next,o?Nve(t,r,i,o):kve(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(c.i/n|0),N1(t),t=c.next,s=c.next;continue}if(t=c,t===s){a?a===1?(t=Dve(np(t),e,n),O1(t,e,n,r,i,o,2)):a===2&&Fve(t,e,n,r,i,o):O1(np(t),e,n,r,i,o,1);break}}}function kve(t){const e=t.prev,n=t,r=t.next;if(Nr(e,n,r)>=0)return!1;const i=e.x,o=n.x,a=r.x,s=e.y,l=n.y,c=r.y,f=io?i>a?i:a:o>a?o:a,v=s>l?s>c?s:c:l>c?l:c;let x=r.next;for(;x!==e;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=v&&_g(i,s,o,l,a,c,x.x,x.y)&&Nr(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function Nve(t,e,n,r){const i=t.prev,o=t,a=t.next;if(Nr(i,o,a)>=0)return!1;const s=i.x,l=o.x,c=a.x,f=i.y,p=o.y,m=a.y,v=sl?s>c?s:c:l>c?l:c,b=f>p?f>m?f:m:p>m?p:m,y=p3(v,x,e,n,r),S=p3(_,b,e,n,r);let M=t.prevZ,C=t.nextZ;for(;M&&M.z>=y&&C&&C.z<=S;){if(M.x>=v&&M.x<=_&&M.y>=x&&M.y<=b&&M!==i&&M!==a&&_g(s,f,l,p,c,m,M.x,M.y)&&Nr(M.prev,M,M.next)>=0||(M=M.prevZ,C.x>=v&&C.x<=_&&C.y>=x&&C.y<=b&&C!==i&&C!==a&&_g(s,f,l,p,c,m,C.x,C.y)&&Nr(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;M&&M.z>=y;){if(M.x>=v&&M.x<=_&&M.y>=x&&M.y<=b&&M!==i&&M!==a&&_g(s,f,l,p,c,m,M.x,M.y)&&Nr(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;C&&C.z<=S;){if(C.x>=v&&C.x<=_&&C.y>=x&&C.y<=b&&C!==i&&C!==a&&_g(s,f,l,p,c,m,C.x,C.y)&&Nr(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Dve(t,e,n){let r=t;do{const i=r.prev,o=r.next.next;!VE(i,o)&&A9(i,r,r.next,o)&&k1(i,o)&&k1(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),N1(r),N1(r.next),r=t=o),r=r.next}while(r!==t);return np(r)}function Fve(t,e,n,r,i,o){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&jve(a,s)){let l=R9(a,s);a=np(a,a.next),l=np(l,l.next),O1(a,e,n,r,i,o,0),O1(l,e,n,r,i,o,0);return}s=s.next}a=a.next}while(a!==t)}function Uve(t,e,n,r){const i=[];let o,a,s,l,c;for(o=0,a=e.length;o=n.next.y&&n.next.y!==n.y){const m=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=o&&m>r&&(r=m,i=n.x=n.x&&n.x>=l&&o!==n.x&&_g(ai.x||n.x===i.x&&Hve(i,n)))&&(i=n,f=p)),n=n.next;while(n!==s);return i}function Hve(t,e){return Nr(t.prev,t,e.prev)<0&&Nr(e.next,t,t.next)<0}function Vve(t,e,n,r){let i=t;do i.z===0&&(i.z=p3(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,Wve(i)}function Wve(t){let e,n,r,i,o,a,s,l,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||l>0&&r;)s!==0&&(l===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(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(a>1);return t}function p3(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 Gve(t){let e=t,n=t;do(e.x=(t-a)*(o-s)&&(t-a)*(r-s)>=(n-a)*(e-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function jve(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Xve(t,e)&&(k1(t,e)&&k1(e,t)&&qve(t,e)&&(Nr(t.prev,t,e.prev)||Nr(t,e.prev,e))||VE(t,e)&&Nr(t.prev,t,t.next)>0&&Nr(e.prev,e,e.next)>0)}function Nr(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function VE(t,e){return t.x===e.x&&t.y===e.y}function A9(t,e,n,r){const i=Z_(Nr(t,e,n)),o=Z_(Nr(t,e,r)),a=Z_(Nr(n,r,t)),s=Z_(Nr(n,r,e));return!!(i!==o&&a!==s||i===0&&K_(t,n,e)||o===0&&K_(t,r,e)||a===0&&K_(n,t,r)||s===0&&K_(n,e,r))}function K_(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 Z_(t){return t>0?1:t<0?-1:0}function Xve(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&&A9(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function k1(t,e){return Nr(t.prev,t,t.next)<0?Nr(t,e,t.next)>=0&&Nr(t,t.prev,e)>=0:Nr(t,e,t.prev)<0||Nr(t,t.next,e)<0}function qve(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 R9(t,e){const n=new m3(t.i,t.x,t.y),r=new m3(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 _D(t,e,n,r){const i=new m3(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 N1(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 m3(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 Yve(t,e,n,r){let i=0;for(let o=e,a=n-r;o2&&t[e-1].equals(t[0])&&t.pop()}function SD(t,e){for(let n=0;nNumber.EPSILON){const $=Math.sqrt(Ht),ye=Math.sqrt(ft*ft+lt*lt),Ge=Ae.x-ot/$,Le=Ae.y+Je/$,Me=ge.x-lt/ye,De=ge.y+ft/ye,je=((Me-Ge)*lt-(De-Le)*ft)/(Je*lt-ot*ft);ve=Ge+Je*je-oe.x,Ue=Le+ot*je-oe.y;const at=ve*ve+Ue*Ue;if(at<=2)return new Be(ve,Ue);We=Math.sqrt(at/2)}else{let $=!1;Je>Number.EPSILON?ft>Number.EPSILON&&($=!0):Je<-Number.EPSILON?ft<-Number.EPSILON&&($=!0):Math.sign(ot)===Math.sign(lt)&&($=!0),$?(ve=-ot,Ue=Je,We=Math.sqrt(Ht)):(ve=Je,Ue=ot,We=Math.sqrt(Ht/2))}return new Be(ve/We,Ue/We)}const Y=[];for(let oe=0,Ae=G.length,ge=Ae-1,ve=oe+1;oe=0;oe--){const Ae=oe/b,ge=v*Math.cos(Ae*Math.PI/2),ve=x*Math.sin(Ae*Math.PI/2)+_;for(let Ue=0,We=G.length;Ue=0;){const ve=ge;let Ue=ge-1;Ue<0&&(Ue=oe.length-1);for(let We=0,Je=f+b*2;We0)&&v.push(M,C,R),(y!==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 sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class k9 extends so{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new _t(16777215),this.specular=new _t(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ud,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=cx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class N9 extends so{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _t(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ud,this.normalScale=new Be(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 D9 extends so{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ud,this.normalScale=new Be(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 F9 extends so{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new _t(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ud,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=cx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class U9 extends so{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _t(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ud,this.normalScale=new Be(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 B9 extends Yo{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 Th(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 z9(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function $9(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 g3(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,a=0;a!==r;++o){const s=n[o]*e;for(let l=0;l!==e;++l)i[a++]=t[s+l]}return i}function fL(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 a=o[r];if(a!==void 0)if(Array.isArray(a))do a=o[r],a!==void 0&&(e.push(o.time),n.push.apply(n,a)),o=t[i++];while(o!==void 0);else if(a.toArray!==void 0)do a=o[r],a!==void 0&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do a=o[r],a!==void 0&&(e.push(o.time),n.push(a)),o=t[i++];while(o!==void 0)}function Jve(t,e,n,r,i=30){const o=t.clone();o.name=e;const a=[];for(let l=0;l=r)){p.push(c.times[v]);for(let _=0;_o.tracks[l].times[0]&&(s=o.tracks[l].times[0]);for(let l=0;l=s.times[x]){const y=x*p+f,S=y+p-f;_=s.values.slice(y,S)}else{const y=s.createInterpolant(),S=f,M=p-f;y.evaluate(o),_=y.resultBuffer.slice(S,M)}l==="quaternion"&&new ya().fromArray(_).normalize().conjugate().toArray(_);const b=c.times.length;for(let y=0;y=o)){const s=n[1];e=o)break t}a=r,r=0;break n}break e}for(;r>>1;en;)--a;if(++a,o!==0||a!==i){o>=a&&(a=Math.max(a,1),o=a-1);const s=this.getValueSize();this.times=r.slice(o,a),this.values=this.values.slice(o*s,a*s)}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 a=null;for(let s=0;s!==o;s++){const l=r[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,a),e=!1;break}a=l}if(i!==void 0&&z9(i))for(let s=0,l=i.length;s!==l;++s){const c=i[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===qw,o=e.length-1;let a=1;for(let s=1;s0){e[a]=e[o];for(let s=o*r,l=a*r,c=0;c!==r;++c)n[l+c]=n[s+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*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}}Ll.prototype.TimeBufferType=Float32Array;Ll.prototype.ValueBufferType=Float32Array;Ll.prototype.DefaultInterpolation=M1;class up extends Ll{}up.prototype.ValueTypeName="bool";up.prototype.ValueBufferType=Array;up.prototype.DefaultInterpolation=S1;up.prototype.InterpolantFactoryMethodLinear=void 0;up.prototype.InterpolantFactoryMethodSmooth=void 0;class hL extends Ll{}hL.prototype.ValueTypeName="color";class D1 extends Ll{}D1.prototype.ValueTypeName="number";class W9 extends bx{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=(r-n)/(i-n);let c=e*s;for(let f=c+s;c!==f;c+=4)ya.slerpFlat(o,0,a,c-s,a,c,l);return o}}class _0 extends Ll{InterpolantFactoryMethodLinear(e){return new W9(this.times,this.values,this.getValueSize(),e)}}_0.prototype.ValueTypeName="quaternion";_0.prototype.DefaultInterpolation=M1;_0.prototype.InterpolantFactoryMethodSmooth=void 0;class fp extends Ll{}fp.prototype.ValueTypeName="string";fp.prototype.ValueBufferType=Array;fp.prototype.DefaultInterpolation=S1;fp.prototype.InterpolantFactoryMethodLinear=void 0;fp.prototype.InterpolantFactoryMethodSmooth=void 0;class F1 extends Ll{}F1.prototype.ValueTypeName="vector";class U1{constructor(e,n=-1,r,i=AE){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=as(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let a=0,s=r.length;a!==s;++a)n.push(rye(r[a]).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,a=r.length;o!==a;++o)n.push(Ll.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,a=[];for(let s=0;s1){const p=f[1];let m=i[p];m||(i[p]=m=[]),m.push(c)}}const a=[];for(const s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],n,r));return a}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(p,m,v,x,_){if(v.length!==0){const b=[],y=[];fL(v,b,y,x),b.length!==0&&_.push(new p(m,b,y))}},i=[],o=e.name||"default",a=e.fps||30,s=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let p=0;p{n&&n(o),this.manager.itemEnd(e)},0),o;if(Qc[e]!==void 0){Qc[e].push({onLoad:n,onProgress:r,onError:i});return}Qc[e]=[],Qc[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).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 f=Qc[e],p=c.body.getReader(),m=c.headers.get("Content-Length")||c.headers.get("X-File-Size"),v=m?parseInt(m):0,x=v!==0;let _=0;const b=new ReadableStream({start(y){S();function S(){p.read().then(({done:M,value:C})=>{if(M)y.close();else{_+=C.byteLength;const A=new ProgressEvent("progress",{lengthComputable:x,loaded:_,total:v});for(let R=0,P=f.length;R{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(f=>new DOMParser().parseFromString(f,s));case"json":return c.json();default:if(s===void 0)return c.text();{const p=/charset="?([^;"\s]*)"?/i.exec(s),m=p&&p[1]?p[1].toLowerCase():void 0,v=new TextDecoder(m);return c.arrayBuffer().then(x=>v.decode(x))}}}).then(c=>{rp.add(e,c);const f=Qc[e];delete Qc[e];for(let p=0,m=f.length;p{const f=Qc[e];if(f===void 0)throw this.manager.itemError(e),c;delete Qc[e];for(let p=0,m=f.length;p{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class oye extends ba{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new Tu(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(s){try{n(o.parse(JSON.parse(s)))}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 a=e.uniforms[o];switch(i.uniforms[o]={},a.type){case"t":i.uniforms[o].value=r(a.value);break;case"c":i.uniforms[o].value=new _t().setHex(a.value);break;case"v2":i.uniforms[o].value=new Be().fromArray(a.value);break;case"v3":i.uniforms[o].value=new q().fromArray(a.value);break;case"v4":i.uniforms[o].value=new Yn().fromArray(a.value);break;case"m3":i.uniforms[o].value=new Tn().fromArray(a.value);break;case"m4":i.uniforms[o].value=new dn().fromArray(a.value);break;default:i.uniforms[o].value=a.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 Be().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.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 Be().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}static createMaterialFromType(e){const n={ShadowMaterial:I9,SpriteMaterial:tL,RawShaderMaterial:L9,ShaderMaterial:wc,PointsMaterial:rL,MeshPhysicalMaterial:O9,MeshStandardMaterial:uL,MeshPhongMaterial:k9,MeshToonMaterial:N9,MeshNormalMaterial:D9,MeshLambertMaterial:F9,MeshDepthMaterial:QI,MeshDistanceMaterial:JI,MeshBasicMaterial:fd,MeshMatcapMaterial:U9,LineDashedMaterial:B9,LineBasicMaterial:Yo,Material:so};return new n[e]}}class v3{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let r=0,i=e.length;r0){const l=new pL(n);o=new B1(l),o.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c0){i=new B1(this.manager),i.setCrossOrigin(this.crossOrigin);for(let a=0,s=e.length;a"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,a=rp.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader,fetch(e,s).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(l){rp.add(e,l),n&&n(l),o.manager.itemEnd(e)}).catch(function(l){i&&i(l),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}let Q_;class gL{static getContext(){return Q_===void 0&&(Q_=new(window.AudioContext||window.webkitAudioContext)),Q_}static setContext(e){Q_=e}}class gye extends ba{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new Tu(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){try{const c=l.slice(0);gL.getContext().decodeAudioData(c,function(p){n(p)},s)}catch(c){s(c)}},r,i);function s(l){i?i(l):console.error(l),o.manager.itemError(e)}}}const ID=new dn,LD=new dn,nh=new dn;class vye{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Hi,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Hi,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,nh.copy(e.projectionMatrix);const i=n.eyeSep/2,o=i*n.near/n.focus,a=n.near*Math.tan(Uh*n.fov*.5)/n.zoom;let s,l;LD.elements[12]=-i,ID.elements[12]=i,s=-a*n.aspect+o,l=a*n.aspect+o,nh.elements[0]=2*n.near/(l-s),nh.elements[8]=(l+s)/(l-s),this.cameraL.projectionMatrix.copy(nh),s=-a*n.aspect-o,l=a*n.aspect-o,nh.elements[0]=2*n.near/(l-s),nh.elements[8]=(l+s)/(l-s),this.cameraR.projectionMatrix.copy(nh)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(LD),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(ID)}}class vL{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=OD(),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=OD();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function OD(){return(typeof performance>"u"?Date:performance).now()}const rh=new q,kD=new ya,yye=new q,ih=new q;class xye extends Hn{constructor(){super(),this.type="AudioListener",this.context=gL.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new vL}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(rh,kD,yye),ih.set(0,0,-1).applyQuaternion(kD),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(rh.x,i),n.positionY.linearRampToValueAtTime(rh.y,i),n.positionZ.linearRampToValueAtTime(rh.z,i),n.forwardX.linearRampToValueAtTime(ih.x,i),n.forwardY.linearRampToValueAtTime(ih.y,i),n.forwardZ.linearRampToValueAtTime(ih.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(rh.x,rh.y,rh.z),n.setOrientation(ih.x,ih.y,ih.z,r.x,r.y,r.z)}}class nH extends Hn{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(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,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]){s.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,a=i;o!==a;++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 a=0;a!==o;++a)e[n+a]=e[r+a]}_slerp(e,n,r,i){ya.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,o){const a=this._workIndex*o;ya.multiplyQuaternionsFlat(e,a,e,n,e,r),ya.slerpFlat(e,n,e,n,e,a,i)}_lerp(e,n,r,i,o){const a=1-i;for(let s=0;s!==o;++s){const l=n+s;e[l]=e[l]*a+e[r+s]*i}}_lerpAdditive(e,n,r,i,o){for(let a=0;a!==o;++a){const s=n+a;e[s]=e[s]+e[r+a]*i}}}const yL="\\[\\]\\.:\\/",Sye=new RegExp("["+yL+"]","g"),xL="[^"+yL+"]",Mye="[^"+yL.replace("\\.","")+"]",Eye=/((?:WC+[\/:])*)/.source.replace("WC",xL),Cye=/(WCOD+)?/.source.replace("WCOD",Mye),Tye=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xL),Aye=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xL),Rye=new RegExp("^"+Eye+Cye+Tye+Aye+"$"),Pye=["material","materials","bones","map"];class Iye{constructor(e,n,r){const i=r||Bn.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 Bn{constructor(e,n,r){this.path=n,this.parsedPath=r||Bn.parseTrackName(n),this.node=Bn.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 Bn.Composite(e,n,r):new Bn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Sye,"")}static parseTrackName(e){const n=Rye.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);Pye.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 a=0;a=o){const p=o++,m=e[p];n[m.uuid]=f,e[f]=m,n[c]=p,e[p]=l;for(let v=0,x=i;v!==x;++v){const _=r[v],b=_[p],y=_[f];_[f]=b,_[p]=y}}}this.nCachedObjects_=o}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let o=this.nCachedObjects_,a=e.length;for(let s=0,l=arguments.length;s!==l;++s){const c=arguments[s],f=c.uuid,p=n[f];if(p!==void 0)if(delete n[f],p0&&(n[v.uuid]=p),e[p]=v,e.pop();for(let x=0,_=i;x!==_;++x){const b=r[x];b[p]=b[m],b.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 a=this._paths,s=this._parsedPaths,l=this._objects,c=l.length,f=this.nCachedObjects_,p=new Array(c);i=o.length,r[e]=i,a.push(e),s.push(n),o.push(p);for(let m=f,v=l.length;m!==v;++m){const x=l[m];p[m]=new Bn(x,e,n)}return p}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length-1,l=a[s],c=e[s];n[c]=r,a[r]=l,a.pop(),o[r]=o[s],o.pop(),i[r]=i[s],i.pop()}}}class iH{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const o=n.tracks,a=o.length,s=new Array(a),l={endingStart:Mh,endingEnd:Mh};for(let c=0;c!==a;++c){const f=o[c].createInterpolant(null);s[c]=f,f.settings=l}this._interpolantSettings=l,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=D7,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,a=o/i,s=i/o;e.warp(1,a,n),this.warp(s,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,a=this.timeScale;let s=this._timeScaleInterpolant;s===null&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);const l=s.parameterPositions,c=s.sampleValues;return l[0]=o,l[1]=o+r,c[0]=e/a,c[1]=n/a,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,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 a=this._updateTime(n),s=this._updateWeight(e);if(s>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case WI:for(let f=0,p=l.length;f!==p;++f)l[f].evaluate(a),c[f].accumulateAdditive(s);break;case AE:default:for(let f=0,p=l.length;f!==p;++f)l[f].evaluate(a),c[f].accumulate(i,s)}}}_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 a=r===F7;if(e===0)return o===-1?i:a&&(o&1)===1?n-i:i;if(r===N7){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,a)):this._setEndings(this.repetitions===0,!0,a)),i>=n||i<0){const s=Math.floor(i/n);i-=n*s,o+=Math.abs(s);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,a)}else this._setEndings(!1,!1,a);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:s})}}else this.time=i;if(a&&(o&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=Eh,i.endingEnd=Eh):(e?i.endingStart=this.zeroSlopeAtStart?Eh:Mh:i.endingStart=E1,n?i.endingEnd=this.zeroSlopeAtEnd?Eh:Mh:i.endingEnd=E1)}_scheduleFading(e,n,r){const i=this._mixer,o=i.time;let a=this._weightInterpolant;a===null&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);const s=a.parameterPositions,l=a.sampleValues;return s[0]=o,l[0]=n,s[1]=o+e,l[1]=r,this}}const Oye=new Float32Array(1);class kye extends Ou{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,a=e._propertyBindings,s=e._interpolants,l=r.uuid,c=this._bindingsByRootAndName;let f=c[l];f===void 0&&(f={},c[l]=f);for(let p=0;p!==o;++p){const m=i[p],v=m.name;let x=f[v];if(x!==void 0)++x.referenceCount,a[p]=x;else{if(x=a[p],x!==void 0){x._cacheIndex===null&&(++x.referenceCount,this._addInactiveBinding(x,l,v));continue}const _=n&&n._propertyBindings[p].binding.parsedPath;x=new rH(Bn.create(r,v,_),m.ValueTypeName,m.getValueSize()),++x.referenceCount,this._addInactiveBinding(x,l,v),a[p]=x}s[p].resultBuffer=x.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),a=this._accuIndex^=1;for(let c=0;c!==r;++c)n[c]._update(i,e,o,a);const s=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)s[c].apply(a);return this}setTime(e){this.time=0;for(let n=0;nthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,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.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,FD).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 UD=new q,J_=new q;class Hye{constructor(e=new q,n=new q){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){UD.subVectors(e,this.start),J_.subVectors(this.end,this.start);const r=J_.dot(J_);let o=J_.dot(UD)/r;return n&&(o=Yr(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 BD=new q;class Vye extends Hn{constructor(e,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new An,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 a=0,s=1,l=32;a1)for(let p=0;p.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{WD.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(WD,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 n1e extends Ec{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 An;i.setAttribute("position",new It(n,3)),i.setAttribute("color",new It(r,3));const o=new Yo({vertexColors:!0,toneMapped:!1});super(i,o),this.type="AxesHelper"}setColors(e,n,r){const i=new _t,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 r1e{constructor(){this.type="ShapePath",this.color=new _t,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new L1,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,a){return this.currentPath.bezierCurveTo(e,n,r,i,o,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(y){const S=[];for(let M=0,C=y.length;MNumber.EPSILON){if(N<0&&(P=S[R],k=-k,U=S[A],N=-N),y.yU.y)continue;if(y.y===P.y){if(y.x===P.x)return!0}else{const z=N*(y.x-P.x)-k*(y.y-P.y);if(z===0)return!0;if(z<0)continue;C=!C}}else{if(y.y!==P.y)continue;if(U.x<=y.x&&y.x<=P.x||P.x<=y.x&&y.x<=U.x)return!0}}return C}const i=mc.isClockWise,o=this.subPaths;if(o.length===0)return[];let a,s,l;const c=[];if(o.length===1)return s=o[0],l=new zh,l.curves=s.curves,c.push(l),c;let f=!i(o[0].getPoints());f=e?!f:f;const p=[],m=[];let v=[],x=0,_;m[x]=void 0,v[x]=[];for(let y=0,S=o.length;y1){let y=!1,S=0;for(let M=0,C=m.length;M0&&y===!1&&(v=p)}let b;for(let y=0,S=m.length;y{const p=typeof c=="function"?c(e):c;if(p!==e){const m=e;e=f?p:Object.assign({},e,p),n.forEach(v=>v(e,m))}},i=()=>e,o=(c,f=i,p=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let m=f(e);function v(){const x=f(e);if(!p(m,x)){const _=m;c(m=x,_)}}return n.add(v),()=>n.delete(v)},l={setState:r,getState:i,subscribe:(c,f,p)=>f||p?o(c,f,p):(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return e=t(r,i,l),l}const a1e=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),GD=a1e?F.useEffect:F.useLayoutEffect;function s1e(t){const e=typeof t=="function"?o1e(t):t,n=(r=e.getState,i=Object.is)=>{const[,o]=F.useReducer(b=>b+1,0),a=e.getState(),s=F.useRef(a),l=F.useRef(r),c=F.useRef(i),f=F.useRef(!1),p=F.useRef();p.current===void 0&&(p.current=r(a));let m,v=!1;(s.current!==a||l.current!==r||c.current!==i||f.current)&&(m=r(a),v=!i(p.current,m)),GD(()=>{v&&(p.current=m),s.current=a,l.current=r,c.current=i,f.current=!1});const x=F.useRef(a);GD(()=>{const b=()=>{try{const S=e.getState(),M=l.current(S);c.current(p.current,M)||(s.current=S,p.current=M,o())}catch{f.current=!0,o()}},y=e.subscribe(b);return e.getState()!==x.current&&b(),y},[]);const _=v?m:p.current;return F.useDebugValue(_),_};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 lH={exports:{}},cH={exports:{}},uH={};/** - * @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(H,Y){var te=H.length;H.push(Y);e:for(;0>>1,ae=H[Q];if(0>>1;Qi(Te,te))Vei(Ye,Te)?(H[Q]=Ye,H[Ve]=te,Q=Ve):(H[Q]=Te,H[we]=te,Q=we);else if(Vei(Ye,te))H[Q]=Ye,H[Ve]=te,Q=Ve;else break e}}return Y}function i(H,Y){var te=H.sortIndex-Y.sortIndex;return te!==0?te:H.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],c=[],f=1,p=null,m=3,v=!1,x=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(H){for(var Y=n(c);Y!==null;){if(Y.callback===null)r(c);else if(Y.startTime<=H)r(c),Y.sortIndex=Y.expirationTime,e(l,Y);else break;Y=n(c)}}function C(H){if(_=!1,M(H),!x)if(n(l)!==null)x=!0,ie(A);else{var Y=n(c);Y!==null&&se(C,Y.startTime-H)}}function A(H,Y){x=!1,_&&(_=!1,y(U),U=-1),v=!0;var te=m;try{for(M(Y),p=n(l);p!==null&&(!(p.expirationTime>Y)||H&&!z());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,m=p.priorityLevel;var ae=Q(p.expirationTime<=Y);Y=t.unstable_now(),typeof ae=="function"?p.callback=ae:p===n(l)&&r(l),M(Y)}else r(l);p=n(l)}if(p!==null)var xe=!0;else{var we=n(c);we!==null&&se(C,we.startTime-Y),xe=!1}return xe}finally{p=null,m=te,v=!1}}var R=!1,P=null,U=-1,k=5,N=-1;function z(){return!(t.unstable_now()-NH||125Q?(H.sortIndex=te,e(c,H),n(l)===null&&H===n(c)&&(_?(y(U),U=-1):_=!0,se(C,te-Q))):(H.sortIndex=ae,e(l,H),x||v||(x=!0,ie(A))),H},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(H){var Y=m;return function(){var te=m;m=Y;try{return H.apply(this,arguments)}finally{m=te}}}})(uH);cH.exports=uH;var x3=cH.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 l1e=function(e){var n={},r=F,i=x3,o=Object.assign;function a(d){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+d,w=1;whe||I[re]!==D[he]){var Pe=` -`+I[re].replace(" at new "," at ");return d.displayName&&Pe.includes("")&&(Pe=Pe.replace("",d.displayName)),Pe}while(1<=re&&0<=he);break}}}finally{en=!1,Error.prepareStackTrace=w}return(d=d?d.displayName||d.name:"")?rn(d):""}var fr=Object.prototype.hasOwnProperty,si=[],tr=-1;function li(d){return{current:d}}function Xt(d){0>tr||(d.current=si[tr],si[tr]=null,tr--)}function Mt(d,h){tr++,si[tr]=d.current,d.current=h}var Qo={},En=li(Qo),vr=li(!1),Ea=Qo;function co(d,h){var w=d.type.contextTypes;if(!w)return Qo;var T=d.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===h)return T.__reactInternalMemoizedMaskedChildContext;var I={},D;for(D in w)I[D]=h[D];return T&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=h,d.__reactInternalMemoizedMaskedChildContext=I),I}function ci(d){return d=d.childContextTypes,d!=null}function Rr(){Xt(vr),Xt(En)}function To(d,h,w){if(En.current!==Qo)throw Error(a(168));Mt(En,h),Mt(vr,w)}function Ac(d,h,w){var T=d.stateNode;if(h=h.childContextTypes,typeof T.getChildContext!="function")return w;T=T.getChildContext();for(var I in T)if(!(I in h))throw Error(a(108,U(d)||"Unknown",I));return o({},w,T)}function ui(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||Qo,Ea=En.current,Mt(En,d),Mt(vr,vr.current),!0}function Rc(d,h,w){var T=d.stateNode;if(!T)throw Error(a(169));w?(d=Ac(d,h,Ea),T.__reactInternalMemoizedMergedChildContext=d,Xt(vr),Xt(En),Mt(En,d)):Xt(vr),Mt(vr,w)}var uo=Math.clz32?Math.clz32:Dx,Fu=Math.log,R2=Math.LN2;function Dx(d){return d>>>=0,d===0?32:31-(Fu(d)/R2|0)|0}var Uu=64,Bu=4194304;function ms(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 vd(d,h){var w=d.pendingLanes;if(w===0)return 0;var T=0,I=d.suspendedLanes,D=d.pingedLanes,re=w&268435455;if(re!==0){var he=re&~I;he!==0?T=ms(he):(D&=re,D!==0&&(T=ms(D)))}else re=w&~I,re!==0?T=ms(re):D!==0&&(T=ms(D));if(T===0)return 0;if(h!==0&&h!==T&&!(h&I)&&(I=T&-T,D=h&-h,I>=D||I===16&&(D&4194240)!==0))return h;if(T&4&&(T|=w&16),h=d.entangledLanes,h!==0)for(d=d.entanglements,h&=T;0w;w++)h.push(d);return h}function zu(d,h,w){d.pendingLanes|=h,h!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,h=31-uo(h),d[h]=w}function Ux(d,h){var w=d.pendingLanes&~h;d.pendingLanes=h,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=h,d.mutableReadLanes&=h,d.entangledLanes&=h,h=d.entanglements;var T=d.eventTimes;for(d=d.expirationTimes;0>=re,I-=re,Qs=1<<32-uo(h)+I|w<vn?(Hr=un,un=null):Hr=un.sibling;var In=Ft(_e,un,Re[vn],xt);if(In===null){un===null&&(un=Hr);break}d&&un&&In.alternate===null&&h(_e,un),pe=D(In,pe,vn),gn===null?Pt=In:gn.sibling=In,gn=In,un=Hr}if(vn===Re.length)return w(_e,un),ar&&Js(_e,vn),Pt;if(un===null){for(;vnvn?(Hr=un,un=null):Hr=un.sibling;var Ts=Ft(_e,un,In.value,xt);if(Ts===null){un===null&&(un=Hr);break}d&&un&&Ts.alternate===null&&h(_e,un),pe=D(Ts,pe,vn),gn===null?Pt=Ts:gn.sibling=Ts,gn=Ts,un=Hr}if(In.done)return w(_e,un),ar&&Js(_e,vn),Pt;if(un===null){for(;!In.done;vn++,In=Re.next())In=sn(_e,In.value,xt),In!==null&&(pe=D(In,pe,vn),gn===null?Pt=In:gn.sibling=In,gn=In);return ar&&Js(_e,vn),Pt}for(un=T(_e,un);!In.done;vn++,In=Re.next())In=Xn(un,_e,vn,In.value,xt),In!==null&&(d&&In.alternate!==null&&un.delete(In.key===null?vn:In.key),pe=D(In,pe,vn),gn===null?Pt=In:gn.sibling=In,gn=In);return d&&un.forEach(function(tm){return h(_e,tm)}),ar&&Js(_e,vn),Pt}function ko(_e,pe,Re,xt){if(typeof Re=="object"&&Re!==null&&Re.type===f&&Re.key===null&&(Re=Re.props.children),typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case l:e:{for(var Pt=Re.key,gn=pe;gn!==null;){if(gn.key===Pt){if(Pt=Re.type,Pt===f){if(gn.tag===7){w(_e,gn.sibling),pe=I(gn,Re.props.children),pe.return=_e,_e=pe;break e}}else if(gn.elementType===Pt||typeof Pt=="object"&&Pt!==null&&Pt.$$typeof===M&&Ed(Pt)===gn.type){w(_e,gn.sibling),pe=I(gn,Re.props),pe.ref=Xu(_e,gn,Re),pe.return=_e,_e=pe;break e}w(_e,gn);break}else h(_e,gn);gn=gn.sibling}Re.type===f?(pe=Yl(Re.props.children,_e.mode,xt,Re.key),pe.return=_e,_e=pe):(xt=Jp(Re.type,Re.key,Re.props,null,_e.mode,xt),xt.ref=Xu(_e,pe,Re),xt.return=_e,_e=xt)}return re(_e);case c:e:{for(gn=Re.key;pe!==null;){if(pe.key===gn)if(pe.tag===4&&pe.stateNode.containerInfo===Re.containerInfo&&pe.stateNode.implementation===Re.implementation){w(_e,pe.sibling),pe=I(pe,Re.children||[]),pe.return=_e,_e=pe;break e}else{w(_e,pe);break}else h(_e,pe);pe=pe.sibling}pe=na(Re,_e.mode,xt),pe.return=_e,_e=pe}return re(_e);case M:return gn=Re._init,ko(_e,pe,gn(Re._payload),xt)}if(ne(Re))return Rt(_e,pe,Re,xt);if(R(Re))return Di(_e,pe,Re,xt);La(_e,Re)}return typeof Re=="string"&&Re!==""||typeof Re=="number"?(Re=""+Re,pe!==null&&pe.tag===6?(w(_e,pe.sibling),pe=I(pe,Re),pe.return=_e,_e=pe):(w(_e,pe),pe=Ni(Re,_e.mode,xt),pe.return=_e,_e=pe),re(_e)):w(_e,pe)}return ko}var qu=qx(!0),Yx=qx(!1),xs={},wr=li(xs),Yu=li(xs),Ku=li(xs);function bs(d){if(d===xs)throw Error(a(174));return d}function W0(d,h){Mt(Ku,h),Mt(Yu,d),Mt(wr,xs),d=se(h),Xt(wr),Mt(wr,d)}function Zu(){Xt(wr),Xt(Yu),Xt(Ku)}function Kx(d){var h=bs(Ku.current),w=bs(wr.current);h=H(w,d.type,h),w!==h&&(Mt(Yu,d),Mt(wr,h))}function Dl(d){Yu.current===d&&(Xt(wr),Xt(Yu))}var ue=li(0);function ke(d){for(var h=d;h!==null;){if(h.tag===13){var w=h.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||hs(w)||ps(w)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===d)break;for(;h.sibling===null;){if(h.return===null||h.return===d)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Ce=[];function bt(){for(var d=0;dw?w:4,d(!0);var T=fn.transition;fn.transition={};try{d(!1),h()}finally{Dn=w,fn.transition=T}}function eb(){return Ao().memoizedState}function Jr(d,h,w){var T=Es(d);w={lane:T,action:w,hasEagerState:!1,eagerState:null,next:null},tb(d)?nb(h,w):(K0(d,h,w),w=Li(),d=ea(d,T,w),d!==null&&rb(d,h,T))}function Ri(d,h,w){var T=Es(d),I={lane:T,action:w,hasEagerState:!1,eagerState:null,next:null};if(tb(d))nb(h,I);else{K0(d,h,I);var D=d.alternate;if(d.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var re=h.lastRenderedState,he=D(re,w);if(I.hasEagerState=!0,I.eagerState=he,vs(he,re))return}catch{}finally{}w=Li(),d=ea(d,T,w),d!==null&&rb(d,h,T)}}function tb(d){var h=d.alternate;return d===qt||h!==null&&h===qt}function nb(d,h){Fl=Zi=!0;var w=d.pending;w===null?h.next=h:(h.next=w.next,w.next=h),d.pending=h}function K0(d,h,w){zr!==null&&d.mode&1&&!(mn&2)?(d=h.interleaved,d===null?(w.next=w,ys===null?ys=[h]:ys.push(h)):(w.next=d.next,d.next=w),h.interleaved=w):(d=h.pending,d===null?w.next=w:(w.next=d.next,d.next=w),h.pending=w)}function rb(d,h,w){if(w&4194240){var T=h.lanes;T&=d.pendingLanes,w|=T,h.lanes=w,k0(d,w)}}var tf={readContext:dr,useCallback:Qr,useContext:Qr,useEffect:Qr,useImperativeHandle:Qr,useInsertionEffect:Qr,useLayoutEffect:Qr,useMemo:Qr,useReducer:Qr,useRef:Qr,useState:Qr,useDebugValue:Qr,useDeferredValue:Qr,useTransition:Qr,useMutableSource:Qr,useSyncExternalStore:Qr,useId:Qr,unstable_isNewReconciler:!1},kd={readContext:dr,useCallback:function(d,h){return _s().memoizedState=[d,h===void 0?null:h],d},useContext:dr,useEffect:ef,useImperativeHandle:function(d,h,w){return w=w!=null?w.concat([d]):null,Bl(4194308,4,Id.bind(null,h,d),w)},useLayoutEffect:function(d,h){return Bl(4194308,4,d,h)},useInsertionEffect:function(d,h){return Bl(4,2,d,h)},useMemo:function(d,h){var w=_s();return h=h===void 0?null:h,d=d(),w.memoizedState=[d,h],d},useReducer:function(d,h,w){var T=_s();return h=w!==void 0?w(h):h,T.memoizedState=T.baseState=h,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:h},T.queue=d,d=d.dispatch=Jr.bind(null,qt,d),[T.memoizedState,d]},useRef:function(d){var h=_s();return d={current:d},h.memoizedState=d},useState:Dp,useDebugValue:Od,useDeferredValue:function(d){var h=Dp(d),w=h[0],T=h[1];return ef(function(){var I=fn.transition;fn.transition={};try{T(d)}finally{fn.transition=I}},[d]),w},useTransition:function(){var d=Dp(!1),h=d[0];return d=F2.bind(null,d[1]),_s().memoizedState=d,[h,d]},useMutableSource:function(){},useSyncExternalStore:function(d,h,w){var T=qt,I=_s();if(ar){if(w===void 0)throw Error(a(407));w=w()}else{if(w=h(),zr===null)throw Error(a(349));hr&30||Ad(T,h,w)}I.memoizedState=w;var D={value:w,getSnapshot:h};return I.queue=D,ef(Rd.bind(null,T,D,d),[d]),T.flags|=2048,Ul(9,j0.bind(null,T,D,w,h),void 0,null),w},useId:function(){var d=_s(),h=zr.identifierPrefix;if(ar){var w=Pa,T=Qs;w=(T&~(1<<32-uo(T)-1)).toString(32)+w,h=":"+h+"R"+w,w=Cd++,0$d&&(h.flags|=128,T=!0,Pi(I,!1),h.lanes=4194304)}else{if(!T)if(d=ke(D),d!==null){if(h.flags|=128,T=!0,d=d.updateQueue,d!==null&&(h.updateQueue=d,h.flags|=4),Pi(I,!0),I.tail===null&&I.tailMode==="hidden"&&!D.alternate&&!ar)return Vt(h),null}else 2*fi()-I.renderingStartTime>$d&&w!==1073741824&&(h.flags|=128,T=!0,Pi(I,!1),h.lanes=4194304);I.isBackwards?(D.sibling=h.child,h.child=D):(d=I.last,d!==null?d.sibling=D:h.child=D,I.last=D)}return I.tail!==null?(h=I.tail,I.rendering=h,I.tail=h.sibling,I.renderingStartTime=fi(),h.sibling=null,d=ue.current,Mt(ue,T?d&1|2:d&1),h):(Vt(h),null);case 22:case 23:return hv(),T=h.memoizedState!==null,d!==null&&d.memoizedState!==null!==T&&(h.flags|=8192),T&&h.mode&1?Lo&1073741824&&(Vt(h),$e&&h.subtreeFlags&6&&(h.flags|=8192)):Vt(h),null;case 24:return null;case 25:return null}throw Error(a(156,h.tag))}var B2=s.ReactCurrentOwner,Ro=!1;function Pr(d,h,w,T){h.child=d===null?Yx(h,null,w,T):qu(h,d.child,w,T)}function lb(d,h,w,T,I){w=w.render;var D=h.ref;return Pc(h,I),T=Un(d,h,w,T,D,I),w=G0(),d!==null&&!Ro?(h.updateQueue=d.updateQueue,h.flags&=-2053,d.lanes&=~I,ei(d,h,I)):(ar&&w&&Op(h),h.flags|=1,Pr(d,h,T,I),h.child)}function cb(d,h,w,T,I){if(d===null){var D=w.type;return typeof D=="function"&&!xv(D)&&D.defaultProps===void 0&&w.compare===null&&w.defaultProps===void 0?(h.tag=15,h.type=D,ub(d,h,D,T,I)):(d=Jp(w.type,null,T,h,h.mode,I),d.ref=h.ref,d.return=h,h.child=d)}if(D=d.child,!(d.lanes&I)){var re=D.memoizedProps;if(w=w.compare,w=w!==null?w:Br,w(re,T)&&d.ref===h.ref)return ei(d,h,I)}return h.flags|=1,d=il(D,T),d.ref=h.ref,d.return=h,h.child=d}function ub(d,h,w,T,I){if(d!==null&&Br(d.memoizedProps,T)&&d.ref===h.ref)if(Ro=!1,(d.lanes&I)!==0)d.flags&131072&&(Ro=!0);else return h.lanes=d.lanes,ei(d,h,I);return Oa(d,h,w,T,I)}function fb(d,h,w){var T=h.pendingProps,I=T.children,D=d!==null?d.memoizedState:null;if(T.mode==="hidden")if(!(h.mode&1))h.memoizedState={baseLanes:0,cachePool:null},Mt(lf,Lo),Lo|=w;else if(w&1073741824)h.memoizedState={baseLanes:0,cachePool:null},T=D!==null?D.baseLanes:w,Mt(lf,Lo),Lo|=T;else return d=D!==null?D.baseLanes|w:w,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:d,cachePool:null},h.updateQueue=null,Mt(lf,Lo),Lo|=d,null;else D!==null?(T=D.baseLanes|w,h.memoizedState=null):T=w,Mt(lf,Lo),Lo|=T;return Pr(d,h,I,w),h.child}function db(d,h){var w=h.ref;(d===null&&w!==null||d!==null&&d.ref!==w)&&(h.flags|=512,h.flags|=2097152)}function Oa(d,h,w,T,I){var D=ci(w)?Ea:En.current;return D=co(h,D),Pc(h,I),w=Un(d,h,w,T,D,I),T=G0(),d!==null&&!Ro?(h.updateQueue=d.updateQueue,h.flags&=-2053,d.lanes&=~I,ei(d,h,I)):(ar&&T&&Op(h),h.flags|=1,Pr(d,h,w,I),h.child)}function hb(d,h,w,T,I){if(ci(w)){var D=!0;ui(h)}else D=!1;if(Pc(h,I),h.stateNode===null)d!==null&&(d.alternate=null,h.alternate=null,h.flags|=2),Wx(h,w,T),Vu(h,w,T,I),T=!0;else if(d===null){var re=h.stateNode,he=h.memoizedProps;re.props=he;var Pe=re.context,tt=w.contextType;typeof tt=="object"&&tt!==null?tt=dr(tt):(tt=ci(w)?Ea:En.current,tt=co(h,tt));var wt=w.getDerivedStateFromProps,sn=typeof wt=="function"||typeof re.getSnapshotBeforeUpdate=="function";sn||typeof re.UNSAFE_componentWillReceiveProps!="function"&&typeof re.componentWillReceiveProps!="function"||(he!==T||Pe!==tt)&&$0(h,re,T,tt),Zr=!1;var Ft=h.memoizedState;re.state=Ft,Aa(h,T,re,I),Pe=h.memoizedState,he!==T||Ft!==Pe||vr.current||Zr?(typeof wt=="function"&&(bd(h,w,wt,T),Pe=h.memoizedState),(he=Zr||Vx(h,w,he,T,Ft,Pe,tt))?(sn||typeof re.UNSAFE_componentWillMount!="function"&&typeof re.componentWillMount!="function"||(typeof re.componentWillMount=="function"&&re.componentWillMount(),typeof re.UNSAFE_componentWillMount=="function"&&re.UNSAFE_componentWillMount()),typeof re.componentDidMount=="function"&&(h.flags|=4194308)):(typeof re.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=T,h.memoizedState=Pe),re.props=T,re.state=Pe,re.context=tt,T=he):(typeof re.componentDidMount=="function"&&(h.flags|=4194308),T=!1)}else{re=h.stateNode,z0(d,h),he=h.memoizedProps,tt=h.type===h.elementType?he:yi(h.type,he),re.props=tt,sn=h.pendingProps,Ft=re.context,Pe=w.contextType,typeof Pe=="object"&&Pe!==null?Pe=dr(Pe):(Pe=ci(w)?Ea:En.current,Pe=co(h,Pe));var Xn=w.getDerivedStateFromProps;(wt=typeof Xn=="function"||typeof re.getSnapshotBeforeUpdate=="function")||typeof re.UNSAFE_componentWillReceiveProps!="function"&&typeof re.componentWillReceiveProps!="function"||(he!==sn||Ft!==Pe)&&$0(h,re,T,Pe),Zr=!1,Ft=h.memoizedState,re.state=Ft,Aa(h,T,re,I);var Rt=h.memoizedState;he!==sn||Ft!==Rt||vr.current||Zr?(typeof Xn=="function"&&(bd(h,w,Xn,T),Rt=h.memoizedState),(tt=Zr||Vx(h,w,tt,T,Ft,Rt,Pe)||!1)?(wt||typeof re.UNSAFE_componentWillUpdate!="function"&&typeof re.componentWillUpdate!="function"||(typeof re.componentWillUpdate=="function"&&re.componentWillUpdate(T,Rt,Pe),typeof re.UNSAFE_componentWillUpdate=="function"&&re.UNSAFE_componentWillUpdate(T,Rt,Pe)),typeof re.componentDidUpdate=="function"&&(h.flags|=4),typeof re.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof re.componentDidUpdate!="function"||he===d.memoizedProps&&Ft===d.memoizedState||(h.flags|=4),typeof re.getSnapshotBeforeUpdate!="function"||he===d.memoizedProps&&Ft===d.memoizedState||(h.flags|=1024),h.memoizedProps=T,h.memoizedState=Rt),re.props=T,re.state=Rt,re.context=Pe,T=tt):(typeof re.componentDidUpdate!="function"||he===d.memoizedProps&&Ft===d.memoizedState||(h.flags|=4),typeof re.getSnapshotBeforeUpdate!="function"||he===d.memoizedProps&&Ft===d.memoizedState||(h.flags|=1024),T=!1)}return Q0(d,h,w,T,D,I)}function Q0(d,h,w,T,I,D){db(d,h);var re=(h.flags&128)!==0;if(!T&&!re)return I&&Rc(h,w,!1),ei(d,h,D);T=h.stateNode,B2.current=h;var he=re&&typeof w.getDerivedStateFromError!="function"?null:T.render();return h.flags|=1,d!==null&&re?(h.child=qu(h,d.child,null,D),h.child=qu(h,null,he,D)):Pr(d,h,he,D),h.memoizedState=T.state,I&&Rc(h,w,!0),h.child}function pb(d){var h=d.stateNode;h.pendingContext?To(d,h.pendingContext,h.pendingContext!==h.context):h.context&&To(d,h.context,!1),W0(d,h.containerInfo)}function mb(d,h,w,T,I){return ju(),Md(I),h.flags|=256,Pr(d,h,w,T),h.child}var Up={dehydrated:null,treeContext:null,retryLane:0};function Jo(d){return{baseLanes:d,cachePool:null}}function gb(d,h,w){var T=h.pendingProps,I=ue.current,D=!1,re=(h.flags&128)!==0,he;if((he=re)||(he=d!==null&&d.memoizedState===null?!1:(I&2)!==0),he?(D=!0,h.flags&=-129):(d===null||d.memoizedState!==null)&&(I|=1),Mt(ue,I&1),d===null)return V0(h),d=h.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?(h.mode&1?ps(d)?h.lanes=8:h.lanes=1073741824:h.lanes=1,null):(I=T.children,d=T.fallback,D?(T=h.mode,D=h.child,I={mode:"hidden",children:I},!(T&1)&&D!==null?(D.childLanes=0,D.pendingProps=I):D=jd(I,T,0,null),d=Yl(d,T,w,null),D.return=h,d.return=h,D.sibling=d,h.child=D,h.child.memoizedState=Jo(w),h.memoizedState=Up,d):J0(h,I));if(I=d.memoizedState,I!==null){if(he=I.dehydrated,he!==null){if(re)return h.flags&256?(h.flags&=-257,Bp(d,h,w,Error(a(422)))):h.memoizedState!==null?(h.child=d.child,h.flags|=128,null):(D=T.fallback,I=h.mode,T=jd({mode:"visible",children:T.children},I,0,null),D=Yl(D,I,w,null),D.flags|=2,T.return=h,D.return=h,T.sibling=D,h.child=T,h.mode&1&&qu(h,d.child,null,w),h.child.memoizedState=Jo(w),h.memoizedState=Up,D);if(!(h.mode&1))h=Bp(d,h,w,null);else if(ps(he))h=Bp(d,h,w,Error(a(419)));else if(T=(w&d.childLanes)!==0,Ro||T){if(T=zr,T!==null){switch(w&-w){case 4:D=2;break;case 16:D=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:D=32;break;case 536870912:D=268435456;break;default:D=0}T=D&(T.suspendedLanes|w)?0:D,T!==0&&T!==I.retryLane&&(I.retryLane=T,ea(d,T,-1))}Kp(),h=Bp(d,h,w,Error(a(421)))}else hs(he)?(h.flags|=128,h.child=d.child,h=ql.bind(null,d),Ks(he,h),h=null):(w=I.treeContext,Ae&&(bi=Ma(he),Ki=h,ar=!0,Ia=null,Gu=!1,w!==null&&(fo[ho++]=Qs,fo[ho++]=Pa,fo[ho++]=Nl,Qs=w.id,Pa=w.overflow,Nl=h)),h=J0(h,h.pendingProps.children),h.flags|=4096);return h}return D?(T=yb(d,h,T.children,T.fallback,w),D=h.child,I=d.child.memoizedState,D.memoizedState=I===null?Jo(w):{baseLanes:I.baseLanes|w,cachePool:null},D.childLanes=d.childLanes&~w,h.memoizedState=Up,T):(w=vb(d,h,T.children,w),h.memoizedState=null,w)}return D?(T=yb(d,h,T.children,T.fallback,w),D=h.child,I=d.child.memoizedState,D.memoizedState=I===null?Jo(w):{baseLanes:I.baseLanes|w,cachePool:null},D.childLanes=d.childLanes&~w,h.memoizedState=Up,T):(w=vb(d,h,T.children,w),h.memoizedState=null,w)}function J0(d,h){return h=jd({mode:"visible",children:h},d.mode,0,null),h.return=d,d.child=h}function vb(d,h,w,T){var I=d.child;return d=I.sibling,w=il(I,{mode:"visible",children:w}),!(h.mode&1)&&(w.lanes=T),w.return=h,w.sibling=null,d!==null&&(T=h.deletions,T===null?(h.deletions=[d],h.flags|=16):T.push(d)),h.child=w}function yb(d,h,w,T,I){var D=h.mode;d=d.child;var re=d.sibling,he={mode:"hidden",children:w};return!(D&1)&&h.child!==d?(w=h.child,w.childLanes=0,w.pendingProps=he,h.deletions=null):(w=il(d,he),w.subtreeFlags=d.subtreeFlags&14680064),re!==null?T=il(re,T):(T=Yl(T,D,I,null),T.flags|=2),T.return=h,w.return=h,w.sibling=T,h.child=w,T}function Bp(d,h,w,T){return T!==null&&Md(T),qu(h,d.child,null,w),d=J0(h,h.pendingProps.children),d.flags|=2,h.memoizedState=null,d}function zl(d,h,w){d.lanes|=h;var T=d.alternate;T!==null&&(T.lanes|=h),Pp(d.return,h,w)}function ev(d,h,w,T,I){var D=d.memoizedState;D===null?d.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:T,tail:w,tailMode:I}:(D.isBackwards=h,D.rendering=null,D.renderingStartTime=0,D.last=T,D.tail=w,D.tailMode=I)}function xb(d,h,w){var T=h.pendingProps,I=T.revealOrder,D=T.tail;if(Pr(d,h,T.children,w),T=ue.current,T&2)T=T&1|2,h.flags|=128;else{if(d!==null&&d.flags&128)e:for(d=h.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&zl(d,w,h);else if(d.tag===19)zl(d,w,h);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===h)break e;for(;d.sibling===null;){if(d.return===null||d.return===h)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}T&=1}if(Mt(ue,T),!(h.mode&1))h.memoizedState=null;else switch(I){case"forwards":for(w=h.child,I=null;w!==null;)d=w.alternate,d!==null&&ke(d)===null&&(I=w),w=w.sibling;w=I,w===null?(I=h.child,h.child=null):(I=w.sibling,w.sibling=null),ev(h,!1,I,w,D);break;case"backwards":for(w=null,I=h.child,h.child=null;I!==null;){if(d=I.alternate,d!==null&&ke(d)===null){h.child=I;break}d=I.sibling,I.sibling=w,w=I,I=d}ev(h,!0,w,null,D);break;case"together":ev(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function ei(d,h,w){if(d!==null&&(h.dependencies=d.dependencies),uf|=h.lanes,!(w&h.childLanes))return null;if(d!==null&&h.child!==d.child)throw Error(a(153));if(h.child!==null){for(d=h.child,w=il(d,d.pendingProps),h.child=w,w.return=h;d.sibling!==null;)d=d.sibling,w=w.sibling=il(d,d.pendingProps),w.return=h;w.sibling=null}return h.child}function z2(d,h,w){switch(h.tag){case 3:pb(h),ju();break;case 5:Kx(h);break;case 1:ci(h.type)&&ui(h);break;case 4:W0(h,h.stateNode.containerInfo);break;case 10:U0(h,h.type._context,h.memoizedProps.value);break;case 13:var T=h.memoizedState;if(T!==null)return T.dehydrated!==null?(Mt(ue,ue.current&1),h.flags|=128,null):w&h.child.childLanes?gb(d,h,w):(Mt(ue,ue.current&1),d=ei(d,h,w),d!==null?d.sibling:null);Mt(ue,ue.current&1);break;case 19:if(T=(w&h.childLanes)!==0,d.flags&128){if(T)return xb(d,h,w);h.flags|=128}var I=h.memoizedState;if(I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),Mt(ue,ue.current),T)break;return null;case 22:case 23:return h.lanes=0,fb(d,h,w)}return ei(d,h,w)}function $2(d,h){switch(Yi(h),h.tag){case 1:return ci(h.type)&&Rr(),d=h.flags,d&65536?(h.flags=d&-65537|128,h):null;case 3:return Zu(),Xt(vr),Xt(En),bt(),d=h.flags,d&65536&&!(d&128)?(h.flags=d&-65537|128,h):null;case 5:return Dl(h),null;case 13:if(Xt(ue),d=h.memoizedState,d!==null&&d.dehydrated!==null){if(h.alternate===null)throw Error(a(340));ju()}return d=h.flags,d&65536?(h.flags=d&-65537|128,h):null;case 19:return Xt(ue),null;case 4:return Zu(),null;case 10:return Rp(h.type._context),null;case 22:case 23:return hv(),null;case 24:return null;default:return null}}var zp=!1,Dc=!1,H2=typeof WeakSet=="function"?WeakSet:Set,mt=null;function Fd(d,h){var w=d.ref;if(w!==null)if(typeof w=="function")try{w(null)}catch(T){ki(d,h,T)}else w.current=null}function tv(d,h,w){try{w()}catch(T){ki(d,h,T)}}var bb=!1;function nv(d,h){for(Y(d.containerInfo),mt=h;mt!==null;)if(d=mt,h=d.child,(d.subtreeFlags&1028)!==0&&h!==null)h.return=d,mt=h;else for(;mt!==null;){d=mt;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 T=w.memoizedProps,I=w.memoizedState,D=d.stateNode,re=D.getSnapshotBeforeUpdate(d.elementType===d.type?T:yi(d.type,T),I);D.__reactInternalSnapshotBeforeUpdate=re}break;case 3:$e&&ut(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(he){ki(d,d.return,he)}if(h=d.sibling,h!==null){h.return=d.return,mt=h;break}mt=d.return}return w=bb,bb=!1,w}function ka(d,h,w){var T=h.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var I=T=T.next;do{if((I.tag&d)===d){var D=I.destroy;I.destroy=void 0,D!==void 0&&tv(h,w,D)}I=I.next}while(I!==T)}}function $l(d,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var w=h=h.next;do{if((w.tag&d)===d){var T=w.create;w.destroy=T()}w=w.next}while(w!==h)}}function rv(d){var h=d.ref;if(h!==null){var w=d.stateNode;switch(d.tag){case 5:d=ie(w);break;default:d=w}typeof h=="function"?h(d):h.current=d}}function iv(d,h,w){if(gs&&typeof gs.onCommitFiberUnmount=="function")try{gs.onCommitFiberUnmount(Ep,h)}catch{}switch(h.tag){case 0:case 11:case 14:case 15:if(d=h.updateQueue,d!==null&&(d=d.lastEffect,d!==null)){var T=d=d.next;do{var I=T,D=I.destroy;I=I.tag,D!==void 0&&(I&2||I&4)&&tv(h,w,D),T=T.next}while(T!==d)}break;case 1:if(Fd(h,w),d=h.stateNode,typeof d.componentWillUnmount=="function")try{d.props=h.memoizedProps,d.state=h.memoizedState,d.componentWillUnmount()}catch(re){ki(h,w,re)}break;case 5:Fd(h,w);break;case 4:$e?av(d,h,w):oe&&oe&&(h=h.stateNode.containerInfo,w=Ne(h),xn(h,w))}}function _b(d,h,w){for(var T=h;;)if(iv(d,T,w),T.child===null||$e&&T.tag===4){if(T===h)break;for(;T.sibling===null;){if(T.return===null||T.return===h)return;T=T.return}T.sibling.return=T.return,T=T.sibling}else T.child.return=T,T=T.child}function Ms(d){var h=d.alternate;h!==null&&(d.alternate=null,Ms(h)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(h=d.stateNode,h!==null&&We(h)),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 $p(d){return d.tag===5||d.tag===3||d.tag===4}function Hl(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||$p(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 Po(d){if($e){e:{for(var h=d.return;h!==null;){if($p(h))break e;h=h.return}throw Error(a(160))}var w=h;switch(w.tag){case 5:h=w.stateNode,w.flags&32&&(Nt(h),w.flags&=-33),w=Hl(d),Hp(d,w,h);break;case 3:case 4:h=w.stateNode.containerInfo,w=Hl(d),ov(d,w,h);break;default:throw Error(a(161))}}}function ov(d,h,w){var T=d.tag;if(T===5||T===6)d=d.stateNode,h?Oe(w,d,h):De(w,d);else if(T!==4&&(d=d.child,d!==null))for(ov(d,h,w),d=d.sibling;d!==null;)ov(d,h,w),d=d.sibling}function Hp(d,h,w){var T=d.tag;if(T===5||T===6)d=d.stateNode,h?Ze(w,d,h):Me(w,d);else if(T!==4&&(d=d.child,d!==null))for(Hp(d,h,w),d=d.sibling;d!==null;)Hp(d,h,w),d=d.sibling}function av(d,h,w){for(var T=h,I=!1,D,re;;){if(!I){I=T.return;e:for(;;){if(I===null)throw Error(a(160));switch(D=I.stateNode,I.tag){case 5:re=!1;break e;case 3:D=D.containerInfo,re=!0;break e;case 4:D=D.containerInfo,re=!0;break e}I=I.return}I=!0}if(T.tag===5||T.tag===6)_b(d,T,w),re?Et(D,T.stateNode):Ut(D,T.stateNode);else if(T.tag===18)re?Ee(D,T.stateNode):Se(D,T.stateNode);else if(T.tag===4){if(T.child!==null){D=T.stateNode.containerInfo,re=!0,T.child.return=T,T=T.child;continue}}else if(iv(d,T,w),T.child!==null){T.child.return=T,T=T.child;continue}if(T===h)break;for(;T.sibling===null;){if(T.return===null||T.return===h)return;T=T.return,T.tag===4&&(I=!1)}T.sibling.return=T.return,T=T.sibling}}function Fc(d,h){if($e){switch(h.tag){case 0:case 11:case 14:case 15:ka(3,h,h.return),$l(3,h),ka(5,h,h.return);return;case 1:return;case 5:var w=h.stateNode;if(w!=null){var T=h.memoizedProps;d=d!==null?d.memoizedProps:T;var I=h.type,D=h.updateQueue;h.updateQueue=null,D!==null&&At(w,D,I,d,T,h)}return;case 6:if(h.stateNode===null)throw Error(a(162));w=h.memoizedProps,je(h.stateNode,d!==null?d.memoizedProps:w,w);return;case 3:Ae&&d!==null&&d.memoizedState.isDehydrated&&fe(h.stateNode.containerInfo);return;case 12:return;case 13:Na(h);return;case 19:Na(h);return;case 17:return}throw Error(a(163))}switch(h.tag){case 0:case 11:case 14:case 15:ka(3,h,h.return),$l(3,h),ka(5,h,h.return);return;case 12:return;case 13:Na(h);return;case 19:Na(h);return;case 3:Ae&&d!==null&&d.memoizedState.isDehydrated&&fe(h.stateNode.containerInfo);break;case 22:case 23:return}e:if(oe){switch(h.tag){case 1:case 5:case 6:break e;case 3:case 4:h=h.stateNode,xn(h.containerInfo,h.pendingChildren);break e}throw Error(a(163))}}function Na(d){var h=d.updateQueue;if(h!==null){d.updateQueue=null;var w=d.stateNode;w===null&&(w=d.stateNode=new H2),h.forEach(function(T){var I=Rb.bind(null,d,T);w.has(T)||(w.add(T),T.then(I,I))})}}function wb(d,h){for(mt=h;mt!==null;){h=mt;var w=h.deletions;if(w!==null)for(var T=0;T";case Bd:return":has("+(zd(d)||"")+")";case Io:return'[role="'+d.value+'"]';case Uc:return'"'+d.value+'"';case af:return'[data-testname="'+d.value+'"]';default:throw Error(a(365))}}function Mb(d,h){var w=[];d=[d,0];for(var T=0;TI&&(I=re),T&=~D}if(T=I,T=fi()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*W2(T/1960))-T,10d?16:d,rl===null)var T=!1;else{if(d=rl,rl=null,Vd=0,mn&6)throw Error(a(331));var I=mn;for(mn|=4,mt=d.current;mt!==null;){var D=mt,re=D.child;if(mt.flags&16){var he=D.deletions;if(he!==null){for(var Pe=0;Pefi()-fv?Cs(d,0):uv|=w),$t(d,h)}function Ab(d,h){h===0&&(d.mode&1?(h=Bu,Bu<<=1,!(Bu&130023424)&&(Bu=4194304)):h=1);var w=Li();d=hf(d,h),d!==null&&(zu(d,h,w),$t(d,w))}function ql(d){var h=d.memoizedState,w=0;h!==null&&(w=h.retryLane),Ab(d,w)}function Rb(d,h){var w=0;switch(d.tag){case 13:var T=d.stateNode,I=d.memoizedState;I!==null&&(w=I.retryLane);break;case 19:T=d.stateNode;break;default:throw Error(a(314))}T!==null&&T.delete(h),Ab(d,w)}var yv;yv=function(d,h,w){if(d!==null)if(d.memoizedProps!==h.pendingProps||vr.current)Ro=!0;else{if(!(d.lanes&w)&&!(h.flags&128))return Ro=!1,z2(d,h,w);Ro=!!(d.flags&131072)}else Ro=!1,ar&&h.flags&1048576&&Gx(h,wd,h.index);switch(h.lanes=0,h.tag){case 2:var T=h.type;d!==null&&(d.alternate=null,h.alternate=null,h.flags|=2),d=h.pendingProps;var I=co(h,En.current);Pc(h,w),I=Un(null,h,T,d,I,w);var D=G0();return h.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,ci(T)?(D=!0,ui(h)):D=!1,h.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,B0(h),I.updater=Lp,h.stateNode=I,I._reactInternals=h,Vu(h,T,d,w),h=Q0(null,h,T,!0,D,w)):(h.tag=0,ar&&D&&Op(h),Pr(null,h,I,w),h=h.child),h;case 16:T=h.elementType;e:{switch(d!==null&&(d.alternate=null,h.alternate=null,h.flags|=2),d=h.pendingProps,I=T._init,T=I(T._payload),h.type=T,I=h.tag=Pb(T),d=yi(T,d),I){case 0:h=Oa(null,h,T,d,w);break e;case 1:h=hb(null,h,T,d,w);break e;case 11:h=lb(null,h,T,d,w);break e;case 14:h=cb(null,h,T,yi(T.type,d),w);break e}throw Error(a(306,T,""))}return h;case 0:return T=h.type,I=h.pendingProps,I=h.elementType===T?I:yi(T,I),Oa(d,h,T,I,w);case 1:return T=h.type,I=h.pendingProps,I=h.elementType===T?I:yi(T,I),hb(d,h,T,I,w);case 3:e:{if(pb(h),d===null)throw Error(a(387));T=h.pendingProps,D=h.memoizedState,I=D.element,z0(d,h),Aa(h,T,null,w);var re=h.memoizedState;if(T=re.element,Ae&&D.isDehydrated)if(D={element:T,isDehydrated:!1,cache:re.cache,transitions:re.transitions},h.updateQueue.baseState=D,h.memoizedState=D,h.flags&256){I=Error(a(423)),h=mb(d,h,T,w,I);break e}else if(T!==I){I=Error(a(424)),h=mb(d,h,T,w,I);break e}else for(Ae&&(bi=Zo(h.stateNode.containerInfo),Ki=h,ar=!0,Ia=null,Gu=!1),w=Yx(h,null,T,w),h.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling;else{if(ju(),T===I){h=ei(d,h,w);break e}Pr(d,h,T,w)}h=h.child}return h;case 5:return Kx(h),d===null&&V0(h),T=h.type,I=h.pendingProps,D=d!==null?d.memoizedProps:null,re=I.children,Te(T,I)?re=null:D!==null&&Te(T,D)&&(h.flags|=32),db(d,h),Pr(d,h,re,w),h.child;case 6:return d===null&&V0(h),null;case 13:return gb(d,h,w);case 4:return W0(h,h.stateNode.containerInfo),T=h.pendingProps,d===null?h.child=qu(h,null,T,w):Pr(d,h,T,w),h.child;case 11:return T=h.type,I=h.pendingProps,I=h.elementType===T?I:yi(T,I),lb(d,h,T,I,w);case 7:return Pr(d,h,h.pendingProps,w),h.child;case 8:return Pr(d,h,h.pendingProps.children,w),h.child;case 12:return Pr(d,h,h.pendingProps.children,w),h.child;case 10:e:{if(T=h.type._context,I=h.pendingProps,D=h.memoizedProps,re=I.value,U0(h,T,re),D!==null)if(vs(D.value,re)){if(D.children===I.children&&!vr.current){h=ei(d,h,w);break e}}else for(D=h.child,D!==null&&(D.return=h);D!==null;){var he=D.dependencies;if(he!==null){re=D.child;for(var Pe=he.firstContext;Pe!==null;){if(Pe.context===T){if(D.tag===1){Pe=Ai(-1,w&-w),Pe.tag=2;var tt=D.updateQueue;if(tt!==null){tt=tt.shared;var wt=tt.pending;wt===null?Pe.next=Pe:(Pe.next=wt.next,wt.next=Pe),tt.pending=Pe}}D.lanes|=w,Pe=D.alternate,Pe!==null&&(Pe.lanes|=w),Pp(D.return,w,h),he.lanes|=w;break}Pe=Pe.next}}else if(D.tag===10)re=D.type===h.type?null:D.child;else if(D.tag===18){if(re=D.return,re===null)throw Error(a(341));re.lanes|=w,he=re.alternate,he!==null&&(he.lanes|=w),Pp(re,w,h),re=D.sibling}else re=D.child;if(re!==null)re.return=D;else for(re=D;re!==null;){if(re===h){re=null;break}if(D=re.sibling,D!==null){D.return=re.return,re=D;break}re=re.return}D=re}Pr(d,h,I.children,w),h=h.child}return h;case 9:return I=h.type,T=h.pendingProps.children,Pc(h,w),I=dr(I),T=T(I),h.flags|=1,Pr(d,h,T,w),h.child;case 14:return T=h.type,I=yi(T,h.pendingProps),I=yi(T.type,I),cb(d,h,T,I,w);case 15:return ub(d,h,h.type,h.pendingProps,w);case 17:return T=h.type,I=h.pendingProps,I=h.elementType===T?I:yi(T,I),d!==null&&(d.alternate=null,h.alternate=null,h.flags|=2),h.tag=1,ci(T)?(d=!0,ui(h)):d=!1,Pc(h,w),Wx(h,T,I),Vu(h,T,I,w),Q0(null,h,T,!0,d,w);case 19:return xb(d,h,w);case 22:return fb(d,h,w)}throw Error(a(156,h.tag))};function Qp(d,h){return Mp(d,h)}function G2(d,h,w,T){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=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ta(d,h,w,T){return new G2(d,h,w,T)}function xv(d){return d=d.prototype,!(!d||!d.isReactComponent)}function Pb(d){if(typeof d=="function")return xv(d)?1:0;if(d!=null){if(d=d.$$typeof,d===_)return 11;if(d===S)return 14}return 2}function il(d,h){var w=d.alternate;return w===null?(w=ta(d.tag,h,d.key,d.mode),w.elementType=d.elementType,w.type=d.type,w.stateNode=d.stateNode,w.alternate=d,d.alternate=w):(w.pendingProps=h,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,h=d.dependencies,w.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},w.sibling=d.sibling,w.index=d.index,w.ref=d.ref,w}function Jp(d,h,w,T,I,D){var re=2;if(T=d,typeof d=="function")xv(d)&&(re=1);else if(typeof d=="string")re=5;else e:switch(d){case f:return Yl(w.children,I,D,h);case p:re=8,I|=8;break;case m:return d=ta(12,w,h,I|2),d.elementType=m,d.lanes=D,d;case b:return d=ta(13,w,h,I),d.elementType=b,d.lanes=D,d;case y:return d=ta(19,w,h,I),d.elementType=y,d.lanes=D,d;case C:return jd(w,I,D,h);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case v:re=10;break e;case x:re=9;break e;case _:re=11;break e;case S:re=14;break e;case M:re=16,T=null;break e}throw Error(a(130,d==null?d:typeof d,""))}return h=ta(re,w,h,I),h.elementType=d,h.type=T,h.lanes=D,h}function Yl(d,h,w,T){return d=ta(7,d,T,h),d.lanes=w,d}function jd(d,h,w,T){return d=ta(22,d,T,h),d.elementType=C,d.lanes=w,d.stateNode={},d}function Ni(d,h,w){return d=ta(6,d,null,h),d.lanes=w,d}function na(d,h,w){return h=ta(4,d.children!==null?d.children:[],d.key,h),h.lanes=w,h.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},h}function j2(d,h,w,T,I){this.tag=h,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ct,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sp(0),this.expirationTimes=Sp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sp(0),this.identifierPrefix=T,this.onRecoverableError=I,Ae&&(this.mutableSourceEagerHydrationData=null)}function Ib(d,h,w,T,I,D,re,he,Pe){return d=new j2(d,h,w,he,Pe),h===1?(h=1,D===!0&&(h|=8)):h=0,D=ta(3,null,null,h),d.current=D,D.stateNode=d,D.memoizedState={element:T,isDehydrated:w,cache:null,transitions:null},B0(D),d}function Xd(d){if(!d)return Qo;d=d._reactInternals;e:{if(k(d)!==d||d.tag!==1)throw Error(a(170));var h=d;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(ci(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(a(171))}if(d.tag===1){var w=d.type;if(ci(w))return Ac(d,w,h)}return h}function $c(d){var h=d._reactInternals;if(h===void 0)throw typeof d.render=="function"?Error(a(188)):(d=Object.keys(d).join(","),Error(a(268,d)));return d=K(h),d===null?null:d.stateNode}function bv(d,h){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var w=d.retryLane;d.retryLane=w!==0&&w=tt&&D>=sn&&I<=wt&&re<=Ft){d.splice(h,1);break}else if(T!==tt||w.width!==Pe.width||Ftre){if(!(D!==sn||w.height!==Pe.height||wtI)){tt>T&&(Pe.width+=tt-T,Pe.x=T),wtD&&(Pe.height+=sn-D,Pe.y=D),Ftw&&(w=re)),re ")+` - -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 ie(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:s.ReactCurrentDispatcher,findHostInstanceByFiber:X2,findFiberByHostInstance:d.findFiberByHostInstance||Lb,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 h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)d=!0;else{try{Ep=h.inject(d),gs=h}catch{}d=!!h.checkDCE}}return d},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(d,h,w,T){if(!ft)throw Error(a(363));d=lv(d,h);var I=Le(d,w,T).disconnect;return{disconnect:function(){I()}}},n.registerMutableSourceForHydration=function(d,h){var w=h._getVersion;w=w(h._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[h,w]:d.mutableSourceEagerHydrationData.push(h,w)},n.runWithPriority=function(d,h){var w=Dn;try{return Dn=d,h()}finally{Dn=w}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(d,h,w,T){var I=h.current,D=Li(),re=Es(I);return w=Xd(w),h.context===null?h.context=w:h.pendingContext=w,h=Ai(D,re),h.payload={element:d},T=T===void 0?null:T,T!==null&&(h.callback=T),Ta(I,h),d=ea(I,re,D),d!==null&&Hu(d,I,re),re},n};lH.exports=l1e;var c1e=lH.exports;const u1e=Au(c1e),_L={},fH=t=>void Object.assign(_L,t);function f1e(t,e){function n(f,{args:p=[],attach:m,...v},x){let _=`${f[0].toUpperCase()}${f.slice(1)}`,b;if(f==="primitive"){if(v.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const y=v.object;b=$m(y,{type:f,root:x,attach:m,primitive:!0})}else{const y=_L[_];if(!y)throw new Error(`R3F: ${_} 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(p))throw new Error("R3F: The args prop must be an array!");b=$m(new y(...p),{type:f,root:x,attach:m,memoizedProps:{args:p}})}return b.__r3f.attach===void 0&&(b instanceof An?b.__r3f.attach="geometry":b instanceof so&&(b.__r3f.attach="material")),_!=="inject"&&DT(b,v),b}function r(f,p){let m=!1;if(p){var v,x;(v=p.__r3f)!=null&&v.attach?NT(f,p,p.__r3f.attach):p.isObject3D&&f.isObject3D&&(f.add(p),m=!0),m||(x=f.__r3f)==null||x.objects.push(p),p.__r3f||$m(p,{}),p.__r3f.parent=f,_3(p),Hm(p)}}function i(f,p,m){let v=!1;if(p){var x,_;if((x=p.__r3f)!=null&&x.attach)NT(f,p,p.__r3f.attach);else if(p.isObject3D&&f.isObject3D){p.parent=f,p.dispatchEvent({type:"added"});const b=f.children.filter(S=>S!==p),y=b.indexOf(m);f.children=[...b.slice(0,y),p,...b.slice(y)],v=!0}v||(_=f.__r3f)==null||_.objects.push(p),p.__r3f||$m(p,{}),p.__r3f.parent=f,_3(p),Hm(p)}}function o(f,p,m=!1){f&&[...f].forEach(v=>a(p,v,m))}function a(f,p,m){if(p){var v,x,_;if(p.__r3f&&(p.__r3f.parent=null),(v=f.__r3f)!=null&&v.objects&&(f.__r3f.objects=f.__r3f.objects.filter(C=>C!==p)),(x=p.__r3f)!=null&&x.attach)KD(f,p,p.__r3f.attach);else if(p.isObject3D&&f.isObject3D){var b;f.remove(p),(b=p.__r3f)!=null&&b.root&&x1e(p.__r3f.root,p)}const S=(_=p.__r3f)==null?void 0:_.primitive,M=m===void 0?p.dispose!==null&&!S:m;if(!S){var y;o((y=p.__r3f)==null?void 0:y.objects,p,M),o(p.children,p,M)}delete p.__r3f,M&&p.dispose&&p.type!=="Scene"&&x3.unstable_scheduleCallback(x3.unstable_IdlePriority,()=>{try{p.dispose()}catch{}}),Hm(f)}}function s(f,p,m,v){var x;const _=(x=f.__r3f)==null?void 0:x.parent;if(!_)return;const b=n(p,m,f.__r3f.root);if(f.children){for(const y of f.children)y.__r3f&&r(b,y);f.children=f.children.filter(y=>!y.__r3f)}f.__r3f.objects.forEach(y=>r(b,y)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||a(_,f),b.parent&&(b.__r3f.autoRemovedBeforeAppend=!0),r(_,b),b.raycast&&b.__r3f.eventCount&&b.__r3f.root.getState().internal.interaction.push(b),[v,v.alternate].forEach(y=>{y!==null&&(y.stateNode=b,y.ref&&(typeof y.ref=="function"?y.ref(b):y.ref.current=b))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:u1e({createInstance:n,removeChild:a,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,p)=>{if(!p)return;const m=f.getState().scene;m.__r3f&&(m.__r3f.root=f,r(m,p))},removeChildFromContainer:(f,p)=>{p&&a(f.getState().scene,p)},insertInContainerBefore:(f,p,m)=>{if(!p||!m)return;const v=f.getState().scene;v.__r3f&&i(v,p,m)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var p;return!!((p=f==null?void 0:f.__r3f)!=null?p:{}).handlers},prepareUpdate(f,p,m,v){var x;if(((x=f==null?void 0:f.__r3f)!=null?x:{}).primitive&&v.object&&v.object!==f)return[!0];{const{args:b=[],children:y,...S}=v,{args:M=[],children:C,...A}=m;if(!Array.isArray(b))throw new Error("R3F: the args prop must be an array!");if(b.some((P,U)=>P!==M[U]))return[!0];const R=yH(f,S,A,!0);return R.changes.length?[!1,R]:null}},commitUpdate(f,[p,m],v,x,_,b){p?s(f,v,_,b):DT(f,m)},commitMount(f,p,m,v){var x;const _=(x=f.__r3f)!=null?x:{};f.raycast&&_.handlers&&_.eventCount&&f.__r3f.root.getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>$m(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var p;const{attach:m,parent:v}=(p=f.__r3f)!=null?p:{};m&&v&&KD(v,f,m),f.isObject3D&&(f.visible=!1),Hm(f)},unhideInstance(f,p){var m;const{attach:v,parent:x}=(m=f.__r3f)!=null?m:{};v&&x&&NT(x,f,v),(f.isObject3D&&p.visible==null||p.visible)&&(f.visible=!0),Hm(f)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():wg.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Mr.fun(performance.now)?performance.now:Mr.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Mr.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Mr.fun(clearTimeout)?clearTimeout:void 0}),applyProps:DT}}var jD,XD;const kT=t=>"colorSpace"in t||"outputColorSpace"in t,dH=()=>{var t;return(t=_L.ColorManagement)!=null?t:null},hH=t=>t&&t.isOrthographicCamera,d1e=t=>t&&t.hasOwnProperty("current"),_x=typeof window<"u"&&((jD=window.document)!=null&&jD.createElement||((XD=window.navigator)==null?void 0:XD.product)==="ReactNative")?F.useLayoutEffect:F.useEffect;function pH(t){const e=F.useRef(t);return _x(()=>void(e.current=t),[t]),e}function h1e({set:t}){return _x(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class mH extends F.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}mH.getDerivedStateFromError=()=>({error:!0});const gH="__default",qD=new Map,p1e=t=>t&&!!t.memoized&&!!t.changes;function vH(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 qv=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()},Mr={obj:t=>t===Object(t)&&!Mr.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(Mr.str(t)||Mr.num(t))return t===e;const o=Mr.obj(t);if(o&&r==="reference")return t===e;const a=Mr.arr(t);if(a&&n==="reference")return t===e;if((a||o)&&t===e)return!0;let s;for(s in t)if(!(s in e))return!1;if(o&&n==="shallow"&&r==="shallow"){for(s in i?e:t)if(!Mr.equ(t[s],e[s],{strict:i,objects:"reference"}))return!1}else for(s in i?e:t)if(t[s]!==e[s])return!1;if(Mr.und(s)){if(a&&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 m1e(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function $m(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function b3(t,e){let n=t;if(e.includes("-")){const r=e.split("-"),i=r.pop();return n=r.reduce((o,a)=>o[a],t),{target:n,key:i}}else return{target:n,key:e}}const YD=/-\d+$/;function NT(t,e,n){if(Mr.str(n)){if(YD.test(n)){const o=n.replace(YD,""),{target:a,key:s}=b3(t,o);Array.isArray(a[s])||(a[s]=[])}const{target:r,key:i}=b3(t,n);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=n(t,e)}function KD(t,e,n){var r,i;if(Mr.str(n)){const{target:o,key:a}=b3(t,n),s=e.__r3f.previousAttach;s===void 0?delete o[a]:o[a]=s}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(t,e);(i=e.__r3f)==null||delete i.previousAttach}function yH(t,{children:e,key:n,ref:r,...i},{children:o,key:a,ref:s,...l}={},c=!1){var f;const p=(f=t==null?void 0:t.__r3f)!=null?f:{},m=Object.entries(i),v=[];if(c){const _=Object.keys(l);for(let b=0;b<_.length;b++)i.hasOwnProperty(_[b])||m.unshift([_[b],gH+"remove"])}m.forEach(([_,b])=>{var y;if((y=t.__r3f)!=null&&y.primitive&&_==="object"||Mr.equ(b,l[_]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(_))return v.push([_,b,!0,[]]);let S=[];_.includes("-")&&(S=_.split("-")),v.push([_,b,!1,S]);for(const M in i){const C=i[M];M.startsWith(`${_}-`)&&v.push([M,C,!1,M.split("-")])}});const x={...i};return p.memoizedProps&&p.memoizedProps.args&&(x.args=p.memoizedProps.args),p.memoizedProps&&p.memoizedProps.attach&&(x.attach=p.memoizedProps.attach),{memoized:x,changes:v}}const g1e=typeof process<"u"&&!1;function DT(t,e){var n,r,i;const o=(n=t.__r3f)!=null?n:{},a=o.root,s=(r=a==null||a.getState==null?void 0:a.getState())!=null?r:{},{memoized:l,changes:c}=p1e(e)?e:yH(t,e),f=o.eventCount;t.__r3f&&(t.__r3f.memoizedProps=l);for(let m=0;mM[C],t),!(S&&S.set))){const[M,...C]=b.reverse();y=C.reverse().reduce((A,R)=>A[R],t),v=M}if(x===gH+"remove")if(y.constructor){let M=qD.get(y.constructor);M||(M=new y.constructor,qD.set(y.constructor,M)),x=M[v]}else x=0;if(_)x?o.handlers[v]=x:delete o.handlers[v],o.eventCount=Object.keys(o.handlers).length;else if(S&&S.set&&(S.copy||S instanceof Bh)){if(Array.isArray(x))S.fromArray?S.fromArray(x):S.set(...x);else if(S.copy&&x&&x.constructor&&(g1e?S.constructor.name===x.constructor.name:S.constructor===x.constructor))S.copy(x);else if(x!==void 0){const M=S instanceof _t;!M&&S.setScalar?S.setScalar(x):S instanceof Bh&&x instanceof Bh?S.mask=x.mask:S.set(x),!dH()&&!s.linear&&M&&S.convertSRGBToLinear()}}else if(y[v]=x,y[v]instanceof Kr&&y[v].format===Wo&&y[v].type===os){const M=y[v];kT(M)&&kT(s.gl)?M.colorSpace=s.gl.outputColorSpace:M.encoding=s.gl.outputEncoding}Hm(t)}if(o.parent&&s.internal&&t.raycast&&f!==o.eventCount){const m=s.internal.interaction.indexOf(t);m>-1&&s.internal.interaction.splice(m,1),o.eventCount&&s.internal.interaction.push(t)}return!(c.length===1&&c[0][0]==="onUpdate")&&c.length&&(i=t.__r3f)!=null&&i.parent&&_3(t),t}function Hm(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 _3(t){t.onUpdate==null||t.onUpdate(t)}function v1e(t,e){t.manual||(hH(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 ow(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function y1e(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return wg.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return wg.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return wg.ContinuousEventPriority;default:return wg.DefaultEventPriority}}function xH(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function x1e(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)=>{xH(n.capturedMap,e,r,i)})}function b1e(t){function e(l){const{internal:c}=t.getState(),f=l.offsetX-c.initialClick[0],p=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(f*f+p*p))}function n(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(f=>{var p;return(p=c.__r3f)==null?void 0:p.handlers["onPointer"+f]}))}function r(l,c){const f=t.getState(),p=new Set,m=[],v=c?c(f.internal.interaction):f.internal.interaction;for(let y=0;y{const M=qv(y.object),C=qv(S.object);return!M||!C?y.distance-S.distance:C.events.priority-M.events.priority||y.distance-S.distance}).filter(y=>{const S=ow(y);return p.has(S)?!1:(p.add(S),!0)});f.events.filter&&(_=f.events.filter(_,f));for(const y of _){let S=y.object;for(;S;){var b;(b=S.__r3f)!=null&&b.eventCount&&m.push({...y,eventObject:S}),S=S.parent}}if("pointerId"in l&&f.internal.capturedMap.has(l.pointerId))for(let y of f.internal.capturedMap.get(l.pointerId).values())p.has(ow(y.intersection))||m.push(y.intersection);return m}function i(l,c,f,p){const m=t.getState();if(l.length){const v={stopped:!1};for(const x of l){const _=qv(x.object)||m,{raycaster:b,pointer:y,camera:S,internal:M}=_,C=new q(y.x,y.y,0).unproject(S),A=N=>{var z,K;return(z=(K=M.capturedMap.get(N))==null?void 0:K.has(x.eventObject))!=null?z:!1},R=N=>{const z={intersection:x,target:c.target};M.capturedMap.has(N)?M.capturedMap.get(N).set(x.eventObject,z):M.capturedMap.set(N,new Map([[x.eventObject,z]])),c.target.setPointerCapture(N)},P=N=>{const z=M.capturedMap.get(N);z&&xH(M.capturedMap,x.eventObject,z,N)};let U={};for(let N in c){let z=c[N];typeof z!="function"&&(U[N]=z)}let k={...x,...U,pointer:y,intersections:l,stopped:v.stopped,delta:f,unprojectedPoint:C,ray:b.ray,camera:S,stopPropagation(){const N="pointerId"in c&&M.capturedMap.get(c.pointerId);if((!N||N.has(x.eventObject))&&(k.stopped=v.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(z=>z.eventObject===x.eventObject))){const z=l.slice(0,l.indexOf(x));o([...z,x])}},target:{hasPointerCapture:A,setPointerCapture:R,releasePointerCapture:P},currentTarget:{hasPointerCapture:A,setPointerCapture:R,releasePointerCapture:P},nativeEvent:c};if(p(k),v.stopped===!0)break}}return l}function o(l){const{internal:c}=t.getState();for(const f of c.hovered.values())if(!l.length||!l.find(p=>p.object===f.object&&p.index===f.index&&p.instanceId===f.instanceId)){const m=f.eventObject.__r3f,v=m==null?void 0:m.handlers;if(c.hovered.delete(ow(f)),m!=null&&m.eventCount){const x={...f,intersections:l};v.onPointerOut==null||v.onPointerOut(x),v.onPointerLeave==null||v.onPointerLeave(x)}}}function a(l,c){for(let f=0;fo([]);case"onLostPointerCapture":return c=>{const{internal:f}=t.getState();"pointerId"in c&&f.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(c.pointerId)&&(f.capturedMap.delete(c.pointerId),o([]))})}}return function(f){const{onPointerMissed:p,internal:m}=t.getState();m.lastEvent.current=f;const v=l==="onPointerMove",x=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",b=r(f,v?n:void 0),y=x?e(f):0;l==="onPointerDown"&&(m.initialClick=[f.offsetX,f.offsetY],m.initialHits=b.map(M=>M.eventObject)),x&&!b.length&&y<=2&&(a(f,m.interaction),p&&p(f)),v&&o(b);function S(M){const C=M.eventObject,A=C.__r3f,R=A==null?void 0:A.handlers;if(A!=null&&A.eventCount)if(v){if(R.onPointerOver||R.onPointerEnter||R.onPointerOut||R.onPointerLeave){const P=ow(M),U=m.hovered.get(P);U?U.stopped&&M.stopPropagation():(m.hovered.set(P,M),R.onPointerOver==null||R.onPointerOver(M),R.onPointerEnter==null||R.onPointerEnter(M))}R.onPointerMove==null||R.onPointerMove(M)}else{const P=R[l];P?(!x||m.initialHits.includes(C))&&(a(f,m.interaction.filter(U=>!m.initialHits.includes(U))),P(M)):x&&m.initialHits.includes(C)&&a(f,m.interaction.filter(U=>!m.initialHits.includes(U)))}}i(b,f,y,S)}}return{handlePointer:s}}const bH=t=>!!(t!=null&&t.render),_H=F.createContext(null),_1e=(t,e)=>{const n=s1e((s,l)=>{const c=new q,f=new q,p=new q;function m(y=l().camera,S=f,M=l().size){const{width:C,height:A,top:R,left:P}=M,U=C/A;S instanceof q?p.copy(S):p.set(...S);const k=y.getWorldPosition(c).distanceTo(p);if(hH(y))return{width:C/y.zoom,height:A/y.zoom,top:R,left:P,factor:1,distance:k,aspect:U};{const N=y.fov*Math.PI/180,z=2*Math.tan(N/2)*k,K=z*(C/A);return{width:K,height:z,top:R,left:P,factor:C/K,distance:k,aspect:U}}}let v;const x=y=>s(S=>({performance:{...S.performance,current:y}})),_=new Be;return{set:s,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(y=1)=>t(l(),y),advance:(y,S)=>e(y,S,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new vL,pointer:_,mouse:_,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const y=l();v&&clearTimeout(v),y.performance.current!==y.performance.min&&x(y.performance.min),v=setTimeout(()=>x(l().performance.max),y.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:m},setEvents:y=>s(S=>({...S,events:{...S.events,...y}})),setSize:(y,S,M,C,A)=>{const R=l().camera,P={width:y,height:S,top:C||0,left:A||0,updateStyle:M};s(U=>({size:P,viewport:{...U.viewport,...m(R,f,P)}}))},setDpr:y=>s(S=>{const M=vH(y);return{viewport:{...S.viewport,dpr:M,initialDpr:S.viewport.initialDpr||M}}}),setFrameloop:(y="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,y!=="never"&&(S.start(),S.elapsedTime=0),s(()=>({frameloop:y}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:F.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(y,S,M)=>{const C=l().internal;return C.priority=C.priority+(S>0?1:0),C.subscribers.push({ref:y,priority:S,store:M}),C.subscribers=C.subscribers.sort((A,R)=>A.priority-R.priority),()=>{const A=l().internal;A!=null&&A.subscribers&&(A.priority=A.priority-(S>0?1:0),A.subscribers=A.subscribers.filter(R=>R.ref!==y))}}}}}),r=n.getState();let i=r.size,o=r.viewport.dpr,a=r.camera;return n.subscribe(()=>{const{camera:s,size:l,viewport:c,gl:f,set:p}=n.getState();if(l.width!==i.width||l.height!==i.height||c.dpr!==o){var m;i=l,o=c.dpr,v1e(s,l),f.setPixelRatio(c.dpr);const v=(m=l.updateStyle)!=null?m:typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(l.width,l.height,v)}s!==a&&(a=s,p(v=>({viewport:{...v.viewport,...v.viewport.getCurrentViewport(s)}})))}),n.subscribe(s=>t(s)),n};let aw,w1e=new Set,S1e=new Set,M1e=new Set;function FT(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function Yv(t,e){switch(t){case"before":return FT(w1e,e);case"after":return FT(S1e,e);case"tail":return FT(M1e,e)}}let UT,BT;function zT(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),UT=e.internal.subscribers,aw=0;aw0)&&!((c=i.gl.xr)!=null&&c.isPresenting)&&(n+=zT(l,i))}if(Yv("after",l),n===0)return Yv("tail",l),e=!1,cancelAnimationFrame(r)}function a(l,c=1){var f;if(!l)return t.forEach(p=>a(p.store.getState()),c);(f=l.gl.xr)!=null&&f.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+c),e||(e=!0,requestAnimationFrame(o)))}function s(l,c=!0,f,p){if(c&&Yv("before",l),f)zT(l,f,p);else for(const m of t.values())zT(l,m.store.getState());c&&Yv("after",l)}return{loop:o,invalidate:a,advance:s}}function wH(){const t=F.useContext(_H);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function oo(t=n=>n,e){return wH()(t,e)}function wL(t,e=0){const n=wH(),r=n.getState().internal.subscribe,i=pH(t);return _x(()=>r(i,e,n),[e,r,n]),null}const a0=new Map,{invalidate:ZD,advance:QD}=E1e(a0),{reconciler:VS,applyProps:Lm}=f1e(a0,y1e),Om={objects:"shallow",strict:!1},C1e=(t,e)=>{const n=typeof t=="function"?t(e):t;return bH(n)?n:new eL({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function T1e(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:o,left:a,updateStyle:s=n}=e;return{width:r,height:i,top:o,left:a,updateStyle:s}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:r,height:i,top:o,left:a}=t.parentElement.getBoundingClientRect();return{width:r,height:i,top:o,left:a,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 A1e(t){const e=a0.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||_1e(ZD,QD),a=n||VS.createContainer(o,wg.ConcurrentRoot,null,!1,null,"",i,null);e||a0.set(t,{fiber:a,store:o});let s,l=!1,c;return{configure(f={}){let{gl:p,size:m,scene:v,events:x,onCreated:_,shadows:b=!1,linear:y=!1,flat:S=!1,legacy:M=!1,orthographic:C=!1,frameloop:A="always",dpr:R=[1,2],performance:P,raycaster:U,camera:k,onPointerMissed:N}=f,z=o.getState(),K=z.gl;z.gl||z.set({gl:K=C1e(p,t)});let J=z.raycaster;J||z.set({raycaster:J=new oH});const{params:G,...ne}=U||{};if(Mr.equ(ne,J,Om)||Lm(J,{...ne}),Mr.equ(G,J.params,Om)||Lm(J,{params:{...J.params,...G}}),!z.camera||z.camera===c&&!Mr.equ(c,k,Om)){c=k;const ae=k instanceof hx,xe=ae?k:C?new gx(0,0,0,0,.1,1e3):new Hi(75,0,.1,1e3);ae||(xe.position.z=5,k&&Lm(xe,k),!z.camera&&!(k!=null&&k.rotation)&&xe.lookAt(0,0,0)),z.set({camera:xe}),J.camera=xe}if(!z.scene){let ae;v instanceof $S?ae=v:(ae=new $S,v&&Lm(ae,v)),z.set({scene:$m(ae)})}if(!z.xr){var ie;const ae=(Te,Ve)=>{const Ye=o.getState();Ye.frameloop!=="never"&&QD(Te,!0,Ye,Ve)},xe=()=>{const Te=o.getState();Te.gl.xr.enabled=Te.gl.xr.isPresenting,Te.gl.xr.setAnimationLoop(Te.gl.xr.isPresenting?ae:null),Te.gl.xr.isPresenting||ZD(Te)},we={connect(){const Te=o.getState().gl;Te.xr.addEventListener("sessionstart",xe),Te.xr.addEventListener("sessionend",xe)},disconnect(){const Te=o.getState().gl;Te.xr.removeEventListener("sessionstart",xe),Te.xr.removeEventListener("sessionend",xe)}};typeof((ie=K.xr)==null?void 0:ie.addEventListener)=="function"&&we.connect(),z.set({xr:we})}if(K.shadowMap){const ae=K.shadowMap.enabled,xe=K.shadowMap.type;if(K.shadowMap.enabled=!!b,Mr.boo(b))K.shadowMap.type=ky;else if(Mr.str(b)){var se;const we={basic:K$,percentage:CE,soft:ky,variance:ml};K.shadowMap.type=(se=we[b])!=null?se:ky}else Mr.obj(b)&&Object.assign(K.shadowMap,b);(ae!==K.shadowMap.enabled||xe!==K.shadowMap.type)&&(K.shadowMap.needsUpdate=!0)}const H=dH();H&&("enabled"in H?H.enabled=!M:"legacyMode"in H&&(H.legacyMode=M)),Lm(K,{outputEncoding:y?3e3:3001,toneMapping:S?pc:NI}),z.legacy!==M&&z.set(()=>({legacy:M})),z.linear!==y&&z.set(()=>({linear:y})),z.flat!==S&&z.set(()=>({flat:S})),p&&!Mr.fun(p)&&!bH(p)&&!Mr.equ(p,K,Om)&&Lm(K,p),x&&!z.events.handlers&&z.set({events:x(o)});const Q=T1e(t,m);return Mr.equ(Q,z.size,Om)||z.setSize(Q.width,Q.height,Q.updateStyle,Q.top,Q.left),R&&z.viewport.dpr!==vH(R)&&z.setDpr(R),z.frameloop!==A&&z.setFrameloop(A),z.onPointerMissed||z.set({onPointerMissed:N}),P&&!Mr.equ(P,z.performance,Om)&&z.set(ae=>({performance:{...ae.performance,...P}})),s=_,l=!0,this},render(f){return l||this.configure(),VS.updateContainer(F.createElement(R1e,{store:o,children:f,onCreated:s,rootElement:t}),a,null,()=>{}),o},unmount(){SH(t)}}}function R1e({store:t,children:e,onCreated:n,rootElement:r}){return _x(()=>{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)},[]),F.createElement(_H.Provider,{value:t},e)}function SH(t,e){const n=a0.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),VS.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var o,a,s,l;i.events.disconnect==null||i.events.disconnect(),(o=i.gl)==null||(a=o.renderLists)==null||a.dispose==null||a.dispose(),(s=i.gl)==null||s.forceContextLoss==null||s.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),m1e(i),a0.delete(t),e&&e(t)}catch{}},500)})}}VS.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:F.version});function w3(t,e,n){var r,i,o,a,s;e==null&&(e=100);function l(){var f=Date.now()-a;f=0?r=setTimeout(l,e-f):(r=null,n||(s=t.apply(o,i),o=i=null))}var c=function(){o=this,i=arguments,a=Date.now();var f=n&&!r;return r||(r=setTimeout(l,e)),f&&(s=t.apply(o,i),o=i=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},c}w3.debounce=w3;var P1e=w3;const JD=Au(P1e);function I1e(t){let{debounce:e,scroll:n,polyfill:r,offsetSize:i}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const o=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!o)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[a,s]=F.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=F.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a}),c=e?typeof e=="number"?e:e.scroll:null,f=e?typeof e=="number"?e:e.resize:null,p=F.useRef(!1);F.useEffect(()=>(p.current=!0,()=>void(p.current=!1)));const[m,v,x]=F.useMemo(()=>{const S=()=>{if(!l.current.element)return;const{left:M,top:C,width:A,height:R,bottom:P,right:U,x:k,y:N}=l.current.element.getBoundingClientRect(),z={left:M,top:C,width:A,height:R,bottom:P,right:U,x:k,y:N};l.current.element instanceof HTMLElement&&i&&(z.height=l.current.element.offsetHeight,z.width=l.current.element.offsetWidth),Object.freeze(z),p.current&&!N1e(l.current.lastBounds,z)&&s(l.current.lastBounds=z)};return[S,f?JD(S,f):S,c?JD(S,c):S]},[s,i,c,f]);function _(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",x,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function b(){l.current.element&&(l.current.resizeObserver=new o(x),l.current.resizeObserver.observe(l.current.element),n&&l.current.scrollContainers&&l.current.scrollContainers.forEach(S=>S.addEventListener("scroll",x,{capture:!0,passive:!0})))}const y=S=>{!S||S===l.current.element||(_(),l.current.element=S,l.current.scrollContainers=MH(S),b())};return O1e(x,!!n),L1e(v),F.useEffect(()=>{_(),b()},[n,x,v]),F.useEffect(()=>_,[]),[y,a,m]}function L1e(t){F.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function O1e(t,e){F.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function MH(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,...MH(t.parentElement)]}const k1e=["x","y","top","bottom","left","right","width","height"],N1e=(t,e)=>k1e.every(n=>t[n]===e[n]);var D1e=Object.defineProperty,F1e=Object.defineProperties,U1e=Object.getOwnPropertyDescriptors,eF=Object.getOwnPropertySymbols,B1e=Object.prototype.hasOwnProperty,z1e=Object.prototype.propertyIsEnumerable,tF=(t,e,n)=>e in t?D1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,nF=(t,e)=>{for(var n in e||(e={}))B1e.call(e,n)&&tF(t,n,e[n]);if(eF)for(var n of eF(e))z1e.call(e,n)&&tF(t,n,e[n]);return t},$1e=(t,e)=>F1e(t,U1e(e));function EH(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=e?t.return:t.child;for(;r;){const i=EH(r,e,n);if(i)return i;r=e?null:r.sibling}}function CH(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const SL=CH(F.createContext(null));class TH extends F.Component{render(){return F.createElement(SL.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:rF,ReactCurrentDispatcher:iF}=F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function H1e(){const t=F.useContext(SL);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=F.useId();return F.useMemo(()=>{for(const r of[rF==null?void 0:rF.current,t,t==null?void 0:t.alternate]){if(!r)continue;const i=EH(r,!1,o=>{let a=o.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(i)return i}},[t,e])}function V1e(){var t,e;const n=H1e(),[r]=F.useState(()=>new Map);r.clear();let i=n;for(;i;){const o=(t=i.type)==null?void 0:t._context;o&&o!==SL&&!r.has(o)&&r.set(o,(e=iF==null?void 0:iF.current)==null?void 0:e.readContext(CH(o))),i=i.return}return r}function W1e(){const t=V1e();return F.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>F.createElement(e,null,F.createElement(n.Provider,$1e(nF({},r),{value:t.get(n)}))),e=>F.createElement(TH,nF({},e))),[t])}const $T={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 G1e(t){const{handlePointer:e}=b1e(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($T).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(a=>({events:{...a.events,connected:n}})),Object.entries((r=o.handlers)!=null?r:[]).forEach(([a,s])=>{const[l,c]=$T[a];n.addEventListener(l,s,{passive:c})})},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([o,a])=>{if(r&&r.connected instanceof HTMLElement){const[s]=$T[o];r.connected.removeEventListener(s,a)}}),n(o=>({events:{...o.events,connected:void 0}}))}}}}const j1e=F.forwardRef(function({children:e,fallback:n,resize:r,style:i,gl:o,events:a=G1e,eventSource:s,eventPrefix:l,shadows:c,linear:f,flat:p,legacy:m,orthographic:v,frameloop:x,dpr:_,performance:b,raycaster:y,camera:S,scene:M,onPointerMissed:C,onCreated:A,...R},P){F.useMemo(()=>fH(i1e),[]);const U=W1e(),[k,N]=I1e({scroll:!0,debounce:{scroll:50,resize:0},...r}),z=F.useRef(null),K=F.useRef(null);F.useImperativeHandle(P,()=>z.current);const J=pH(C),[G,ne]=F.useState(!1),[ie,se]=F.useState(!1);if(G)throw G;if(ie)throw ie;const H=F.useRef(null);_x(()=>{const te=z.current;N.width>0&&N.height>0&&te&&(H.current||(H.current=A1e(te)),H.current.configure({gl:o,events:a,shadows:c,linear:f,flat:p,legacy:m,orthographic:v,frameloop:x,dpr:_,performance:b,raycaster:y,camera:S,scene:M,size:N,onPointerMissed:(...Q)=>J.current==null?void 0:J.current(...Q),onCreated:Q=>{Q.events.connect==null||Q.events.connect(s?d1e(s)?s.current:s:K.current),l&&Q.setEvents({compute:(ae,xe)=>{const we=ae[l+"X"],Te=ae[l+"Y"];xe.pointer.set(we/xe.size.width*2-1,-(Te/xe.size.height)*2+1),xe.raycaster.setFromCamera(xe.pointer,xe.camera)}}),A==null||A(Q)}}),H.current.render(F.createElement(U,null,F.createElement(mH,{set:se},F.createElement(F.Suspense,{fallback:F.createElement(h1e,{set:ne})},e)))))}),F.useEffect(()=>{const te=z.current;if(te)return()=>SH(te)},[]);const Y=s?"none":"auto";return F.createElement("div",j({ref:K,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Y,...i}},R),F.createElement("div",{ref:k,style:{width:"100%",height:"100%"}},F.createElement("canvas",{ref:z,style:{display:"block"}},n)))}),X1e=F.forwardRef(function(e,n){return F.createElement(TH,null,F.createElement(j1e,j({},e,{ref:n})))});function Kw(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function q1e(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function AH(t){let e,n,r;t.length!==2?(e=Kw,n=(s,l)=>Kw(t(s),l),r=(s,l)=>t(s)-l):(e=t===Kw||t===q1e?t:Y1e,n=t,r=t);function i(s,l,c=0,f=s.length){if(c>>1;n(s[p],l)<0?c=p+1:f=p}while(c>>1;n(s[p],l)<=0?c=p+1:f=p}while(cc&&r(s[p-1],l)>-r(s[p],l)?p-1:p}return{left:i,center:a,right:o}}function Y1e(){return 0}function K1e(t){return t===null?NaN:+t}const Z1e=AH(Kw),Q1e=Z1e.right;AH(K1e).center;const J1e=Q1e,exe=Math.sqrt(50),txe=Math.sqrt(10),nxe=Math.sqrt(2);function WS(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=exe?10:o>=txe?5:o>=nxe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?sw(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?sw(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=ixe.exec(t))?new Wi(e[1],e[2],e[3],1):(e=oxe.exec(t))?new Wi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=axe.exec(t))?sw(e[1],e[2],e[3],e[4]):(e=sxe.exec(t))?sw(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=lxe.exec(t))?fF(e[1],e[2]/100,e[3]/100,1):(e=cxe.exec(t))?fF(e[1],e[2]/100,e[3]/100,e[4]):oF.hasOwnProperty(t)?lF(oF[t]):t==="transparent"?new Wi(NaN,NaN,NaN,0):null}function lF(t){return new Wi(t>>16&255,t>>8&255,t&255,1)}function sw(t,e,n,r){return r<=0&&(t=e=n=NaN),new Wi(t,e,n,r)}function ML(t){return t instanceof pd||(t=$1(t)),t?(t=t.rgb(),new Wi(t.r,t.g,t.b,t.opacity)):new Wi}function Jf(t,e,n,r){return arguments.length===1?ML(t):new Wi(t,e,n,r??1)}function Wi(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}w0(Wi,Jf,wx(pd,{brighter(t){return t=t==null?s0:Math.pow(s0,t),new Wi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ip:Math.pow(ip,t),new Wi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Wi($h(this.r),$h(this.g),$h(this.b),GS(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:cF,formatHex:cF,formatHex8:dxe,formatRgb:uF,toString:uF}));function cF(){return`#${Ah(this.r)}${Ah(this.g)}${Ah(this.b)}`}function dxe(){return`#${Ah(this.r)}${Ah(this.g)}${Ah(this.b)}${Ah((isNaN(this.opacity)?1:this.opacity)*255)}`}function uF(){const t=GS(this.opacity);return`${t===1?"rgb(":"rgba("}${$h(this.r)}, ${$h(this.g)}, ${$h(this.b)}${t===1?")":`, ${t})`}`}function GS(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function $h(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ah(t){return t=$h(t),(t<16?"0":"")+t.toString(16)}function fF(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new bl(t,e,n,r)}function PH(t){if(t instanceof bl)return new bl(t.h,t.s,t.l,t.opacity);if(t instanceof pd||(t=$1(t)),!t)return new bl;if(t instanceof bl)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),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n0&&l<1?0:a,new bl(a,s,l,t.opacity)}function jS(t,e,n,r){return arguments.length===1?PH(t):new bl(t,e,n,r??1)}function bl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}w0(bl,jS,wx(pd,{brighter(t){return t=t==null?s0:Math.pow(s0,t),new bl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ip:Math.pow(ip,t),new bl(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 Wi(HT(t>=240?t-240:t+120,i,r),HT(t,i,r),HT(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new bl(dF(this.h),lw(this.s),lw(this.l),GS(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=GS(this.opacity);return`${t===1?"hsl(":"hsla("}${dF(this.h)}, ${lw(this.s)*100}%, ${lw(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dF(t){return t=(t||0)%360,t<0?t+360:t}function lw(t){return Math.max(0,Math.min(1,t||0))}function HT(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 IH=Math.PI/180,LH=180/Math.PI,XS=18,OH=.96422,kH=1,NH=.82521,DH=4/29,Fg=6/29,FH=3*Fg*Fg,hxe=Fg*Fg*Fg;function UH(t){if(t instanceof vc)return new vc(t.l,t.a,t.b,t.opacity);if(t instanceof du)return BH(t);t instanceof Wi||(t=ML(t));var e=jT(t.r),n=jT(t.g),r=jT(t.b),i=VT((.2225045*e+.7168786*n+.0606169*r)/kH),o,a;return e===n&&n===r?o=a=i:(o=VT((.4360747*e+.3850649*n+.1430804*r)/OH),a=VT((.0139322*e+.0971045*n+.7141733*r)/NH)),new vc(116*i-16,500*(o-i),200*(i-a),t.opacity)}function E3(t,e,n,r){return arguments.length===1?UH(t):new vc(t,e,n,r??1)}function vc(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}w0(vc,E3,wx(pd,{brighter(t){return new vc(this.l+XS*(t??1),this.a,this.b,this.opacity)},darker(t){return new vc(this.l-XS*(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=OH*WT(e),t=kH*WT(t),n=NH*WT(n),new Wi(GT(3.1338561*e-1.6168667*t-.4906146*n),GT(-.9787684*e+1.9161415*t+.033454*n),GT(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function VT(t){return t>hxe?Math.pow(t,1/3):t/FH+DH}function WT(t){return t>Fg?t*t*t:FH*(t-DH)}function GT(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function jT(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pxe(t){if(t instanceof du)return new du(t.h,t.c,t.l,t.opacity);if(t instanceof vc||(t=UH(t)),t.a===0&&t.b===0)return new du(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r()=>t;function $H(t,e){return function(n){return t+n*e}}function yxe(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 TL(t,e){var n=e-t;return n?$H(t,n>180||n<-180?n-360*Math.round(n/360):n):t2(isNaN(t)?e:t)}function xxe(t){return(t=+t)==1?Gi:function(e,n){return n-e?yxe(e,n,t):t2(isNaN(e)?n:e)}}function Gi(t,e){var n=e-t;return n?$H(t,n):t2(isNaN(t)?e:t)}const T3=function t(e){var n=xxe(e);function r(i,o){var a=n((i=Jf(i)).r,(o=Jf(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=Gi(i.opacity,o.opacity);return function(f){return i.r=a(f),i.g=s(f),i.b=l(f),i.opacity=c(f),i+""}}return r.gamma=t,r}(1);function bxe(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;an&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:l0(r,i)})),n=XT.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Bxe(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?zxe:Bxe,l=c=null,p}function p(m){return m==null||isNaN(m=+m)?o:(l||(l=s(t.map(r),e,n)))(r(a(m)))}return p.invert=function(m){return a(i((c||(c=s(e,t.map(r),l0)))(m)))},p.domain=function(m){return arguments.length?(t=Array.from(m,Fxe),f()):t.slice()},p.range=function(m){return arguments.length?(e=Array.from(m),f()):e.slice()},p.rangeRound=function(m){return e=Array.from(m),n=RL,f()},p.clamp=function(m){return arguments.length?(a=m?!0:sc,f()):a!==sc},p.interpolate=function(m){return arguments.length?(n=m,f()):n},p.unknown=function(m){return arguments.length?(o=m,p):o},function(m,v){return r=m,i=v,f()}}function $xe(){return i2()(sc,sc)}function Hxe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function qS(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 c0(t){return t=qS(Math.abs(t)),t?t[1]:NaN}function Vxe(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function Wxe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Gxe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function V1(t){if(!(e=Gxe.exec(t)))throw new Error("invalid format: "+t);var e;return new PL({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]})}V1.prototype=PL.prototype;function PL(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+""}PL.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 jxe(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 GH;function Xxe(t,e){var n=qS(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(GH=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+qS(t,Math.max(0,e+o-1))[0]}function vF(t,e){var n=qS(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 yF={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Hxe,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)=>vF(t*100,e),r:vF,s:Xxe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function xF(t){return t}var bF=Array.prototype.map,_F=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function qxe(t){var e=t.grouping===void 0||t.thousands===void 0?xF:Vxe(bF.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?xF:Wxe(bF.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(p){p=V1(p);var m=p.fill,v=p.align,x=p.sign,_=p.symbol,b=p.zero,y=p.width,S=p.comma,M=p.precision,C=p.trim,A=p.type;A==="n"?(S=!0,A="g"):yF[A]||(M===void 0&&(M=12),C=!0,A="g"),(b||m==="0"&&v==="=")&&(b=!0,m="0",v="=");var R=_==="$"?n:_==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():"",P=_==="$"?r:/[%p]/.test(A)?a:"",U=yF[A],k=/[defgprs%]/.test(A);M=M===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function N(z){var K=R,J=P,G,ne,ie;if(A==="c")J=U(z)+J,z="";else{z=+z;var se=z<0||1/z<0;if(z=isNaN(z)?l:U(Math.abs(z),M),C&&(z=jxe(z)),se&&+z==0&&x!=="+"&&(se=!1),K=(se?x==="("?x:s:x==="-"||x==="("?"":x)+K,J=(A==="s"?_F[8+GH/3]:"")+J+(se&&x==="("?")":""),k){for(G=-1,ne=z.length;++Gie||ie>57){J=(ie===46?i+z.slice(G+1):z.slice(G))+J,z=z.slice(0,G);break}}}S&&!b&&(z=e(z,1/0));var H=K.length+z.length+J.length,Y=H>1)+K+z+J+Y.slice(H);break;default:z=Y+K+z+J;break}return o(z)}return N.toString=function(){return p+""},N}function f(p,m){var v=c((p=V1(p),p.type="f",p)),x=Math.max(-8,Math.min(8,Math.floor(c0(m)/3)))*3,_=Math.pow(10,-x),b=_F[8+x/3];return function(y){return v(_*y)+b}}return{format:c,formatPrefix:f}}var cw,Cc,jH;Yxe({thousands:",",grouping:[3],currency:["$",""]});function Yxe(t){return cw=qxe(t),Cc=cw.format,jH=cw.formatPrefix,cw}function Kxe(t){return Math.max(0,-c0(Math.abs(t)))}function Zxe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(c0(e)/3)))*3-c0(Math.abs(t)))}function Qxe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,c0(e)-c0(t))+1}function Jxe(t,e,n,r){var i=RH(t,e,n),o;switch(r=V1(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=Zxe(i,a))&&(r.precision=o),jH(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Qxe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Kxe(i))&&(r.precision=o-(r.type==="%")*2);break}}return Cc(r)}function IL(t){var e=t.domain;return t.ticks=function(n){var r=e();return S3(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Jxe(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,a=r[i],s=r[o],l,c,f=10;for(s0;){if(c=M3(a,s,n),c===l)return r[i]=a,r[o]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function XH(){var t=$xe();return t.copy=function(){return r2(t,XH())},JE.apply(t,arguments),IL(t)}function ebe(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return oMath.pow(t,e)}function obe(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 MF(t){return(e,n)=>-t(-e,n)}function abe(t){const e=t(wF,SF),n=e.domain;let r=10,i,o;function a(){return i=obe(r),o=ibe(r),n()[0]<0?(i=MF(i),o=MF(o),t(tbe,nbe)):t(wF,SF),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let c=l[0],f=l[l.length-1];const p=f0){for(;m<=v;++m)for(x=1;xf)break;y.push(_)}}else for(;m<=v;++m)for(x=r-1;x>=1;--x)if(_=m>0?x/o(-m):x*o(m),!(_f)break;y.push(_)}y.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=V1(l)).precision==null&&(l.trim=!0),l=Cc(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return f=>{let p=f/o(Math.round(i(f)));return p*rn(ebe(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function qH(){const t=abe(i2()).domain([1,10]);return t.copy=()=>r2(t,qH()).base(t.base()),JE.apply(t,arguments),t}function EF(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function CF(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function sbe(t){var e=1,n=t(EF(e),CF(e));return n.constant=function(r){return arguments.length?t(EF(e=+r),CF(e)):e},IL(n)}function YH(){var t=sbe(i2());return t.copy=function(){return r2(t,YH()).constant(t.constant())},JE.apply(t,arguments)}function TF(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function lbe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function cbe(t){return t<0?-t*t:t*t}function ube(t){var e=t(sc,sc),n=1;function r(){return n===1?t(sc,sc):n===.5?t(lbe,cbe):t(TF(n),TF(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},IL(e)}function LL(){var t=ube(i2());return t.copy=function(){return r2(t,LL()).exponent(t.exponent())},JE.apply(t,arguments),t}function fbe(){return LL.apply(null,arguments).exponent(.5)}const qT=new Date,YT=new Date;function lo(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 a=i(o),s=i.ceil(o);return o-a(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,s),t(o);while(clo(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(qT.setTime(+o),YT.setTime(+a),t(qT),t(YT),Math.floor(n(qT,YT))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const W1=1e3,ed=W1*60,G1=ed*60,j1=G1*24,KH=j1*7,OL=lo(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*W1)},(t,e)=>(e-t)/W1,t=>t.getUTCSeconds());OL.range;const ZH=lo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*W1)},(t,e)=>{t.setTime(+t+e*ed)},(t,e)=>(e-t)/ed,t=>t.getMinutes());ZH.range;const QH=lo(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ed)},(t,e)=>(e-t)/ed,t=>t.getUTCMinutes());QH.range;const JH=lo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*W1-t.getMinutes()*ed)},(t,e)=>{t.setTime(+t+e*G1)},(t,e)=>(e-t)/G1,t=>t.getHours());JH.range;const eV=lo(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*G1)},(t,e)=>(e-t)/G1,t=>t.getUTCHours());eV.range;const tV=lo(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ed)/j1,t=>t.getDate()-1);tV.range;const nV=lo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/j1,t=>t.getUTCDate()-1);nV.range;const dbe=lo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/j1,t=>Math.floor(t/j1));dbe.range;function hp(t){return lo(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())*ed)/KH)}const rV=hp(0),hbe=hp(1),pbe=hp(2),mbe=hp(3),gbe=hp(4),vbe=hp(5),ybe=hp(6);rV.range;hbe.range;pbe.range;mbe.range;gbe.range;vbe.range;ybe.range;function pp(t){return lo(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)/KH)}const iV=pp(0),xbe=pp(1),bbe=pp(2),_be=pp(3),wbe=pp(4),Sbe=pp(5),Mbe=pp(6);iV.range;xbe.range;bbe.range;_be.range;wbe.range;Sbe.range;Mbe.range;const oV=lo(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());oV.range;const aV=lo(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());aV.range;const kL=lo(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());kL.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:lo(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)});kL.range;const NL=lo(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());NL.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:lo(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)});NL.range;function Ebe(t,e){e.domain&&("nice"in t||"quantiles"in t||"padding"in t,t.domain(e.domain))}function Cbe(t,e){e.range&&("padding"in t,t.range(e.range))}function Tbe(t,e){"align"in t&&"align"in e&&typeof e.align<"u"&&t.align(e.align)}function Abe(t,e){"base"in t&&"base"in e&&typeof e.base<"u"&&t.base(e.base)}function Rbe(t,e){"clamp"in t&&"clamp"in e&&typeof e.clamp<"u"&&t.clamp(e.clamp)}function Pbe(t,e){"constant"in t&&"constant"in e&&typeof e.constant<"u"&&t.constant(e.constant)}function Ibe(t,e){"exponent"in t&&"exponent"in e&&typeof e.exponent<"u"&&t.exponent(e.exponent)}var AF={lab:Lxe,hcl:Oxe,"hcl-long":kxe,hsl:Pxe,"hsl-long":Ixe,cubehelix:Nxe,"cubehelix-long":n2,rgb:T3};function Lbe(t){switch(t){case"lab":case"hcl":case"hcl-long":case"hsl":case"hsl-long":case"cubehelix":case"cubehelix-long":case"rgb":return AF[t]}var e=t.type,n=t.gamma,r=AF[e];return typeof n>"u"?r:r.gamma(n)}function Obe(t,e){if("interpolate"in e&&"interpolate"in t&&typeof e.interpolate<"u"){var n=Lbe(e.interpolate);t.interpolate(n)}}var kbe=new Date(Date.UTC(2020,1,2,3,4,5)),Nbe="%Y-%m-%d %H:%M";function Dbe(t){var e=t.tickFormat(1,Nbe)(kbe);return e==="2020-02-02 03:04"}var RF={day:tV,hour:JH,minute:ZH,month:oV,second:OL,week:rV,year:kL},PF={day:nV,hour:eV,minute:QH,month:aV,second:OL,week:iV,year:NL};function Fbe(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=Dbe(r);if(typeof n=="string")r.nice(i?PF[n]:RF[n]);else{var o=n.interval,a=n.step,s=(i?PF[o]:RF[o]).every(a);s!=null&&r.nice(s)}}}}function Ube(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 Bbe(t,e){if(e.reverse){var n=t.range().slice().reverse();"padding"in t,t.range(n)}}function zbe(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(RL))}function $be(t,e){"unknown"in t&&"unknown"in e&&typeof e.unknown<"u"&&t.unknown(e.unknown)}function Hbe(t,e){if("zero"in e&&e.zero===!0){var n=t.domain(),r=n[0],i=n[1],o=i0,a=[],s=[],l=0,c=0,f,p;for(f=0;f0&&a.push("var "+s.join(",")),f=r-1;f>=0;--f)l=t[f],a.push(["for(i",f,"=0;i",f,"0&&a.push(["index[",c,"]-=s",c].join("")),a.push(["++index[",l,"]"].join(""))),a.push("}")}return a.join(` -`)}function s_e(t,e,n,r){for(var i=e.length,o=n.arrayArgs.length,a=n.blockSize,s=n.indexArgs.length>0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",a,"){"].join("")),l.push(["s",e[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",e[c],"=",a].join("")),l.push(["j",c,"-=",a,"}"].join("")),s&&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 u_e(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&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var b=new Array(n),o=0;o0&&x.push("var "+_.join(","));for(var o=0;o3&&x.push(KT(t.pre,t,i));var C=KT(t.body,t,i),A=l_e(f);A3&&x.push(KT(t.post,t,i)),t.debug&&console.log("-----Generated cwise routine for ",e,`: -`+x.join(` -`)+` -----------`);var R=[t.funcName||"unnamed","_cwise_loop_",r[0].join("s"),"m",A,c_e(i)].join(""),P=new Function(["function ",R,"(",v.join(","),"){",x.join(` -`),"} return ",R].join(""));return P()}var f_e=u_e,d_e=f_e;function h_e(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=[],a=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],s=[],l=[],c=0;c0&&(s.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".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"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+s.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,m_e(e)}var y_e=v_e;(function(t){var e=y_e,n={body:"",args:[],thisVars:[],localVars:[]};function r(m){if(!m)return n;for(var v=0;v>",rrshift:">>>"};(function(){for(var m in a){var v=a[m];t[m]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+v+"c"},funcName:m}),t[m+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+v+"=b"},rvalue:!0,funcName:m+"eq"}),t[m+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+v+"s"},funcName:m+"s"}),t[m+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+v+"=s"},rvalue:!0,funcName:m+"seq"})}})();var s={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var m in s){var v=s[m];t[m]=o({args:["array","array"],body:{args:["a","b"],body:"a="+v+"b"},funcName:m}),t[m+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+v+"a"},rvalue:!0,count:2,funcName:m+"eq"})}})();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var m in l){var v=l[m];t[m]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+v+"c"},funcName:m}),t[m+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+v+"s"},funcName:m+"s"}),t[m+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+v+"b"},rvalue:!0,count:2,funcName:m+"eq"}),t[m+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+v+"s"},rvalue:!0,count:2,funcName:m+"seq"})}})();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var m=0;mthis_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"})})(t_e);var lV={exports:{}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],i=0;i=0)&&(n[i]=t[i]);return n}function Mx(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.transform,a=t.className,s=t.children,l=t.innerRef,c=b_e(t,x_e);return Z.createElement("g",P3({ref:l,className:Mc("visx-group",a),transform:o||"translate("+i+", "+n+")"},c),s)}Mx.propTypes={top:qe.number,left:qe.number,transform:qe.string,className:qe.string,children:qe.node,innerRef:qe.oneOfType([qe.string,qe.func,qe.object])};var __e=["from","to","fill","className","innerRef"];function I3(){return I3=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function uV(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,a=o===void 0?"transparent":o,s=t.className,l=t.innerRef,c=w_e(t,__e),f=n.x===i.x||n.y===i.y;return Z.createElement("line",I3({ref:l,className:Mc("visx-line",s),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:a,shapeRendering:f?"crispEdges":"auto"},c))}var S_e=fV;function fV(t,e,n){t instanceof RegExp&&(t=IF(t,n)),e instanceof RegExp&&(e=IF(e,n));var r=dV(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 IF(t,e){var n=e.match(t);return n?n[0]:null}fV.range=dV;function dV(t,e,n){var r,i,o,a,s,l=n.indexOf(t),c=n.indexOf(e,l+1),f=l;if(l>=0&&c>0){for(r=[],o=n.length;f>=0&&!s;)f==l?(r.push(f),l=n.indexOf(t,f+1)):r.length==1?s=[r.pop(),c]:(i=r.pop(),i=0?l:c;r.length&&(s=[o,a])}return s}var M_e=hV;function hV(t,e,n){t instanceof RegExp&&(t=LF(t,n)),e instanceof RegExp&&(e=LF(e,n));var r=pV(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 LF(t,e){var n=e.match(t);return n?n[0]:null}hV.range=pV;function pV(t,e,n){var r,i,o,a,s,l=n.indexOf(t),c=n.indexOf(e,l+1),f=l;if(l>=0&&c>0){if(t===e)return[l,c];for(r=[],o=n.length;f>=0&&!s;)f==l?(r.push(f),l=n.indexOf(t,f+1)):r.length==1?s=[r.pop(),c]:(i=r.pop(),i=0?l:c;r.length&&(s=[o,a])}return s}var E_e=M_e,C_e=mV;function mV(t,e,n){var r=t;return T_e(t,e).reduce(function(i,o){return i.replace(o.functionIdentifier+"("+o.matches.body+")",A_e(o.matches.body,o.functionIdentifier,n,r,e))},t)}function T_e(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],a=i.index,s=E_e("(",")",t.substring(a));if(!s||s.start!==i[0].length-1)throw new SyntaxError(o+"(): missing closing ')' in the value '"+t+"'");n.push({matches:s,functionIdentifier:o}),t=s.post}while(r.test(t));return n}function A_e(t,e,n,r,i){return n(mV(t,i,n),e,r)}var zo=function(t){this.value=t};zo.math={isDegree:!0,acos:function(t){return zo.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,e){return t+e},asin:function(t){return zo.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return zo.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;iHo.length-2?Ho.length-1:t.length-a;i>0;i--)if(Ho[i]!==void 0)for(o=0;o0&&cr)a.push(e);else{for(;r>=i&&!c||c&&i"u"?e[e.length-1].value.push(o[s]):e[e.length-1].value=o[s].value(e[e.length-1].value);else if(o[s].type===7)typeof e[e.length-1].type>"u"?e[e.length-1].value.push(o[s]):e[e.length-1].value=o[s].value(e[e.length-1].value);else if(o[s].type===8){for(var l=[],c=0;c"u"?(r.value=r.concat(n),r.value.push(o[s]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[s]),e.push(n)):e.push({type:1,value:o[s].value(r.value,n.value)})):o[s].type===2||o[s].type===9?(n=e.pop(),r=e.pop(),typeof r.type>"u"?(r=r.concat(n),r.push(o[s]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[s]),e.push(n)):e.push({type:1,value:o[s].value(r.value,n.value)})):o[s].type===12?(n=e.pop(),typeof n.type<"u"&&(n=[n]),r=e.pop(),i=e.pop(),e.push({type:1,value:o[s].value(i.value,r.value,new zy(n))})):o[s].type===13&&(a?e.push({value:t[o[s].value],type:3}):e.push([o[s]]));if(e.length>1)throw new zy.Exception("Uncaught Syntax error");return e[0].value>1e15?"Infinity":parseFloat(e[0].value.toFixed(15))};zy.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 F_e=zy,vV=F_e;vV.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 U_e=vV,B_e=S_e,z_e=C_e,$_e=U_e,H_e=100,V_e=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,ZT,W_e=G_e;function G_e(t,e){ZT=0,e=Math.pow(10,e===void 0?5:e),t=t.replace(/\n+/g," ");function n(i,o,a){if(ZT++>H_e)throw ZT=0,new Error("Call stack overflow for "+a);if(i==="")throw new Error(o+"(): '"+a+"' must contain a non-whitespace string");i=r(i,a);var s=j_e(i);if(s.length>1||i.indexOf("var(")>-1)return o+"("+i+")";var l=s[0]||"";l==="%"&&(i=i.replace(/\b[0-9\.]+%/g,function(p){return parseFloat(p.slice(0,-1))*.01}));var c=i.replace(new RegExp(l,"gi"),""),f;try{f=$_e.eval(c)}catch{return o+"("+i+")"}return l==="%"&&(f*=100),(o.length||l==="%")&&(f=Math.round(f*e)/e),f+=l,f}function r(i,o){i=i.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var a="",s=i,l;l=V_e.exec(s);){l[0].index>0&&(a+=s.substring(0,l[0].index));var c=B_e("(",")",s.substring([0].index));if(c.body==="")throw new Error("'"+i+"' must contain a non-whitespace string");var f=n(c.body,"",o);a+=c.pre+f,s=c.post}return a+s}return z_e(t,/((?:\-[a-z]+\-)?calc)\(/,n)}function j_e(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 QT=Au(W_e);var X_e=typeof iu=="object"&&iu&&iu.Object===Object&&iu,yV=X_e,q_e=yV,Y_e=typeof self=="object"&&self&&self.Object===Object&&self,K_e=q_e||Y_e||Function("return this")(),Tc=K_e,Z_e=Tc,Q_e=Z_e.Symbol,Ex=Q_e,OF=Ex,xV=Object.prototype,J_e=xV.hasOwnProperty,ewe=xV.toString,Qv=OF?OF.toStringTag:void 0;function twe(t){var e=J_e.call(t,Qv),n=t[Qv];try{t[Qv]=void 0;var r=!0}catch{}var i=ewe.call(t);return r&&(e?t[Qv]=n:delete t[Qv]),i}var nwe=twe,rwe=Object.prototype,iwe=rwe.toString;function owe(t){return iwe.call(t)}var awe=owe,kF=Ex,swe=nwe,lwe=awe,cwe="[object Null]",uwe="[object Undefined]",NF=kF?kF.toStringTag:void 0;function fwe(t){return t==null?t===void 0?uwe:cwe:NF&&NF in Object(t)?swe(t):lwe(t)}var mp=fwe;function dwe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var S0=dwe,hwe=mp,pwe=S0,mwe="[object AsyncFunction]",gwe="[object Function]",vwe="[object GeneratorFunction]",ywe="[object Proxy]";function xwe(t){if(!pwe(t))return!1;var e=hwe(t);return e==gwe||e==vwe||e==mwe||e==ywe}var bV=xwe,bwe=Tc,_we=bwe["__core-js_shared__"],wwe=_we,JT=wwe,DF=function(){var t=/[^.]+$/.exec(JT&&JT.keys&&JT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Swe(t){return!!DF&&DF in t}var Mwe=Swe,Ewe=Function.prototype,Cwe=Ewe.toString;function Twe(t){if(t!=null){try{return Cwe.call(t)}catch{}try{return t+""}catch{}}return""}var _V=Twe,Awe=bV,Rwe=Mwe,Pwe=S0,Iwe=_V,Lwe=/[\\^$.*+?()[\]{}|]/g,Owe=/^\[object .+?Constructor\]$/,kwe=Function.prototype,Nwe=Object.prototype,Dwe=kwe.toString,Fwe=Nwe.hasOwnProperty,Uwe=RegExp("^"+Dwe.call(Fwe).replace(Lwe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bwe(t){if(!Pwe(t)||Rwe(t))return!1;var e=Awe(t)?Uwe:Owe;return e.test(Iwe(t))}var zwe=Bwe;function $we(t,e){return t==null?void 0:t[e]}var Hwe=$we,Vwe=zwe,Wwe=Hwe;function Gwe(t,e){var n=Wwe(t,e);return Vwe(n)?n:void 0}var gp=Gwe,jwe=gp,Xwe=jwe(Object,"create"),o2=Xwe,FF=o2;function qwe(){this.__data__=FF?FF(null):{},this.size=0}var Ywe=qwe;function Kwe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Zwe=Kwe,Qwe=o2,Jwe="__lodash_hash_undefined__",eSe=Object.prototype,tSe=eSe.hasOwnProperty;function nSe(t){var e=this.__data__;if(Qwe){var n=e[t];return n===Jwe?void 0:n}return tSe.call(e,t)?e[t]:void 0}var rSe=nSe,iSe=o2,oSe=Object.prototype,aSe=oSe.hasOwnProperty;function sSe(t){var e=this.__data__;return iSe?e[t]!==void 0:aSe.call(e,t)}var lSe=sSe,cSe=o2,uSe="__lodash_hash_undefined__";function fSe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=cSe&&e===void 0?uSe:e,this}var dSe=fSe,hSe=Ywe,pSe=Zwe,mSe=rSe,gSe=lSe,vSe=dSe;function M0(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var kSe=OSe,NSe=a2;function DSe(t,e){var n=this.__data__,r=NSe(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var FSe=DSe,USe=bSe,BSe=ASe,zSe=ISe,$Se=kSe,HSe=FSe;function E0(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e=0)&&(n[i]=t[i]);return n}function eA(t){return typeof t=="number"}function $F(t){return typeof t=="number"&&Number.isFinite(t)||typeof t=="string"}function wMe(t){var e=t.verticalAnchor,n=e===void 0?"end":e,r=t.scaleToFit,i=r===void 0?!1:r,o=t.angle,a=t.width,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,f=c===void 0?"0.71em":c,p=t.children,m=t.style,v=_Me(t,bMe),x=v.x,_=x===void 0?0:x,b=v.y,y=b===void 0?0:b,S=!$F(_)||!$F(y),M=F.useMemo(function(){var k=p==null?[]:p.toString().split(/(?:(?!\u00A0+)\s+)/);return{wordsWithWidth:k.map(function(N){return{word:N,wordWidth:zF(N,m)||0}}),spaceWidth:zF(" ",m)||0}},[p,m]),C=M.wordsWithWidth,A=M.spaceWidth,R=F.useMemo(function(){return S?[]:a||i?C.reduce(function(k,N){var z=N.word,K=N.wordWidth,J=k[k.length-1];if(J&&(a==null||i||(J.width||0)+K+A0){var N=R[0].width||1,z=i==="shrink-only"?Math.min(a/N,1):a/N,K=z,J=_-z*_,G=y-K*y;k.push("matrix("+z+", 0, 0, "+K+", "+J+", "+G+")")}return o&&k.push("rotate("+o+", "+_+", "+y+")"),k.length>0?k.join(" "):""},[S,_,y,a,i,R,o]);return{wordsByLines:R,startDy:P,transform:U}}var SMe=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function k3(){return k3=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var EMe={overflow:"visible"};function MV(t){var e=t.dx,n=e===void 0?0:e,r=t.dy,i=r===void 0?0:r,o=t.textAnchor,a=o===void 0?"start":o,s=t.innerRef,l=t.innerTextRef;t.verticalAnchor,t.angle;var c=t.lineHeight,f=c===void 0?"1em":c;t.scaleToFit,t.capHeight,t.width;var p=MMe(t,SMe),m=p.x,v=m===void 0?0:m,x=p.fontSize,_=wMe(t),b=_.wordsByLines,y=_.startDy,S=_.transform;return Z.createElement("svg",{ref:s,x:n,y:i,fontSize:x,style:EMe},b.length>0?Z.createElement("text",k3({ref:l,transform:S},p,{textAnchor:a}),b.map(function(M,C){return Z.createElement("tspan",{key:C,x:v,dy:C===0?y:f},M.words.join(" "))})):null)}var CMe={top:"top",left:"left",right:"right",bottom:"bottom"};const Qa=CMe;function TMe(t){var e=t.labelOffset,n=t.labelProps,r=t.orientation,i=t.range,o=t.tickLabelFontSize,a=t.tickLength,s=r===Qa.left||r===Qa.top?-1:1,l,c,f;if(r===Qa.top||r===Qa.bottom){var p=r===Qa.bottom&&typeof n.fontSize=="number"?n.fontSize:0;l=(Number(i[0])+Number(i[i.length-1]))/2,c=s*(a+e+o+p)}else l=s*((Number(i[0])+Number(i[i.length-1]))/2),c=-(a+e),f="rotate("+s*90+")";return{x:l,y:c,transform:f}}function $y(){return $y=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function EV(t){var e=t.children,n=e===void 0?RMe:e,r=t.axisClassName,i=t.hideAxisLine,o=i===void 0?!1:i,a=t.hideTicks,s=a===void 0?!1:a,l=t.hideZero,c=l===void 0?!1:l,f=t.left,p=f===void 0?0:f,m=t.numTicks,v=m===void 0?10:m,x=t.orientation,_=x===void 0?Qa.bottom:x,b=t.rangePadding,y=b===void 0?0:b,S=t.scale,M=t.tickFormat,C=t.tickLength,A=C===void 0?8:C,R=t.tickValues,P=t.top,U=P===void 0?0:P,k=kMe(t,OMe),N=M??IMe(S),z=_===Qa.left,K=_===Qa.top,J=K||_===Qa.bottom,G=PMe(S),ne=z||K?-1:1,ie=S.range(),se=LMe(y),H=dw({x:Number(ie[0])+.5-se.start,y:0},J),Y=dw({x:Number(ie[ie.length-1])+.5+se.end,y:0},J),te=(R??UL(S,v)).filter(function(ae){return!c||ae!==0&&ae!=="0"}).map(function(ae,xe){return{value:ae,index:xe}}),Q=te.map(function(ae){var xe=ae.value,we=ae.index,Te=FL(G(xe));return{value:xe,index:we,from:dw({x:Te,y:0},J),to:dw({x:Te,y:A*ne},J),formattedValue:N(xe,we,te)}});return Z.createElement(Mx,{className:Mc("visx-axis",r),top:U,left:p},n(D3({},k,{axisFromPoint:H,axisToPoint:Y,hideAxisLine:o,hideTicks:s,hideZero:c,horizontal:J,numTicks:v,orientation:_,rangePadding:y,scale:S,tickFormat:N,tickLength:A,tickPosition:G,tickSign:ne,ticks:Q})))}var NMe=["axisClassName","labelOffset","tickLength","tickLabelProps"];function KS(){return KS=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var FMe={dx:"-0.25em",dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"end"};function UMe(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?36:n,i=t.tickLength,o=i===void 0?8:i,a=t.tickLabelProps,s=DMe(t,NMe),l=typeof a=="function"?a:KS({},FMe,a);return Z.createElement(EV,KS({axisClassName:Mc("visx-axis-left",e),labelOffset:r,orientation:Qa.left,tickLabelProps:l,tickLength:o},s))}var BMe=["axisClassName","labelOffset","tickLength","tickLabelProps"];function ZS(){return ZS=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var $Me={dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"middle"};function HMe(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?8:n,i=t.tickLength,o=i===void 0?8:i,a=t.tickLabelProps,s=zMe(t,BMe),l=typeof a=="function"?a:ZS({},$Me,a);return Z.createElement(EV,ZS({axisClassName:Mc("visx-axis-bottom",e),labelOffset:r,orientation:Qa.bottom,tickLabelProps:l,tickLength:o},s))}var CV=XMe,VMe=TV(F),WMe=TV(cV),GMe=["from","to","fill","className","innerRef"];function TV(t){return t&&t.__esModule?t:{default:t}}function F3(){return F3=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function XMe(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,a=o===void 0?"transparent":o,s=t.className,l=t.innerRef,c=jMe(t,GMe),f=n.x===i.x||n.y===i.y;return VMe.default.createElement("line",F3({ref:l,className:(0,WMe.default)("visx-line",s),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:a,shapeRendering:f?"crispEdges":"auto"},c))}function AV(t){return"bandwidth"in t?t.bandwidth():0}var qMe=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function U3(){return U3=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function RV(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,a=t.width,s=t.stroke,l=s===void 0?"#eaf0f6":s,c=t.strokeWidth,f=c===void 0?1:c,p=t.strokeDasharray,m=t.className,v=t.children,x=t.numTicks,_=x===void 0?10:x,b=t.lineStyle,y=t.offset,S=t.tickValues,M=YMe(t,qMe),C=S??UL(o,_),A=(y??0)+AV(o)/2,R=C.map(function(P,U){var k,N=((k=FL(o(P)))!=null?k:0)+A;return{index:U,from:new X1({x:0,y:N}),to:new X1({x:a,y:N})}});return Z.createElement(Mx,{className:Mc("visx-rows",m),top:n,left:i},v?v({lines:R}):R.map(function(P){var U=P.from,k=P.to,N=P.index;return Z.createElement(CV,U3({key:"row-line-"+N,from:U,to:k,stroke:l,strokeWidth:f,strokeDasharray:p,style:b},M))}))}RV.propTypes={tickValues:qe.array,width:qe.number.isRequired};var KMe=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function B3(){return B3=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function PV(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,a=t.height,s=t.stroke,l=s===void 0?"#eaf0f6":s,c=t.strokeWidth,f=c===void 0?1:c,p=t.strokeDasharray,m=t.className,v=t.numTicks,x=v===void 0?10:v,_=t.lineStyle,b=t.offset,y=t.tickValues,S=t.children,M=ZMe(t,KMe),C=y??UL(o,x),A=(b??0)+AV(o)/2,R=C.map(function(P,U){var k,N=((k=FL(o(P)))!=null?k:0)+A;return{index:U,from:new X1({x:N,y:0}),to:new X1({x:N,y:a})}});return Z.createElement(Mx,{className:Mc("visx-columns",m),top:n,left:i},S?S({lines:R}):R.map(function(P){var U=P.from,k=P.to,N=P.index;return Z.createElement(CV,B3({key:"column-line-"+N,from:U,to:k,stroke:l,strokeWidth:f,strokeDasharray:p,style:_},M))}))}PV.propTypes={tickValues:qe.array,height:qe.number.isRequired};function jn(t){for(var e=t.length/6|0,n=new Array(e),r=0;r_xe(t[t.length-1]);var QMe=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(jn);const JMe=cr(QMe);var eEe=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(jn);const tEe=cr(eEe);var nEe=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(jn);const rEe=cr(nEe);var iEe=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(jn);const oEe=cr(iEe);var aEe=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(jn);const sEe=cr(aEe);var lEe=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(jn);const cEe=cr(lEe);var uEe=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(jn);const fEe=cr(uEe);var dEe=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(jn);const hEe=cr(dEe);var pEe=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(jn);const mEe=cr(pEe);var gEe=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(jn);const vEe=cr(gEe);var yEe=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(jn);const xEe=cr(yEe);var bEe=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(jn);const _Ee=cr(bEe);var wEe=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(jn);const SEe=cr(wEe);var MEe=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(jn);const EEe=cr(MEe);var CEe=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(jn);const TEe=cr(CEe);var AEe=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(jn);const REe=cr(AEe);var PEe=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(jn);const IEe=cr(PEe);var LEe=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(jn);const OEe=cr(LEe);var kEe=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(jn);const NEe=cr(kEe);var DEe=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(jn);const FEe=cr(DEe);var UEe=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(jn);const BEe=cr(UEe);var zEe=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(jn);const $Ee=cr(zEe);var HEe=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(jn);const VEe=cr(HEe);var WEe=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(jn);const GEe=cr(WEe);var jEe=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(jn);const XEe=cr(jEe);var qEe=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(jn);const YEe=cr(qEe);var KEe=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(jn);const ZEe=cr(KEe);function QEe(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 JEe=n2(Sc(300,.5,0),Sc(-240,.5,1));var e2e=n2(Sc(-100,.75,.35),Sc(80,1.5,.8)),t2e=n2(Sc(260,.75,.35),Sc(80,1.5,.8)),hw=Sc();function n2e(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return hw.h=360*t-100,hw.s=1.5-1.5*e,hw.l=.8-.9*e,hw+""}var pw=Jf(),r2e=Math.PI/3,i2e=Math.PI*2/3;function o2e(t){var e;return t=(.5-t)*Math.PI,pw.r=255*(e=Math.sin(t))*e,pw.g=255*(e=Math.sin(t+r2e))*e,pw.b=255*(e=Math.sin(t+i2e))*e,pw+""}function a2e(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 c2(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const s2e=c2(jn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var l2e=c2(jn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),c2e=c2(jn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),u2e=c2(jn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),IV={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},VF=Z.createContext&&Z.createContext(IV),Xf=globalThis&&globalThis.__assign||function(){return Xf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0},t.prototype.connect_=function(){!z3||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),w2e?(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(){!z3||!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=_2e.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}(),kV=function(t,e){for(var n=0,r=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof u0(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new I2e(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 u0(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 L2e(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}(),DV=typeof WeakMap<"u"?new WeakMap:new OV,FV=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=S2e.getInstance(),r=new O2e(e,n,this);DV.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){FV.prototype[t]=function(){var e;return(e=DV.get(this))[t].apply(e,arguments)}});var k2e=function(){return typeof QS.ResizeObserver<"u"?QS.ResizeObserver:FV}(),N2e=["client","offset","scroll","bounds","margin"];function GF(t){var e=[];return N2e.forEach(function(n){t[n]&&e.push(n)}),e}function jF(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 D2e(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||window}function F2e(t){return function(e){var n,r;return r=n=function(i){yI(o,i);function o(){for(var s,l=arguments.length,c=new Array(l),f=0;f0?e=t-1:this._settings.wrap?e=this._members.length-1:e=t,this.focusNodeAtIndex(e),e};Tr.prototype.moveFocusToFirst=function(){this.focusNodeAtIndex(0)};Tr.prototype.moveFocusToLast=function(){this.focusNodeAtIndex(this._members.length-1)};Tr.prototype._handleUnboundKey=function(t){if(this._settings.stringSearch){if(this._searchString!==""&&(t.key===" "||t.keyCode===32))return t.preventDefault(),-1;if(!X2e(t.keyCode)||t.ctrlKey||t.metaKey||t.altKey)return-1;t.preventDefault(),this._addToSearchString(String.fromCharCode(t.keyCode)),this._runStringSearch()}};Tr.prototype._clearSearchString=function(){this._searchString=""};Tr.prototype._addToSearchString=function(t){this._searchString+=t.toLowerCase()};Tr.prototype._startSearchStringRefreshTimer=function(){var t=this;this._clearSearchStringRefreshTimer(),this._stringSearchTimer=setTimeout(function(){t._clearSearchString()},this._settings.stringSearchDelay)};Tr.prototype._clearSearchStringRefreshTimer=function(){clearTimeout(this._stringSearchTimer)};Tr.prototype._runStringSearch=function(){this._startSearchStringRefreshTimer(),this.moveFocusByString(this._searchString)};Tr.prototype.moveFocusByString=function(t){for(var e,n=0,r=this._members.length;n=65&&t<=90}function $V(t){!t||!t.focus||(t.focus(),t.tagName.toLowerCase()==="input"&&t.select())}var q2e=function(e){return new Tr(e)},Y2e=q2e,XF=zV,K2e={wrap:!0,stringSearch:!0},Z2e={init:function(e){this.updateOptions(e),this.handleBlur=Q2e.bind(this),this.handleSelection=J2e.bind(this),this.handleMenuKey=eCe.bind(this),this.focusGroup=Y2e(K2e),this.button=null,this.menu=null,this.isOpen=!1},updateOptions:function(e){var n=this.options;this.options=e||this.options||{},typeof this.options.closeOnSelection>"u"&&(this.options.closeOnSelection=!0),typeof this.options.closeOnBlur>"u"&&(this.options.closeOnBlur=!0),this.options.id&&XF.registerManager(this.options.id,this),n&&n.id&&n.id!==this.options.id&&XF.unregisterManager(this.options.id,this)},focusItem:function(e){this.focusGroup.focusNodeAtIndex(e)},addItem:function(e){this.focusGroup.addMember(e)},clearItems:function(){this.focusGroup.clearMembers()},handleButtonNonArrowKey:function(e){this.focusGroup._handleUnboundKey(e)},destroy:function(){this.button=null,this.menu=null,this.focusGroup.deactivate(),clearTimeout(this.blurTimer),clearTimeout(this.moveFocusTimer)},update:function(){this.menu.setState({isOpen:this.isOpen}),this.button.setState({menuOpen:this.isOpen}),this.options.onMenuToggle&&this.options.onMenuToggle({isOpen:this.isOpen})},openMenu:function(e){if(!this.isOpen&&(e=e||{},e.focusMenu===void 0&&(e.focusMenu=!0),this.isOpen=!0,this.update(),this.focusGroup.activate(),e.focusMenu)){var n=this;this.moveFocusTimer=setTimeout(function(){n.focusItem(0)},0)}},closeMenu:function(e){this.isOpen&&(e=e||{},this.isOpen=!1,this.update(),e.focusButton&&this.button.ref.current.focus())},toggleMenu:function(e,n){e=e||{},n=n||{},this.isOpen?this.closeMenu(e):this.openMenu(n)}};function Q2e(){var t=this;t.blurTimer=setTimeout(function(){if(t.button){var e=t.button.ref.current;if(e){var n=e.ownerDocument.activeElement;if(!(e&&n===e)){var r=t.menu.ref.current;if(r===n){t.focusItem(0);return}r&&r.contains(n)||t.isOpen&&t.closeMenu({focusButton:!1})}}}},0)}function J2e(t,e){this.options.closeOnSelection&&this.closeMenu({focusButton:!0}),this.options.onSelection&&this.options.onSelection(t,e)}function eCe(t){if(this.isOpen)switch(t.key){case"Escape":t.preventDefault(),this.closeMenu({focusButton:!0});break;case"Home":t.preventDefault(),this.focusGroup.moveFocusToFirst();break;case"End":t.preventDefault(),this.focusGroup.moveFocusToLast();break}}var tCe=function(t){var e=Object.create(Z2e);return e.init(t),e},nCe=F,rCe=nCe.createContext(),d2=rCe,mw=p0,h2={refType:mw.oneOfType([mw.func,mw.shape({current:mw.elementType})])},p2=function(t,e,n){n=n||{};for(var r in e)e.hasOwnProperty(r)&&(n[r]||(t[r]=e[r]))};function iCe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oCe(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function aCe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Hy=F,Nm=p0,sCe=tCe,lCe=d2,cCe=h2,uCe=cCe.refType,$3=p2,eM={children:Nm.node.isRequired,forwardedRef:uCe,onMenuToggle:Nm.func,onSelection:Nm.func,closeOnSelection:Nm.bool,closeOnBlur:Nm.bool,tag:Nm.string},qF=function(e){return{onMenuToggle:e.onMenuToggle,onSelection:e.onSelection,closeOnSelection:e.closeOnSelection,closeOnBlur:e.closeOnBlur,id:e.id}},VL=function(t){aCe(e,t);function e(n){iCe(this,e);var r=oCe(this,t.call(this,n));return r.manager=sCe(qF(n)),r}return e.prototype.componentDidUpdate=function(){this.manager.updateOptions(qF(this.props))},e.prototype.render=function(){var r={};return $3(r,this.props,eM),Hy.createElement(lCe.Provider,{value:this.manager},Hy.createElement(this.props.tag,r,this.props.children))},e}(Hy.Component);VL.propTypes=eM;VL.defaultProps={tag:"div"};var fCe=Hy.forwardRef(function(t,e){var n={forwardedRef:e};return $3(n,t,{children:eM.children,forwardedRef:eM.forwardedRef}),$3(n,{forwardedRef:e}),Hy.createElement(VL,n,t.children)});function dCe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function YF(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function hCe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ug=F,gw=p0,pCe=d2,mCe=h2,gCe=mCe.refType,Zw=p2,Vy={ambManager:gw.object.isRequired,children:gw.node.isRequired,disabled:gw.bool,forwardedRef:gCe,tag:gw.string},vCe=function(){return["button","fieldset","input","optgroup","option","select","textarea"]},WL=function(t){hCe(e,t);function e(){var n,r,i;dCe(this,e);for(var o=arguments.length,a=Array(o),s=0;s=0&&delete a.disabled,i.options.closeOnBlur&&(o.onBlur=i.handleBlur),Zw(o,r,a),Zw(o,{ref:this.setRef}),Ug.createElement(r.tag,o,r.children)},e}(Ug.Component);WL.propTypes=Vy;WL.defaultProps={tag:"span"};var yCe=Ug.forwardRef(function(t,e){return Ug.createElement(pCe.Consumer,null,function(n){var r={ambManager:n,forwardedRef:e};return Zw(r,t,{ambManager:Vy.ambManager,children:Vy.children,forwardedRef:Vy.forwardedRef}),Ug.createElement(WL,r,t.children)})}),xCe=function(e,n,r){var i=0,o=0,a=!1,s=!1,l=!1;e.addEventListener("click",c,r),e.addEventListener("touchstart",f,r);function c(b){l||n(b)}function f(b){l=!0,!a&&(a=!0,e.addEventListener("touchmove",p,r),e.addEventListener("touchend",m,r),e.addEventListener("touchcancel",v,r),s=!1,i=b.touches[0].clientX,o=b.touches[0].clientY)}function p(b){s||Math.abs(b.touches[0].clientX-i)<=10&&Math.abs(b.touches[0].clientY-o)<=10||(s=!0)}function m(b){a=!1,x(),s||n(b)}function v(){a=!1,s=!1,i=0,o=0}function x(){e.removeEventListener("touchmove",p,r),e.removeEventListener("touchend",m,r),e.removeEventListener("touchcancel",v,r)}function _(){e.removeEventListener("click",c,r),e.removeEventListener("touchstart",f,r),x()}return{remove:_}};function bCe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function KF(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function _Ce(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Bg=F,Jv=p0,wCe=xCe,SCe=d2,MCe=h2,ECe=MCe.refType,H3=p2,Wy={ambManager:Jv.object.isRequired,children:Jv.oneOfType([Jv.func,Jv.node]).isRequired,forwardedRef:ECe,tag:Jv.string},GL=function(t){_Ce(e,t);function e(){var n,r,i;bCe(this,e);for(var o=arguments.length,a=Array(o),s=0;s{let e;const n=new Set,r=(l,c)=>{const f=typeof l=="function"?l(e):l;if(!Object.is(f,e)){const p=e;e=c??typeof f!="object"?f:Object.assign({},e,f),n.forEach(m=>m(e,p))}},i=()=>e,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return e=t(r,i,s),s},OCe=t=>t?JF(t):JF,{useSyncExternalStoreWithSelector:kCe}=H$;function NCe(t,e=t.getState,n){const r=kCe(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return F.useDebugValue(r),r}const eU=t=>{const e=typeof t=="function"?OCe(t):t,n=(r,i)=>NCe(e,r,i);return Object.assign(n,e),n},DCe=t=>t?eU(t):eU;var FCe=Object.defineProperty,UCe=(t,e,n)=>e in t?FCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vw=(t,e,n)=>(UCe(t,typeof e!="symbol"?e+"":e,n),n);const XL=F.createContext({}),BCe=F.createContext(void 0),zCe="_wrapper_1t5kp_1",$Ce="_grid_1t5kp_6",HCe="_innerContainer_1t5kp_15",VCe="_colHeaders_1t5kp_19",WCe="_rowHeaders_1t5kp_23",GCe="_indexCell_1t5kp_28",jCe="_topLeftCell_1t5kp_49 _indexCell_1t5kp_28",XCe="_stickyGrid_1t5kp_53",qCe="_cell_1t5kp_72",xh={wrapper:zCe,grid:$Ce,innerContainer:HCe,colHeaders:VCe,rowHeaders:WCe,indexCell:GCe,topLeftCell:jCe,stickyGrid:XCe,cell:qCe};function YCe(t){const{rowIndex:e,columnIndex:n,style:r}=t,{rowHeaderCellsWidth:i,cellSize:o,cellFormatter:a}=F.useContext(XL);return O.jsx("div",{className:xh.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:a(e,n)})}F.memo(YCe);function tU(t){const{indexMin:e,indexMax:n,width:r,transform:i,headers:o}=t,{cellSize:a}=F.useContext(XL);return O.jsx(O.Fragment,{children:Co.range(e,n+1).map(s=>O.jsx("div",{className:xh.indexCell,style:{width:r||a.width,height:a.height,transform:i},"data-bg":s%2===1?"":void 0,children:s>=0&&o?o[s]:s},s.toString()))})}const KCe=F.forwardRef((t,e)=>{const{children:n,style:r}=t,{rowCount:i,columnCount:o,cellSize:a,sticky:s,rowHeaderCellsWidth:l,columnHeaders:c}=F.useContext(XL),f=F.useContext(BCe),{overscanColumnStartIndex:p=0,overscanColumnStopIndex:m=0,overscanRowStartIndex:v=0,overscanRowStopIndex:x=0}=f||{};return O.jsxs("div",{ref:e,className:xh.stickyGrid,style:{...r,width:r.width+l,height:r.height+a.height},role:"table","aria-rowcount":i,"aria-colcount":o,"data-sticky":s||void 0,children:[O.jsxs("div",{className:xh.colHeaders,children:[O.jsx("div",{className:xh.topLeftCell,style:{width:l,height:a.height},"data-bg":!0,"aria-hidden":"true"}),O.jsx(tU,{indexMin:p,indexMax:m,transform:`translateX(${a.width*p}px)`,headers:c})]}),O.jsxs("div",{className:xh.innerContainer,children:[O.jsx("div",{className:xh.rowHeaders,"aria-hidden":"true",children:O.jsx(tU,{indexMin:v,indexMax:x,transform:`translateY(${a.height*v}px)`,width:l})}),n]})]})});KCe.displayName="StickyGrid";var T0=(t=>(t.Group="group",t.Dataset="dataset",t.Datatype="datatype",t.Unresolved="unresolved",t))(T0||{}),Vo=(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.Unknown="Unknown",t))(Vo||{}),m2=(t=>(t.LE="little-endian",t.BE="big-endian",t))(m2||{}),Sn=(t=>(t.Linear="linear",t.Log="log",t.SymLog="symlog",t.Sqrt="sqrt",t.Gamma="gamma",t))(Sn||{});Sn.Linear,Sn.Log,Sn.SymLog;Sn.Linear,Sn.Log,Sn.SymLog,Sn.Sqrt;const nU=Cc(".3~e"),nA=Cc(".5~e");Cc(".5~g");Cc(".3~g");eTe(".12~g");const qL=3,ZCe=/0\.([0-9]+)$/u,QCe=Cc(`.${qL}~g`),JCe=Cc(`.${qL}~e`);function rA(t){const e=QCe(t),n=ZCe.exec(e);return n&&n[1].length>qL?JCe(t):e}function eTe(t,e=!1){const n=Cc(t);return r=>{const[i,o]=r;if(o===0&&!e)return`${n(i)}`;if(i===0&&!e)return`${n(o)} i`;const a=Math.sign(o)>=0?" + ":" − ";return`${n(i)}${a}${n(Math.abs(o))} i`}}function tTe(t,e){return`${t==="/"?"":t}/${e}`}function nTe(t){const[e,n]=t.shape;return{rows:e,cols:n}}Vo.Unsigned,Vo.Integer,Vo.Float,Vo.String,Vo.Bool,Vo.Complex;function rTe(t){return t!==void 0}function iTe(t){return t!==null}function Qw(t,e="Expected some value"){if(!rTe(t))throw new TypeError(e)}function iA(t,e="Expected value to not be null"){if(!iTe(t))throw new TypeError(e)}function oTe(t){return t.kind===T0.Group}function aTe(t){return"children"in t}function sTe(t){return(...e)=>F.useMemo(()=>t(...e),e)}const wf=Co.range(-20,21),Jw=Co.range(0,100,5),lTe=Co.range(-1,1.25,.25),cTe=Co.range(10,40,10),uTe=Co.range(1,4),fTe=Co.range(9335,9338),q1=wf.map(t=>t**2),eS=Jw.map(t=>q1.map(e=>e-t)),VV=lTe.map(t=>eS.map(e=>e.map(n=>n*t))),dTe=cTe.map(t=>VV.map(e=>e.map(n=>n.map(r=>Math.sin(r/t))))),yw=[0,1,2,3],V3=[[[255,0,0],[0,255,0],[0,0,255]],[[0,255,255],[255,0,255],[255,255,0]],[[0,0,0],[128,128,128],[255,255,255]]],xw=V3.flat(1/0),YL=Co.range(1,11).map(t=>[t*Math.cos(t*3.14/10),t*Math.sin(t*3.14/10)]),WV=["Hydrogen","Lithum","Carbon","Sodium","Argon"].map((t,e)=>[t,e,q1[e],e%2===0,YL[e]]),oA=[!0,!1,!1,!0,!0,!0,!1,!0,!1,!1],hTe=[WV,["Vanadium","Niobium","Tantalum","Silicon","Germanium"].map((t,e)=>[t,e*10,q1[e],e%2===1,YL[e]])],pTe={null:null,raw:{int:42},scalar_int:0,scalar_int_42:42,scalar_str:"foo",scalar_bool:!0,scalar_cplx:[1,5],oneD:q1,oneD_cplx:YL,oneD_linear:wf,oneD_errors:q1.map(t=>Math.abs(t)/10),oneD_str:["foo","bar"],oneD_bool:oA,twoD:eS,twoD_errors:Jw.map(t=>wf.map(e=>Math.abs(e-t))),twoD_cplx:[[[0,-5],[-2.1,-2]],[[5,0],[-3,.1]]],twoD_bool:oA.map(t=>oA.map(e=>t?e:!e)),threeD:VV,threeD_bool:[[[!0,!1,!0,!1],[!0,!0,!0,!0],[!1,!1,!1,!1]],[[!0,!1,!1,!1],[!0,!0,!0,!0],[!1,!1,!0,!1]]],threeD_cplx:[[[[2,0],[1.41,1.41],[1,1.73],[0,2]],[[4,0],[2.82,2.82],[2,3.46],[0,4]],[[1,0],[.71,.71],[.5,.87],[0,1]]],[[[-1,0],[.87,-.5],[.92,-.38],[1,0]],[[-4,0],[3.46,-2],[3.7,-1.53],[4,0]],[[-8,0],[6.93,-4],[7.39,-3.06],[8,0]]]],threeD_rgb:V3,fourD_rgb:Co.range(0,10).map(t=>V3.map(e=>e.map(n=>n.map(r=>Math.min(r+t*20,255))))),fourD:dTe,uint8:Uint8Array.from(yw),int16:Int16Array.from(yw),float32:Float32Array.from(yw),float64:Float64Array.from(yw),int8_rgb:Int8Array.from(xw.map(t=>t-128)),uint8_rgb:Uint8Array.from(xw),int32_rgb:Uint32Array.from(xw),float32_rgb:Float32Array.from(xw.map(t=>t/255)),X:wf,X_desc:[...wf].reverse(),X_log:wf.map((t,e)=>(e+1)*.1),X_rgb:uTe,Y:Jw,Y_desc:[...Jw].reverse(),Y_rgb:fTe,title_twoD:"NeXus 2D",secondary:eS.map(t=>t.map(e=>e*2)),tertiary:eS.map(t=>t.map(e=>e/2)),position:[-1,1,3],scatter_data:wf.map(t=>Math.cos(t*3.14/40)),Y_scatter:wf.map((t,e)=>(e%10+e%5)/123456),oneD_compound:WV,twoD_compound:hTe},Dt={class:Vo.Integer,endianness:m2.LE,size:32};Vo.Unsigned,m2.LE;const ru={class:Vo.Float,endianness:m2.LE,size:64},lu={class:Vo.String,charSet:"ASCII"},aA={class:Vo.Compound,fields:{int:Dt}},hy={class:Vo.Bool},ph={class:Vo.Complex,realType:ru,imagType:ru},rU={class:Vo.Compound,fields:{string:lu,int:Dt,float:ru,bool:hy,complex:ph}};function KL(t,e,n,r){return{name:t,type:e,shape:n,value:r}}function GV(t,e,n){return KL(t,e,[],n)}function wi(t,e){return GV(t,lu,e)}function iU(t,e){return GV(t,Dt,e)}function W3(t,e){return{...t,attributes:[...t.attributes,...e]}}function Dm(t){return W3(t,[wi("CLASS","IMAGE"),wi("IMAGE_VERSION","1.2")])}function jV(t,e){t.children.forEach(n=>{n.path=tTe(e,n.path.slice(1)),oTe(n)&&aTe(n)&&jV(n,e)})}function Va(t,e=[],n={}){const{attributes:r=[],link:i,isRoot:o=!1}=n,a=o?"/":`/${t}`,s={name:t,path:a,kind:T0.Group,children:e,attributes:r,link:i};return jV(s,a),s}function Wt(t,e,n,r={}){const{attributes:i=[],valueId:o=t,link:a}=r;return{name:t,path:`/${t}`,kind:T0.Dataset,attributes:i,shape:n,type:e,value:pTe[o],link:a}}function Is(t,e,n={}){return Wt(t,e,[],n)}function mTe(t,e,n={}){const{attributes:r=[],link:i}=n;return{name:t,path:`/${t}`,kind:T0.Datatype,attributes:r,type:e,link:i}}function sA(t,e,n,r){return{name:t,path:`/${t}`,kind:T0.Unresolved,attributes:[],link:{class:e,file:r,path:n}}}function gTe(t){return KL("axes",lu,[t.length],t)}function vTe(t){return KL("auxiliary_signals",lu,[t.length],t)}function yTe(t){const{signalScaleType:e,axisScaleTypes:n}=t;return wi("SILX_style",JSON.stringify({signal_scale_type:e,axes_scale_type:n}))}function Ls(t,e,n={}){const{defaultPath:r,children:i,...o}=n;return Va(t,i,{...o,attributes:[...o.attributes??[],wi("NX_class",e),...r?[wi("default",r)]:[]]})}function Qi(t,e){const{signal:n,title:r,errors:i,silxStyle:o,axes:a={},axesAttr:s,auxiliary:l={},auxAttr:c,attributes:f=[],children:p=[],...m}=e;return Ls(t,"NXdata",{...m,attributes:[wi("signal",n.name),...s?[gTe(s)]:[],...o?[yTe(o)]:[],...c?[vTe(c)]:[],...f],children:[n,...r?[r]:[],...i?[i]:[],...Object.values(a),...Object.values(l),...p]})}function Bi(t,e,n,r={}){const{interpretation:i,longName:o,units:a,...s}=r;return Wt(t,e,n,{...s,attributes:[...s.attributes??[],...i?[wi("interpretation",i)]:[],...o?[wi("long_name",o)]:[],...a?[wi("units",a)]:[]]})}const xTe="source.h5";Ls(xTe,"NXroot",{isRoot:!0,defaultPath:"nexus_entry",children:[Va("entities",[Va("empty_group"),Wt("empty_dataset",Dt,null),mTe("datatype",aA),Is("raw",aA),Is("raw_large",aA),Is("scalar_int",Dt),Is("scalar_str",lu),Is("scalar_bool",hy),Is("scalar_cplx",ph),sA("unresolved_hard_link","Hard"),sA("unresolved_soft_link","Soft","/foo"),sA("unresolved_external_link","External","entry_000/dataset","my_file.h5")]),Va("nD_datasets",[Wt("oneD_linear",Dt,[41]),Wt("oneD",Dt,[41]),Wt("oneD_cplx",ph,[10]),Wt("oneD_compound",rU,[5]),Wt("oneD_bool",hy,[10]),Wt("twoD",Dt,[20,41]),Wt("twoD_cplx",ph,[2,2]),Wt("twoD_compound",rU,[2,5]),Wt("twoD_bool",hy,[10,10]),Wt("threeD",Dt,[9,20,41]),Wt("threeD_bool",hy,[2,3,4]),Wt("threeD_cplx",ph,[2,3,4]),Dm(Wt("threeD_rgb",Dt,[3,3,3])),Wt("fourD",Dt,[3,9,20,41])]),Va("typed_arrays",[Wt("uint8",Dt,[2,2]),Wt("int16",Dt,[2,2]),Wt("float32",Dt,[2,2]),Wt("float64",Dt,[2,2]),Dm(Wt("int8_rgb",Dt,[3,3,3])),Dm(Wt("uint8_rgb",Dt,[3,3,3])),Dm(Wt("int32_rgb",Dt,[3,3,3])),Dm(Wt("float32_rgb",Dt,[3,3,3]))]),Ls("nexus_entry","NXentry",{defaultPath:"nx_process/nx_data",children:[Ls("nx_process","NXprocess",{children:[Qi("nx_data",{signal:Wt("twoD",Dt,[20,41]),silxStyle:{signalScaleType:Sn.SymLog},title:Is("title",lu,{valueId:"title_twoD"})}),Ls("absolute_default_path","NXentry",{defaultPath:"/nexus_entry/nx_process/nx_data"})]}),Qi("spectrum",{signal:Bi("twoD_spectrum",Dt,[20,41],{valueId:"twoD",interpretation:"spectrum",units:"arb. units"}),errors:Wt("errors",ru,[20,41],{valueId:"twoD_errors"}),axes:{X:Bi("X",Dt,[41],{units:"nm"})},axesAttr:[".","X"]}),Qi("image",{signal:Bi("fourD_image",Dt,[3,9,20,41],{valueId:"fourD",longName:"Interference fringes",interpretation:"image"}),axes:{X:Bi("X",Dt,[41],{units:"nm"}),Y:Bi("Y",Dt,[20],{units:"deg",longName:"Angle (degrees)"})},axesAttr:[".",".","Y","X"],silxStyle:{signalScaleType:Sn.Log}}),Qi("log_spectrum",{signal:Wt("oneD",Dt,[41]),errors:Wt("oneD_errors",Dt,[41]),axes:{X_log:Wt("X_log",ru,[41])},axesAttr:["X_log"],silxStyle:{signalScaleType:Sn.Log,axisScaleTypes:[Sn.Log]}}),Qi("spectrum_with_aux",{signal:Bi("twoD_spectrum",Dt,[20,41],{valueId:"twoD",interpretation:"spectrum",units:"arb. units"}),errors:Wt("errors",ru,[20,41],{valueId:"twoD_errors"}),axes:{X:Bi("X",Dt,[41],{units:"nm"})},axesAttr:[".","X"],auxiliary:{secondary:Wt("secondary",Dt,[20,41]),tertiary:Wt("tertiary",Dt,[20,41])},auxAttr:["secondary","tertiary"],children:[Wt("secondary_errors",ru,[20,41],{valueId:"twoD_errors"})]}),Qi("complex",{signal:Wt("twoD_complex",ph,[2,2],{valueId:"twoD_cplx"}),axes:{position:Wt("position",Dt,[3])},axesAttr:[".","position"]}),Qi("complex_spectrum",{signal:Bi("twoD_complex",ph,[2,2],{valueId:"twoD_cplx",interpretation:"spectrum"})}),Qi("rgb-image",{signal:Dm(Bi("fourD_rgb",Dt,[10,3,3,3],{longName:"RGB CMY DGW",interpretation:"rgb-image"})),axes:{X_rgb:Wt("X_rgb",ru,[3]),Y_rgb:Wt("Y_rgb",ru,[3])},axesAttr:[".","Y_rgb","X_rgb"]}),Qi("descending-axes",{signal:Wt("twoD",Dt,[20,41]),axes:{X:Bi("X",Dt,[41],{valueId:"X_desc"}),Y:Bi("Y",Dt,[20],{valueId:"Y_desc"})},axesAttr:["Y","X"]}),Qi("scatter",{signal:Wt("scatter_data",Dt,[41]),axes:{X:Bi("X",Dt,[41],{valueId:"X"}),Y:Bi("Y",Dt,[41],{valueId:"Y_scatter"})},axesAttr:["X","Y"]}),Ls("old-style","NXdata",{children:[Wt("twoD",Dt,[20,41],{attributes:[iU("signal",1),wi("axes","Y:X")]}),Bi("X",Dt,[41],{units:"nm"}),Bi("Y",Dt,[20],{units:"deg",longName:"Angle (degrees)"})]})]}),Ls("nexus_no_default","NXprocess",{defaultPath:void 0,children:[Ls("ignore_me","NXentry"),Qi("spectrum",{signal:Wt("oneD",Dt,[41])})]}),Va("nexus_malformed",[Va("default_not_found",[],{attributes:[wi("default","/test")]}),Va("no_signal",[],{attributes:[wi("NX_class","NXdata")]}),Va("signal_not_found",[],{attributes:[wi("NX_class","NXdata"),wi("signal","unknown")]}),Ls("signal_not_dataset","NXdata",{children:[Va("some_group")],attributes:[wi("signal","some_group")]}),Ls("signal_old-style_not_dataset","NXdata",{children:[Va("some_group",[],{attributes:[iU("signal",1)]})]}),Ls("signal_not_array","NXdata",{children:[Is("some_scalar",Dt)],attributes:[wi("signal","some_scalar")]}),Ls("signal_not_numeric","NXdata",{children:[Wt("oneD_str",lu,[2])],attributes:[wi("signal","oneD_str")]}),Qi("interpretation_unknown",{signal:Bi("fourD",Dt,[3,9,20,41],{interpretation:"unknown"})}),Qi("rgb-image_incompatible",{signal:Bi("oneD",Dt,[41],{interpretation:"rgb-image"})}),W3(Qi("silx_style_unknown",{signal:Wt("oneD",Dt,[41]),axes:{X:Wt("X",Dt,[41])},axesAttr:["X"]}),[wi("SILX_style",JSON.stringify({unknown:Sn.Log,signal_scale_type:"invalid",axes_scale_type:["invalid"]}))]),W3(Qi("silx_style_malformed",{signal:Wt("oneD",Dt,[41])}),[wi("SILX_style","{")])]),Va("resilience",[Is("error_value",Dt),Is("slow_value",Dt,{valueId:"scalar_int_42"}),Wt("slow_slicing",Dt,[9,20,41],{valueId:"threeD"}),Va("slow_metadata"),Qi("slow_nx_spectrum",{signal:Bi("slow_twoD",Dt,[20,41],{valueId:"twoD",interpretation:"spectrum"}),errors:Wt("slow_twoD_errors",Dt,[20,41],{valueId:"twoD_errors"}),axes:{slow_X:Wt("slow_X",Dt,[41],{valueId:"X"})},axesAttr:[".","slow_X"],auxiliary:{slow_secondary:Wt("slow_secondary",Dt,[20,41],{valueId:"secondary"})},auxAttr:["slow_secondary"],title:Is("title",lu,{valueId:"title_twoD"})}),Qi("slow_nx_image",{signal:Wt("slow_threeD",Dt,[9,20,41],{valueId:"threeD"}),axes:{slow_X:Wt("slow_X",Dt,[41],{valueId:"X"}),slow_Y:Wt("slow_Y",Dt,[20],{valueId:"Y"})},axesAttr:[".","slow_Y","slow_X"],title:Is("title",lu,{valueId:"title_twoD"})})])]});const bTe=new q(0,0,0);class Sg extends Ys{get size(){const{x:e,y:n}=this.getSize(new q);return{width:e,height:n}}get center(){return this.getCenter(new q)}static empty(e=bTe){return new Sg(e.clone(),e.clone())}static fromPoints(...e){return new Sg().setFromPoints(e)}static fromSize({width:e,height:n}){return Sg.empty().expandBySize(e,n)}clampPoint(e){return super.clampPoint(e,new q)}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 q(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,a=Sg.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(a)}toRect(){return[this.min,this.max]}}const td=Sg;function oU(t,e){const n=e-t;return r=>n!==0?(r-t)/n:.5}function XV(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=l0,a;const s=function(P){const U=Co.isNumber(P)?P:P.valueOf();return Number.isNaN(U)?a:o(...n)(oU(...e)(l(U))**r)};function l(P){if(!i)return P;const[U,k]=e;return Math.max(U,Math.min(k,P))}function c(P){return P?(e=P,R):[...e]}function f(P){return P?(n=P,R):[...n]}function p(P){return P?(n=P,o=RL,R):[...n]}function m(P){return P?(i=P,R):i}function v(){return a}function x(P){return P?(o=P,R):o}function _(P){return P?(r=P,R):r}function b(P){return l(l0(...e)(oU(...n)(P)**(1/r)))}function y(){return Ybe({domain:e,range:n,exponent:r,clamp:i})}function S(P){return e=y().nice(P).domain(),R}function M(P){return y().ticks(P)}function C(P,U){return y().tickFormat(P,U)}function A(){return XV().domain(e).range(n).exponent(r).clamp(i).interpolate(o)}const R=Object.assign(s,{domain:c,range:f,rangeRound:p,clamp:m,interpolate:x,invert:b,unknown:v,exponent:_,nice:S,ticks:M,tickFormat:C,copy:A});return R}const _Te=[.1,1],wTe={left:80,right:24,top:16,bottom:34},STe=28,aU=24;Sn.Linear+"",-1/0,Sn.Log+"",Number.MIN_VALUE,Sn.SymLog+"",-1/0,Sn.Sqrt+"",Sn.Gamma+"",-1/0;const MTe=DL({domain:[300,900],range:[3,10],clamp:!0,round:!0}),ETe=DL({domain:[300,500],range:[.8,1.4]});function qV(t,e){if(Array.isArray(t)){const[,n]=t;return XV({...e,exponent:n})}switch(t){case Sn.Linear:return DL(e);case Sn.Log:return Xbe(e);case Sn.SymLog:return Zbe(e);case Sn.Sqrt:return Jbe(e)}throw new Error("Unknown scale type")}function CTe(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 TTe(t,e=[-Number.MAX_VALUE/2,Number.MAX_VALUE/2]){const[n,r]=e;return Co.clamp(t,n,r)}function sU(t,e){const{scaleType:n,visDomain:r,flip:i,nice:o=!1}=t;return qV(n??Sn.Linear,{domain:r,range:[-e/2,e/2],reverse:i,nice:o})}function ATe(t,e){const n=Math.min(...t),r=Math.max(...t),i=Math.ceil(n),o=Math.floor(r),a=o-i+1,s=Math.min(a,e);if(s===0)return[];const l=Math.max(RH(i,o,s),1),c=Math.ceil(n/l),f=Math.floor(r/l)-c+1;return Array.from({length:f},(p,m)=>(c+m)*l)}function RTe(t,e,n){if(n!==Sn.Log)return rA;const[r,i]=t[0]>0?t:[-t[1],-[t[0]]],o=ETe(e);return i/r<10**o?rA:a=>{const s=Math.log10(Math.abs(a.valueOf()));return s===Math.floor(s)?rA(a):""}}function YV(t,e,n){if(t==="auto")return;if(t==="equal")return YV(1,e,n);const[r,i]=e,[o,a]=n;return Math.abs(i-r)/Math.abs(a-o)/t}function PTe(t={}){const{left:e,right:n,top:r,bottom:i}=wTe;return{left:e+(t.left?aU:0),right:n,top:r+(t.top?STe:0),bottom:i+(t.bottom?aU:0)}}const ITe=` - varying vec2 coords; - - void main() { - coords = uv; - gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); - } -`;function LTe(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{value:n}]))}const KV=F.createContext({});function qi(){return F.useContext(KV)}function OTe(t){const{visRatio:e,abscissaConfig:n,ordinateConfig:r,svgOverlay:i,floatingToolbar:o,children:a}=t,{width:s,height:l}=oo(K=>K.size),c={width:s,height:l},f=s/l,p=CTe(c,e),m=F.useMemo(()=>td.empty().expandByPoint(new q(s,l)),[s,l]),v=sU(n,p.width),x=sU(r,p.height),_=F.useCallback(K=>new q(v(K.x),x(K.y)),[v,x]),b=F.useCallback(K=>new q(v.invert(K.x),x.invert(K.y)),[v,x]),y=F.useMemo(()=>new dn().makeScale(s/2,-l/2,1).setPosition(s/2,l/2,0),[s,l]),S=F.useMemo(()=>y.clone().invert(),[y]),M=F.useCallback((K,J)=>J.clone().project(K).applyMatrix4(y),[y]),C=F.useCallback((K,J)=>J.clone().applyMatrix4(S).unproject(K),[S]),A=F.useCallback((K,J)=>M(K,_(J)),[_,M]),R=F.useCallback((K,J)=>b(C(K,J)),[C,b]),P=F.useCallback((K,J=K.position)=>{const{scale:G}=K;return td.empty(J).expandBySize(s*G.x,l*G.y)},[s,l]),U=F.useCallback(K=>{const[J,G]=P(K).toRect().map(b);return{xVisibleDomain:[J.x,G.x],yVisibleDomain:[J.y,G.y]}},[P,b]),k=oo(K=>{var J;return(J=K.gl.domElement.parentElement)==null?void 0:J.parentElement});Qw(k),iA(k);const N=k.parentElement;iA(N);const z=N.parentElement;return iA(z),O.jsx(KV.Provider,{value:{canvasSize:c,canvasRatio:f,canvasBox:m,visRatio:e,visSize:p,abscissaConfig:n,ordinateConfig:r,abscissaScale:v,ordinateScale:x,dataToWorld:_,dataToHtml:A,worldToHtml:M,worldToData:b,htmlToWorld:C,htmlToData:R,getFovBox:P,getVisibleDomains:U,visCanvas:z,canvasArea:N,r3fRoot:k,svgOverlay:i,floatingToolbar:o},children:a})}var g2=(t=>(t[t.Left=0]="Left",t[t.Middle=1]="Middle",t))(g2||{});class kTe{constructor(e,n){vw(this,"buttons"),vw(this,"modifierKeys"),vw(this,"isWheel"),vw(this,"isEnabled"),this.id=e;const{button:r=g2.Left,modifierKey:i=[],disabled:o=!1}=n;r==="Wheel"?(this.buttons=[],this.isWheel=!0):(this.buttons=Co.castArray(r),this.isWheel=!1),this.modifierKeys=Co.castArray(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 ZV=F.createContext({});function NTe(){return F.useContext(ZV)}function DTe(t){const{children:e}=t,[n]=F.useState(new Map),r=F.useCallback((a,s)=>{n.has(a)?console.warn(`An interaction with ID "${a}" is already registered.`):n.set(a,new kTe(a,s))},[n]),i=F.useCallback(a=>{n.delete(a)},[n]),o=F.useCallback((a,s)=>{const l=[...n.values()];if(!n.has(a))throw new Error(`Interaction ${a} is not registered`);const c=l.filter(f=>f.matches(s));return c.length===0?!1:c.length===1?c[0].id===a:c.reduce((f,p)=>p.modifierKeys.length>f.modifierKeys.length?p:f).id===a},[n]);return O.jsx(ZV.Provider,{value:{registerInteraction:r,unregisterInteraction:i,shouldInteract:o},children:e})}const lU=.95,cU=new q(1,1,1),FTe=["Alt","Control","Shift"];function Cx(){const{visSize:t,getFovBox:e}=qi(),n=oo(i=>i.camera),r=oo(i=>i.invalidate);return F.useCallback(i=>{const{position:o}=n,a=td.fromSize(t),s=e(n,i).keepWithin(a);o.copy(s.center.setZ(o.z)),n.updateMatrixWorld(),r()},[n,t,e,r])}function QV(){const{canvasSize:t}=qi(),e=oo(r=>r.camera),n=Cx();return F.useCallback(({world:r})=>{const{width:i,height:o}=t,a=td.fromPoints(...r),{width:s,height:l}=a.size;e.scale.set(Math.max(s,1)/i,Math.max(l,1)/o,1),n(a.center)},[e,t,n])}function ZL(){const{canvasArea:t}=qi();Dh(t,"wheel",e=>e.preventDefault(),{passive:!1})}function QL(t){const e=oo(r=>r.camera),n=Cx();return function(r){const{sourceEvent:i,worldPt:o}=r,{x:a,y:s}=t(i);if(!a&&!s)return;const l=new q(a?lU:1,s?lU:1,1);i.deltaY<0?e.scale.multiply(l).min(cU):e.scale.divide(l).min(cU);const c=e.position.clone().sub(o);i.deltaY<0?c.multiply(l):c.divide(l),n(o.clone().add(c))}}function gu(t,e,n={}){const r=Ya(e),i=oo(c=>c.camera),{htmlToWorld:o,worldToData:a,canvasArea:s}=qi();function l(c){const{offsetX:f,offsetY:p}=c,m=new q(f,p),v=o(i,m),x=a(v);r.current({htmlPt:m,worldPt:v,dataPt:x,sourceEvent:c})}Dh(s,t,l,n)}function Tx(t,e){const{shouldInteract:n,registerInteraction:r,unregisterInteraction:i}=NTe();return F.useEffect(()=>(r(t,e),()=>i(t)),[t,r,i,e]),F.useCallback(o=>n(t,o),[t,n])}function JV(t=[]){const{canvasArea:e}=qi(),n=Co.castArray(t),[r]=F.useState(new Map),[i,o]=gde(!1);function a(){const s=n.every(l=>r.get(l));i!==s&&o(s)}return Dh(window,"keyup",s=>{const{key:l}=s;r.set(l,!1),a()}),Dh(window,"keydown",s=>{const{key:l}=s;r.set(l,!0),a()}),Dh(e,"pointerdown",s=>{FTe.forEach(l=>{r.set(l,s.getModifierState(l))}),a()}),i}function UTe(t){const{id:e="Pan",button:n=g2.Left,modifierKey:r,disabled:i}=t,o=Tx(e,{button:n,modifierKey:r,disabled:i}),a=oo(v=>v.camera),s=Cx(),l=F.useRef(),c=JV(r);function f(v){const{worldPt:x,sourceEvent:_}=v,{target:b,pointerId:y}=_;o(_)&&(b.setPointerCapture(y),l.current=x.clone())}function p(v){if(!l.current||!c)return;const{worldPt:x}=v,_=l.current.clone().sub(x);s(a.position.clone().add(_))}function m(v){const{sourceEvent:x}=v,{target:_,pointerId:b}=x;_.releasePointerCapture(b),l.current=void 0}return gu("pointerdown",f),gu("pointermove",p),gu("pointerup",m),null}function eW(t){const{id:e="Selection",modifierKey:n,disabled:r,transform:i=te=>te,validate:o=()=>!0,onSelectionStart:a,onSelectionChange:s,onSelectionEnd:l,onValidSelection:c,children:f}=t,p=Ya(i),m=Ya(o),v=Ya(a),x=Ya(s),_=Ya(l),b=Ya(c),y=oo(te=>te.camera),S=qi(),{canvasBox:M,htmlToWorld:C,worldToData:A}=S,[R,P]=mde(),U=F.useRef(),k=F.useRef(!1),N=JV(n),z=Tx(e,{button:g2.Left,modifierKey:n,disabled:r});function K(te){const{sourceEvent:Q}=te;if(!z(Q))return;const{target:ae,pointerId:xe}=Q;ae.setPointerCapture(xe),U.current=te}function J(te){if(!U.current)return;const{htmlPt:Q}=U.current,ae=[Q,M.clampPoint(te.htmlPt)],xe=ae.map(Te=>C(y,Te)),we=xe.map(A);P({html:ae,world:xe,data:we})}function G(te){if(!U.current)return;const{sourceEvent:Q}=te,{target:ae,pointerId:xe}=Q;ae.releasePointerCapture(xe),U.current=void 0,k.current=z(Q),P(void 0)}gu("pointerdown",K),gu("pointermove",J),gu("pointerup",G);function ne(){U.current=void 0,P(void 0)}xde("Escape",ne,[],{event:"keydown"}),Dh(window,"contextmenu",te=>{U.current&&(te.preventDefault(),ne())});const ie=F.useMemo(()=>R&&p.current(R,y,S),[R,p,y,S]),se=F.useMemo(()=>!!ie&&m.current(ie),[ie,m]),H=vN(ie),Y=vN(se);return F.useEffect(()=>{var te,Q,ae,xe;if(ie){Qw(R),H||(te=v.current)==null||te.call(v),(Q=x.current)==null||Q.call(x,N?ie:void 0,R,se);return}H&&(Qw(Y),(ae=_.current)==null||ae.call(_,k.current?H:void 0,Y),Y&&k.current&&((xe=b.current)==null||xe.call(b,H)),k.current=!1)},[ie,H,R,se,Y,N,v,x,_,b]),!ie||!N?null:(Qw(R),O.jsx(O.Fragment,{children:f(ie,R,se)}))}const BTe="_selection_1p9dp_1",G3={selection:BTe};function JL(t){const{overflowCanvas:e=!1,children:n}=t,{r3fRoot:r,canvasArea:i}=qi(),o=e?i:r,[a]=F.useState(()=>{const l=document.createElement("div");return l.setAttribute("hidden",""),l}),[s]=F.useState(()=>sz(a));return F.useLayoutEffect(()=>{s.render(sd.createPortal(n,o))},[n,o,s]),F.useLayoutEffect(()=>(r.append(a),()=>{s.unmount(),a.remove()}),[r,s,a]),null}function eO(t){const{children:e}=t,{svgOverlay:n}=qi();return n?O.jsx(JL,{children:sd.createPortal(e,n)}):null}function tM(t){const{coords:e,strokePosition:n,...r}=t,{stroke:i,strokeWidth:o=1}=r,a=i&&n?o*(n==="outside"?1:-1):0,{min:s,max:l}=td.fromPoints(...e).expandBySize(a,a);return O.jsx("path",{d:`M ${s.x},${s.y} H ${l.x} V ${l.y} H ${s.x} z`,...r})}const zTe=20;function $Te(t){const{minZoom:e=zTe,...n}=t,{canvasSize:r,canvasRatio:i,canvasBox:o,visRatio:a,visSize:s,htmlToWorld:l,worldToData:c}=qi(),f=QV(),p=oo(x=>x.camera),m=a!==void 0;function v(x){if(!m)return x;const{scale:_}=p,b=td.empty(new q(r.width/2,r.height/2)).expandBySize(s.width/_.x,s.height/_.y),y=td.fromPoints(...x.html).expandToRatio(i).keepWithin(o).keepWithin(b).toRect(),S=y.map(C=>l(p,C)),M=S.map(c);return{html:y,world:S,data:M}}return O.jsx(eW,{id:"SelectToZoom",transform:v,validate:({html:x})=>x[0].manhattanDistanceTo(x[1])>=e,onValidSelection:f,...n,children:({html:x},{html:_},b)=>O.jsxs(eO,{children:[O.jsx(tM,{className:G3.selection,coords:_,fill:"white",fillOpacity:!m&&b?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:m||!b?4:void 0}),m&&O.jsx(tM,{className:G3.selection,coords:x,fill:"white",fillOpacity:b?.25:0,stroke:"black",strokePosition:"inside"})]})})}function HTe(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=qi(),i=Tx("XAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=a=>({x:i(a),y:!1});return ZL(),gu("wheel",QL(o)),null}function VTe(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=qi(),i=Tx("YAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=a=>({x:!1,y:i(a)});return ZL(),gu("wheel",QL(o)),null}function WTe(t){const{modifierKey:e,disabled:n}=t,r=Tx("Zoom",{button:"Wheel",modifierKey:e,disabled:n}),i=o=>{const a=r(o);return{x:a,y:a}};return ZL(),gu("wheel",QL(i)),null}function GTe(t){const{axis:e,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,children:o,...a}=t;function s(l,c,f){const{canvasSize:p,htmlToWorld:m,worldToData:v}=f,{width:x,height:_}=p,[b,y]=l.html,S=e==="x"?[new q(b.x,0),new q(y.x,_)]:[new q(0,b.y),new q(x,y.y)],M=S.map(A=>m(c,A)),C=M.map(v);return{html:S,world:M,data:C}}return O.jsx(eW,{transform:s,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,...a,children:o})}const jTe=20;function uU(t){const{axis:e,modifierKey:n,disabled:r,minZoom:i=jTe}=t,{visRatio:o}=qi(),a=QV();return O.jsx(GTe,{axis:e,id:`${e.toUpperCase()}SelectToZoom`,modifierKey:n,disabled:o!==void 0||r,validate:({html:s})=>td.fromPoints(...s).hasMinSize(i),onValidSelection:a,children:({html:s},l,c)=>O.jsx(eO,{children:O.jsx(tM,{className:G3.selection,coords:s,fill:"white",fillOpacity:c?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:c?void 0:4})})})}function XTe(t){const{...e}=t;return O.jsxs(O.Fragment,{children:[e.pan!==!1&&O.jsx(UTe,{...e.pan}),e.zoom!==!1&&O.jsx(WTe,{...e.zoom}),e.xAxisZoom!==!1&&O.jsx(HTe,{modifierKey:"Alt",...e.xAxisZoom}),e.yAxisZoom!==!1&&O.jsx(VTe,{modifierKey:"Shift",...e.yAxisZoom}),e.selectToZoom!==!1&&O.jsx($Te,{modifierKey:"Control",...e.selectToZoom}),e.xSelectToZoom!==!1&&O.jsx(uU,{axis:"x",modifierKey:["Control","Alt"],...e.xSelectToZoom}),e.ySelectToZoom!==!1&&O.jsx(uU,{axis:"y",modifierKey:["Control","Shift"],...e.ySelectToZoom})]})}function tO(t,e,n=(r,i)=>Object.is(r,i)){const r=oo(s=>s.camera),i=hde(),o=F.useRef(),a=Ya(t);return F.useMemo(()=>{o.current=a.current(r)},e),wL(()=>{const s=a.current(r);n(o.current,s)||(o.current=s,i())}),o.current}function qTe(t){const{children:e}=t,{floatingToolbar:n}=qi();return n?O.jsx(JL,{children:sd.createPortal(e,n)}):null}const YTe="_btn_rzs1v_1 _btn_rnveq_39 btnClean",KTe="_btnLike_rzs1v_11 _btnLike_rnveq_55",fU={btn:YTe,btnLike:KTe};function ZTe(){const t=oo(i=>i.camera),e=oo(i=>i.invalidate),n=tO(({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 O.jsx(qTe,{children:O.jsx("button",{className:fU.btn,type:"button",hidden:!n,onClick:()=>r(),children:O.jsx("span",{className:fU.btnLike,children:"Reset zoom"})})})}function QTe(t){const{children:e,size:n,...r}=t,{visSize:i}=qi(),{width:o,height:a}=n??i;return O.jsxs("mesh",{...r,children:[O.jsx("planeGeometry",{args:[o,a]}),e]})}const JTe="_axis_1fn7e_1",eAe="_grid_1fn7e_2",tAe="_tick_1fn7e_22",nAe="_label_1fn7e_34",nM={axis:JTe,grid:eAe,tick:tAe,label:nAe};function rAe(t){const{formattedValue:e,...n}=t;return O.jsx("text",{...n,dy:"0.3125em",children:e})}const iAe={labelClassName:nM.label,labelProps:{},tickClassName:nM.tick,tickComponent:rAe},oAe={abscissa:[HMe,PV],ordinate:[UMe,RV]};function dU(t){const{type:e,config:n,domain:r,canvasSize:i,offset:o,flipAxis:a,showAxis:s}=t,{width:l,height:c}=i,f=e==="abscissa",p=f?l:c,{scaleType:m=Sn.Linear,isIndexAxis:v,showGrid:x,label:_,nice:b=!1}=n,y=qV(m,{domain:r,range:a?[p,0]:[0,p],nice:b}),[S,M]=oAe[e],C=MTe(p),A=v?{tickValues:ATe(r,C)}:{numTicks:C};return O.jsxs(O.Fragment,{children:[s&&O.jsx("svg",{className:nM.axis,"data-type":e,style:f?{width:l,height:o}:{width:o,height:c},children:O.jsx(S,{scale:y,tickFormat:RTe(r,p,m),label:_,labelOffset:o-(f?32:36),hideAxisLine:x,...A,...iAe})}),x&&O.jsx("svg",{className:nM.grid,...i,children:O.jsx(M,{scale:y,...i,...A})})]})}function aAe(t){const{axisOffsets:e,showAxes:n}=t,{canvasSize:r,visCanvas:i,abscissaConfig:o,ordinateConfig:a,getVisibleDomains:s}=qi(),l=tO(s,[s]);return O.jsx(JL,{children:sd.createPortal(O.jsxs(O.Fragment,{children:[O.jsx(dU,{type:"abscissa",config:o,domain:l.xVisibleDomain,canvasSize:r,offset:e.bottom,showAxis:n}),O.jsx(dU,{type:"ordinate",config:a,domain:l.yVisibleDomain,canvasSize:r,offset:e.left,showAxis:n,flipAxis:!0})]}),i)})}function sAe(t){const{className:e,orthographic:n,children:r}=t;return O.jsxs(X1e,{className:e,orthographic:n,flat:!0,frameloop:"demand",dpr:[1,3],resize:{debounce:{scroll:20,resize:200},scroll:!1},gl:{preserveDrawingBuffer:!0},children:[O.jsx("ambientLight",{}),r]})}function lAe(){const{visRatio:t}=qi(),e=oo(r=>r.camera),n=Cx();return F.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 cAe(t){const{value:e}=t,n=oo(i=>i.raycaster),r=oo(i=>i.camera);return F.useEffect(()=>{const i=n.params.Points,o=i?i.threshold:1;return i&&(i.threshold=e),()=>{i&&(i.threshold=o)}},[n,e]),wL(()=>{const i=(r.scale.x+r.scale.y)/2;n.params.Points&&(n.params.Points.threshold=e*i/2)}),null}function uAe(){const{dataToWorld:t,worldToData:e}=qi(),n=F.useRef(),r=oo(o=>o.camera),i=Cx();return wL(()=>{n.current=e(r.position)}),F.useEffect(()=>{n.current&&i(t(n.current))},[n,i,t,r]),null}const fAe="_visCanvas_lddco_1",dAe="_title_lddco_28",hAe="_canvasArea_lddco_40",pAe="_r3fRoot_lddco_42",mAe="_svgOverlay_lddco_42",gAe="_floatingToolbar_lddco_42",Fm={visCanvas:fAe,title:dAe,canvasArea:hAe,r3fRoot:pAe,svgOverlay:mAe,floatingToolbar:gAe},vAe={left:0,right:0,top:0,bottom:0};function yAe(t){const{title:e,aspect:n="auto",abscissaConfig:r,ordinateConfig:i,raycasterThreshold:o,showAxes:a=!0,children:s}=t,l=YV(n,r.visDomain,i.visDomain),c=a?PTe({left:!!i.label,bottom:!!r.label,top:!!e}):vAe,[f,p]=F.useState(null),[m,v]=F.useState(null);return O.jsxs("div",{className:Fm.visCanvas,style:{gridTemplateColumns:`${c.left}px minmax(0, 1fr) ${c.right}px`,gridTemplateRows:`${c.top}px minmax(0, 1fr) ${c.bottom}px`},children:[a&&e&&O.jsx("p",{className:Fm.title,children:e}),O.jsxs("div",{className:Fm.canvasArea,children:[O.jsx(sAe,{className:Fm.r3fRoot,orthographic:!0,children:O.jsxs(OTe,{visRatio:l,abscissaConfig:r,ordinateConfig:i,svgOverlay:f,floatingToolbar:m,children:[O.jsx(aAe,{axisOffsets:c,showAxes:a}),O.jsx(DTe,{children:s}),O.jsx(uAe,{}),O.jsx(lAe,{}),o!==void 0&&O.jsx(cAe,{value:o})]})}),O.jsx("svg",{ref:p,className:Fm.svgOverlay,overflow:"hidden"})]}),O.jsx("div",{ref:v,className:Fm.floatingToolbar})]})}var py=(t=>(t.Circle="Circle",t.Cross="Cross",t.Square="Square",t.Cap="Cap",t))(py||{});py.Cross+"",py.Cap+"",py.Circle+"",py.Square+"";class xAe extends Cu{}fH({Line_:xAe});var Mg=(t=>(t.MinGreater="min-greater",t.InvalidMinWithScale="invalid-min-with-scale",t.InvalidMaxWithScale="invalid-max-with-scale",t.CustomMaxFallback="custom-max-fallback",t))(Mg||{});function bAe(t){return jS(t*360,1,.5).formatRgb()}function Um(t){return e=>t(1-e)}const _Ae={Blues:Um($Ee),Greens:Um(VEe),Greys:Um(GEe),Oranges:Um(ZEe),Purples:Um(XEe),Reds:Um(YEe),Turbo:a2e,Viridis:s2e,Inferno:c2e,Magma:l2e,Plasma:u2e,Cividis:QEe,Warm:e2e,Cool:t2e,Cubehelix:JEe,BuGn:vEe,BuPu:xEe,GnBu:_Ee,OrRd:SEe,PuBuGn:EEe,PuBu:TEe,PuRd:REe,RdPu:IEe,YlGnBu:OEe,YlGn:NEe,YlOrBr:FEe,YlOrRd:BEe,Rainbow:n2e,Sinebow:o2e,HSL:bAe,BrBG:JMe,PRGn:tEe,PiYG:rEe,PuOr:oEe,RdBu:sEe,RdGy:cEe,RdYlBu:fEe,RdYlGn:hEe,Spectral:mEe},hU=1/20;Co.range(0,1+hU,hU);const wAe={[Sn.Linear]:t=>t,[Sn.Log]:Math.log10,[Sn.SymLog]:t=>Math.sign(t)*Math.log10(1+Math.abs(t)),[Sn.Sqrt]:Math.sqrt,[Sn.Gamma]:t=>t},SAe={float32:Sl,uint16:Jh,uint8:os,uint8_clamped:os};function MAe(t,e){const n=_Ae[t];return e?r=>n(1-r):n}function EAe(t,e=Sn.Linear){const n=wAe[e];return[n(t[0]),n(t[1])]}function CAe(t,e=qr){if(!t)return;const{rows:n,cols:r}=nTe(t),i=new Gf(t.data,r,n,zI,SAe[t.dtype],ux,Vi,Vi,e);return i.needsUpdate=!0,i}const lA=sTe(CAe),TAe=Jf(255,255,255,0),cA=256,AAe={[Sn.Log]:"log(value) * oneOverLog10",[Sn.SymLog]:"sign(value) * log(1. + abs(value)) * oneOverLog10",[Sn.Sqrt]:"sqrt(value)"},RAe={[Sn.Log]:"value > 0.",[Sn.Sqrt]:"value >= 0."};function PAe(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o=!1,magFilter:a,alphaValues:s,alphaDomain:l=_Te,badColor:c=TAe,mask:f}=t,p=lA(e,a),m=lA(s),v=lA(f),x=F.useMemo(()=>{const C=MAe(i,o),A=Array.from({length:cA}).flatMap((P,U)=>{const{r:k,g:N,b:z}=Jf(C(U/(cA-1)));return[k,N,z,255]}),R=new Gf(Uint8Array.from(A),cA,1,Wo,os);return R.needsUpdate=!0,R},[i,o]),[_,b]=Array.isArray(r)?r:[r,1],y=EAe(n,_),S=typeof c=="string"?Jf(c):c,M={uniforms:LTe({data:p,mask:v,colorMap:x,min:y[0],oneOverRange:1/(y[1]-y[0]),gammaExponent:b,normRevertFactor:e.dtype==="uint8"?255:1,alpha:m,withAlpha:s?1:0,alphaMin:l[0],oneOverAlphaRange:1/(l[1]-l[0]),badColor:new Yn(S.r/255,S.g/255,S.b/255,S.opacity)}),vertexShader:ITe,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 ${RAe[_]||"true"}; - } - - float scale(float value) { - return ${AAe[_]||"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 O.jsx("shaderMaterial",{args:[M],side:xl})}const IAe=F.memo(PAe);function LAe(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:a,alphaValues:s,alphaDomain:l,badColor:c,mask:f,...p}=t;return O.jsx(QTe,{...p,children:O.jsx(IAe,{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:a,alphaValues:s,alphaDomain:l,badColor:c,mask:f})})}const OAe="_toolbar_rnveq_1",kAe="_controls_rnveq_13",NAe="_controlWrapper_rnveq_20",DAe="_control_rnveq_13",FAe="_sep_rnveq_34",UAe="_btn_rnveq_39 btnClean",BAe="_btnLike_rnveq_55",zAe="_icon_rnveq_80",$Ae="_label_rnveq_97",HAe="_popup_rnveq_133",VAe="_popupInner_rnveq_140",bw={toolbar:OAe,controls:kAe,controlWrapper:NAe,control:DAe,sep:FAe,btn:UAe,btnLike:BAe,icon:zAe,label:$Ae,popup:HAe,popupInner:VAe};function WAe(t){const{label:e,icon:n,iconOnly:r,small:i,raised:o,disabled:a,onClick:s,...l}=t;return O.jsx("button",{className:bw.btn,type:"button",title:r?e:void 0,"aria-label":r?e:void 0,disabled:a,"data-small":i||void 0,"data-raised":o||void 0,onClick:()=>s(),...l,children:O.jsxs("span",{className:bw.btnLike,children:[n&&O.jsx(n,{className:bw.icon}),!r&&O.jsx("span",{className:bw.label,children:e})]})})}function pU(t){const{value:e,onToggle:n,...r}=t;return O.jsx(WAe,{...r,"aria-pressed":e,onClick:()=>n()})}F.createContext(void 0);const GAe="_boundEditor_fj0px_1",jAe="_label_fj0px_8",XAe="_value_fj0px_16",qAe="_actionBtn_fj0px_64 _actionBtn_3jqdy_30 btnClean",ty={boundEditor:GAe,label:jAe,value:XAe,actionBtn:qAe},tW=F.forwardRef((t,e)=>{const{bound:n,value:r,isEditing:i,hasError:o,onEditToggle:a,onChange:s}=t,l=`${n}-bound`,c=F.useRef(null),[f,p]=F.useState("");function m(){a(!1),p(nA(r))}return F.useImperativeHandle(e,()=>({cancel:m})),F.useEffect(()=>{p(nA(r))},[r,p]),F.useEffect(()=>{var v,x;i||(v=c.current)==null||v.blur(),i&&n==="min"&&((x=c.current)==null||x.focus())},[i,n]),O.jsxs("form",{className:ty.boundEditor,"data-error":o||void 0,"data-editing":i,onSubmit:v=>{v.preventDefault();const x=Number.parseFloat(f.replace("−","-")),_=Number.isNaN(x)?r:TTe(x);p(nA(_)),s(_),a(!1)},children:[O.jsx("label",{id:`${l}-label`,className:ty.label,htmlFor:l,children:n}),O.jsx("input",{id:l,ref:c,className:ty.value,type:"text",name:"bound",value:f,title:i?void 0:r.toString(),"aria-labelledby":`${l}-label`,onChange:v=>p(v.target.value),onFocus:()=>{i||a(!0)}}),O.jsx("button",{className:ty.actionBtn,type:"submit",disabled:!i,"aria-label":`Apply ${n}`,children:O.jsx(p2e,{})}),O.jsx("button",{className:ty.actionBtn,type:"button",disabled:!i,"aria-label":`Cancel ${n}`,onClick:()=>m(),children:O.jsx(g2e,{})})]})});tW.displayName="BoundEditor";const mU=tW,YAe="_root_3jqdy_1",KAe="_dataRange_3jqdy_9",ZAe="_autoscale_3jqdy_20",QAe="_actionBtn_3jqdy_30 btnClean",JAe="_error_3jqdy_51",eRe="_errorMessage_3jqdy_59",tRe="_swapBtn_3jqdy_73 _actionBtn_3jqdy_30 btnClean",$g={root:YAe,dataRange:KAe,autoscale:ZAe,actionBtn:QAe,error:JAe,errorMessage:eRe,swapBtn:tRe},nRe={[Mg.MinGreater]:{message:"Min greater than max",fallback:"data range"},[Mg.InvalidMinWithScale]:{message:"Custom min invalid with this scale",fallback:"data min"},[Mg.InvalidMaxWithScale]:{message:"Custom max invalid with this scale",fallback:"data max"},[Mg.CustomMaxFallback]:{message:"Custom min invalid with this scale",fallback:"custom max"}};function uA(t){const{error:e,showSwapBtn:n=!1,onSwap:r}=t,{message:i,fallback:o}=nRe[e];return O.jsxs("p",{className:$g.error,children:[O.jsxs("span",{className:$g.errorMessage,children:[i,O.jsx("br",{}),O.jsx(m2e,{})," falling back to ",O.jsx("strong",{children:o})]}),n&&r&&O.jsx("button",{className:$g.swapBtn,type:"button","aria-label":"Swap min and max",onClick:()=>r(),children:O.jsx(U2e,{})})]})}const rRe=F.forwardRef((t,e)=>{const{sliderDomain:n,dataDomain:r,errors:i}=t,{isAutoMin:o,isAutoMax:a,isEditingMin:s,isEditingMax:l}=t,{onAutoMinToggle:c,onAutoMaxToggle:f,onEditMin:p,onEditMax:m,onChangeMin:v,onChangeMax:x,onSwap:_}=t,{minGreater:b,minError:y,maxError:S}=i,M=F.useRef(null),C=F.useRef(null);return F.useImperativeHandle(e,()=>({cancelEditing:()=>{var A,R;(A=M.current)==null||A.cancel(),(R=C.current)==null||R.cancel()}})),O.jsxs("div",{className:$g.root,children:[b&&O.jsx(uA,{error:Mg.MinGreater,showSwapBtn:!o&&!a,onSwap:_}),O.jsx(mU,{ref:M,bound:"min",value:n[0],isEditing:s,hasError:b||!!y,onEditToggle:p,onChange:v}),y&&O.jsx(uA,{error:y}),O.jsx(mU,{ref:C,bound:"max",value:n[1],isEditing:l,hasError:b||!!S,onEditToggle:m,onChange:x}),S&&O.jsx(uA,{error:S}),O.jsxs("p",{className:$g.dataRange,children:["Data range"," ",O.jsxs("span",{children:["["," ",O.jsx("abbr",{title:r[0].toString(),children:nU(r[0])})," ",","," ",O.jsx("abbr",{title:r[1].toString(),children:nU(r[1])})," ","]"]})]}),O.jsxs("p",{className:$g.autoscale,children:["Autoscale"," ",O.jsx(pU,{label:"Min",raised:!0,value:o,onToggle:c}),O.jsx(pU,{label:"Max",raised:!0,value:a,onToggle:f})]})]})});rRe.displayName="DomainControls";const iRe="_thumb_doizn_1",oRe="_thumbBtnLike_doizn_11",aRe="_icon_doizn_47",_w={thumb:iRe,thumbBtnLike:oRe,icon:aRe},sRe=F.forwardRef((t,e)=>{const{bound:n,isAuto:r,hasError:i,disabled:o,AutoIcon:a,...s}=t;return O.jsx("div",{ref:e,...s,className:_w.thumb,"aria-label":`Change ${n} limit`,"aria-disabled":o||void 0,tabIndex:o?-1:s.tabIndex,"data-auto":r,"data-error":i||void 0,children:O.jsxs("div",{className:_w.thumbBtnLike,children:[r&&O.jsx(a,{className:_w.icon}),!r&&i&&O.jsx(h2e,{className:_w.icon,strokeWidth:"3"})]})})});sRe.displayName="Thumb";function lRe(t){return O.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:O.jsx("path",{d:"M18 17v-2H6v2zm4-4v-2H2v2zm-8 8v-2h-4v2zm4-12V7H6v2zm-8-4h4V3h-4z",stroke:"none"})})}function cRe(t){return O.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:O.jsx("polyline",{points:"2 12 6 12 9 21 15 3 19 3"})})}Sn.Linear+"",Sn.Log+"",Sn.SymLog+"",Sn.Sqrt+"",Sn.Gamma+"";function uRe(t){const{points:e,children:n}=t,{dataToHtml:r}=qi(),i=tO(o=>e.map(a=>r(o,a)),[e,r]);return O.jsx(O.Fragment,{children:n(...i)})}function fA(t){const{coords:e,...n}=t,[r,i]=e;return O.jsx("line",{x1:r.x,y1:r.y,x2:i.x,y2:i.y,...n})}DCe(t=>({val:void 0,setTooltipValue:(e,n,r)=>t(()=>({val:{x:e,y:n,v:r}}))}));function fRe(t){const{api:e,layer:n,x:r,y:i,magFilter:o,onPointerMove:a,...s}=t,l=e.get(n,new Be(r,i)),[c,f]=l.shape,p=a&&Co.throttle(m=>{a(m,l)},50,{trailing:!1});return O.jsx("group",{position:[r+f/2,i+c/2,0],children:O.jsx(LAe,{values:l,...s,magFilter:o,size:{width:f,height:c},onPointerMove:p})})}F.memo(fRe);new Ys(new q(-1,-1,-1),new q(1,1,1));class to{constructor(e,n){jc(this,"min");jc(this,"max");if(this.min=e,this.max=n,e>n){const r=n;this.max=e,this.min=r}}containsValue(e){return e>=this.min&&e<=this.max}containsRange(e){return e.min>=this.min&&e.max<=this.max}toString(){return`(min:${this.min}, max:${this.max})`}intersect(e){return e===null||e.min>this.max||this.min>e.max?null:new to(Math.max(e.min,this.min),Math.min(e.max,this.max))}equals(e){return this.min===e.min&&this.max===e.max}apply(e){return new to(e(this.min),e(this.max))}inPlaceApply(e){return this.min=e(this.min),this.max=e(this.max),this}static createWithFunc(e,n,r){return new to(r(e),r(n))}}var vu=(t=>(t.milimeter="milimeter",t.pixel="pixel",t.reciprocal="reciprocal",t))(vu||{});const nW=g0(t=>({detector:!0,detectorColour:{r:144,g:19,b:254,a:.4},beamstop:!0,beamstopColor:{r:0,g:0,b:0,a:1},cameraTube:!0,cameraTubeColor:{r:80,g:227,b:194,a:.4},visibleRange:!0,visibleColor:{r:208,g:2,b:27,a:1},requestedRange:!0,requestedRangeColor:{r:65,g:117,b:5,a:1},clearance:!0,clearanceColor:{r:0,g:0,b:0,a:.2},inaccessibleRange:!1,inaccessibleRangeColor:{r:245,g:166,b:35,a:1},plotAxes:"milimeter",update:e=>{t({...e})}})),dRe=(t,e)=>{let n=500;e===vu.milimeter&&(n=100);const r=t.upperBound.x>t.upperBound.y?t.upperBound.x:t.upperBound.y;return{xAxis:new to(Math.round(-n),Math.round(r+n)),yAxis:new to(Math.round(-n),Math.round(r+n))}},Sf=t=>`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`,gU=(t,e,n,r)=>{let i=e/2/n.width,o=e/2/n.height;const a=new q(t.x??0,t.y??0);return r===vu.milimeter&&(i=e/2,o=e/2,a.multiply(new q(n.width,n.height))),{centre:a,endPointX:new q(a.x+i,a.y),endPointY:new q(a.x,a.y+o)}},hRe=(t,e,n,r)=>{let i=e.width,o=e.height;switch(r){case vu.milimeter:i*=n.width,o*=n.height}return{lowerBound:t,upperBound:new q(i,o)}},pRe=(t,e,n,r)=>{const i=new q(n.width,n.height);return r===vu.pixel?{start:t.clone().divide(i),end:e.clone().divide(i)}:{start:t,end:e}},mRe=(t,e,n,r,i)=>{let o=e/2/n.width+i,a=e/2/n.height+i;const s=new q(t.x??0,t.y??0);return r===vu.milimeter&&(o=e/2+i*n.width,a=e/2+i*n.height,s.multiply(new q(n.width,n.height))),{centre:s,endPointX:new q(s.x+o,s.y),endPointY:new q(s.x,s.y+a)}};class gRe{constructor(e,n,r){jc(this,"detProps");jc(this,"kmod");jc(this,"qScale");jc(this,"mki");this.detProps=e,e.beamVector.normalize(),this.qScale=r,this.mki=e.beamVector.clone().negate(),this.kmod=this.qScale/n;const i=this.detProps.beamVector.clone();i.multiplyScalar(this.kmod),this.mki=i.negate()}convertToQ(e){const n=e.length();return n>0?(e.multiplyScalar(this.kmod/n),e.add(this.mki)):e.add(this.mki),e}qFromPixelPosition(e){const n=new q;return n.set(-e.x,-e.y,0),n.add(this.detProps.origin),this.convertToQ(n)}setDiffractionCrystalEnviroment(e){this.kmod=this.qScale/e;const n=this.detProps.beamVector.clone();n.multiplyScalar(this.kmod),this.mki=n.negate()}}class rW{constructor(e,n){jc(this,"direction");jc(this,"initial_point");if(e.length()==0)throw TypeError("The direction vector of a ray cannot be the zero vector.");this.direction=e,this.initial_point=n}getPoint(e){const n=new Be(this.direction.x,this.direction.y);return n.multiplyScalar(e),n.add(this.initial_point),n}getPointAtDistance(e){return this.getPoint(e/this.direction.length())}getParameterRange(e,n){let r=Math.min(e,n);const i=Math.max(e,n);return r<0&&(r=0),new to(r,i)}getCircleIntersectionParameterRange(e,n){const r=this.initial_point.clone().add(n.multiplyScalar(-1)),i=this.direction.dot(this.direction),o=2*r.dot(this.direction),a=r.dot(r)-Math.pow(e,2),s=Math.pow(o,2)-4*i*a;if(s<0)return null;let l,c;if(i==0){if(o==0)return a==0?new to(0,Number.POSITIVE_INFINITY):null;l=-a/o,c=-a/o}else l=.5*(-o-Math.sqrt(s))/i,c=.5*(-o+Math.sqrt(s))/i;return this.getParameterRange(l,c)}getRectangleIntersectionParameterRange(e,n,r){let i;const o=e.x+n,a=e.x,s=e.y,l=e.y-r;if(this.direction.x===0){if(!new to(a,o).containsValue(this.initial_point.x))return null;i=new to(0,Number.POSITIVE_INFINITY)}else i=new to((a-this.initial_point.x)/this.direction.x,(o-this.initial_point.x)/this.direction.x);return this.direction.y==0?new to(l,s).containsValue(this.initial_point.y)?this.getParameterRange(i.min,i.max):null:(i=i.intersect(new to((l-this.initial_point.y)/this.direction.y,(s-this.initial_point.y)/this.direction.y)),i==null?null:this.getParameterRange(i.min,i.max))}}function vRe(t,e,n,r){const i={ptMin:new Be(0,0),ptMax:new Be(0,0),visibleQRange:null,fullQRange:null},o=(e.clearance??0)*t.pixelSize.width+e.diameter/2,a=(e.clearance??0)*t.pixelSize.height+e.diameter/2,s=(e.centre.x??0)*t.pixelSize.width,l=(e.centre.y??0)*t.pixelSize.height,c=t.resolution.height*t.pixelSize.height,f=t.resolution.width*t.pixelSize.width,p=(n.centre.x??0)*t.pixelSize.width,m=(n.centre.y??0)*t.pixelSize.height,v=new Be(o*Math.cos(r.angle??0)+s,a*Math.sin(r.angle??0)+l),x=new rW(new Be(Math.cos(r.angle??0),Math.sin(r.angle??0)),v);let _=x.getRectangleIntersectionParameterRange(new Be(0,c),f,c);if(_!=null&&n!=null&&n.diameter!=0&&(_=_.intersect(x.getCircleIntersectionParameterRange((n.diameter??0)/2,new Be(p,m)))),_===null||r.wavelength==null||r.cameraLength==null)return i;const b=x.getPoint(_.min),y=x.getPoint(_.max),S={...t,origin:new q(s,l,r.cameraLength*1e3),beamVector:new q(0,0,1)},M=new gRe(S,r.wavelength*1e10,2*Math.PI),C=M.qFromPixelPosition(b),A=M.qFromPixelPosition(y);S.origin.z=r.minCameraLength*1e3,M.setDiffractionCrystalEnviroment(r.minWavelength*1e10);const R=M.qFromPixelPosition(y);S.origin.z=r.maxCameraLength*1e3,M.setDiffractionCrystalEnviroment(r.maxWavelength*1e10);const P=M.qFromPixelPosition(b);return{ptMin:b,ptMax:y,visibleQRange:new to(C.length()*1e10,A.length()*1e10),fullQRange:new to(R.length()*1e10,P.length()*1e10)}}var Fs={},Ax={},yRe=Array.isArray,Ol=yRe;function xRe(t){return t!=null&&typeof t=="object"}var ku=xRe,bRe=mp,_Re=Ol,wRe=ku,SRe="[object String]";function MRe(t){return typeof t=="string"||!_Re(t)&&wRe(t)&&bRe(t)==SRe}var ERe=MRe;function CRe(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var TRe=CRe,ARe=TRe,RRe=ARe(),PRe=RRe;function IRe(t,e){for(var n=-1,r=Array(t);++n-1&&t%1==0&&t-1&&t%1==0&&t<=XRe}var rO=qRe,YRe=mp,KRe=rO,ZRe=ku,QRe="[object Arguments]",JRe="[object Array]",e3e="[object Boolean]",t3e="[object Date]",n3e="[object Error]",r3e="[object Function]",i3e="[object Map]",o3e="[object Number]",a3e="[object Object]",s3e="[object RegExp]",l3e="[object Set]",c3e="[object String]",u3e="[object WeakMap]",f3e="[object ArrayBuffer]",d3e="[object DataView]",h3e="[object Float32Array]",p3e="[object Float64Array]",m3e="[object Int8Array]",g3e="[object Int16Array]",v3e="[object Int32Array]",y3e="[object Uint8Array]",x3e="[object Uint8ClampedArray]",b3e="[object Uint16Array]",_3e="[object Uint32Array]",xr={};xr[h3e]=xr[p3e]=xr[m3e]=xr[g3e]=xr[v3e]=xr[y3e]=xr[x3e]=xr[b3e]=xr[_3e]=!0;xr[QRe]=xr[JRe]=xr[f3e]=xr[e3e]=xr[d3e]=xr[t3e]=xr[n3e]=xr[r3e]=xr[i3e]=xr[o3e]=xr[a3e]=xr[s3e]=xr[l3e]=xr[c3e]=xr[u3e]=!1;function w3e(t){return ZRe(t)&&KRe(t.length)&&!!xr[YRe(t)]}var S3e=w3e;function M3e(t){return function(e){return t(e)}}var iO=M3e,iM={exports:{}};iM.exports;(function(t,e){var n=yV,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(iM,iM.exports);var oO=iM.exports,E3e=S3e,C3e=iO,yU=oO,xU=yU&&yU.isTypedArray,T3e=xU?C3e(xU):E3e,sW=T3e,A3e=LRe,R3e=oW,P3e=Ol,I3e=nO,L3e=aW,O3e=sW,k3e=Object.prototype,N3e=k3e.hasOwnProperty;function D3e(t,e){var n=P3e(t),r=!n&&R3e(t),i=!n&&!r&&I3e(t),o=!n&&!r&&!i&&O3e(t),a=n||r||i||o,s=a?A3e(t.length,String):[],l=s.length;for(var c in t)(e||N3e.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||L3e(c,l)))&&s.push(c);return s}var lW=D3e,F3e=Object.prototype;function U3e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||F3e;return t===n}var aO=U3e;function B3e(t,e){return function(n){return t(e(n))}}var cW=B3e,z3e=cW,$3e=z3e(Object.keys,Object),H3e=$3e,V3e=aO,W3e=H3e,G3e=Object.prototype,j3e=G3e.hasOwnProperty;function X3e(t){if(!V3e(t))return W3e(t);var e=[];for(var n in Object(t))j3e.call(t,n)&&n!="constructor"&&e.push(n);return e}var q3e=X3e,Y3e=bV,K3e=rO;function Z3e(t){return t!=null&&K3e(t.length)&&!Y3e(t)}var v2=Z3e,Q3e=lW,J3e=q3e,ePe=v2;function tPe(t){return ePe(t)?Q3e(t):J3e(t)}var Rx=tPe,nPe=PRe,rPe=Rx;function iPe(t,e){return t&&nPe(t,e,rPe)}var uW=iPe;function oPe(t){return t}var fW=oPe,aPe=fW;function sPe(t){return typeof t=="function"?t:aPe}var lPe=sPe,cPe=uW,uPe=lPe;function fPe(t,e){return t&&cPe(t,uPe(e))}var sO=fPe,dPe=cW,hPe=dPe(Object.getPrototypeOf,Object),lO=hPe,pPe=mp,mPe=lO,gPe=ku,vPe="[object Object]",yPe=Function.prototype,xPe=Object.prototype,dW=yPe.toString,bPe=xPe.hasOwnProperty,_Pe=dW.call(Object);function wPe(t){if(!gPe(t)||pPe(t)!=vPe)return!1;var e=mPe(t);if(e===null)return!0;var n=bPe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&dW.call(n)==_Pe}var SPe=wPe;function MPe(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++ns))return!1;var c=o.get(t),f=o.get(e);if(c&&f)return c==e&&f==t;var p=-1,m=!0,v=n&cIe?new oIe:void 0;for(o.set(t,e),o.set(e,t);++p0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,Z4e.default)(e,function(r){Array.isArray(r)?t(r).map(function(i){return n.push(i)}):(0,Y4e.default)(r)?(0,X4e.default)(r,function(i,o){i===!0&&n.push(o),n.push(o+"-"+i)}):(0,G4e.default)(r)&&n.push(r)}),n};Ax.default=Q4e;var Px={};function J4e(t,e){for(var n=-1,r=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=e.default&&(0,xDe.default)(e.default)||{};return n.map(function(i){var o=e[i];return o&&(0,vDe.default)(o,function(a,s){r[s]||(r[s]={}),r[s]=bDe({},r[s],o[s])}),i}),r};Px.default=_De;var Ix={};Object.defineProperty(Ix,"__esModule",{value:!0});Ix.autoprefix=void 0;var wDe=sO,KU=MDe(wDe),SDe=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){IDe(i,r);function i(){var o,a,s,l;PDe(this,i);for(var c=arguments.length,f=Array(c),p=0;p1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){FDe(i,r);function i(){var o,a,s,l;DDe(this,i);for(var c=arguments.length,f=Array(c),p=0;p1&&arguments[1]!==void 0?arguments[1]:!0;r[a]=s};return e===0&&i("first-child"),e===n-1&&i("last-child"),(e===0||e%2===0)&&i("even"),Math.abs(e%2)===1&&i("odd"),i("nth-child",e),r};mO.default=BDe;Object.defineProperty(Fs,"__esModule",{value:!0});Fs.ReactCSS=Fs.loop=Fs.handleActive=gO=Fs.handleHover=Fs.hover=void 0;var zDe=Ax,$De=P0(zDe),HDe=Px,VDe=P0(HDe),WDe=Ix,GDe=P0(WDe),jDe=Lx,NW=P0(jDe),XDe=Ox,qDe=P0(XDe),YDe=mO,KDe=P0(YDe);function P0(t){return t&&t.__esModule?t:{default:t}}Fs.hover=NW.default;var gO=Fs.handleHover=NW.default;Fs.handleActive=qDe.default;Fs.loop=KDe.default;var ZDe=Fs.ReactCSS=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;is?m=1:m=Math.round(p*100/s)/100,n.a!==m)return{h:n.h,s:n.s,l:n.l,a:m,source:"rgb"}}else{var v=void 0;if(f<0?v=0:f>a?v=1:v=Math.round(f*100/a)/100,i!==v)return{h:n.h,s:n.s,l:n.l,a:v,source:"rgb"}}return null},gA={},JDe=function(e,n,r,i){if(typeof document>"u"&&!i)return null;var o=i?new i:document.createElement("canvas");o.width=r*2,o.height=r*2;var a=o.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,o.width,o.height),a.fillStyle=n,a.fillRect(0,0,r,r),a.translate(r,r),a.fillRect(0,0,r,r),o.toDataURL()):null},eFe=function(e,n,r,i){var o=e+"-"+n+"-"+r+(i?"-server":"");if(gA[o])return gA[o];var a=JDe(e,n,r,i);return gA[o]=a,a},JU=Object.assign||function(t){for(var e=1;e-1},pFe=function(e){return Number(String(e).replace(/%/g,""))},mFe=1,Nn=function(t){cFe(e,t);function e(n){sFe(this,e);var r=lFe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(i){r.setUpdatedValue(i.target.value,i)},r.handleKeyDown=function(i){var o=pFe(i.target.value);if(!isNaN(o)&&hFe(i.keyCode)){var a=r.getArrowOffset(),s=i.keyCode===DW?o+a:o-a;r.setUpdatedValue(s,i)}},r.handleDrag=function(i){if(r.props.dragLabel){var o=Math.round(r.props.value+i.movementX);o>=0&&o<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(o),i)}},r.handleMouseDown=function(i){r.props.dragLabel&&(i.preventDefault(),r.handleDrag(i),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},r.inputId="rc-editable-input-"+mFe++,r}return oFe(e,[{key:"componentDidUpdate",value:function(r,i){this.props.value!==this.state.value&&(r.value!==this.props.value||i.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return aFe({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||uFe}},{key:"setUpdatedValue",value:function(r,i){var o=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(o,i),this.setState({value:r})}},{key:"render",value:function(){var r=this,i=cn({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return Z.createElement("div",{style:i.wrap},Z.createElement("input",{id:this.inputId,style:i.input,ref:function(a){return r.input=a},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?Z.createElement("label",{htmlFor:this.inputId,style:i.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(F.PureComponent||F.Component),gFe=function(e,n,r,i){var o=i.clientWidth,a=i.clientHeight,s=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=s-(i.getBoundingClientRect().left+window.pageXOffset),f=l-(i.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var p=void 0;if(f<0)p=359;else if(f>a)p=0;else{var m=-(f*100/a)+100;p=360*m/100}if(r.h!==p)return{h:p,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var v=void 0;if(c<0)v=0;else if(c>o)v=359;else{var x=c*100/o;v=360*x/100}if(r.h!==v)return{h:v,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},vFe=function(){function t(e,n){for(var r=0;r-1}function CFe(t,e){var n=this.__data__,r=w2(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Nu(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=jUe}function O0(t){return t!=null&&_O(t.length)&&!yO(t)}function XUe(t){return rd(t)&&O0(t)}function qUe(){return!1}var WW=typeof ts=="object"&&ts&&!ts.nodeType&&ts,c8=WW&&typeof ns=="object"&&ns&&!ns.nodeType&&ns,YUe=c8&&c8.exports===WW,u8=YUe?kl.Buffer:void 0,KUe=u8?u8.isBuffer:void 0,ZUe=KUe||qUe;const uM=ZUe;var QUe="[object Object]",JUe=Function.prototype,e8e=Object.prototype,GW=JUe.toString,t8e=e8e.hasOwnProperty,n8e=GW.call(Object);function r8e(t){if(!rd(t)||vp(t)!=QUe)return!1;var e=HW(t);if(e===null)return!0;var n=t8e.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&GW.call(n)==n8e}var i8e="[object Arguments]",o8e="[object Array]",a8e="[object Boolean]",s8e="[object Date]",l8e="[object Error]",c8e="[object Function]",u8e="[object Map]",f8e="[object Number]",d8e="[object Object]",h8e="[object RegExp]",p8e="[object Set]",m8e="[object String]",g8e="[object WeakMap]",v8e="[object ArrayBuffer]",y8e="[object DataView]",x8e="[object Float32Array]",b8e="[object Float64Array]",_8e="[object Int8Array]",w8e="[object Int16Array]",S8e="[object Int32Array]",M8e="[object Uint8Array]",E8e="[object Uint8ClampedArray]",C8e="[object Uint16Array]",T8e="[object Uint32Array]",br={};br[x8e]=br[b8e]=br[_8e]=br[w8e]=br[S8e]=br[M8e]=br[E8e]=br[C8e]=br[T8e]=!0;br[i8e]=br[o8e]=br[v8e]=br[a8e]=br[y8e]=br[s8e]=br[l8e]=br[c8e]=br[u8e]=br[f8e]=br[d8e]=br[h8e]=br[p8e]=br[m8e]=br[g8e]=!1;function A8e(t){return rd(t)&&_O(t.length)&&!!br[vp(t)]}function R8e(t){return function(e){return t(e)}}var jW=typeof ts=="object"&&ts&&!ts.nodeType&&ts,jy=jW&&typeof ns=="object"&&ns&&!ns.nodeType&&ns,P8e=jy&&jy.exports===jW,yA=P8e&&FW.process,I8e=function(){try{var t=jy&&jy.require&&jy.require("util").types;return t||yA&&yA.binding&&yA.binding("util")}catch{}}();const f8=I8e;var d8=f8&&f8.isTypedArray,L8e=d8?R8e(d8):A8e;const wO=L8e;function Q3(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var O8e=Object.prototype,k8e=O8e.hasOwnProperty;function N8e(t,e,n){var r=t[e];(!(k8e.call(t,e)&&kx(r,n))||n===void 0&&!(e in t))&&xO(t,e,n)}function D8e(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o-1&&t%1==0&&t0){if(++e>=J8e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var r6e=n6e(Q8e);const i6e=r6e;function o6e(t,e){return i6e(Y8e(t,e,M2),t+"")}function a6e(t,e,n){if(!Xs(n))return!1;var r=typeof e;return(r=="number"?O0(n)&&SO(e,n.length):r=="string"&&e in n)?kx(n[e],t):!1}function s6e(t){return o6e(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&a6e(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r=e||P<0||p&&U>=o}function y(){var R=xA();if(b(R))return S(R);s=setTimeout(y,_(R))}function S(R){return s=void 0,m&&r?v(R):(r=i=void 0,a)}function M(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function C(){return s===void 0?a:S(xA())}function A(){var R=xA(),P=b(R);if(r=arguments,i=this,l=R,P){if(s===void 0)return x(l);if(p)return clearTimeout(s),s=setTimeout(y,e),v(l)}return s===void 0&&(s=setTimeout(y,e)),a}return A.cancel=M,A.flush=C,A}var w6e="Expected a function";function S6e(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(w6e);return Xs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),KW(t,e,{leading:r,maxWait:e,trailing:i})}var M6e=function(e,n,r){var i=r.getBoundingClientRect(),o=i.width,a=i.height,s=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=s-(r.getBoundingClientRect().left+window.pageXOffset),f=l-(r.getBoundingClientRect().top+window.pageYOffset);c<0?c=0:c>o&&(c=o),f<0?f=0:f>a&&(f=a);var p=c/o,m=1-f/a;return{h:n.h,s:p,v:m,a:n.a,source:"hsv"}},E6e=function(){function t(e,n){for(var r=0;r=0,o=!n&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return kt(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(K6e,arguments)},brighten:function(){return this._applyModification(Z6e,arguments)},darken:function(){return this._applyModification(Q6e,arguments)},desaturate:function(){return this._applyModification(X6e,arguments)},saturate:function(){return this._applyModification(q6e,arguments)},greyscale:function(){return this._applyModification(Y6e,arguments)},spin:function(){return this._applyModification(J6e,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(nBe,arguments)},complement:function(){return this._applyCombination(eBe,arguments)},monochromatic:function(){return this._applyCombination(rBe,arguments)},splitcomplement:function(){return this._applyCombination(tBe,arguments)},triad:function(){return this._applyCombination(b8,[3])},tetrad:function(){return this._applyCombination(b8,[4])}};kt.fromRatio=function(t,e){if(fM(t)=="object"){var n={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?n[r]=t[r]:n[r]=my(t[r]));t=n}return kt(t,e)};function H6e(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof t=="string"&&(t=lBe(t)),fM(t)=="object"&&(Jc(t.r)&&Jc(t.g)&&Jc(t.b)?(e=V6e(t.r,t.g,t.b),a=!0,s=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Jc(t.h)&&Jc(t.s)&&Jc(t.v)?(r=my(t.s),i=my(t.v),e=G6e(t.h,r,i),a=!0,s="hsv"):Jc(t.h)&&Jc(t.s)&&Jc(t.l)&&(r=my(t.s),o=my(t.l),e=W6e(t.h,r,o),a=!0,s="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=QW(n),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function V6e(t,e,n){return{r:Er(t,255)*255,g:Er(e,255)*255,b:Er(n,255)*255}}function g8(t,e,n){t=Er(t,255),e=Er(e,255),n=Er(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o,a,s=(r+i)/2;if(r==i)o=a=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case t:o=(e-n)/l+(e1&&(p-=1),p<1/6?c+(f-c)*6*p:p<1/2?f:p<2/3?c+(f-c)*(2/3-p)*6:c}if(e===0)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=a(l,s,t+1/3),i=a(l,s,t),o=a(l,s,t-1/3)}return{r:r*255,g:i*255,b:o*255}}function v8(t,e,n){t=Er(t,255),e=Er(e,255),n=Er(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o,a,s=r,l=r-i;if(a=r===0?0:l/r,r==i)o=0;else{switch(r){case t:o=(e-n)/l+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(kt(r));return o}function rBe(t,e){e=e||6;for(var n=kt(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(kt({h:r,s:i,v:o})),o=(o+s)%1;return a}kt.mix=function(t,e,n){n=n===0?0:n||50;var r=kt(t).toRgb(),i=kt(e).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return kt(a)};kt.readability=function(t,e){var n=kt(t),r=kt(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};kt.isReadable=function(t,e,n){var r=kt.readability(t,e),i,o;switch(o=!1,i=cBe(n),i.level+i.size){case"AAsmall":case"AAAlarge":o=r>=4.5;break;case"AAlarge":o=r>=3;break;case"AAAsmall":o=r>=7;break}return o};kt.mostReadable=function(t,e,n){var r=null,i=0,o,a,s,l;n=n||{},a=n.includeFallbackColors,s=n.level,l=n.size;for(var c=0;ci&&(i=o,r=kt(e[c]));return kt.isReadable(t,r,{level:s,size:l})||!a?r:(n.includeFallbackColors=!1,kt.mostReadable(t,["#fff","#000"],n))};var J3=kt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},iBe=kt.hexNames=oBe(J3);function oBe(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function QW(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Er(t,e){aBe(t)&&(t="100%");var n=sBe(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function T2(t){return Math.min(1,Math.max(0,t))}function Wa(t){return parseInt(t,16)}function aBe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function sBe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Ml(t){return t.length==1?"0"+t:""+t}function my(t){return t<=1&&(t=t*100+"%"),t}function JW(t){return Math.round(parseFloat(t)*255).toString(16)}function _8(t){return Wa(t)/255}var dl=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Jc(t){return!!dl.CSS_UNIT.exec(t)}function lBe(t){t=t.replace(z6e,"").replace($6e,"").toLowerCase();var e=!1;if(J3[t])t=J3[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=dl.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=dl.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=dl.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=dl.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=dl.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=dl.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=dl.hex8.exec(t))?{r:Wa(n[1]),g:Wa(n[2]),b:Wa(n[3]),a:_8(n[4]),format:e?"name":"hex8"}:(n=dl.hex6.exec(t))?{r:Wa(n[1]),g:Wa(n[2]),b:Wa(n[3]),format:e?"name":"hex"}:(n=dl.hex4.exec(t))?{r:Wa(n[1]+""+n[1]),g:Wa(n[2]+""+n[2]),b:Wa(n[3]+""+n[3]),a:_8(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=dl.hex3.exec(t))?{r:Wa(n[1]+""+n[1]),g:Wa(n[2]+""+n[2]),b:Wa(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function cBe(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}var w8=function(e){var n=["r","g","b","a","h","s","l","v"],r=0,i=0;return B6e(n,function(o){if(e[o]&&(r+=1,isNaN(e[o])||(i+=1),o==="s"||o==="l")){var a=/^\d+%$/;a.test(e[o])&&(i+=1)}}),r===i?e:!1},gy=function(e,n){var r=e.hex?kt(e.hex):kt(e),i=r.toHsl(),o=r.toHsv(),a=r.toRgb(),s=r.toHex();i.s===0&&(i.h=n||0,o.h=n||0);var l=s==="000000"&&a.a===0;return{hsl:i,hex:l?"transparent":"#"+s,rgb:a,hsv:o,oldHue:e.h||n||i.h,source:e.source}},gd=function(e){if(e==="transparent")return!0;var n=String(e).charAt(0)==="#"?1:0;return e.length!==4+n&&e.length<7+n&&kt(e).isValid()},EO=function(e){if(!e)return"#fff";var n=gy(e);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},bA=function(e,n){var r=e.replace("°","");return kt(n+" ("+r+")")._ok},ry=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){vBe(i,r);function i(){var o,a,s,l;gBe(this,i);for(var c=arguments.length,f=Array(c),p=0;ps))return!1;var c=o.get(t),f=o.get(e);if(c&&f)return c==e&&f==t;var p=-1,m=!0,v=n&RBe?new dM:void 0;for(o.set(t,e),o.set(e,t);++p=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var Mw=24,Zze=cG.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,i=r===void 0?Mw:r,o=t.height,a=o===void 0?Mw:o,s=t.style,l=s===void 0?{}:s,c=Kze(t,["fill","width","height","style"]);return $8.default.createElement("svg",z8({viewBox:"0 0 "+Mw+" "+Mw,style:z8({fill:n,width:i,height:a},l)},c),$8.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},Qze=function(){function t(e,n){for(var r=0;r1&&(i.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(i.a*100)/100,source:"rgb"},o)):(i.h||i.s||i.l)&&(typeof i.s=="string"&&i.s.includes("%")&&(i.s=i.s.replace("%","")),typeof i.l=="string"&&i.l.includes("%")&&(i.l=i.l.replace("%","")),i.s==1?i.s=.01:i.l==1&&(i.l=.01),r.props.onChange({h:i.h||r.props.hsl.h,s:Number(B8(i.s)?r.props.hsl.s:i.s),l:Number(B8(i.l)?r.props.hsl.l:i.l),source:"hsl"},o))},r.showHighlight=function(i){i.currentTarget.style.background="#eee"},r.hideHighlight=function(i){i.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return Qze(e,[{key:"render",value:function(){var r=this,i=cn({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),o=void 0;return this.state.view==="hex"?o=Z.createElement("div",{style:i.fields,className:"flexbox-fix"},Z.createElement("div",{style:i.field},Z.createElement(Nn,{style:{input:i.input,label:i.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?o=Z.createElement("div",{style:i.fields,className:"flexbox-fix"},Z.createElement("div",{style:i.field},Z.createElement(Nn,{style:{input:i.input,label:i.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),Z.createElement("div",{style:i.field},Z.createElement(Nn,{style:{input:i.input,label:i.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),Z.createElement("div",{style:i.field},Z.createElement(Nn,{style:{input:i.input,label:i.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),Z.createElement("div",{style:i.alpha},Z.createElement(Nn,{style:{input:i.input,label:i.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(o=Z.createElement("div",{style:i.fields,className:"flexbox-fix"},Z.createElement("div",{style:i.field},Z.createElement(Nn,{style:{input:i.input,label:i.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),Z.createElement("div",{style:i.field},Z.createElement(Nn,{style:{input:i.input,label:i.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),Z.createElement("div",{style:i.field},Z.createElement(Nn,{style:{input:i.input,label:i.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),Z.createElement("div",{style:i.alpha},Z.createElement(Nn,{style:{input:i.input,label:i.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),Z.createElement("div",{style:i.wrap,className:"flexbox-fix"},o,Z.createElement("div",{style:i.toggle},Z.createElement("div",{style:i.icon,onClick:this.toggleViews,ref:function(s){return r.icon=s}},Z.createElement(Zze,{style:i.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.hsl.a!==1&&i.view==="hex"?{view:"rgb"}:null}}]),e}(Z.Component);uG.defaultProps={view:"hex"};var H8=function(){var e=cn({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return Z.createElement("div",{style:e.picker})},n$e=function(){var e=cn({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return Z.createElement("div",{style:e.picker})},IO=function(e){var n=e.width,r=e.onChange,i=e.disableAlpha,o=e.rgb,a=e.hsl,s=e.hsv,l=e.hex,c=e.renderers,f=e.styles,p=f===void 0?{}:f,m=e.className,v=m===void 0?"":m,x=e.defaultView,_=cn(_a({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+o.r+", "+o.g+", "+o.b+", "+o.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},p),{disableAlpha:i});return Z.createElement("div",{style:_.picker,className:"chrome-picker "+v},Z.createElement("div",{style:_.saturation},Z.createElement(C2,{style:_.Saturation,hsl:a,hsv:s,pointer:n$e,onChange:r})),Z.createElement("div",{style:_.body},Z.createElement("div",{style:_.controls,className:"flexbox-fix"},Z.createElement("div",{style:_.color},Z.createElement("div",{style:_.swatch},Z.createElement("div",{style:_.active}),Z.createElement(I0,{renderers:c}))),Z.createElement("div",{style:_.toggles},Z.createElement("div",{style:_.hue},Z.createElement(L0,{style:_.Hue,hsl:a,pointer:H8,onChange:r})),Z.createElement("div",{style:_.alpha},Z.createElement(vO,{style:_.Alpha,rgb:o,hsl:a,pointer:H8,renderers:c,onChange:r})))),Z.createElement(uG,{rgb:o,hsl:a,hex:l,view:x,onChange:r,disableAlpha:i})))};IO.propTypes={width:qe.oneOfType([qe.string,qe.number]),disableAlpha:qe.bool,styles:qe.object,defaultView:qe.oneOf(["hex","rgb","hsl"])};IO.defaultProps={width:225,disableAlpha:!1,styles:{}};wa(IO);var r$e=function(e){var n=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=e.active,s=cn({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:EO(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:a,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return Z.createElement(bp,{style:s.color,color:n,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+n}},Z.createElement("div",{style:s.dot}))},i$e=function(e){var n=e.hex,r=e.rgb,i=e.onChange,o=cn({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),a=function(l,c){l.r||l.g||l.b?i({r:l.r||r.r,g:l.g||r.g,b:l.b||r.b,source:"rgb"},c):i({hex:l.hex,source:"hex"},c)};return Z.createElement("div",{style:o.fields,className:"flexbox-fix"},Z.createElement("div",{style:o.active}),Z.createElement(Nn,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"hex",value:n,onChange:a}),Z.createElement(Nn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:r.r,onChange:a}),Z.createElement(Nn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:r.g,onChange:a}),Z.createElement(Nn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:r.b,onChange:a}))},LO=function(e){var n=e.onChange,r=e.onSwatchHover,i=e.colors,o=e.hex,a=e.rgb,s=e.styles,l=s===void 0?{}:s,c=e.className,f=c===void 0?"":c,p=cn(_a({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},l)),m=function(x,_){x.hex?gd(x.hex)&&n({hex:x.hex,source:"hex"},_):n(x,_)};return Z.createElement(Nx,{style:p.Compact,styles:l},Z.createElement("div",{style:p.compact,className:"compact-picker "+f},Z.createElement("div",null,_p(i,function(v){return Z.createElement(r$e,{key:v,color:v,active:v.toLowerCase()===o,onClick:m,onSwatchHover:r})}),Z.createElement("div",{style:p.clear})),Z.createElement(i$e,{hex:o,rgb:a,onChange:m})))};LO.propTypes={colors:qe.arrayOf(qe.string),styles:qe.object};LO.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};wa(LO);var o$e=function(e){var n=e.hover,r=e.color,i=e.onClick,o=e.onSwatchHover,a={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=cn({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:a}},{hover:n});return Z.createElement("div",{style:s.swatch},Z.createElement(bp,{color:r,onClick:i,onHover:o,focusStyle:a}))};const a$e=gO(o$e);var OO=function(e){var n=e.width,r=e.colors,i=e.onChange,o=e.onSwatchHover,a=e.triangle,s=e.styles,l=s===void 0?{}:s,c=e.className,f=c===void 0?"":c,p=cn(_a({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},l),{"hide-triangle":a==="hide","top-left-triangle":a==="top-left","top-right-triangle":a==="top-right","bottom-left-triangle":a==="bottom-left","bottom-right-triangle":a==="bottom-right"}),m=function(x,_){return i({hex:x,source:"hex"},_)};return Z.createElement("div",{style:p.card,className:"github-picker "+f},Z.createElement("div",{style:p.triangleShadow}),Z.createElement("div",{style:p.triangle}),_p(r,function(v){return Z.createElement(a$e,{color:v,key:v,onClick:m,onSwatchHover:o})}))};OO.propTypes={width:qe.oneOfType([qe.string,qe.number]),colors:qe.arrayOf(qe.string),triangle:qe.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:qe.object};OO.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};wa(OO);var s$e=function(e){var n=e.direction,r=cn({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return Z.createElement("div",{style:r.picker})},l$e=Object.assign||function(t){for(var e=1;e.5});return Z.createElement("div",{style:r.picker})},d$e=function(){var e=cn({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return Z.createElement("div",{style:e.pointer},Z.createElement("div",{style:e.left},Z.createElement("div",{style:e.leftInside})),Z.createElement("div",{style:e.right},Z.createElement("div",{style:e.rightInside})))},V8=function(e){var n=e.onClick,r=e.label,i=e.children,o=e.active,a=cn({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:o});return Z.createElement("div",{style:a.button,onClick:n},r||i)},h$e=function(e){var n=e.rgb,r=e.currentColor,i=cn({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return Z.createElement("div",null,Z.createElement("div",{style:i.label},"new"),Z.createElement("div",{style:i.swatches},Z.createElement("div",{style:i.new}),Z.createElement("div",{style:i.current})),Z.createElement("div",{style:i.label},"current"))},p$e=function(){function t(e,n){for(var r=0;r100&&(f.a=100),f.a/=100,n({h:i.h,s:i.s,l:i.l,a:f.a,source:"rgb"},p))};return Z.createElement("div",{style:s.fields,className:"flexbox-fix"},Z.createElement("div",{style:s.double},Z.createElement(Nn,{style:{input:s.input,label:s.label},label:"hex",value:o.replace("#",""),onChange:l})),Z.createElement("div",{style:s.single},Z.createElement(Nn,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),Z.createElement("div",{style:s.single},Z.createElement(Nn,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),Z.createElement("div",{style:s.single},Z.createElement(Nn,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),Z.createElement("div",{style:s.alpha},Z.createElement(Nn,{style:{input:s.input,label:s.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},x$e=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var Ew=24,T$e=dG.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,i=r===void 0?Ew:r,o=t.height,a=o===void 0?Ew:o,s=t.style,l=s===void 0?{}:s,c=C$e(t,["fill","width","height","style"]);return G8.default.createElement("svg",W8({viewBox:"0 0 "+Ew+" "+Ew,style:W8({fill:n,width:i,height:a},l)},c),G8.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},A$e=function(e){var n=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=e.first,s=e.last,l=e.active,c=cn({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:EO(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:a,last:s,active:l,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return Z.createElement(bp,{color:n,style:c.color,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+n}},Z.createElement("div",{style:c.check},Z.createElement(T$e,null)))},R$e=function(e){var n=e.onClick,r=e.onSwatchHover,i=e.group,o=e.active,a=cn({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return Z.createElement("div",{style:a.group},_p(i,function(s,l){return Z.createElement(A$e,{key:s,color:s,active:s.toLowerCase()===o,first:l===0,last:l===i.length-1,onClick:n,onSwatchHover:r})}))},UO=function(e){var n=e.width,r=e.height,i=e.onChange,o=e.onSwatchHover,a=e.colors,s=e.hex,l=e.styles,c=l===void 0?{}:l,f=e.className,p=f===void 0?"":f,m=cn(_a({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},c)),v=function(_,b){return i({hex:_,source:"hex"},b)};return Z.createElement("div",{style:m.picker,className:"swatches-picker "+p},Z.createElement(Nx,null,Z.createElement("div",{style:m.overflow},Z.createElement("div",{style:m.body},_p(a,function(x){return Z.createElement(R$e,{key:x.toString(),group:x,active:s,onClick:v,onSwatchHover:o})}),Z.createElement("div",{style:m.clear})))))};UO.propTypes={width:qe.oneOfType([qe.string,qe.number]),height:qe.oneOfType([qe.string,qe.number]),colors:qe.arrayOf(qe.arrayOf(qe.string)),styles:qe.object};UO.defaultProps={width:320,height:240,colors:[[Vm[900],Vm[700],Vm[500],Vm[300],Vm[100]],[Wm[900],Wm[700],Wm[500],Wm[300],Wm[100]],[Gm[900],Gm[700],Gm[500],Gm[300],Gm[100]],[jm[900],jm[700],jm[500],jm[300],jm[100]],[Xm[900],Xm[700],Xm[500],Xm[300],Xm[100]],[qm[900],qm[700],qm[500],qm[300],qm[100]],[Ym[900],Ym[700],Ym[500],Ym[300],Ym[100]],[Km[900],Km[700],Km[500],Km[300],Km[100]],[Zm[900],Zm[700],Zm[500],Zm[300],Zm[100]],["#194D33",vy[700],vy[500],vy[300],vy[100]],[Qm[900],Qm[700],Qm[500],Qm[300],Qm[100]],[Jm[900],Jm[700],Jm[500],Jm[300],Jm[100]],[eg[900],eg[700],eg[500],eg[300],eg[100]],[tg[900],tg[700],tg[500],tg[300],tg[100]],[ng[900],ng[700],ng[500],ng[300],ng[100]],[rg[900],rg[700],rg[500],rg[300],rg[100]],[ig[900],ig[700],ig[500],ig[300],ig[100]],[og[900],og[700],og[500],og[300],og[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};wa(UO);var BO=function(e){var n=e.onChange,r=e.onSwatchHover,i=e.hex,o=e.colors,a=e.width,s=e.triangle,l=e.styles,c=l===void 0?{}:l,f=e.className,p=f===void 0?"":f,m=cn(_a({default:{card:{width:a,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},c),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),v=function(_,b){gd(_)&&n({hex:_,source:"hex"},b)};return Z.createElement("div",{style:m.card,className:"twitter-picker "+p},Z.createElement("div",{style:m.triangleShadow}),Z.createElement("div",{style:m.triangle}),Z.createElement("div",{style:m.body},_p(o,function(x,_){return Z.createElement(bp,{key:_,color:x,hex:x,style:m.swatch,onClick:v,onHover:r,focusStyle:{boxShadow:"0 0 4px "+x}})}),Z.createElement("div",{style:m.hash},"#"),Z.createElement(Nn,{label:null,style:{input:m.input},value:i.replace("#",""),onChange:v}),Z.createElement("div",{style:m.clear})))};BO.propTypes={width:qe.oneOfType([qe.string,qe.number]),triangle:qe.oneOf(["hide","top-left","top-right"]),colors:qe.arrayOf(qe.string),styles:qe.object};BO.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};wa(BO);var zO=function(e){var n=cn({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(e.hsl.s*100)+"%, "+Math.round(e.hsl.l*100)+"%)"}}});return Z.createElement("div",{style:n.picker})};zO.propTypes={hsl:qe.shape({h:qe.number,s:qe.number,l:qe.number,a:qe.number})};zO.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var $O=function(e){var n=cn({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return Z.createElement("div",{style:n.picker})};$O.propTypes={hsl:qe.shape({h:qe.number,s:qe.number,l:qe.number,a:qe.number})};$O.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var P$e=function(e){var n=e.onChange,r=e.rgb,i=e.hsl,o=e.hex,a=e.hsv,s=function(v,x){if(v.hex)gd(v.hex)&&n({hex:v.hex,source:"hex"},x);else if(v.rgb){var _=v.rgb.split(",");bA(v.rgb,"rgb")&&n({r:_[0],g:_[1],b:_[2],a:1,source:"rgb"},x)}else if(v.hsv){var b=v.hsv.split(",");bA(v.hsv,"hsv")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),b[1]==1?b[1]=.01:b[2]==1&&(b[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsv"},x))}else if(v.hsl){var y=v.hsl.split(",");bA(v.hsl,"hsl")&&(y[2]=y[2].replace("%",""),y[1]=y[1].replace("%",""),y[0]=y[0].replace("°",""),p[1]==1?p[1]=.01:p[2]==1&&(p[2]=.01),n({h:Number(y[0]),s:Number(y[1]),v:Number(y[2]),source:"hsl"},x))}},l=cn({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),c=r.r+", "+r.g+", "+r.b,f=Math.round(i.h)+"°, "+Math.round(i.s*100)+"%, "+Math.round(i.l*100)+"%",p=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.v*100)+"%";return Z.createElement("div",{style:l.wrap,className:"flexbox-fix"},Z.createElement("div",{style:l.fields},Z.createElement("div",{style:l.double},Z.createElement(Nn,{style:{input:l.input,label:l.label},label:"hex",value:o,onChange:s})),Z.createElement("div",{style:l.column},Z.createElement("div",{style:l.single},Z.createElement(Nn,{style:{input:l.input2,label:l.label2},label:"rgb",value:c,onChange:s})),Z.createElement("div",{style:l.single},Z.createElement(Nn,{style:{input:l.input2,label:l.label2},label:"hsv",value:p,onChange:s})),Z.createElement("div",{style:l.single},Z.createElement(Nn,{style:{input:l.input2,label:l.label2},label:"hsl",value:f,onChange:s})))))},HO=function(e){var n=e.width,r=e.onChange,i=e.rgb,o=e.hsl,a=e.hsv,s=e.hex,l=e.header,c=e.styles,f=c===void 0?{}:c,p=e.className,m=p===void 0?"":p,v=cn(_a({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+i.r+", "+i.g+", "+i.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},f));return Z.createElement("div",{style:v.picker,className:"google-picker "+m},Z.createElement("div",{style:v.head},l),Z.createElement("div",{style:v.swatch}),Z.createElement("div",{style:v.saturation},Z.createElement(C2,{hsl:o,hsv:a,pointer:zO,onChange:r})),Z.createElement("div",{style:v.body},Z.createElement("div",{style:v.controls,className:"flexbox-fix"},Z.createElement("div",{style:v.hue},Z.createElement(L0,{style:v.Hue,hsl:o,radius:"4px",pointer:$O,onChange:r}))),Z.createElement(P$e,{rgb:i,hsl:o,hex:s,hsv:a,onChange:r})))};HO.propTypes={width:qe.oneOfType([qe.string,qe.number]),styles:qe.object,header:qe.string};HO.defaultProps={width:652,styles:{},header:"Color picker"};wa(HO);var VO={},hG={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})(hG);var pG=hG.exports,wA={};const I$e=KY(ane);var j8;function mG(){return j8||(j8=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=I$e}(wA)),wA}var L$e=pG;Object.defineProperty(VO,"__esModule",{value:!0});var gG=VO.default=void 0,O$e=L$e(mG()),k$e=O,N$e=(0,O$e.default)((0,k$e.jsx)("path",{d:"M3 3h18v18H3z"}),"Square");gG=VO.default=N$e;function sh(t){const[e,n]=Z.useState(null),r=a=>{n(a.currentTarget)},i=()=>{n(null)},o=!!e;return O.jsxs("div",{children:[O.jsx(mE,{style:{color:Sf(t.color)},onClick:r,children:O.jsx(gG,{})}),O.jsx(E$,{open:o,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:O.jsx(_$e,{color:t.color,onChangeComplete:t.onChangeComplete})})]})}function D$e(){const t=nW();return O.jsx(_E,{sx:{height:1,width:1},children:O.jsx(wE,{children:O.jsxs(Fn,{spacing:1,children:[O.jsx(yn,{variant:"h6",children:" Legend"}),O.jsx(Oh,{}),O.jsxs(v$,{children:[O.jsx(Ga,{control:O.jsx(Zd,{checked:t.detector,onChange:(e,n)=>t.update({detector:n})}),label:O.jsxs(Fn,{direction:"row",children:[O.jsx(sh,{color:t.detectorColour,onChangeComplete:e=>t.update({detectorColour:e.rgb})}),O.jsx(yn,{children:"Detector:"})]})}),O.jsx(Ga,{control:O.jsx(Zd,{checked:t.cameraTube,onChange:(e,n)=>t.update({cameraTube:n})}),label:O.jsxs(Fn,{direction:"row",children:[O.jsx(sh,{color:t.cameraTubeColor,onChangeComplete:e=>t.update({cameraTubeColor:e.rgb})}),O.jsx(yn,{children:"Camera Tube:"})]})}),O.jsx(Ga,{control:O.jsx(Zd,{checked:t.beamstop,onChange:(e,n)=>{t.update({beamstop:n})}}),label:O.jsxs(Fn,{direction:"row",children:[O.jsx(sh,{color:t.beamstopColor,onChangeComplete:e=>t.update({beamstopColor:e.rgb})}),O.jsx(yn,{children:"Beamstop"})]})}),O.jsx(Ga,{control:O.jsx(Zd,{checked:t.clearance,onChange:(e,n)=>{t.update({clearance:n})}}),label:O.jsxs(Fn,{direction:"row",children:[O.jsx(sh,{color:t.clearanceColor,onChangeComplete:e=>t.update({clearanceColor:e.rgb})}),O.jsx(yn,{children:"Clearance"})]})}),O.jsx(Ga,{control:O.jsx(Zd,{checked:t.visibleRange,onChange:(e,n)=>t.update({visibleRange:n})}),label:O.jsxs(Fn,{direction:"row",children:[O.jsx(sh,{color:t.visibleColor,onChangeComplete:e=>t.update({visibleColor:e.rgb})}),O.jsx(yn,{children:"Visible Range"})]})}),O.jsx(Ga,{control:O.jsx(Zd,{checked:t.requestedRange,onChange:(e,n)=>t.update({requestedRange:n})}),label:O.jsxs(Fn,{direction:"row",children:[O.jsx(sh,{color:t.requestedRangeColor,onChangeComplete:e=>t.update({requestedRangeColor:e.rgb})}),O.jsx(yn,{children:"Requested Range"})]})}),O.jsx(Ga,{control:O.jsx(Zd,{checked:t.inaccessibleRange,onChange:(e,n)=>t.update({inaccessibleRange:n})}),label:O.jsxs(Fn,{direction:"row",children:[O.jsx(sh,{color:t.inaccessibleRangeColor,onChangeComplete:e=>t.update({inaccessibleRangeColor:e.rgb})}),O.jsx(yn,{children:"inaccessible Range"})]})})]}),O.jsxs($s,{children:[O.jsx(LI,{id:"demo-radio-buttons-group-label",children:"Axes:"}),O.jsxs(L$,{"aria-labelledby":"demo-radio-buttons-group-label",value:t.plotAxes,name:"radio-buttons-group",onChange:e=>t.update({plotAxes:e.target.value}),children:[O.jsx(Ga,{value:vu.milimeter,control:O.jsx(Og,{}),label:"Axes in mm"}),O.jsx(Ga,{value:vu.pixel,control:O.jsx(Og,{}),label:"Axes in pixels"}),O.jsx(Ga,{value:vu.reciprocal,control:O.jsx(Og,{}),label:"Axes in q(nm^-1)"})]})]})]})})})}var sa=(t=>(t.q="q",t.s="s",t.d="d",t))(sa||{});const Rh=g0(t=>({requested:"q",qUnits:au.nanmometres,sUnits:Gn.nanmometres,dUnits:Gn.nanmometres,requestedMin:null,requestedMax:null,updateRequested:e=>{t({requested:e})},updateRequestedRange:e=>{t({...e})},updateQUnits:e=>t({qUnits:e}),updateSUnits:e=>t({sUnits:e}),updateDUnits:e=>t({dUnits:e})}));function F$e(t){return O.jsx("svg",{style:{display:"grid",height:"40%",width:"90%",border:"solid black"},children:O.jsx("text",{x:"40%",y:"50%",children:t.message})})}function U$e(t){const e=t.visibleQRange.max-t.visibleQRange.min,n=t.requestedRange.max/e*100,r=t.requestedRange.min/e*100,i=t.visibleQRange.containsRange(t.requestedRange)?"green":"red";return O.jsxs("svg",{style:{display:"grid",height:"40%",width:"90%",border:"solid black"},children:[O.jsx("rect",{y:"0",x:"0",width:"100%",height:"50%",fill:i}),O.jsx("line",{x1:`${r}%`,y1:0,x2:`${r}%`,y2:"50%",style:{stroke:"black",strokeWidth:2}}),O.jsx("line",{x1:`${n}%`,y1:0,x2:`${n}%`,y2:"60%",style:{stroke:"black",strokeWidth:2}}),O.jsxs("text",{y:"60%",x:`${r}%`,children:[" ","Requested min"]}),O.jsx("text",{y:"80%",x:`${n}%`,children:"Requested max"})]})}const hM=t=>1/t,pM=t=>2*Math.PI/t;function B$e(t){const e=Rh(),n=Rh(p=>p.updateQUnits),r=Rh(p=>p.updateSUnits),i=Rh(p=>p.updateDUnits),o=p=>{n(p.target.value)},a=p=>{r(p.target.value)},s=p=>{i(p.target.value)};let l=t.qRange,c=null,f=null;return t.qRange&&(c=t.qRange.apply(hM),f=t.qRange.apply(pM),e.qUnits===au.angstroms&&(l=t.qRange.apply(pu)),e.sUnits===Gn.angstroms&&(c=c.apply(Nh)),e.dUnits===Gn.angstroms&&(f=f.apply(Nh))),O.jsx(Su,{flexGrow:1,children:O.jsx(Lue,{component:lp,children:O.jsxs(fue,{sx:{minWidth:50},"aria-label":"simple table",size:"small",children:[O.jsx(Bue,{children:O.jsxs(p_,{children:[O.jsx(vo,{children:"Values"}),O.jsx(vo,{align:"right",children:"Min"}),O.jsx(vo,{align:"right",children:"Max"}),O.jsx(vo,{align:"right",children:"Units"})]})}),O.jsxs(xue,{children:[O.jsxs(p_,{children:[O.jsx(vo,{component:"th",scope:"row",children:sa.q}),O.jsx(vo,{align:"right",children:l?l.min.toFixed(4):""}),O.jsx(vo,{align:"right",children:l?l.max.toFixed(4):""}),O.jsx(vo,{align:"right",children:O.jsxs($s,{children:[O.jsx(dc,{children:"q"}),O.jsxs(hc,{size:"small",label:"units",value:e.qUnits,onChange:o,children:[O.jsx($i,{value:au.nanmometres,children:au.nanmometres}),O.jsx($i,{value:au.angstroms,children:au.angstroms})]})]})})]},"q"),O.jsxs(p_,{children:[O.jsx(vo,{component:"th",scope:"row",children:sa.s}),O.jsx(vo,{align:"right",children:c?c.min.toFixed(4):""}),O.jsx(vo,{align:"right",children:c?c.max.toFixed(4):""}),O.jsx(vo,{align:"right",children:O.jsxs($s,{children:[O.jsx(dc,{children:"s"}),O.jsxs(hc,{size:"small",label:"units",value:e.sUnits,onChange:a,children:[O.jsx($i,{value:Gn.nanmometres,children:Gn.nanmometres}),O.jsx($i,{value:Gn.angstroms,children:Gn.angstroms})]})]})})]},"s"),O.jsxs(p_,{children:[O.jsx(vo,{component:"th",scope:"row",children:sa.d}),O.jsx(vo,{align:"right",children:f?f.min.toFixed(4):""}),O.jsx(vo,{align:"right",children:f?f.max.toFixed(4):""}),O.jsx(vo,{align:"right",children:O.jsxs($s,{children:[O.jsx(dc,{children:"d"}),O.jsxs(hc,{size:"small",label:"units",value:e.dUnits,onChange:s,children:[O.jsx($i,{value:Gn.nanmometres,children:Gn.nanmometres}),O.jsx($i,{value:Gn.angstroms,children:Gn.angstroms})]})]})})]},"d")]})]})})})}function z$e(t){const e=Rh(),n=Rh(l=>l.requestedMax&&l.requestedMin?new to(l.requestedMin,l.requestedMax):null);let r=null,i=null,o=n;const a=l=>{e.updateRequestedRange({requestedMax:wl(l.target.value)})},s=l=>{e.updateRequestedRange({requestedMin:wl(l.target.value)})};if(t.visableQRange&&t.fullQrange&&n)switch(e.requested){case sa.d:r=t.visableQRange.apply(pM),i=t.fullQrange.apply(pM),e.dUnits===Gn.angstroms&&(o=n.apply(pu));break;case sa.s:r=t.visableQRange.apply(hM),i=t.fullQrange.apply(hM),e.sUnits===Gn.angstroms&&(o=n.apply(pu));break;default:r=t.visableQRange,i=t.fullQrange,e.qUnits===au.angstroms&&(o=n.apply(Nh))}return O.jsx(Su,{sx:{flexGrow:1},children:O.jsx(_E,{sx:{height:1},children:O.jsx(wE,{children:O.jsxs(Fn,{spacing:1,children:[O.jsx(yn,{variant:"h6",children:" Results"}),O.jsx(Oh,{}),O.jsxs(Fn,{direction:"row",spacing:3,children:[O.jsx(B$e,{qRange:t.visableQRange}),O.jsx(Oh,{orientation:"vertical"}),O.jsxs(Fn,{flexGrow:2,children:[O.jsx(Fn,{spacing:1,children:O.jsxs(Fn,{direction:"row",spacing:1,children:[O.jsxs(Fn,{spacing:1,children:[O.jsxs(yn,{children:["Requested min ",e.requested," value:"," "]}),O.jsxs(yn,{children:["Requested max ",e.requested," value:"," "]})]}),O.jsxs(Fn,{spacing:1,children:[O.jsx(es,{type:"number",size:"small",value:e.requestedMin,onChange:s}),O.jsx(es,{type:"number",size:"small",value:e.requestedMax,onChange:a})]}),O.jsxs($s,{children:[O.jsx(LI,{children:"Requested Quantiy"}),O.jsxs(L$,{row:!0,value:e.requested,onChange:l=>e.updateRequested(l.target.value),children:[O.jsx(Ga,{value:sa.q,control:O.jsx(Og,{}),label:sa.q}),O.jsx(Ga,{value:sa.s,control:O.jsx(Og,{}),label:sa.s}),O.jsx(Ga,{value:sa.d,control:O.jsx(Og,{}),label:sa.d})]})]})]})}),(()=>r&&i&&o&&{}?O.jsx(U$e,{visibleQRange:r,fullQRange:i,requestedRange:o}):O.jsx(F$e,{message:"No solution"}))()]})]})]})})})})}const $$e=(t,e,n)=>{if(t<0||e<0||n<0)return null;const r=n*t/(4*Math.PI);return Math.abs(r)>=Math.sqrt(2)/2?null:Math.tan(2*Math.asin(r))*e},X8=(t,e,n,r,i)=>new rW(new Be(Math.cos(e),Math.sin(e)),i).getPointAtDistance(1e3*($$e(t,n,r)??0));function SA(t){const{coords:e,...n}=t,[r,i,o]=e,a=i.distanceTo(r),s=o.distanceTo(r);return O.jsx("ellipse",{cx:r.x,cy:r.y,rx:a,ry:s,...n})}function H$e(){const t=nW(),e=kg(C=>{let A=C.angle,R=C.wavelength;return R&&C.wavelengthUnits===Gn.angstroms&&(R=pu(R)),A&&C.angleUnits===pl.degrees&&(A=K7.degToRad(A)),{angle:A,cameraLength:C.cameraLength,minWavelength:C.minWavelength,maxWavelength:C.maxWavelength,minCameraLength:C.minCameraLength,maxCameraLength:C.maxCameraLength,cameraLengthStep:C.cameraLengthStep,wavelength:R}}),n=tc(C=>C.current),r=tu(C=>({centre:C.centre,diameter:C.diameter,clearance:C.clearance})),i=vh(C=>({centre:C.centre,diameter:C.diameter})),o=vRe(n,r,i,e),{ptMin:a,ptMax:s,visibleQRange:l,fullQRange:c}=o,f=gU(r.centre,r.diameter,n.pixelSize,t.plotAxes),p=mRe(r.centre,r.diameter,n.pixelSize,t.plotAxes,r.clearance??0),m=gU(i.centre,i.diameter,n.pixelSize,t.plotAxes),v=hRe(new q(0,0),n.resolution,n.pixelSize,t.plotAxes),x=pRe(new q(a.x,a.y),new q(s.x,s.y),n.pixelSize,t.plotAxes),_=Rh(C=>!C.requestedMax||!C.requestedMin?null:to.createWithFunc(C.requestedMin,C.requestedMax,A=>{switch(C.requested){case sa.d:C.dUnits===Gn.angstroms&&(A=pu(A)),A=pM(A);break;case sa.s:C.sUnits===Gn.angstroms&&(A=pu(A)),A=hM(A);break;default:C.qUnits===au.angstroms&&(A=Nh(A))}return A}));let b=new Be(0,0),y=new Be(0,0);_&&e.angle&&e.cameraLength&&e.wavelength&&(y=X8(_.max*1e9,e.angle,e.cameraLength,e.wavelength*1e-9,new Be(f.centre.x,f.centre.y)),b=X8(_.min*1e9,e.angle,e.cameraLength,e.wavelength*1e-9,new Be(f.centre.x,f.centre.y)));const S={start:new q(b.x,b.y),end:new q(y.x,y.y)},M=dRe(v,t.plotAxes);return O.jsx(Su,{children:O.jsxs(Fn,{direction:"column",spacing:1,children:[O.jsxs(Fn,{direction:"row",spacing:1,children:[O.jsx(_E,{children:O.jsx(wE,{children:O.jsx("div",{style:{display:"grid",height:"60vh",width:"65vh",border:"solid black"},children:O.jsxs(yAe,{abscissaConfig:{visDomain:[M.xAxis.min,M.xAxis.max],showGrid:!0},ordinateConfig:{visDomain:[M.yAxis.max,M.yAxis.min],showGrid:!0},children:[O.jsx(XTe,{}),O.jsx(ZTe,{}),O.jsx(uRe,{points:[f.centre,f.endPointX,f.endPointY,p.centre,p.endPointX,p.endPointY,m.centre,m.endPointX,m.endPointY,v.lowerBound,v.upperBound,x.start,x.end,S.start,S.end],children:(C,A,R,P,U,k,N,z,K,J,G,ne,ie,se,H)=>O.jsxs(eO,{children:[t.cameraTube&&O.jsx(SA,{coords:[N,z,K],fill:Sf(t.cameraTubeColor),id:"camera tube"}),t.detector&&O.jsx(tM,{coords:[J,G],fill:Sf(t.detectorColour),id:"detector"}),t.inaccessibleRange&&O.jsx(fA,{coords:[C,ne],stroke:Sf(t.inaccessibleRangeColor),strokeWidth:3,id:"inaccessible"}),t.clearance&&O.jsx(SA,{coords:[P,U,k],fill:Sf(t.clearanceColor),id:"clearance"}),t.visibleRange&&O.jsx(fA,{coords:[ne,ie],stroke:Sf(t.visibleColor),strokeWidth:3,id:"visible"}),t.requestedRange&&O.jsx(fA,{coords:[se,H],stroke:Sf(t.requestedRangeColor),strokeWidth:3,id:"requested"}),t.beamstop&&O.jsx(SA,{coords:[C,A,R],fill:Sf(t.beamstopColor),id:"beamstop"})]})})]})})})}),O.jsx(Su,{flexGrow:1,children:O.jsx(D$e,{})})]}),O.jsx(z$e,{visableQRange:l,fullQrange:c})]})})}var WO={},V$e=pG;Object.defineProperty(WO,"__esModule",{value:!0});var vG=WO.default=void 0,W$e=V$e(mG()),G$e=O,j$e=(0,W$e.default)((0,G$e.jsx)("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");vG=WO.default=j$e;function X$e(){return O.jsxs(Su,{children:[O.jsx(_$,{children:O.jsx(Ole,{children:O.jsx(Fn,{direction:"row",children:O.jsx(yn,{flexGrow:3,children:"Nothing to see here (0_0)"})})})}),O.jsx(Oh,{})]})}function q$e(){const[t,e]=F.useState({menuOpen:!1}),n=c=>()=>{e({menuOpen:c})},r=kg(c=>c.preset),i=tu(c=>c.updateBeamstop),o=vh(c=>c.updateCameraTube),a=kg(c=>c.update),s=tc(c=>c.updateDetector),l=c=>{const{beamstop:f,cameraTube:p,detector:m,...v}=v1[c];s(m),i(f),o(p),a(v),a({preset:c})};return O.jsx(Su,{sx:{flexGrow:2},children:O.jsx(ire,{position:"static",children:O.jsxs(Gue,{children:[O.jsxs(F.Fragment,{children:[O.jsx(mE,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:n(!0),children:O.jsx(vG,{})}),O.jsx(gse,{anchor:"left",open:t.menuOpen,onClose:n(!1),children:O.jsx(Su,{sx:{width:250},role:"presentation",onClick:n(!1),children:O.jsx(X$e,{})})})]}),O.jsx(yn,{variant:"h6",component:"div",sx:{flexGrow:1},children:"Dedi Web"}),O.jsx(l$,{size:"small",disablePortal:!0,id:"combo-box-demo",options:Object.keys(v1),value:r,sx:{width:300,color:"white"},renderInput:c=>O.jsx(es,{...c,label:"choose beamline preset",sx:{color:"white"}}),onChange:(c,f)=>{f&&l(f)}})]})})})}function Y$e(){return O.jsxs(Su,{children:[O.jsx(q$e,{}),O.jsxs(Fn,{direction:"row",spacing:1,margin:1,children:[O.jsx(Su,{children:O.jsx(ide,{})}),O.jsx(Fn,{direction:"column",spacing:1,flexGrow:1,children:O.jsx(H$e,{})})]})]})}EA.createRoot(document.getElementById("root")).render(O.jsx(Z.StrictMode,{children:O.jsx(Y$e,{})}))});export default K$e(); diff --git a/assets/index-e75c3f43.js b/assets/index-e75c3f43.js new file mode 100644 index 0000000..e004be0 --- /dev/null +++ b/assets/index-e75c3f43.js @@ -0,0 +1,3923 @@ +var BQ=Object.defineProperty;var UQ=(t,e,n)=>e in t?BQ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var zQ=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Il=(t,e,n)=>(UQ(t,typeof e!="symbol"?e+"":e,n),n);var IXe=zQ((As,Ts)=>{function $Q(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 a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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 Fc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function su(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function HQ(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 Kz={exports:{}},W2={},Zz={exports:{}},zn={};/** + * @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 tb=Symbol.for("react.element"),VQ=Symbol.for("react.portal"),WQ=Symbol.for("react.fragment"),GQ=Symbol.for("react.strict_mode"),jQ=Symbol.for("react.profiler"),qQ=Symbol.for("react.provider"),XQ=Symbol.for("react.context"),YQ=Symbol.for("react.forward_ref"),KQ=Symbol.for("react.suspense"),ZQ=Symbol.for("react.memo"),JQ=Symbol.for("react.lazy"),J5=Symbol.iterator;function QQ(t){return t===null||typeof t!="object"?null:(t=J5&&t[J5]||t["@@iterator"],typeof t=="function"?t:null)}var Jz={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qz=Object.assign,e9={};function ov(t,e,n){this.props=t,this.context=e,this.refs=e9,this.updater=n||Jz}ov.prototype.isReactComponent={};ov.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")};ov.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function t9(){}t9.prototype=ov.prototype;function aN(t,e,n){this.props=t,this.context=e,this.refs=e9,this.updater=n||Jz}var sN=aN.prototype=new t9;sN.constructor=aN;Qz(sN,ov.prototype);sN.isPureReactComponent=!0;var Q5=Array.isArray,n9=Object.prototype.hasOwnProperty,lN={current:null},r9={key:!0,ref:!0,__self:!0,__source:!0};function i9(t,e,n){var r,i={},o=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(o=""+e.key),e)n9.call(e,r)&&!r9.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,ue=W[re];if(0>>1;rei(Re,ne))Iei(He,Re)?(W[re]=He,W[Ie]=ne,re=Ie):(W[re]=Re,W[Ce]=ne,re=Ce);else if(Iei(He,ne))W[re]=He,W[Ie]=ne,re=Ie;else break e}}return U}function i(W,U){var ne=W.sortIndex-U.sortIndex;return ne!==0?ne:W.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,d=3,p=!1,y=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(W){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=W)r(u),U.sortIndex=U.expirationTime,e(l,U);else break;U=n(u)}}function E(W){if(x=!1,w(W),!y)if(n(l)!==null)y=!0,Y(T);else{var U=n(u);U!==null&&$(E,U.startTime-W)}}function T(W,U){y=!1,x&&(x=!1,v(I),I=-1),p=!0;var ne=d;try{for(w(U),f=n(l);f!==null&&(!(f.expirationTime>U)||W&&!B());){var re=f.callback;if(typeof re=="function"){f.callback=null,d=f.priorityLevel;var ue=re(f.expirationTime<=U);U=t.unstable_now(),typeof ue=="function"?f.callback=ue:f===n(l)&&r(l),w(U)}else r(l);f=n(l)}if(f!==null)var ce=!0;else{var Ce=n(u);Ce!==null&&$(E,Ce.startTime-U),ce=!1}return ce}finally{f=null,d=ne,p=!1}}var A=!1,D=null,I=-1,P=5,N=-1;function B(){return!(t.unstable_now()-NW||125re?(W.sortIndex=ne,e(u,W),n(l)===null&&W===n(u)&&(x?(v(I),I=-1):x=!0,$(E,ne-re))):(W.sortIndex=ue,e(l,W),y||p||(y=!0,Y(T))),W},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(W){var U=d;return function(){var ne=d;d=U;try{return W.apply(this,arguments)}finally{d=ne}}}})(l9);s9.exports=l9;var cee=s9.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 u9=V,Os=cee;function dt(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"),gD=Object.prototype.hasOwnProperty,fee=/^[: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]*$/,tL={},nL={};function dee(t){return gD.call(nL,t)?!0:gD.call(tL,t)?!1:fee.test(t)?nL[t]=!0:(tL[t]=!0,!1)}function hee(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 pee(t,e,n,r){if(e===null||typeof e>"u"||hee(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 _a(t,e,n,r,i,o,a){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=a}var Mo={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Mo[t]=new _a(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Mo[e]=new _a(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Mo[t]=new _a(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Mo[t]=new _a(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){Mo[t]=new _a(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Mo[t]=new _a(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Mo[t]=new _a(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Mo[t]=new _a(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Mo[t]=new _a(t,5,!1,t.toLowerCase(),null,!1,!1)});var cN=/[\-:]([a-z])/g;function fN(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(cN,fN);Mo[e]=new _a(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(cN,fN);Mo[e]=new _a(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(cN,fN);Mo[e]=new _a(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Mo[t]=new _a(t,1,!1,t.toLowerCase(),null,!1,!1)});Mo.xlinkHref=new _a("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Mo[t]=new _a(t,1,!1,t.toLowerCase(),null,!0,!0)});function dN(t,e,n,r){var i=Mo.hasOwnProperty(e)?Mo[e]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` +`+i[a].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=s);break}}}finally{nT=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?n1(t):""}function mee(t){switch(t.tag){case 5:return n1(t.type);case 16:return n1("Lazy");case 13:return n1("Suspense");case 19:return n1("SuspenseList");case 0:case 2:case 15:return t=rT(t.type,!1),t;case 11:return t=rT(t.type.render,!1),t;case 1:return t=rT(t.type,!0),t;default:return""}}function bD(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 K0:return"Fragment";case Y0:return"Portal";case vD:return"Profiler";case hN:return"StrictMode";case yD:return"Suspense";case xD:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case d9:return(t.displayName||"Context")+".Consumer";case f9:return(t._context.displayName||"Context")+".Provider";case pN:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case mN:return e=t.displayName||null,e!==null?e:bD(t.type)||"Memo";case id:e=t._payload,t=t._init;try{return bD(t(e))}catch{}}return null}function gee(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 bD(e);case 8:return e===hN?"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 Pd(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function p9(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function vee(t){var e=p9(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(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function tw(t){t._valueTracker||(t._valueTracker=vee(t))}function m9(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=p9(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function gE(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 _D(t,e){var n=e.checked;return Zr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function iL(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Pd(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 g9(t,e){e=e.checked,e!=null&&dN(t,"checked",e,!1)}function wD(t,e){g9(t,e);var n=Pd(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")?SD(t,e.type,n):e.hasOwnProperty("defaultValue")&&SD(t,e.type,Pd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function oL(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 SD(t,e,n){(e!=="number"||gE(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var r1=Array.isArray;function vg(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=nw.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function X1(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var v1={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},yee=["Webkit","ms","Moz","O"];Object.keys(v1).forEach(function(t){yee.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),v1[e]=v1[t]})});function b9(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||v1.hasOwnProperty(t)&&v1[t]?(""+e).trim():e+"px"}function _9(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=b9(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var xee=Zr({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 CD(t,e){if(e){if(xee[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(dt(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(dt(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(dt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(dt(62))}}function AD(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 TD=null;function gN(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var DD=null,yg=null,xg=null;function lL(t){if(t=ib(t)){if(typeof DD!="function")throw Error(dt(280));var e=t.stateNode;e&&(e=Y2(e),DD(t.stateNode,t.type,e))}}function w9(t){yg?xg?xg.push(t):xg=[t]:yg=t}function S9(){if(yg){var t=yg,e=xg;if(xg=yg=null,lL(t),e)for(t=0;t>>=0,t===0?32:31-(Ree(t)/Pee|0)|0}var rw=64,iw=4194304;function i1(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 bE(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=i1(s):(o&=a,o!==0&&(r=i1(o)))}else a=n&~i,a!==0?r=i1(a):o!==0&&(r=i1(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 nb(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-eu(e),t[e]=n}function Lee(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=x1),vL=String.fromCharCode(32),yL=!1;function V9(t,e){switch(t){case"keyup":return ute.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function W9(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Z0=!1;function fte(t,e){switch(t){case"compositionend":return W9(e);case"keypress":return e.which!==32?null:(yL=!0,vL);case"textInput":return t=e.data,t===vL&&yL?null:t;default:return null}}function dte(t,e){if(Z0)return t==="compositionend"||!EN&&V9(t,e)?(t=$9(),$S=_N=hd=null,Z0=!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=wL(n)}}function X9(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?X9(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Y9(){for(var t=window,e=gE();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=gE(t.document)}return e}function MN(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 _te(t){var e=Y9(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&X9(n.ownerDocument.documentElement,n)){if(r!==null&&MN(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=SL(n,o);var a=SL(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.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,J0=null,LD=null,_1=null,FD=!1;function EL(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;FD||J0==null||J0!==gE(r)||(r=J0,"selectionStart"in r&&MN(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}),_1&&ex(_1,r)||(_1=r,r=SE(LD,"onSelect"),0tg||(t.current=HD[tg],HD[tg]=null,tg--)}function Mr(t,e){tg++,HD[tg]=t.current,t.current=e}var Nd={},qo=Gd(Nd),Ua=Gd(!1),Dp=Nd;function Lg(t,e){var n=t.type.contextTypes;if(!n)return Nd;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 za(t){return t=t.childContextTypes,t!=null}function ME(){Nr(Ua),Nr(qo)}function PL(t,e,n){if(qo.current!==Nd)throw Error(dt(168));Mr(qo,e),Mr(Ua,n)}function i7(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(dt(108,gee(t)||"Unknown",i));return Zr({},n,r)}function CE(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Nd,Dp=qo.current,Mr(qo,t),Mr(Ua,Ua.current),!0}function NL(t,e,n){var r=t.stateNode;if(!r)throw Error(dt(169));n?(t=i7(t,e,Dp),r.__reactInternalMemoizedMergedChildContext=t,Nr(Ua),Nr(qo),Mr(qo,t)):Nr(Ua),Mr(Ua,n)}var Ic=null,K2=!1,vT=!1;function o7(t){Ic===null?Ic=[t]:Ic.push(t)}function Ote(t){K2=!0,o7(t)}function jd(){if(!vT&&Ic!==null){vT=!0;var t=0,e=sr;try{var n=Ic;for(sr=1;t>=a,i-=a,$c=1<<32-eu(e)+i|n<I?(P=D,D=null):P=D.sibling;var N=d(v,D,w[I],E);if(N===null){D===null&&(D=P);break}t&&D&&N.alternate===null&&e(v,D),S=o(N,S,I),A===null?T=N:A.sibling=N,A=N,D=P}if(I===w.length)return n(v,D),Ur&&Kh(v,I),T;if(D===null){for(;II?(P=D,D=null):P=D.sibling;var B=d(v,D,N.value,E);if(B===null){D===null&&(D=P);break}t&&D&&B.alternate===null&&e(v,D),S=o(B,S,I),A===null?T=B:A.sibling=B,A=B,D=P}if(N.done)return n(v,D),Ur&&Kh(v,I),T;if(D===null){for(;!N.done;I++,N=w.next())N=f(v,N.value,E),N!==null&&(S=o(N,S,I),A===null?T=N:A.sibling=N,A=N);return Ur&&Kh(v,I),T}for(D=r(v,D);!N.done;I++,N=w.next())N=p(D,v,I,N.value,E),N!==null&&(t&&N.alternate!==null&&D.delete(N.key===null?I:N.key),S=o(N,S,I),A===null?T=N:A.sibling=N,A=N);return t&&D.forEach(function(G){return e(v,G)}),Ur&&Kh(v,I),T}function _(v,S,w,E){if(typeof w=="object"&&w!==null&&w.type===K0&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ew:e:{for(var T=w.key,A=S;A!==null;){if(A.key===T){if(T=w.type,T===K0){if(A.tag===7){n(v,A.sibling),S=i(A,w.props.children),S.return=v,v=S;break e}}else if(A.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===id&&UL(T)===A.type){n(v,A.sibling),S=i(A,w.props),S.ref=Cy(v,A,w),S.return=v,v=S;break e}n(v,A);break}else e(v,A);A=A.sibling}w.type===K0?(S=yp(w.props.children,v.mode,E,w.key),S.return=v,v=S):(E=YS(w.type,w.key,w.props,null,v.mode,E),E.ref=Cy(v,S,w),E.return=v,v=E)}return a(v);case Y0:e:{for(A=w.key;S!==null;){if(S.key===A)if(S.tag===4&&S.stateNode.containerInfo===w.containerInfo&&S.stateNode.implementation===w.implementation){n(v,S.sibling),S=i(S,w.children||[]),S.return=v,v=S;break e}else{n(v,S);break}else e(v,S);S=S.sibling}S=MT(w,v.mode,E),S.return=v,v=S}return a(v);case id:return A=w._init,_(v,S,A(w._payload),E)}if(r1(w))return y(v,S,w,E);if(_y(w))return x(v,S,w,E);fw(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,S!==null&&S.tag===6?(n(v,S.sibling),S=i(S,w),S.return=v,v=S):(n(v,S),S=ET(w,v.mode,E),S.return=v,v=S),a(v)):n(v,S)}return _}var kg=h7(!0),p7=h7(!1),ob={},$u=Gd(ob),ix=Gd(ob),ox=Gd(ob);function up(t){if(t===ob)throw Error(dt(174));return t}function IN(t,e){switch(Mr(ox,e),Mr(ix,t),Mr($u,ob),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:MD(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=MD(e,t)}Nr($u),Mr($u,e)}function Bg(){Nr($u),Nr(ix),Nr(ox)}function m7(t){up(ox.current);var e=up($u.current),n=MD(e,t.type);e!==n&&(Mr(ix,t),Mr($u,n))}function LN(t){ix.current===t&&(Nr($u),Nr(ix))}var Xr=Gd(0);function NE(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var yT=[];function FN(){for(var t=0;tn?n:4,t(!0);var r=xT.transition;xT.transition={};try{t(!1),e()}finally{sr=n,xT.transition=r}}function P7(){return gl().memoizedState}function kte(t,e,n){var r=wd(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},N7(t))O7(e,n);else if(n=u7(t,e,n,r),n!==null){var i=va();tu(n,t,r,i),I7(n,e,r)}}function Bte(t,e,n){var r=wd(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(N7(t))O7(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,iu(s,a)){var l=e.interleaved;l===null?(i.next=i,NN(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=u7(t,e,i,r),n!==null&&(i=va(),tu(n,t,r,i),I7(n,e,r))}}function N7(t){var e=t.alternate;return t===Kr||e!==null&&e===Kr}function O7(t,e){w1=OE=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function I7(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,yN(t,n)}}var IE={readContext:ml,useCallback:ko,useContext:ko,useEffect:ko,useImperativeHandle:ko,useInsertionEffect:ko,useLayoutEffect:ko,useMemo:ko,useReducer:ko,useRef:ko,useState:ko,useDebugValue:ko,useDeferredValue:ko,useTransition:ko,useMutableSource:ko,useSyncExternalStore:ko,useId:ko,unstable_isNewReconciler:!1},Ute={readContext:ml,useCallback:function(t,e){return Pu().memoizedState=[t,e===void 0?null:e],t},useContext:ml,useEffect:$L,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,GS(4194308,4,C7.bind(null,e,t),n)},useLayoutEffect:function(t,e){return GS(4194308,4,t,e)},useInsertionEffect:function(t,e){return GS(4,2,t,e)},useMemo:function(t,e){var n=Pu();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Pu();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=kte.bind(null,Kr,t),[r.memoizedState,t]},useRef:function(t){var e=Pu();return t={current:t},e.memoizedState=t},useState:zL,useDebugValue:$N,useDeferredValue:function(t){return Pu().memoizedState=t},useTransition:function(){var t=zL(!1),e=t[0];return t=Fte.bind(null,t[1]),Pu().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Kr,i=Pu();if(Ur){if(n===void 0)throw Error(dt(407));n=n()}else{if(n=e(),fo===null)throw Error(dt(349));Pp&30||y7(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,$L(b7.bind(null,r,o,t),[t]),r.flags|=2048,lx(9,x7.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Pu(),e=fo.identifierPrefix;if(Ur){var n=Hc,r=$c;n=(r&~(1<<32-eu(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=ax++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[Fu]=e,t[rx]=r,V7(t,e,!1,!1),e.stateNode=t;e:{switch(a=AD(n,r),n){case"dialog":Tr("cancel",t),Tr("close",t),i=r;break;case"iframe":case"object":case"embed":Tr("load",t),i=r;break;case"video":case"audio":for(i=0;izg&&(e.flags|=128,r=!0,Ay(o,!1),e.lanes=4194304)}else{if(!r)if(t=NE(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Ay(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Ur)return Bo(e),null}else 2*_i()-o.renderingStartTime>zg&&n!==1073741824&&(e.flags|=128,r=!0,Ay(o,!1),e.lanes=4194304);o.isBackwards?(a.sibling=e.child,e.child=a):(n=o.last,n!==null?n.sibling=a:e.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=_i(),e.sibling=null,n=Xr.current,Mr(Xr,r?n&1|2:n&1),e):(Bo(e),null);case 22:case 23:return qN(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ys&1073741824&&(Bo(e),e.subtreeFlags&6&&(e.flags|=8192)):Bo(e),null;case 24:return null;case 25:return null}throw Error(dt(156,e.tag))}function qte(t,e){switch(AN(e),e.tag){case 1:return za(e.type)&&ME(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Bg(),Nr(Ua),Nr(qo),FN(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return LN(e),null;case 13:if(Nr(Xr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(dt(340));Fg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Nr(Xr),null;case 4:return Bg(),null;case 10:return PN(e.type._context),null;case 22:case 23:return qN(),null;case 24:return null;default:return null}}var hw=!1,Wo=!1,Xte=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function og(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){li(t,e,r)}else n.current=null}function eR(t,e,n){try{n()}catch(r){li(t,e,r)}}var KL=!1;function Yte(t,e){if(kD=_E,t=Y9(),MN(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 a=0,s=-1,l=-1,u=0,c=0,f=t,d=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(s=a+i),f!==o||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===t)break t;if(d===n&&++u===i&&(s=a),d===o&&++c===r&&(l=a),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(BD={focusedElem:t,selectionRange:n},_E=!1,Ot=e;Ot!==null;)if(e=Ot,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ot=t;else for(;Ot!==null;){e=Ot;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,_=y.memoizedState,v=e.stateNode,S=v.getSnapshotBeforeUpdate(e.elementType===e.type?x:$l(e.type,x),_);v.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(dt(163))}}catch(E){li(e,e.return,E)}if(t=e.sibling,t!==null){t.return=e.return,Ot=t;break}Ot=e.return}return y=KL,KL=!1,y}function S1(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&&eR(e,n,o)}i=i.next}while(i!==r)}}function Q2(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 tR(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 j7(t){var e=t.alternate;e!==null&&(t.alternate=null,j7(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Fu],delete e[rx],delete e[$D],delete e[Pte],delete e[Nte])),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 q7(t){return t.tag===5||t.tag===3||t.tag===4}function ZL(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||q7(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 nR(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=EE));else if(r!==4&&(t=t.child,t!==null))for(nR(t,e,n),t=t.sibling;t!==null;)nR(t,e,n),t=t.sibling}function rR(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(rR(t,e,n),t=t.sibling;t!==null;)rR(t,e,n),t=t.sibling}var bo=null,Vl=!1;function Yf(t,e,n){for(n=n.child;n!==null;)X7(t,e,n),n=n.sibling}function X7(t,e,n){if(zu&&typeof zu.onCommitFiberUnmount=="function")try{zu.onCommitFiberUnmount(G2,n)}catch{}switch(n.tag){case 5:Wo||og(n,e);case 6:var r=bo,i=Vl;bo=null,Yf(t,e,n),bo=r,Vl=i,bo!==null&&(Vl?(t=bo,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):bo.removeChild(n.stateNode));break;case 18:bo!==null&&(Vl?(t=bo,n=n.stateNode,t.nodeType===8?gT(t.parentNode,n):t.nodeType===1&&gT(t,n),J1(t)):gT(bo,n.stateNode));break;case 4:r=bo,i=Vl,bo=n.stateNode.containerInfo,Vl=!0,Yf(t,e,n),bo=r,Vl=i;break;case 0:case 11:case 14:case 15:if(!Wo&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&eR(n,e,a),i=i.next}while(i!==r)}Yf(t,e,n);break;case 1:if(!Wo&&(og(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){li(n,e,s)}Yf(t,e,n);break;case 21:Yf(t,e,n);break;case 22:n.mode&1?(Wo=(r=Wo)||n.memoizedState!==null,Yf(t,e,n),Wo=r):Yf(t,e,n);break;default:Yf(t,e,n)}}function JL(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Xte),e.forEach(function(r){var i=ine.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ll(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=_i()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Zte(r/1960))-r,10t?16:t,pd===null)var r=!1;else{if(t=pd,pd=null,kE=0,qn&6)throw Error(dt(331));var i=qn;for(qn|=4,Ot=t.current;Ot!==null;){var o=Ot,a=o.child;if(Ot.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l_i()-GN?vp(t,0):WN|=n),$a(t,e)}function n$(t,e){e===0&&(t.mode&1?(e=iw,iw<<=1,!(iw&130023424)&&(iw=4194304)):e=1);var n=va();t=Jc(t,e),t!==null&&(nb(t,e,n),$a(t,n))}function rne(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),n$(t,n)}function ine(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(dt(314))}r!==null&&r.delete(e),n$(t,n)}var r$;r$=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ua.current)Ba=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Ba=!1,Gte(t,e,n);Ba=!!(t.flags&131072)}else Ba=!1,Ur&&e.flags&1048576&&a7(e,TE,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;jS(t,e),t=e.pendingProps;var i=Lg(e,qo.current);_g(e,n),i=BN(null,e,r,t,i,n);var o=UN();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,za(r)?(o=!0,CE(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ON(e),i.updater=Z2,e.stateNode=i,i._reactInternals=e,qD(e,r,t,n),e=KD(null,e,r,!0,o,n)):(e.tag=0,Ur&&o&&CN(e),ha(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(jS(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=ane(r),t=$l(r,t),i){case 0:e=YD(null,e,r,t,n);break e;case 1:e=qL(null,e,r,t,n);break e;case 11:e=GL(null,e,r,t,n);break e;case 14:e=jL(null,e,r,$l(r.type,t),n);break e}throw Error(dt(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:$l(r,i),YD(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:$l(r,i),qL(t,e,r,i,n);case 3:e:{if(z7(e),t===null)throw Error(dt(387));r=e.pendingProps,o=e.memoizedState,i=o.element,c7(t,e),PE(e,r,null,n);var a=e.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Ug(Error(dt(423)),e),e=XL(t,e,r,n,i);break e}else if(r!==i){i=Ug(Error(dt(424)),e),e=XL(t,e,r,n,i);break e}else for(Ms=xd(e.stateNode.containerInfo.firstChild),Ds=e,Ur=!0,Wl=null,n=p7(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fg(),r===i){e=Qc(t,e,n);break e}ha(t,e,r,n)}e=e.child}return e;case 5:return m7(e),t===null&&WD(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,UD(r,i)?a=null:o!==null&&UD(r,o)&&(e.flags|=32),U7(t,e),ha(t,e,a,n),e.child;case 6:return t===null&&WD(e),null;case 13:return $7(t,e,n);case 4:return IN(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=kg(e,null,r,n):ha(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:$l(r,i),GL(t,e,r,i,n);case 7:return ha(t,e,e.pendingProps,n),e.child;case 8:return ha(t,e,e.pendingProps.children,n),e.child;case 12:return ha(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,a=i.value,Mr(DE,r._currentValue),r._currentValue=a,o!==null)if(iu(o.value,a)){if(o.children===i.children&&!Ua.current){e=Qc(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=jc(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),GD(o.return,n,e),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===e.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(dt(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),GD(a,n,e),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}ha(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,_g(e,n),i=ml(i),r=r(i),e.flags|=1,ha(t,e,r,n),e.child;case 14:return r=e.type,i=$l(r,e.pendingProps),i=$l(r.type,i),jL(t,e,r,i,n);case 15:return k7(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:$l(r,i),jS(t,e),e.tag=1,za(r)?(t=!0,CE(e)):t=!1,_g(e,n),d7(e,r,i),qD(e,r,i,n),KD(null,e,r,!0,t,n);case 19:return H7(t,e,n);case 22:return B7(t,e,n)}throw Error(dt(156,e.tag))};function i$(t,e){return R9(t,e)}function one(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 cl(t,e,n,r){return new one(t,e,n,r)}function YN(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ane(t){if(typeof t=="function")return YN(t)?1:0;if(t!=null){if(t=t.$$typeof,t===pN)return 11;if(t===mN)return 14}return 2}function Sd(t,e){var n=t.alternate;return n===null?(n=cl(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 YS(t,e,n,r,i,o){var a=2;if(r=t,typeof t=="function")YN(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case K0:return yp(n.children,i,o,e);case hN:a=8,i|=8;break;case vD:return t=cl(12,n,e,i|2),t.elementType=vD,t.lanes=o,t;case yD:return t=cl(13,n,e,i),t.elementType=yD,t.lanes=o,t;case xD:return t=cl(19,n,e,i),t.elementType=xD,t.lanes=o,t;case h9:return tM(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case f9:a=10;break e;case d9:a=9;break e;case pN:a=11;break e;case mN:a=14;break e;case id:a=16,r=null;break e}throw Error(dt(130,t==null?t:typeof t,""))}return e=cl(a,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function yp(t,e,n,r){return t=cl(7,t,r,e),t.lanes=n,t}function tM(t,e,n,r){return t=cl(22,t,r,e),t.elementType=h9,t.lanes=n,t.stateNode={isHidden:!1},t}function ET(t,e,n){return t=cl(6,t,null,e),t.lanes=n,t}function MT(t,e,n){return e=cl(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function sne(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=oT(0),this.expirationTimes=oT(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oT(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function KN(t,e,n,r,i,o,a,s,l){return t=new sne(t,e,n,s,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=cl(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ON(o),t}function lne(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l$)}catch(t){console.error(t)}}l$(),a9.exports=Fs;var qd=a9.exports;const gw=su(qd);var u$,aF=qd;u$=mD.createRoot=aF.createRoot,mD.hydrateRoot=aF.hydrateRoot;const hne={black:"#000",white:"#fff"},cx=hne,pne={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"},qm=pne,mne={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"},Xm=mne,gne={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"},Ym=gne,vne={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"},Km=vne,yne={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"},Zm=yne,xne={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"},Dy=xne,bne={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"},_ne=bne;function ee(){return ee=Object.assign?Object.assign.bind():function(t){for(var e=1;e{e[n]=c$(t[n])}),e}function Go(t,e,n={clone:!0}){const r=n.clone?ee({},t):t;return kc(t)&&kc(e)&&Object.keys(e).forEach(i=>{i!=="__proto__"&&(kc(e[i])&&i in t&&kc(t[i])?r[i]=Go(t[i],e[i],n):n.clone?r[i]=kc(e[i])?c$(e[i]):e[i]:r[i]=e[i])}),r}var f$={exports:{}},wne="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Sne=wne,Ene=Sne;function d$(){}function h$(){}h$.resetWarningCache=d$;var Mne=function(){function t(r,i,o,a,s,l){if(l!==Ene){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:h$,resetWarningCache:d$};return n.PropTypes=n,n};f$.exports=Mne();var lv=f$.exports;const at=su(lv);function Od(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;nn==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function gM(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 Tne(t,e){return()=>null}function C1(t,e){var n,r;return V.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 jo(t){return t&&t.ownerDocument||document}function Zu(t){return jo(t).defaultView||window}function Dne(t,e){return()=>null}function fx(t,e){typeof t=="function"?t(e):t&&(t.current=e)}const Rne=typeof window<"u"?V.useLayoutEffect:V.useEffect,vl=Rne;let sF=0;function Pne(t){const[e,n]=V.useState(t),r=t||e;return V.useEffect(()=>{e==null&&(sF+=1,n(`mui-${sF}`))},[e]),r}const lF=pD["useId".toString()];function ab(t){if(lF!==void 0){const e=lF();return t??e}return Pne(t)}function Nne(t,e,n,r,i){return null}function Ed({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=V.useRef(t!==void 0),[o,a]=V.useState(e),s=i?t:o,l=V.useCallback(u=>{i||a(u)},[]);return[s,l]}function Yl(t){const e=V.useRef(t);return vl(()=>{e.current=t}),V.useRef((...n)=>(0,e.current)(...n)).current}function Jr(...t){return V.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{fx(n,e)})},t)}let vM=!0,lR=!1,uF;const One={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 Ine(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&One[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function Lne(t){t.metaKey||t.altKey||t.ctrlKey||(vM=!0)}function CT(){vM=!1}function Fne(){this.visibilityState==="hidden"&&lR&&(vM=!0)}function kne(t){t.addEventListener("keydown",Lne,!0),t.addEventListener("mousedown",CT,!0),t.addEventListener("pointerdown",CT,!0),t.addEventListener("touchstart",CT,!0),t.addEventListener("visibilitychange",Fne,!0)}function Bne(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return vM||Ine(e)}function m$(){const t=V.useCallback(i=>{i!=null&&kne(i.ownerDocument)},[]),e=V.useRef(!1);function n(){return e.current?(lR=!0,window.clearTimeout(uF),uF=window.setTimeout(()=>{lR=!1},100),e.current=!1,!0):!1}function r(i){return Bne(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function g$(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}const Une=t=>{const e=V.useRef({});return V.useEffect(()=>{e.current=t}),e.current},zne=Une;function nO(t,e){const n=ee({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=ee({},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]=ee({},o),Object.keys(i).forEach(a=>{n[r][a]=nO(i[a],o[a])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function fn(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((o,a)=>{if(a){const s=e(a);s!==""&&o.push(s),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}const cF=t=>t,$ne=()=>{let t=cF;return{configure(e){t=e},generate(e){return t(e)},reset(){t=cF}}},Hne=$ne(),rO=Hne,Vne={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 cn(t,e,n="Mui"){const r=Vne[e];return r?`${n}-${r}`:`${rO.generate(t)}-${e}`}function an(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=cn(t,i,n)}),r}const sb="$$material";function _t(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function v$(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var Wne=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Gne=v$(function(t){return Wne.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91});function jne(t){if(t.sheet)return t.sheet;for(var e=0;e0?_o(uv,--Ga):0,$g--,Pi===10&&($g=1,xM--),Pi}function Rs(){return Pi=Ga<_$?_o(uv,Ga++):0,$g++,Pi===10&&($g=1,xM++),Pi}function Hu(){return _o(uv,Ga)}function KS(){return Ga}function lb(t,e){return dx(uv,t,e)}function hx(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function w$(t){return xM=$g=1,_$=Ou(uv=t),Ga=0,[]}function S$(t){return uv="",t}function ZS(t){return b$(lb(Ga-1,cR(t===91?t+2:t===40?t+1:t)))}function ire(t){for(;(Pi=Hu())&&Pi<33;)Rs();return hx(t)>2||hx(Pi)>3?"":" "}function ore(t,e){for(;--e&&Rs()&&!(Pi<48||Pi>102||Pi>57&&Pi<65||Pi>70&&Pi<97););return lb(t,KS()+(e<6&&Hu()==32&&Rs()==32))}function cR(t){for(;Rs();)switch(Pi){case t:return Ga;case 34:case 39:t!==34&&t!==39&&cR(Pi);break;case 40:t===41&&cR(t);break;case 92:Rs();break}return Ga}function are(t,e){for(;Rs()&&t+Pi!==47+10;)if(t+Pi===42+42&&Hu()===47)break;return"/*"+lb(e,Ga-1)+"*"+yM(t===47?t:Rs())}function sre(t){for(;!hx(Hu());)Rs();return lb(t,Ga)}function lre(t){return S$(JS("",null,null,null,[""],t=w$(t),0,[0],t))}function JS(t,e,n,r,i,o,a,s,l){for(var u=0,c=0,f=a,d=0,p=0,y=0,x=1,_=1,v=1,S=0,w="",E=i,T=o,A=r,D=w;_;)switch(y=S,S=Rs()){case 40:if(y!=108&&_o(D,f-1)==58){uR(D+=Qn(ZS(S),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:D+=ZS(S);break;case 9:case 10:case 13:case 32:D+=ire(y);break;case 92:D+=ore(KS()-1,7);continue;case 47:switch(Hu()){case 42:case 47:vw(ure(are(Rs(),KS()),e,n),l);break;default:D+="/"}break;case 123*x:s[u++]=Ou(D)*v;case 125*x:case 59:case 0:switch(S){case 0:case 125:_=0;case 59+c:v==-1&&(D=Qn(D,/\f/g,"")),p>0&&Ou(D)-f&&vw(p>32?dF(D+";",r,n,f-1):dF(Qn(D," ","")+";",r,n,f-2),l);break;case 59:D+=";";default:if(vw(A=fF(D,e,n,u,c,i,s,w,E=[],T=[],f),o),S===123)if(c===0)JS(D,e,A,A,E,o,f,s,T);else switch(d===99&&_o(D,3)===110?100:d){case 100:case 108:case 109:case 115:JS(t,A,A,r&&vw(fF(t,A,A,0,0,i,s,w,i,E=[],f),T),i,T,f,s,r?E:T);break;default:JS(D,A,A,A,[""],T,0,s,T)}}u=c=p=0,x=v=1,w=D="",f=a;break;case 58:f=1+Ou(D),p=y;default:if(x<1){if(S==123)--x;else if(S==125&&x++==0&&rre()==125)continue}switch(D+=yM(S),S*x){case 38:v=c>0?1:(D+="\f",-1);break;case 44:s[u++]=(Ou(D)-1)*v,v=1;break;case 64:Hu()===45&&(D+=ZS(Rs())),d=Hu(),c=f=Ou(w=D+=sre(KS())),S++;break;case 45:y===45&&Ou(D)==2&&(x=0)}}return o}function fF(t,e,n,r,i,o,a,s,l,u,c){for(var f=i-1,d=i===0?o:[""],p=aO(d),y=0,x=0,_=0;y0?d[v]+" "+S:Qn(S,/&\f/g,d[v])))&&(l[_++]=w);return bM(t,e,n,i===0?iO:s,l,u,c)}function ure(t,e,n){return bM(t,e,n,y$,yM(nre()),dx(t,2,-2),0)}function dF(t,e,n,r){return bM(t,e,n,oO,dx(t,0,r),dx(t,r+1,-1),r)}function Sg(t,e){for(var n="",r=aO(t),i=0;i6)switch(_o(t,e+1)){case 109:if(_o(t,e+4)!==45)break;case 102:return Qn(t,/(.+:)(.+)-([^]+)/,"$1"+Jn+"$2-$3$1"+$E+(_o(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~uR(t,"stretch")?E$(Qn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(_o(t,e+1)!==115)break;case 6444:switch(_o(t,Ou(t)-3-(~uR(t,"!important")&&10))){case 107:return Qn(t,":",":"+Jn)+t;case 101:return Qn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Jn+(_o(t,14)===45?"inline-":"")+"box$3$1"+Jn+"$2$3$1"+Ho+"$2box$3")+t}break;case 5936:switch(_o(t,e+11)){case 114:return Jn+t+Ho+Qn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Jn+t+Ho+Qn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Jn+t+Ho+Qn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Jn+t+Ho+t+t}return t}var yre=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case oO:e.return=E$(e.value,e.length);break;case x$:return Sg([Ry(e,{value:Qn(e.value,"@","@"+Jn)})],i);case iO:if(e.length)return tre(e.props,function(o){switch(ere(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Sg([Ry(e,{props:[Qn(o,/:(read-\w+)/,":"+$E+"$1")]})],i);case"::placeholder":return Sg([Ry(e,{props:[Qn(o,/:(plac\w+)/,":"+Jn+"input-$1")]}),Ry(e,{props:[Qn(o,/:(plac\w+)/,":"+$E+"$1")]}),Ry(e,{props:[Qn(o,/:(plac\w+)/,Ho+"input-$1")]})],i)}return""})}},xre=[yre],bre=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 _=x.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var i=e.stylisPlugins||xre,o={},a,s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var _=x.getAttribute("data-emotion").split(" "),v=1;v<_.length;v++)o[_[v]]=!0;s.push(x)});var l,u=[gre,vre];{var c,f=[cre,dre(function(x){c.insert(x)})],d=fre(u.concat(i,f)),p=function(_){return Sg(lre(_),d)};l=function(_,v,S,w){c=S,p(_?_+"{"+v.styles+"}":v.styles),w&&(y.inserted[v.name]=!0)}}var y={key:n,sheet:new Xne({key:n,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return y.sheet.hydrate(s),y},M$={exports:{}},lr={};/** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ho=typeof Symbol=="function"&&Symbol.for,sO=ho?Symbol.for("react.element"):60103,lO=ho?Symbol.for("react.portal"):60106,_M=ho?Symbol.for("react.fragment"):60107,wM=ho?Symbol.for("react.strict_mode"):60108,SM=ho?Symbol.for("react.profiler"):60114,EM=ho?Symbol.for("react.provider"):60109,MM=ho?Symbol.for("react.context"):60110,uO=ho?Symbol.for("react.async_mode"):60111,CM=ho?Symbol.for("react.concurrent_mode"):60111,AM=ho?Symbol.for("react.forward_ref"):60112,TM=ho?Symbol.for("react.suspense"):60113,_re=ho?Symbol.for("react.suspense_list"):60120,DM=ho?Symbol.for("react.memo"):60115,RM=ho?Symbol.for("react.lazy"):60116,wre=ho?Symbol.for("react.block"):60121,Sre=ho?Symbol.for("react.fundamental"):60117,Ere=ho?Symbol.for("react.responder"):60118,Mre=ho?Symbol.for("react.scope"):60119;function Bs(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case sO:switch(t=t.type,t){case uO:case CM:case _M:case SM:case wM:case TM:return t;default:switch(t=t&&t.$$typeof,t){case MM:case AM:case RM:case DM:case EM:return t;default:return e}}case lO:return e}}}function C$(t){return Bs(t)===CM}lr.AsyncMode=uO;lr.ConcurrentMode=CM;lr.ContextConsumer=MM;lr.ContextProvider=EM;lr.Element=sO;lr.ForwardRef=AM;lr.Fragment=_M;lr.Lazy=RM;lr.Memo=DM;lr.Portal=lO;lr.Profiler=SM;lr.StrictMode=wM;lr.Suspense=TM;lr.isAsyncMode=function(t){return C$(t)||Bs(t)===uO};lr.isConcurrentMode=C$;lr.isContextConsumer=function(t){return Bs(t)===MM};lr.isContextProvider=function(t){return Bs(t)===EM};lr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===sO};lr.isForwardRef=function(t){return Bs(t)===AM};lr.isFragment=function(t){return Bs(t)===_M};lr.isLazy=function(t){return Bs(t)===RM};lr.isMemo=function(t){return Bs(t)===DM};lr.isPortal=function(t){return Bs(t)===lO};lr.isProfiler=function(t){return Bs(t)===SM};lr.isStrictMode=function(t){return Bs(t)===wM};lr.isSuspense=function(t){return Bs(t)===TM};lr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===_M||t===CM||t===SM||t===wM||t===TM||t===_re||typeof t=="object"&&t!==null&&(t.$$typeof===RM||t.$$typeof===DM||t.$$typeof===EM||t.$$typeof===MM||t.$$typeof===AM||t.$$typeof===Sre||t.$$typeof===Ere||t.$$typeof===Mre||t.$$typeof===wre)};lr.typeOf=Bs;M$.exports=lr;var Cre=M$.exports,A$=Cre,Are={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Tre={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},T$={};T$[A$.ForwardRef]=Are;T$[A$.Memo]=Tre;var Dre=!0;function Rre(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):r+=i+" "}),r}var D$=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||Dre===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},R$=function(e,n,r){D$(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+i:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function Pre(t){for(var e=0,n,r=0,i=t.length;i>=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 Nre={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,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},Ore=/[A-Z]|^ms/g,Ire=/_EMO_([^_]+?)_([^]*?)_EMO_/g,P$=function(e){return e.charCodeAt(1)===45},pF=function(e){return e!=null&&typeof e!="boolean"},AT=v$(function(t){return P$(t)?t:t.replace(Ore,"-$&").toLowerCase()}),mF=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(Ire,function(r,i,o){return Iu={name:i,styles:o,next:Iu},i})}return Nre[e]!==1&&!P$(e)&&typeof n=="number"&&n!==0?n+"px":n};function px(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Iu={name:n.name,styles:n.styles,next:Iu},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Iu={name:r.name,styles:r.styles,next:Iu},r=r.next;var i=n.styles+";";return i}return Lre(t,e,n)}case"function":{if(t!==void 0){var o=Iu,a=n(t);return Iu=o,px(t,e,a)}break}}if(e==null)return n;var s=e[n];return s!==void 0?s:n}function Lre(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?zre:$re},xF=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(a){return e.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},Hre=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return D$(n,r,i),kre(function(){return R$(n,r,i)}),null},Vre=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,a;n!==void 0&&(o=n.label,a=n.target);var s=xF(e,n,r),l=s||yF(i),u=!l("as");return function(){var c=arguments,f=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{f.push(c[0][0]);for(var d=c.length,p=1;pe(Gre(i)?n:i):e;return k.jsx(Bre,{styles:r})}/** + * @mui/styled-engine v5.14.17 + * + * @license MIT + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */function L$(t,e){return fR(t,e)}const qre=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},Xre=["values","unit","step"],Yre=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)=>ee({},n,{[r.key]:r.val}),{})};function Kre(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=_t(t,Xre),o=Yre(e),a=Object.keys(o);function s(d){return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof e[d]=="number"?e[d]:d)-r/100}${n})`}function u(d,p){const y=a.indexOf(p);return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n}) and (max-width:${(y!==-1&&typeof e[a[y]]=="number"?e[a[y]]:p)-r/100}${n})`}function c(d){return a.indexOf(d)+1`@media (min-width:${hO[t]}px)`};function ou(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||bF;return e.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(e[l]),a),{})}if(typeof e=="object"){const o=r.breakpoints||bF;return Object.keys(e).reduce((a,s)=>{if(Object.keys(o.values||hO).indexOf(s)!==-1){const l=o.up(s);a[l]=n(e[s],s)}else{const l=s;a[l]=e[l]}return a},{})}return n(e)}function F$(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function k$(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function Qre(t,...e){const n=F$(t),r=[n,...e].reduce((i,o)=>Go(i,o),{});return k$(Object.keys(n),r)}function eie(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 TT({values:t,breakpoints:e,base:n}){const r=n||eie(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((a,s,l)=>(Array.isArray(t)?(a[s]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(a[s]=t[s]!=null?t[s]:t[o],o=s):a[s]=t,a),{})}function PM(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 HE(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=PM(t,n)||r,e&&(i=e(i,r,t)),i}function or(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=a=>{if(a[e]==null)return null;const s=a[e],l=a.theme,u=PM(l,r)||{};return ou(a,s,f=>{let d=HE(u,i,f);return f===d&&typeof f=="string"&&(d=HE(u,i,`${e}${f==="default"?"":lt(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[e],o}function tie(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const nie={m:"margin",p:"padding"},rie={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},_F={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},iie=tie(t=>{if(t.length>2)if(_F[t])t=_F[t];else return[t];const[e,n]=t.split(""),r=nie[e],i=rie[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),pO=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],mO=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...pO,...mO];function ub(t,e,n,r){var i;const o=(i=PM(t,e,!1))!=null?i:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function gO(t){return ub(t,"spacing",8)}function Ip(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 oie(t,e){return n=>t.reduce((r,i)=>(r[i]=Ip(e,n),r),{})}function aie(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=iie(n),o=oie(i,r),a=t[n];return ou(t,a,o)}function B$(t,e){const n=gO(t.theme);return Object.keys(t).map(r=>aie(t,e,r,n)).reduce(A1,{})}function ai(t){return B$(t,pO)}ai.propTypes={};ai.filterProps=pO;function si(t){return B$(t,mO)}si.propTypes={};si.filterProps=mO;function sie(t=8){if(t.mui)return t;const e=gO({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=e(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function NM(...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]?A1(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function ku(t){return typeof t!="number"?t:`${t}px solid`}const lie=or({prop:"border",themeKey:"borders",transform:ku}),uie=or({prop:"borderTop",themeKey:"borders",transform:ku}),cie=or({prop:"borderRight",themeKey:"borders",transform:ku}),fie=or({prop:"borderBottom",themeKey:"borders",transform:ku}),die=or({prop:"borderLeft",themeKey:"borders",transform:ku}),hie=or({prop:"borderColor",themeKey:"palette"}),pie=or({prop:"borderTopColor",themeKey:"palette"}),mie=or({prop:"borderRightColor",themeKey:"palette"}),gie=or({prop:"borderBottomColor",themeKey:"palette"}),vie=or({prop:"borderLeftColor",themeKey:"palette"}),OM=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=ub(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:Ip(e,r)});return ou(t,t.borderRadius,n)}return null};OM.propTypes={};OM.filterProps=["borderRadius"];NM(lie,uie,cie,fie,die,hie,pie,mie,gie,vie,OM);const IM=t=>{if(t.gap!==void 0&&t.gap!==null){const e=ub(t.theme,"spacing",8),n=r=>({gap:Ip(e,r)});return ou(t,t.gap,n)}return null};IM.propTypes={};IM.filterProps=["gap"];const LM=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=ub(t.theme,"spacing",8),n=r=>({columnGap:Ip(e,r)});return ou(t,t.columnGap,n)}return null};LM.propTypes={};LM.filterProps=["columnGap"];const FM=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=ub(t.theme,"spacing",8),n=r=>({rowGap:Ip(e,r)});return ou(t,t.rowGap,n)}return null};FM.propTypes={};FM.filterProps=["rowGap"];const yie=or({prop:"gridColumn"}),xie=or({prop:"gridRow"}),bie=or({prop:"gridAutoFlow"}),_ie=or({prop:"gridAutoColumns"}),wie=or({prop:"gridAutoRows"}),Sie=or({prop:"gridTemplateColumns"}),Eie=or({prop:"gridTemplateRows"}),Mie=or({prop:"gridTemplateAreas"}),Cie=or({prop:"gridArea"});NM(IM,LM,FM,yie,xie,bie,_ie,wie,Sie,Eie,Mie,Cie);function Eg(t,e){return e==="grey"?e:t}const Aie=or({prop:"color",themeKey:"palette",transform:Eg}),Tie=or({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Eg}),Die=or({prop:"backgroundColor",themeKey:"palette",transform:Eg});NM(Aie,Tie,Die);function ws(t){return t<=1&&t!==0?`${t*100}%`:t}const Rie=or({prop:"width",transform:ws}),vO=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])||hO[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:ws(n)}};return ou(t,t.maxWidth,e)}return null};vO.filterProps=["maxWidth"];const Pie=or({prop:"minWidth",transform:ws}),Nie=or({prop:"height",transform:ws}),Oie=or({prop:"maxHeight",transform:ws}),Iie=or({prop:"minHeight",transform:ws});or({prop:"size",cssProperty:"width",transform:ws});or({prop:"size",cssProperty:"height",transform:ws});const Lie=or({prop:"boxSizing"});NM(Rie,vO,Pie,Nie,Oie,Iie,Lie);const Fie={border:{themeKey:"borders",transform:ku},borderTop:{themeKey:"borders",transform:ku},borderRight:{themeKey:"borders",transform:ku},borderBottom:{themeKey:"borders",transform:ku},borderLeft:{themeKey:"borders",transform:ku},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:OM},color:{themeKey:"palette",transform:Eg},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Eg},backgroundColor:{themeKey:"palette",transform:Eg},p:{style:si},pt:{style:si},pr:{style:si},pb:{style:si},pl:{style:si},px:{style:si},py:{style:si},padding:{style:si},paddingTop:{style:si},paddingRight:{style:si},paddingBottom:{style:si},paddingLeft:{style:si},paddingX:{style:si},paddingY:{style:si},paddingInline:{style:si},paddingInlineStart:{style:si},paddingInlineEnd:{style:si},paddingBlock:{style:si},paddingBlockStart:{style:si},paddingBlockEnd:{style:si},m:{style:ai},mt:{style:ai},mr:{style:ai},mb:{style:ai},ml:{style:ai},mx:{style:ai},my:{style:ai},margin:{style:ai},marginTop:{style:ai},marginRight:{style:ai},marginBottom:{style:ai},marginLeft:{style:ai},marginX:{style:ai},marginY:{style:ai},marginInline:{style:ai},marginInlineStart:{style:ai},marginInlineEnd:{style:ai},marginBlock:{style:ai},marginBlockStart:{style:ai},marginBlockEnd:{style:ai},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:IM},rowGap:{style:FM},columnGap:{style:LM},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ws},maxWidth:{style:vO},minWidth:{transform:ws},height:{transform:ws},maxHeight:{transform:ws},minHeight:{transform:ws},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},kM=Fie;function kie(...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 Bie(t,e){return typeof t=="function"?t(e):t}function Uie(){function t(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:u,transform:c,style:f}=s;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const d=PM(i,u)||{};return f?f(a):ou(a,r,y=>{let x=HE(d,c,y);return y===x&&typeof y=="string"&&(x=HE(d,c,`${n}${y==="default"?"":lt(y)}`,y)),l===!1?x:{[l]:x}})}function e(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const a=(r=o.unstable_sxConfig)!=null?r:kM;function s(l){let u=l;if(typeof l=="function")u=l(o);else if(typeof l!="object")return l;if(!u)return null;const c=F$(o.breakpoints),f=Object.keys(c);let d=c;return Object.keys(u).forEach(p=>{const y=Bie(u[p],o);if(y!=null)if(typeof y=="object")if(a[p])d=A1(d,t(p,y,o,a));else{const x=ou({theme:o},y,_=>({[p]:_}));kie(x,y)?d[p]=e({sx:y,theme:o}):d=A1(d,x)}else d=A1(d,t(p,y,o,a))}),k$(f,d)}return Array.isArray(i)?i.map(s):s(i)}return e}const U$=Uie();U$.filterProps=["sx"];const BM=U$,zie=["breakpoints","palette","spacing","shape"];function UM(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,a=_t(t,zie),s=Kre(n),l=sie(i);let u=Go({breakpoints:s,direction:"ltr",components:{},palette:ee({mode:"light"},r),spacing:l,shape:ee({},Jre,o)},a);return u=e.reduce((c,f)=>Go(c,f),u),u.unstable_sxConfig=ee({},kM,a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(f){return BM({sx:f,theme:this})},u}function $ie(t){return Object.keys(t).length===0}function z$(t=null){const e=V.useContext(fO);return!e||$ie(e)?t:e}const Hie=UM();function zM(t=Hie){return z$(t)}function Vie({styles:t,themeId:e,defaultTheme:n={}}){const r=zM(n),i=typeof t=="function"?t(e&&r[e]||r):t;return k.jsx(jre,{styles:i})}const Wie=["sx"],Gie=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:kM;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function yO(t){const{sx:e}=t,n=_t(t,Wie),{systemProps:r,otherProps:i}=Gie(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...a)=>{const s=e(...a);return kc(s)?ee({},r,s):r}:o=ee({},r,e),ee({},i,{sx:o})}function $$(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;es!=="theme"&&s!=="sx"&&s!=="as"})(BM);return V.forwardRef(function(l,u){const c=zM(n),f=yO(l),{className:d,component:p="div"}=f,y=_t(f,jie);return k.jsx(o,ee({as:p,ref:u,className:Mt(d,i?i(r):r),theme:e&&c[e]||c},y))})}const Xie=["variant"];function wF(t){return t.length===0}function H$(t){const{variant:e}=t,n=_t(t,Xie);let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=wF(r)?t[i]:lt(t[i]):r+=`${wF(r)?i:lt(i)}${lt(t[i].toString())}`}),r}const Yie=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Kie(t){return Object.keys(t).length===0}function Zie(t){return typeof t=="string"&&t.charCodeAt(0)>96}const Jie=(t,e)=>e.components&&e.components[t]&&e.components[t].styleOverrides?e.components[t].styleOverrides:null,VE=t=>{const e={};return t&&t.forEach(n=>{const r=H$(n.props);e[r]=n.style}),e},Qie=(t,e)=>{let n=[];return e&&e.components&&e.components[t]&&e.components[t].variants&&(n=e.components[t].variants),VE(n)},WE=(t,e,n)=>{const{ownerState:r={}}=t,i=[];return n&&n.forEach(o=>{let a=!0;Object.keys(o.props).forEach(s=>{r[s]!==o.props[s]&&t[s]!==o.props[s]&&(a=!1)}),a&&i.push(e[H$(o.props)])}),i},eoe=(t,e,n,r)=>{var i;const o=n==null||(i=n.components)==null||(i=i[r])==null?void 0:i.variants;return WE(t,e,o)};function T1(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const toe=UM(),noe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function QS({defaultTheme:t,theme:e,themeId:n}){return Kie(e)?t:e[n]||e}function roe(t){return t?(e,n)=>n[t]:null}const SF=({styledArg:t,props:e,defaultTheme:n,themeId:r})=>{const i=t(ee({},e,{theme:QS(ee({},e,{defaultTheme:n,themeId:r}))}));let o;if(i&&i.variants&&(o=i.variants,delete i.variants),o){const a=WE(e,VE(o),o);return[i,...a]}return i};function V$(t={}){const{themeId:e,defaultTheme:n=toe,rootShouldForwardProp:r=T1,slotShouldForwardProp:i=T1}=t,o=a=>BM(ee({},a,{theme:QS(ee({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{qre(a,E=>E.filter(T=>!(T!=null&&T.__mui_systemSx)));const{name:l,slot:u,skipVariantsResolver:c,skipSx:f,overridesResolver:d=roe(noe(u))}=s,p=_t(s,Yie),y=c!==void 0?c:u&&u!=="Root"&&u!=="root"||!1,x=f||!1;let _,v=T1;u==="Root"||u==="root"?v=r:u?v=i:Zie(a)&&(v=void 0);const S=L$(a,ee({shouldForwardProp:v,label:_},p)),w=(E,...T)=>{const A=T?T.map(N=>{if(typeof N=="function"&&N.__emotion_real!==N)return B=>SF({styledArg:N,props:B,defaultTheme:n,themeId:e});if(kc(N)){let B=N,G;return N&&N.variants&&(G=N.variants,delete B.variants,B=Z=>{let j=N;return WE(Z,VE(G),G).forEach(Y=>{j=Go(j,Y)}),j}),B}return N}):[];let D=E;if(kc(E)){let N;E&&E.variants&&(N=E.variants,delete D.variants,D=B=>{let G=E;return WE(B,VE(N),N).forEach(j=>{G=Go(G,j)}),G})}else typeof E=="function"&&E.__emotion_real!==E&&(D=N=>SF({styledArg:E,props:N,defaultTheme:n,themeId:e}));l&&d&&A.push(N=>{const B=QS(ee({},N,{defaultTheme:n,themeId:e})),G=Jie(l,B);if(G){const Z={};return Object.entries(G).forEach(([j,J])=>{Z[j]=typeof J=="function"?J(ee({},N,{theme:B})):J}),d(N,Z)}return null}),l&&!y&&A.push(N=>{const B=QS(ee({},N,{defaultTheme:n,themeId:e}));return eoe(N,Qie(l,B),B,l)}),x||A.push(o);const I=A.length-T.length;if(Array.isArray(E)&&I>0){const N=new Array(I).fill("");D=[...E,...N],D.raw=[...E.raw,...N]}const P=S(D,...A);return a.muiName&&(P.muiName=a.muiName),P};return S.withConfig&&(w.withConfig=S.withConfig),w}}const ioe=V$(),ooe=ioe;function aoe(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:nO(e.components[n].defaultProps,r)}function W$({props:t,name:e,defaultTheme:n,themeId:r}){let i=zM(n);return r&&(i=i[r]||i),aoe({theme:i,name:e,props:t})}function xO(t,e=0,n=1){return Math.min(Math.max(e,t),n)}function soe(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 Lp(t){if(t.type)return t;if(t.charAt(0)==="#")return Lp(soe(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(Od(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(Od(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function $M(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 loe(t){t=Lp(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),a=(u,c=(u+n/30)%12)=>i-o*Math.max(Math.min(c-3,9-c,1),-1);let s="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(s+="a",l.push(e[3])),$M({type:s,values:l})}function EF(t){t=Lp(t);let e=t.type==="hsl"||t.type==="hsla"?Lp(loe(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 uoe(t,e){const n=EF(t),r=EF(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Un(t,e){return t=Lp(t),e=xO(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,$M(t)}function G$(t,e){if(t=Lp(t),e=xO(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 $M(t)}function j$(t,e){if(t=Lp(t),e=xO(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 $M(t)}const coe=["component","direction","spacing","divider","children","className","useFlexGap"],foe=UM(),doe=ooe("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function hoe(t){return W$({props:t,name:"MuiStack",defaultTheme:foe})}function poe(t,e){const n=V.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],goe=({ownerState:t,theme:e})=>{let n=ee({display:"flex",flexDirection:"column"},ou({theme:e},TT({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=gO(e),i=Object.keys(e.breakpoints.values).reduce((l,u)=>((typeof t.spacing=="object"&&t.spacing[u]!=null||typeof t.direction=="object"&&t.direction[u]!=null)&&(l[u]=!0),l),{}),o=TT({values:t.direction,base:i}),a=TT({values:t.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,u,c)=>{if(!o[l]){const d=u>0?o[c[u-1]]:"column";o[l]=d}}),n=Go(n,ou({theme:e},a,(l,u)=>t.useFlexGap?{gap:Ip(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${moe(u?o[u]:t.direction)}`]:Ip(r,l)}}))}return n=Qre(e.breakpoints,n),n};function q$(t={}){const{createStyledComponent:e=doe,useThemeProps:n=hoe,componentName:r="MuiStack"}=t,i=()=>fn({root:["root"]},l=>cn(r,l),{}),o=e(goe);return V.forwardRef(function(l,u){const c=n(l),f=yO(c),{component:d="div",direction:p="column",spacing:y=0,divider:x,children:_,className:v,useFlexGap:S=!1}=f,w=_t(f,coe),E={direction:p,spacing:y,useFlexGap:S},T=i();return k.jsx(o,ee({as:d,ownerState:E,ref:u,className:Mt(T.root,v)},w,{children:x?poe(_,x):_}))})}const voe=q$(),yw=voe;function yoe(t,e){return ee({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}const xoe=["mode","contrastThreshold","tonalOffset"],MF={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:cx.white,default:cx.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}},DT={text:{primary:cx.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:cx.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 CF(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=j$(t.main,i):e==="dark"&&(t.dark=G$(t.main,o)))}function boe(t="light"){return t==="dark"?{main:Ym[200],light:Ym[50],dark:Ym[400]}:{main:Ym[700],light:Ym[400],dark:Ym[800]}}function _oe(t="light"){return t==="dark"?{main:Xm[200],light:Xm[50],dark:Xm[400]}:{main:Xm[500],light:Xm[300],dark:Xm[700]}}function woe(t="light"){return t==="dark"?{main:qm[500],light:qm[300],dark:qm[700]}:{main:qm[700],light:qm[400],dark:qm[800]}}function Soe(t="light"){return t==="dark"?{main:Km[400],light:Km[300],dark:Km[700]}:{main:Km[700],light:Km[500],dark:Km[900]}}function Eoe(t="light"){return t==="dark"?{main:Zm[400],light:Zm[300],dark:Zm[700]}:{main:Zm[800],light:Zm[500],dark:Zm[900]}}function Moe(t="light"){return t==="dark"?{main:Dy[400],light:Dy[300],dark:Dy[700]}:{main:"#ed6c02",light:Dy[500],dark:Dy[900]}}function Coe(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=_t(t,xoe),o=t.primary||boe(e),a=t.secondary||_oe(e),s=t.error||woe(e),l=t.info||Soe(e),u=t.success||Eoe(e),c=t.warning||Moe(e);function f(x){return uoe(x,DT.text.primary)>=n?DT.text.primary:MF.text.primary}const d=({color:x,name:_,mainShade:v=500,lightShade:S=300,darkShade:w=700})=>{if(x=ee({},x),!x.main&&x[v]&&(x.main=x[v]),!x.hasOwnProperty("main"))throw new Error(Od(11,_?` (${_})`:"",v));if(typeof x.main!="string")throw new Error(Od(12,_?` (${_})`:"",JSON.stringify(x.main)));return CF(x,"light",S,r),CF(x,"dark",w,r),x.contrastText||(x.contrastText=f(x.main)),x},p={dark:DT,light:MF};return Go(ee({common:ee({},cx),mode:e,primary:d({color:o,name:"primary"}),secondary:d({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:s,name:"error"}),warning:d({color:c,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:u,name:"success"}),grey:_ne,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r},p[e]),i)}const Aoe=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Toe(t){return Math.round(t*1e5)/1e5}const AF={textTransform:"uppercase"},TF='"Roboto", "Helvetica", "Arial", sans-serif';function Doe(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=TF,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:u=16,allVariants:c,pxToRem:f}=n,d=_t(n,Aoe),p=i/14,y=f||(v=>`${v/u*p}rem`),x=(v,S,w,E,T)=>ee({fontFamily:r,fontWeight:v,fontSize:y(S),lineHeight:w},r===TF?{letterSpacing:`${Toe(E/S)}em`}:{},T,c),_={h1:x(o,96,1.167,-1.5),h2:x(o,60,1.2,-.5),h3:x(a,48,1.167,0),h4:x(a,34,1.235,.25),h5:x(a,24,1.334,0),h6:x(s,20,1.6,.15),subtitle1:x(a,16,1.75,.15),subtitle2:x(s,14,1.57,.1),body1:x(a,16,1.5,.15),body2:x(a,14,1.43,.15),button:x(s,14,1.75,.4,AF),caption:x(a,12,1.66,.4),overline:x(a,12,2.66,1,AF),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Go(ee({htmlFontSize:u,pxToRem:y,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},_),d,{clone:!1})}const Roe=.2,Poe=.14,Noe=.12;function Ir(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${Roe})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${Poe})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${Noe})`].join(",")}const Ooe=["none",Ir(0,2,1,-1,0,1,1,0,0,1,3,0),Ir(0,3,1,-2,0,2,2,0,0,1,5,0),Ir(0,3,3,-2,0,3,4,0,0,1,8,0),Ir(0,2,4,-1,0,4,5,0,0,1,10,0),Ir(0,3,5,-1,0,5,8,0,0,1,14,0),Ir(0,3,5,-1,0,6,10,0,0,1,18,0),Ir(0,4,5,-2,0,7,10,1,0,2,16,1),Ir(0,5,5,-3,0,8,10,1,0,3,14,2),Ir(0,5,6,-3,0,9,12,1,0,3,16,2),Ir(0,6,6,-3,0,10,14,1,0,4,18,3),Ir(0,6,7,-4,0,11,15,1,0,4,20,3),Ir(0,7,8,-4,0,12,17,2,0,5,22,4),Ir(0,7,8,-4,0,13,19,2,0,5,24,4),Ir(0,7,9,-4,0,14,21,2,0,5,26,4),Ir(0,8,9,-5,0,15,22,2,0,6,28,5),Ir(0,8,10,-5,0,16,24,2,0,6,30,5),Ir(0,8,11,-5,0,17,26,2,0,6,32,5),Ir(0,9,11,-5,0,18,28,2,0,7,34,6),Ir(0,9,12,-6,0,19,29,2,0,7,36,6),Ir(0,10,13,-6,0,20,31,3,0,8,38,7),Ir(0,10,13,-6,0,21,33,3,0,8,40,7),Ir(0,10,14,-6,0,22,35,3,0,8,42,7),Ir(0,11,14,-7,0,23,36,3,0,9,44,8),Ir(0,11,15,-7,0,24,38,3,0,9,46,8)],Ioe=Ooe,Loe=["duration","easing","delay"],Foe={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)"},koe={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function DF(t){return`${Math.round(t)}ms`}function Boe(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function Uoe(t){const e=ee({},Foe,t.easing),n=ee({},koe,t.duration);return ee({getAutoHeightDuration:Boe,create:(i=["all"],o={})=>{const{duration:a=n.standard,easing:s=e.easeInOut,delay:l=0}=o;return _t(o,Loe),(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof a=="string"?a:DF(a)} ${s} ${typeof l=="string"?l:DF(l)}`).join(",")}},t,{easing:e,duration:n})}const zoe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},$oe=zoe,Hoe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function X$(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,a=_t(t,Hoe);if(t.vars)throw new Error(Od(18));const s=Coe(r),l=UM(t);let u=Go(l,{mixins:yoe(l.breakpoints,n),palette:s,shadows:Ioe.slice(),typography:Doe(s,o),transitions:Uoe(i),zIndex:ee({},$oe)});return u=Go(u,a),u=e.reduce((c,f)=>Go(c,f),u),u.unstable_sxConfig=ee({},kM,a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(f){return BM({sx:f,theme:this})},u}const Voe=X$(),HM=Voe;function cb(){const t=zM(HM);return t[sb]||t}function pn({props:t,name:e}){return W$({props:t,name:e,defaultTheme:HM,themeId:sb})}const Ao=t=>T1(t)&&t!=="classes",Woe=T1,Goe=V$({themeId:sb,defaultTheme:HM,rootShouldForwardProp:Ao}),mt=Goe,joe=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)},RF=joe;function qoe(t){return cn("MuiSvgIcon",t)}an("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Xoe=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Yoe=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${lt(e)}`,`fontSize${lt(n)}`]};return fn(i,qoe,r)},Koe=mt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${lt(n.color)}`],e[`fontSize${lt(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,o,a,s,l,u,c,f,d,p,y;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||(a=o.pxToRem)==null?void 0:a.call(o,20))||"1.25rem",medium:((s=t.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem",large:((u=t.typography)==null||(c=u.pxToRem)==null?void 0:c.call(u,35))||"2.1875rem"}[e.fontSize],color:(f=(d=(t.vars||t).palette)==null||(d=d[e.color])==null?void 0:d.main)!=null?f:{action:(p=(t.vars||t).palette)==null||(p=p.action)==null?void 0:p.active,disabled:(y=(t.vars||t).palette)==null||(y=y.action)==null?void 0:y.disabled,inherit:void 0}[e.color]}}),Y$=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:c=!1,titleAccess:f,viewBox:d="0 0 24 24"}=r,p=_t(r,Xoe),y=V.isValidElement(i)&&i.type==="svg",x=ee({},r,{color:a,component:s,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:c,viewBox:d,hasSvgAsChild:y}),_={};c||(_.viewBox=d);const v=Yoe(x);return k.jsxs(Koe,ee({as:s,className:Mt(v.root,o),focusable:"false",color:u,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},_,p,y&&i.props,{ownerState:x,children:[y?i.props.children:i,f?k.jsx("title",{children:f}):null]}))});Y$.muiName="SvgIcon";const PF=Y$;function uf(t,e){function n(r,i){return k.jsx(PF,ee({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=PF.muiName,V.memo(V.forwardRef(n))}const Zoe={configure:t=>{rO.configure(t)}},Joe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:lt,createChainedFunction:zE,createSvgIcon:uf,debounce:gM,deprecatedPropType:Tne,isMuiElement:C1,ownerDocument:jo,ownerWindow:Zu,requirePropFactory:Dne,setRef:fx,unstable_ClassNameGenerator:Zoe,unstable_useEnhancedEffect:vl,unstable_useId:ab,unsupportedProp:Nne,useControlled:Ed,useEventCallback:Yl,useForkRef:Jr,useIsFocusVisible:m$},Symbol.toStringTag,{value:"Module"}));function dR(t,e){return dR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dR(t,e)}function bO(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,dR(t,e)}const NF={disabled:!1},GE=se.createContext(null);var Qoe=function(e){return e.scrollTop},a1="unmounted",Jh="exited",Qh="entering",T0="entered",hR="exiting",cf=function(t){bO(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=Jh,o.appearStatus=Qh):l=T0:r.unmountOnExit||r.mountOnEnter?l=a1:l=Jh,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===a1?{status:Jh}: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 a=this.state.status;this.props.in?a!==Qh&&a!==T0&&(o=Qh):(a===Qh||a===T0)&&(o=hR)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Qh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:gw.findDOMNode(this);a&&Qoe(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Jh&&this.setState({status:a1})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[gw.findDOMNode(this),s],u=l[0],c=l[1],f=this.getTimeouts(),d=s?f.appear:f.enter;if(!i&&!a||NF.disabled){this.safeSetState({status:T0},function(){o.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:Qh},function(){o.props.onEntering(u,c),o.onTransitionEnd(d,function(){o.safeSetState({status:T0},function(){o.props.onEntered(u,c)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:gw.findDOMNode(this);if(!o||NF.disabled){this.safeSetState({status:Jh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:hR},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Jh},function(){i.props.onExited(s)})})})},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,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:gw.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===a1)return null;var o=this.props,a=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 s=_t(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return se.createElement(GE.Provider,{value:null},typeof a=="function"?a(i,s):se.cloneElement(se.Children.only(a),s))},e}(se.Component);cf.contextType=GE;cf.propTypes={};function Jm(){}cf.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Jm,onEntering:Jm,onEntered:Jm,onExit:Jm,onExiting:Jm,onExited:Jm};cf.UNMOUNTED=a1;cf.EXITED=Jh;cf.ENTERING=Qh;cf.ENTERED=T0;cf.EXITING=hR;const _O=cf;function eae(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wO(t,e){var n=function(o){return e&&V.isValidElement(o)?e(o):o},r=Object.create(null);return t&&V.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function tae(t,e){t=t||{},e=e||{};function n(c){return c in e?e[c]:t[c]}var r=Object.create(null),i=[];for(var o in t)o in e?i.length&&(r[o]=i,i=[]):i.push(o);var a,s={};for(var l in e){if(r[l])for(a=0;at.scrollTop;function Hg(t,e){var n,r;const{timeout:i,easing:o,style:a={}}=t;return{duration:(n=a.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:a.transitionDelay}}function sae(t){return cn("MuiPaper",t)}an("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 lae=["className","component","elevation","square","variant"],uae=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return fn(o,sae,i)},cae=mt("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 ee({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"&&ee({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Un("#fff",RF(e.elevation))}, ${Un("#fff",RF(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),fae=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiPaper"}),{className:i,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,u=_t(r,lae),c=ee({},r,{component:o,elevation:a,square:s,variant:l}),f=uae(c);return k.jsx(cae,ee({as:o,ownerState:c,className:Mt(f.root,i),ref:n},u))}),Xp=fae;function dae(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:u}=t,[c,f]=V.useState(!1),d=Mt(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:a,height:a,top:-(a/2)+o,left:-(a/2)+i},y=Mt(n.child,c&&n.childLeaving,r&&n.childPulsate);return!s&&!c&&f(!0),V.useEffect(()=>{if(!s&&l!=null){const x=setTimeout(l,u);return()=>{clearTimeout(x)}}},[l,s,u]),k.jsx("span",{className:d,style:p,children:k.jsx("span",{className:y})})}const hae=an("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),ol=hae,pae=["center","classes","className"];let VM=t=>t,OF,IF,LF,FF;const pR=550,mae=80,gae=dO(OF||(OF=VM` + 0% { + transform: scale(0); + opacity: 0.1; + } + + 100% { + transform: scale(1); + opacity: 0.3; + } +`)),vae=dO(IF||(IF=VM` + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +`)),yae=dO(LF||(LF=VM` + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.92); + } + + 100% { + transform: scale(1); + } +`)),xae=mt("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),bae=mt(dae,{name:"MuiTouchRipple",slot:"Ripple"})(FF||(FF=VM` + 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; + } +`),ol.rippleVisible,gae,pR,({theme:t})=>t.transitions.easing.easeInOut,ol.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,ol.child,ol.childLeaving,vae,pR,({theme:t})=>t.transitions.easing.easeInOut,ol.childPulsate,yae,({theme:t})=>t.transitions.easing.easeInOut),_ae=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:a}=r,s=_t(r,pae),[l,u]=V.useState([]),c=V.useRef(0),f=V.useRef(null);V.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=V.useRef(!1),p=V.useRef(0),y=V.useRef(null),x=V.useRef(null);V.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const _=V.useCallback(E=>{const{pulsate:T,rippleX:A,rippleY:D,rippleSize:I,cb:P}=E;u(N=>[...N,k.jsx(bae,{classes:{ripple:Mt(o.ripple,ol.ripple),rippleVisible:Mt(o.rippleVisible,ol.rippleVisible),ripplePulsate:Mt(o.ripplePulsate,ol.ripplePulsate),child:Mt(o.child,ol.child),childLeaving:Mt(o.childLeaving,ol.childLeaving),childPulsate:Mt(o.childPulsate,ol.childPulsate)},timeout:pR,pulsate:T,rippleX:A,rippleY:D,rippleSize:I},c.current)]),c.current+=1,f.current=P},[o]),v=V.useCallback((E={},T={},A=()=>{})=>{const{pulsate:D=!1,center:I=i||T.pulsate,fakeElement:P=!1}=T;if((E==null?void 0:E.type)==="mousedown"&&d.current){d.current=!1;return}(E==null?void 0:E.type)==="touchstart"&&(d.current=!0);const N=P?null:x.current,B=N?N.getBoundingClientRect():{width:0,height:0,left:0,top:0};let G,Z,j;if(I||E===void 0||E.clientX===0&&E.clientY===0||!E.clientX&&!E.touches)G=Math.round(B.width/2),Z=Math.round(B.height/2);else{const{clientX:J,clientY:Y}=E.touches&&E.touches.length>0?E.touches[0]:E;G=Math.round(J-B.left),Z=Math.round(Y-B.top)}if(I)j=Math.sqrt((2*B.width**2+B.height**2)/3),j%2===0&&(j+=1);else{const J=Math.max(Math.abs((N?N.clientWidth:0)-G),G)*2+2,Y=Math.max(Math.abs((N?N.clientHeight:0)-Z),Z)*2+2;j=Math.sqrt(J**2+Y**2)}E!=null&&E.touches?y.current===null&&(y.current=()=>{_({pulsate:D,rippleX:G,rippleY:Z,rippleSize:j,cb:A})},p.current=setTimeout(()=>{y.current&&(y.current(),y.current=null)},mae)):_({pulsate:D,rippleX:G,rippleY:Z,rippleSize:j,cb:A})},[i,_]),S=V.useCallback(()=>{v({},{pulsate:!0})},[v]),w=V.useCallback((E,T)=>{if(clearTimeout(p.current),(E==null?void 0:E.type)==="touchend"&&y.current){y.current(),y.current=null,p.current=setTimeout(()=>{w(E,T)});return}y.current=null,u(A=>A.length>0?A.slice(1):A),f.current=T},[]);return V.useImperativeHandle(n,()=>({pulsate:S,start:v,stop:w}),[S,v,w]),k.jsx(xae,ee({className:Mt(ol.root,o.root,a),ref:x},s,{children:k.jsx(aae,{component:null,exit:!0,children:l})}))}),wae=_ae;function Sae(t){return cn("MuiButtonBase",t)}const Eae=an("MuiButtonBase",["root","disabled","focusVisible"]),Mae=Eae,Cae=["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"],Aae=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,a=fn({root:["root",e&&"disabled",n&&"focusVisible"]},Sae,i);return n&&r&&(a.root+=` ${r}`),a},Tae=mt("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"},[`&.${Mae.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Dae=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:a,className:s,component:l="button",disabled:u=!1,disableRipple:c=!1,disableTouchRipple:f=!1,focusRipple:d=!1,LinkComponent:p="a",onBlur:y,onClick:x,onContextMenu:_,onDragLeave:v,onFocus:S,onFocusVisible:w,onKeyDown:E,onKeyUp:T,onMouseDown:A,onMouseLeave:D,onMouseUp:I,onTouchEnd:P,onTouchMove:N,onTouchStart:B,tabIndex:G=0,TouchRippleProps:Z,touchRippleRef:j,type:J}=r,Y=_t(r,Cae),$=V.useRef(null),W=V.useRef(null),U=Jr(W,j),{isFocusVisibleRef:ne,onFocus:re,onBlur:ue,ref:ce}=m$(),[Ce,Re]=V.useState(!1);u&&Ce&&Re(!1),V.useImperativeHandle(i,()=>({focusVisible:()=>{Re(!0),$.current.focus()}}),[]);const[Ie,He]=V.useState(!1);V.useEffect(()=>{He(!0)},[]);const tt=Ie&&!c&&!u;V.useEffect(()=>{Ce&&d&&!c&&Ie&&W.current.pulsate()},[c,d,Ce,Ie]);function Qe(ve,Se,Pe=f){return Yl(Be=>(Se&&Se(Be),!Pe&&W.current&&W.current[ve](Be),!0))}const ut=Qe("start",A),Xe=Qe("stop",_),le=Qe("stop",v),De=Qe("stop",I),Ee=Qe("stop",ve=>{Ce&&ve.preventDefault(),D&&D(ve)}),X=Qe("start",B),te=Qe("stop",P),me=Qe("stop",N),we=Qe("stop",ve=>{ue(ve),ne.current===!1&&Re(!1),y&&y(ve)},!1),Ne=Yl(ve=>{$.current||($.current=ve.currentTarget),re(ve),ne.current===!0&&(Re(!0),w&&w(ve)),S&&S(ve)}),Ue=()=>{const ve=$.current;return l&&l!=="button"&&!(ve.tagName==="A"&&ve.href)},We=V.useRef(!1),st=Yl(ve=>{d&&!We.current&&Ce&&W.current&&ve.key===" "&&(We.current=!0,W.current.stop(ve,()=>{W.current.start(ve)})),ve.target===ve.currentTarget&&Ue()&&ve.key===" "&&ve.preventDefault(),E&&E(ve),ve.target===ve.currentTarget&&Ue()&&ve.key==="Enter"&&!u&&(ve.preventDefault(),x&&x(ve))}),z=Yl(ve=>{d&&ve.key===" "&&W.current&&Ce&&!ve.defaultPrevented&&(We.current=!1,W.current.stop(ve,()=>{W.current.pulsate(ve)})),T&&T(ve),x&&ve.target===ve.currentTarget&&Ue()&&ve.key===" "&&!ve.defaultPrevented&&x(ve)});let F=l;F==="button"&&(Y.href||Y.to)&&(F=p);const oe={};F==="button"?(oe.type=J===void 0?"button":J,oe.disabled=u):(!Y.href&&!Y.to&&(oe.role="button"),u&&(oe["aria-disabled"]=u));const ge=Jr(n,ce,$),pe=ee({},r,{centerRipple:o,component:l,disabled:u,disableRipple:c,disableTouchRipple:f,focusRipple:d,tabIndex:G,focusVisible:Ce}),de=Aae(pe);return k.jsxs(Tae,ee({as:F,className:Mt(de.root,s),ownerState:pe,onBlur:we,onClick:x,onContextMenu:Xe,onFocus:Ne,onKeyDown:st,onKeyUp:z,onMouseDown:ut,onMouseLeave:Ee,onMouseUp:De,onDragLeave:le,onTouchEnd:te,onTouchMove:me,onTouchStart:X,ref:ge,tabIndex:u?-1:G,type:J},oe,Y,{children:[a,tt?k.jsx(wae,ee({ref:U,center:o},Z)):null]}))}),Fp=Dae;function Rae(t){return cn("MuiIconButton",t)}const Pae=an("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Nae=Pae,Oae=["edge","children","className","color","disabled","disableFocusRipple","size"],Iae=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,a={root:["root",n&&"disabled",r!=="default"&&`color${lt(r)}`,i&&`edge${lt(i)}`,`size${lt(o)}`]};return fn(a,Rae,e)},Lae=mt(Fp,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${lt(n.color)}`],n.edge&&e[`edge${lt(n.edge)}`],e[`size${lt(n.size)}`]]}})(({theme:t,ownerState:e})=>ee({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Un(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var n;const r=(n=(t.vars||t).palette)==null?void 0:n[e.color];return ee({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&ee({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":ee({},r&&{backgroundColor:t.vars?`rgba(${r.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Un(r.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${Nae.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),Fae=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:a,color:s="default",disabled:l=!1,disableFocusRipple:u=!1,size:c="medium"}=r,f=_t(r,Oae),d=ee({},r,{edge:i,color:s,disabled:l,disableFocusRipple:u,size:c}),p=Iae(d);return k.jsx(Lae,ee({className:Mt(p.root,a),centerRipple:!0,focusRipple:!u,disabled:l,ref:n,ownerState:d},f,{children:o}))}),WM=Fae,kae=uf(k.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function Bae(t){return cn("MuiTypography",t)}an("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Uae=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],zae=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=t,s={root:["root",o,t.align!=="inherit"&&`align${lt(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return fn(s,Bae,a)},$ae=mt("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${lt(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>ee({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})),kF={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Hae={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Vae=t=>Hae[t]||t,Wae=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiTypography"}),i=Vae(r.color),o=yO(ee({},r,{color:i})),{align:a="inherit",className:s,component:l,gutterBottom:u=!1,noWrap:c=!1,paragraph:f=!1,variant:d="body1",variantMapping:p=kF}=o,y=_t(o,Uae),x=ee({},o,{align:a,color:i,className:s,component:l,gutterBottom:u,noWrap:c,paragraph:f,variant:d,variantMapping:p}),_=l||(f?"p":p[d]||kF[d])||"span",v=zae(x);return k.jsx($ae,ee({as:_,ref:n,ownerState:x,className:Mt(v.root,s)},y))}),An=Wae;function Gae(t){return cn("MuiAppBar",t)}an("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const jae=["className","color","enableColorOnDark","position"],qae=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${lt(e)}`,`position${lt(n)}`]};return fn(i,Gae,r)},xw=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,Xae=mt(Xp,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${lt(n.position)}`],e[`color${lt(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return ee({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&&ee({},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"&&ee({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&ee({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:xw(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:xw(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:xw(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:xw(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),Yae=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:a=!1,position:s="fixed"}=r,l=_t(r,jae),u=ee({},r,{color:o,position:s,enableColorOnDark:a}),c=qae(u);return k.jsx(Xae,ee({square:!0,component:"header",ownerState:u,elevation:4,className:Mt(c.root,i,s==="fixed"&&"mui-fixed"),ref:n},l))}),Kae=Yae;function Vg(t){return typeof t=="string"}function Zae(t,e,n){return t===void 0||Vg(t)?e:ee({},e,{ownerState:ee({},e.ownerState,n)})}const Jae={disableDefaultClasses:!1},Qae=V.createContext(Jae);function ese(t){const{disableDefaultClasses:e}=V.useContext(Qae);return n=>e?"":t(n)}function K$(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 tse(t,e,n){return typeof t=="function"?t(e,n):t}function BF(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 nse(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const p=Mt(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),y=ee({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),x=ee({},n,i,r);return p.length>0&&(x.className=p),Object.keys(y).length>0&&(x.style=y),{props:x,internalRef:void 0}}const a=K$(ee({},i,r)),s=BF(r),l=BF(i),u=e(a),c=Mt(u==null?void 0:u.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),f=ee({},u==null?void 0:u.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),d=ee({},u,n,l,s);return c.length>0&&(d.className=c),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:u.ref}}const rse=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function kp(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,a=_t(t,rse),s=o?{}:tse(r,i),{props:l,internalRef:u}=nse(ee({},a,{externalSlotProps:s})),c=Jr(u,s==null?void 0:s.ref,(e=t.additionalProps)==null?void 0:e.ref);return Zae(n,ee({},l,{ref:c}),i)}const ise=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function ose(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 ase(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 sse(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||ase(t))}function lse(t){const e=[],n=[];return Array.from(t.querySelectorAll(ise)).forEach((r,i)=>{const o=ose(r);o===-1||!sse(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 use(){return!0}function cse(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=lse,isEnabled:a=use,open:s}=t,l=V.useRef(!1),u=V.useRef(null),c=V.useRef(null),f=V.useRef(null),d=V.useRef(null),p=V.useRef(!1),y=V.useRef(null),x=Jr(e.ref,y),_=V.useRef(null);V.useEffect(()=>{!s||!y.current||(p.current=!n)},[n,s]),V.useEffect(()=>{if(!s||!y.current)return;const w=jo(y.current);return y.current.contains(w.activeElement)||(y.current.hasAttribute("tabIndex")||y.current.setAttribute("tabIndex","-1"),p.current&&y.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[s]),V.useEffect(()=>{if(!s||!y.current)return;const w=jo(y.current),E=D=>{_.current=D,!(r||!a()||D.key!=="Tab")&&w.activeElement===y.current&&D.shiftKey&&(l.current=!0,c.current&&c.current.focus())},T=()=>{const D=y.current;if(D===null)return;if(!w.hasFocus()||!a()||l.current){l.current=!1;return}if(D.contains(w.activeElement)||r&&w.activeElement!==u.current&&w.activeElement!==c.current)return;if(w.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!p.current)return;let I=[];if((w.activeElement===u.current||w.activeElement===c.current)&&(I=o(y.current)),I.length>0){var P,N;const B=!!((P=_.current)!=null&&P.shiftKey&&((N=_.current)==null?void 0:N.key)==="Tab"),G=I[0],Z=I[I.length-1];typeof G!="string"&&typeof Z!="string"&&(B?Z.focus():G.focus())}else D.focus()};w.addEventListener("focusin",T),w.addEventListener("keydown",E,!0);const A=setInterval(()=>{w.activeElement&&w.activeElement.tagName==="BODY"&&T()},50);return()=>{clearInterval(A),w.removeEventListener("focusin",T),w.removeEventListener("keydown",E,!0)}},[n,r,i,a,s,o]);const v=w=>{f.current===null&&(f.current=w.relatedTarget),p.current=!0,d.current=w.target;const E=e.props.onFocus;E&&E(w)},S=w=>{f.current===null&&(f.current=w.relatedTarget),p.current=!0};return k.jsxs(V.Fragment,{children:[k.jsx("div",{tabIndex:s?0:-1,onFocus:S,ref:u,"data-testid":"sentinelStart"}),V.cloneElement(e,{ref:x,onFocus:v}),k.jsx("div",{tabIndex:s?0:-1,onFocus:S,ref:c,"data-testid":"sentinelEnd"})]})}var Ha="top",yl="bottom",xl="right",Va="left",MO="auto",fb=[Ha,yl,xl,Va],Wg="start",mx="end",fse="clippingParents",Z$="viewport",Py="popper",dse="reference",UF=fb.reduce(function(t,e){return t.concat([e+"-"+Wg,e+"-"+mx])},[]),J$=[].concat(fb,[MO]).reduce(function(t,e){return t.concat([e,e+"-"+Wg,e+"-"+mx])},[]),hse="beforeRead",pse="read",mse="afterRead",gse="beforeMain",vse="main",yse="afterMain",xse="beforeWrite",bse="write",_se="afterWrite",wse=[hse,pse,mse,gse,vse,yse,xse,bse,_se];function Ju(t){return t?(t.nodeName||"").toLowerCase():null}function Is(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Bp(t){var e=Is(t).Element;return t instanceof e||t instanceof Element}function hl(t){var e=Is(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function CO(t){if(typeof ShadowRoot>"u")return!1;var e=Is(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Sse(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!hl(o)||!Ju(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function Ese(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!hl(i)||!Ju(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Mse={name:"applyStyles",enabled:!0,phase:"write",fn:Sse,effect:Ese,requires:["computeStyles"]};function Vu(t){return t.split("-")[0]}var xp=Math.max,jE=Math.min,Gg=Math.round;function mR(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Q$(){return!/^((?!chrome|android).)*safari/i.test(mR())}function jg(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&hl(t)&&(i=t.offsetWidth>0&&Gg(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Gg(r.height)/t.offsetHeight||1);var a=Bp(t)?Is(t):window,s=a.visualViewport,l=!Q$()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function AO(t){var e=jg(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function eH(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&CO(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ef(t){return Is(t).getComputedStyle(t)}function Cse(t){return["table","td","th"].indexOf(Ju(t))>=0}function Xd(t){return((Bp(t)?t.ownerDocument:t.document)||window.document).documentElement}function GM(t){return Ju(t)==="html"?t:t.assignedSlot||t.parentNode||(CO(t)?t.host:null)||Xd(t)}function zF(t){return!hl(t)||ef(t).position==="fixed"?null:t.offsetParent}function Ase(t){var e=/firefox/i.test(mR()),n=/Trident/i.test(mR());if(n&&hl(t)){var r=ef(t);if(r.position==="fixed")return null}var i=GM(t);for(CO(i)&&(i=i.host);hl(i)&&["html","body"].indexOf(Ju(i))<0;){var o=ef(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function db(t){for(var e=Is(t),n=zF(t);n&&Cse(n)&&ef(n).position==="static";)n=zF(n);return n&&(Ju(n)==="html"||Ju(n)==="body"&&ef(n).position==="static")?e:n||Ase(t)||e}function TO(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function D1(t,e,n){return xp(t,jE(e,n))}function Tse(t,e,n){var r=D1(t,e,n);return r>n?n:r}function tH(){return{top:0,right:0,bottom:0,left:0}}function nH(t){return Object.assign({},tH(),t)}function rH(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Dse=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,nH(typeof e!="number"?e:rH(e,fb))};function Rse(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Vu(n.placement),l=TO(s),u=[Va,xl].indexOf(s)>=0,c=u?"height":"width";if(!(!o||!a)){var f=Dse(i.padding,n),d=AO(o),p=l==="y"?Ha:Va,y=l==="y"?yl:xl,x=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],_=a[l]-n.rects.reference[l],v=db(o),S=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,w=x/2-_/2,E=f[p],T=S-d[c]-f[y],A=S/2-d[c]/2+w,D=D1(E,A,T),I=l;n.modifiersData[r]=(e={},e[I]=D,e.centerOffset=D-A,e)}}function Pse(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||eH(e.elements.popper,i)&&(e.elements.arrow=i))}const Nse={name:"arrow",enabled:!0,phase:"main",fn:Rse,effect:Pse,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qg(t){return t.split("-")[1]}var Ose={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ise(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Gg(n*i)/i||0,y:Gg(r*i)/i||0}}function $F(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,a=t.offsets,s=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,f=t.isFixed,d=a.x,p=d===void 0?0:d,y=a.y,x=y===void 0?0:y,_=typeof c=="function"?c({x:p,y:x}):{x:p,y:x};p=_.x,x=_.y;var v=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),w=Va,E=Ha,T=window;if(u){var A=db(n),D="clientHeight",I="clientWidth";if(A===Is(n)&&(A=Xd(n),ef(A).position!=="static"&&s==="absolute"&&(D="scrollHeight",I="scrollWidth")),A=A,i===Ha||(i===Va||i===xl)&&o===mx){E=yl;var P=f&&A===T&&T.visualViewport?T.visualViewport.height:A[D];x-=P-r.height,x*=l?1:-1}if(i===Va||(i===Ha||i===yl)&&o===mx){w=xl;var N=f&&A===T&&T.visualViewport?T.visualViewport.width:A[I];p-=N-r.width,p*=l?1:-1}}var B=Object.assign({position:s},u&&Ose),G=c===!0?Ise({x:p,y:x},Is(n)):{x:p,y:x};if(p=G.x,x=G.y,l){var Z;return Object.assign({},B,(Z={},Z[E]=S?"0":"",Z[w]=v?"0":"",Z.transform=(T.devicePixelRatio||1)<=1?"translate("+p+"px, "+x+"px)":"translate3d("+p+"px, "+x+"px, 0)",Z))}return Object.assign({},B,(e={},e[E]=S?x+"px":"",e[w]=v?p+"px":"",e.transform="",e))}function Lse(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Vu(e.placement),variation:qg(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,$F(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,$F(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Fse={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Lse,data:{}};var bw={passive:!0};function kse(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=Is(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,bw)}),s&&l.addEventListener("resize",n.update,bw),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,bw)}),s&&l.removeEventListener("resize",n.update,bw)}}const Bse={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kse,data:{}};var Use={left:"right",right:"left",bottom:"top",top:"bottom"};function eE(t){return t.replace(/left|right|bottom|top/g,function(e){return Use[e]})}var zse={start:"end",end:"start"};function HF(t){return t.replace(/start|end/g,function(e){return zse[e]})}function DO(t){var e=Is(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function RO(t){return jg(Xd(t)).left+DO(t).scrollLeft}function $se(t,e){var n=Is(t),r=Xd(t),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=Q$();(u||!u&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+RO(t),y:l}}function Hse(t){var e,n=Xd(t),r=DO(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=xp(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=xp(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+RO(t),l=-r.scrollTop;return ef(i||n).direction==="rtl"&&(s+=xp(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function PO(t){var e=ef(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function iH(t){return["html","body","#document"].indexOf(Ju(t))>=0?t.ownerDocument.body:hl(t)&&PO(t)?t:iH(GM(t))}function R1(t,e){var n;e===void 0&&(e=[]);var r=iH(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Is(r),a=i?[o].concat(o.visualViewport||[],PO(r)?r:[]):r,s=e.concat(a);return i?s:s.concat(R1(GM(a)))}function gR(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Vse(t,e){var n=jg(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function VF(t,e,n){return e===Z$?gR($se(t,n)):Bp(e)?Vse(e,n):gR(Hse(Xd(t)))}function Wse(t){var e=R1(GM(t)),n=["absolute","fixed"].indexOf(ef(t).position)>=0,r=n&&hl(t)?db(t):t;return Bp(r)?e.filter(function(i){return Bp(i)&&eH(i,r)&&Ju(i)!=="body"}):[]}function Gse(t,e,n,r){var i=e==="clippingParents"?Wse(t):[].concat(e),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var c=VF(t,u,r);return l.top=xp(c.top,l.top),l.right=jE(c.right,l.right),l.bottom=jE(c.bottom,l.bottom),l.left=xp(c.left,l.left),l},VF(t,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function oH(t){var e=t.reference,n=t.element,r=t.placement,i=r?Vu(r):null,o=r?qg(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,l;switch(i){case Ha:l={x:a,y:e.y-n.height};break;case yl:l={x:a,y:e.y+e.height};break;case xl:l={x:e.x+e.width,y:s};break;case Va:l={x:e.x-n.width,y:s};break;default:l={x:e.x,y:e.y}}var u=i?TO(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Wg:l[u]=l[u]-(e[c]/2-n[c]/2);break;case mx:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function gx(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,a=o===void 0?t.strategy:o,s=n.boundary,l=s===void 0?fse:s,u=n.rootBoundary,c=u===void 0?Z$:u,f=n.elementContext,d=f===void 0?Py:f,p=n.altBoundary,y=p===void 0?!1:p,x=n.padding,_=x===void 0?0:x,v=nH(typeof _!="number"?_:rH(_,fb)),S=d===Py?dse:Py,w=t.rects.popper,E=t.elements[y?S:d],T=Gse(Bp(E)?E:E.contextElement||Xd(t.elements.popper),l,c,a),A=jg(t.elements.reference),D=oH({reference:A,element:w,strategy:"absolute",placement:i}),I=gR(Object.assign({},w,D)),P=d===Py?I:A,N={top:T.top-P.top+v.top,bottom:P.bottom-T.bottom+v.bottom,left:T.left-P.left+v.left,right:P.right-T.right+v.right},B=t.modifiersData.offset;if(d===Py&&B){var G=B[i];Object.keys(N).forEach(function(Z){var j=[xl,yl].indexOf(Z)>=0?1:-1,J=[Ha,yl].indexOf(Z)>=0?"y":"x";N[Z]+=G[J]*j})}return N}function jse(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?J$:l,c=qg(r),f=c?s?UF:UF.filter(function(y){return qg(y)===c}):fb,d=f.filter(function(y){return u.indexOf(y)>=0});d.length===0&&(d=f);var p=d.reduce(function(y,x){return y[x]=gx(t,{placement:x,boundary:i,rootBoundary:o,padding:a})[Vu(x)],y},{});return Object.keys(p).sort(function(y,x){return p[y]-p[x]})}function qse(t){if(Vu(t)===MO)return[];var e=eE(t);return[HF(t),e,HF(e)]}function Xse(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,y=p===void 0?!0:p,x=n.allowedAutoPlacements,_=e.options.placement,v=Vu(_),S=v===_,w=l||(S||!y?[eE(_)]:qse(_)),E=[_].concat(w).reduce(function(Ce,Re){return Ce.concat(Vu(Re)===MO?jse(e,{placement:Re,boundary:c,rootBoundary:f,padding:u,flipVariations:y,allowedAutoPlacements:x}):Re)},[]),T=e.rects.reference,A=e.rects.popper,D=new Map,I=!0,P=E[0],N=0;N=0,J=j?"width":"height",Y=gx(e,{placement:B,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),$=j?Z?xl:Va:Z?yl:Ha;T[J]>A[J]&&($=eE($));var W=eE($),U=[];if(o&&U.push(Y[G]<=0),s&&U.push(Y[$]<=0,Y[W]<=0),U.every(function(Ce){return Ce})){P=B,I=!1;break}D.set(B,U)}if(I)for(var ne=y?3:1,re=function(Re){var Ie=E.find(function(He){var tt=D.get(He);if(tt)return tt.slice(0,Re).every(function(Qe){return Qe})});if(Ie)return P=Ie,"break"},ue=ne;ue>0;ue--){var ce=re(ue);if(ce==="break")break}e.placement!==P&&(e.modifiersData[r]._skip=!0,e.placement=P,e.reset=!0)}}const Yse={name:"flip",enabled:!0,phase:"main",fn:Xse,requiresIfExists:["offset"],data:{_skip:!1}};function WF(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function GF(t){return[Ha,xl,yl,Va].some(function(e){return t[e]>=0})}function Kse(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=gx(e,{elementContext:"reference"}),s=gx(e,{altBoundary:!0}),l=WF(a,r),u=WF(s,i,o),c=GF(l),f=GF(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const Zse={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kse};function Jse(t,e,n){var r=Vu(t),i=[Va,Ha].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Va,xl].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function Qse(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,a=J$.reduce(function(c,f){return c[f]=Jse(f,e.rects,o),c},{}),s=a[e.placement],l=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=a}const ele={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Qse};function tle(t){var e=t.state,n=t.name;e.modifiersData[n]=oH({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const nle={name:"popperOffsets",enabled:!0,phase:"read",fn:tle,data:{}};function rle(t){return t==="x"?"y":"x"}function ile(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,y=n.tetherOffset,x=y===void 0?0:y,_=gx(e,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),v=Vu(e.placement),S=qg(e.placement),w=!S,E=TO(v),T=rle(E),A=e.modifiersData.popperOffsets,D=e.rects.reference,I=e.rects.popper,P=typeof x=="function"?x(Object.assign({},e.rects,{placement:e.placement})):x,N=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),B=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,G={x:0,y:0};if(A){if(o){var Z,j=E==="y"?Ha:Va,J=E==="y"?yl:xl,Y=E==="y"?"height":"width",$=A[E],W=$+_[j],U=$-_[J],ne=p?-I[Y]/2:0,re=S===Wg?D[Y]:I[Y],ue=S===Wg?-I[Y]:-D[Y],ce=e.elements.arrow,Ce=p&&ce?AO(ce):{width:0,height:0},Re=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:tH(),Ie=Re[j],He=Re[J],tt=D1(0,D[Y],Ce[Y]),Qe=w?D[Y]/2-ne-tt-Ie-N.mainAxis:re-tt-Ie-N.mainAxis,ut=w?-D[Y]/2+ne+tt+He+N.mainAxis:ue+tt+He+N.mainAxis,Xe=e.elements.arrow&&db(e.elements.arrow),le=Xe?E==="y"?Xe.clientTop||0:Xe.clientLeft||0:0,De=(Z=B==null?void 0:B[E])!=null?Z:0,Ee=$+Qe-De-le,X=$+ut-De,te=D1(p?jE(W,Ee):W,$,p?xp(U,X):U);A[E]=te,G[E]=te-$}if(s){var me,we=E==="x"?Ha:Va,Ne=E==="x"?yl:xl,Ue=A[T],We=T==="y"?"height":"width",st=Ue+_[we],z=Ue-_[Ne],F=[Ha,Va].indexOf(v)!==-1,oe=(me=B==null?void 0:B[T])!=null?me:0,ge=F?st:Ue-D[We]-I[We]-oe+N.altAxis,pe=F?Ue+D[We]+I[We]-oe-N.altAxis:z,de=p&&F?Tse(ge,Ue,pe):D1(p?ge:st,Ue,p?pe:z);A[T]=de,G[T]=de-Ue}e.modifiersData[r]=G}}const ole={name:"preventOverflow",enabled:!0,phase:"main",fn:ile,requiresIfExists:["offset"]};function ale(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function sle(t){return t===Is(t)||!hl(t)?DO(t):ale(t)}function lle(t){var e=t.getBoundingClientRect(),n=Gg(e.width)/t.offsetWidth||1,r=Gg(e.height)/t.offsetHeight||1;return n!==1||r!==1}function ule(t,e,n){n===void 0&&(n=!1);var r=hl(e),i=hl(e)&&lle(e),o=Xd(e),a=jg(t,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Ju(e)!=="body"||PO(o))&&(s=sle(e)),hl(e)?(l=jg(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=RO(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function cle(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=e.get(s);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function fle(t){var e=cle(t);return wse.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function dle(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function hle(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var jF={placement:"bottom",modifiers:[],strategy:"absolute"};function qF(){for(var t=arguments.length,e=new Array(t),n=0;n{o||s(vle(i)||document.body)},[i,o]),vl(()=>{if(a&&!o)return fx(n,a),()=>{fx(n,null)}},[n,a,o]),o){if(V.isValidElement(r)){const u={ref:l};return V.cloneElement(r,u)}return k.jsx(V.Fragment,{children:r})}return k.jsx(V.Fragment,{children:a&&qd.createPortal(r,a)})});function yle(t){return cn("MuiPopper",t)}an("MuiPopper",["root"]);const xle=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],ble=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function _le(t,e){if(e==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function vR(t){return typeof t=="function"?t():t}function wle(t){return t.nodeType!==void 0}const Sle=()=>fn({root:["root"]},ese(yle)),Ele={},Mle=V.forwardRef(function(e,n){var r;const{anchorEl:i,children:o,direction:a,disablePortal:s,modifiers:l,open:u,placement:c,popperOptions:f,popperRef:d,slotProps:p={},slots:y={},TransitionProps:x}=e,_=_t(e,xle),v=V.useRef(null),S=Jr(v,n),w=V.useRef(null),E=Jr(w,d),T=V.useRef(E);vl(()=>{T.current=E},[E]),V.useImperativeHandle(d,()=>w.current,[]);const A=_le(c,a),[D,I]=V.useState(A),[P,N]=V.useState(vR(i));V.useEffect(()=>{w.current&&w.current.forceUpdate()}),V.useEffect(()=>{i&&N(vR(i))},[i]),vl(()=>{if(!P||!u)return;const J=W=>{I(W.placement)};let Y=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:W})=>{J(W)}}];l!=null&&(Y=Y.concat(l)),f&&f.modifiers!=null&&(Y=Y.concat(f.modifiers));const $=gle(P,v.current,ee({placement:A},f,{modifiers:Y}));return T.current($),()=>{$.destroy(),T.current(null)}},[P,s,l,u,f,A]);const B={placement:D};x!==null&&(B.TransitionProps=x);const G=Sle(),Z=(r=y.root)!=null?r:"div",j=kp({elementType:Z,externalSlotProps:p.root,externalForwardedProps:_,additionalProps:{role:"tooltip",ref:S},ownerState:e,className:G.root});return k.jsx(Z,ee({},j,{children:typeof o=="function"?o(B):o}))}),Cle=V.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:u,open:c,placement:f="bottom",popperOptions:d=Ele,popperRef:p,style:y,transition:x=!1,slotProps:_={},slots:v={}}=e,S=_t(e,ble),[w,E]=V.useState(!0),T=()=>{E(!1)},A=()=>{E(!0)};if(!l&&!c&&(!x||w))return null;let D;if(o)D=o;else if(r){const N=vR(r);D=N&&wle(N)?jo(N).body:jo(null).body}const I=!c&&l&&(!x||w)?"none":void 0,P=x?{in:c,onEnter:T,onExited:A}:void 0;return k.jsx(aH,{disablePortal:s,container:D,children:k.jsx(Mle,ee({anchorEl:r,direction:a,disablePortal:s,modifiers:u,ref:n,open:x?!w:c,placement:f,popperOptions:d,popperRef:p,slotProps:_,slots:v},S,{style:ee({position:"fixed",top:0,left:0,display:I},y),TransitionProps:P,children:i}))})});function Ale(t){const e=jo(t);return e.body===t?Zu(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function P1(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function XF(t){return parseInt(Zu(t).getComputedStyle(t).paddingRight,10)||0}function Tle(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 YF(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,a=>{const s=o.indexOf(a)===-1,l=!Tle(a);s&&l&&P1(a,i)})}function RT(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function Dle(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(Ale(r)){const a=g$(jo(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${XF(r)+a}px`;const s=jo(r).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${XF(l)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=jo(r).body;else{const a=r.parentElement,s=Zu(r);o=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a: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:a,property:s})=>{o?a.style.setProperty(s,o):a.style.removeProperty(s)})}}function Rle(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class Ple{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&&P1(e.modalRef,!1);const i=Rle(n);YF(n,e.mount,e.modalRef,i,!0);const o=RT(this.containers,a=>a.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=RT(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=Dle(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=RT(this.containers,a=>a.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&&P1(e.modalRef,n),YF(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const a=o.modals[o.modals.length-1];a.modalRef&&P1(a.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function Nle(t){return typeof t=="function"?t():t}function Ole(t){return t?t.props.hasOwnProperty("in"):!1}const Ile=new Ple;function Lle(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=Ile,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:u,open:c,rootRef:f}=t,d=V.useRef({}),p=V.useRef(null),y=V.useRef(null),x=Jr(y,f),[_,v]=V.useState(!c),S=Ole(l);let w=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(w=!1);const E=()=>jo(p.current),T=()=>(d.current.modalRef=y.current,d.current.mount=p.current,d.current),A=()=>{i.mount(T(),{disableScrollLock:r}),y.current&&(y.current.scrollTop=0)},D=Yl(()=>{const Y=Nle(e)||E().body;i.add(T(),Y),y.current&&A()}),I=V.useCallback(()=>i.isTopModal(T()),[i]),P=Yl(Y=>{p.current=Y,Y&&(c&&I()?A():y.current&&P1(y.current,w))}),N=V.useCallback(()=>{i.remove(T(),w)},[w,i]);V.useEffect(()=>()=>{N()},[N]),V.useEffect(()=>{c?D():(!S||!o)&&N()},[c,N,S,o,D]);const B=Y=>$=>{var W;(W=Y.onKeyDown)==null||W.call(Y,$),!($.key!=="Escape"||$.which===229||!I())&&(n||($.stopPropagation(),u&&u($,"escapeKeyDown")))},G=Y=>$=>{var W;(W=Y.onClick)==null||W.call(Y,$),$.target===$.currentTarget&&u&&u($,"backdropClick")};return{getRootProps:(Y={})=>{const $=K$(t);delete $.onTransitionEnter,delete $.onTransitionExited;const W=ee({},$,Y);return ee({role:"presentation"},W,{onKeyDown:B(W),ref:x})},getBackdropProps:(Y={})=>{const $=Y;return ee({"aria-hidden":!0},$,{onClick:G($),open:c})},getTransitionProps:()=>{const Y=()=>{v(!1),a&&a()},$=()=>{v(!0),s&&s(),o&&N()};return{onEnter:zE(Y,l==null?void 0:l.props.onEnter),onExited:zE($,l==null?void 0:l.props.onExited)}},rootRef:x,portalRef:P,isTopModal:I,exited:_,hasTransition:S}}const Fle=["onChange","maxRows","minRows","style","value"];function _w(t){return parseInt(t,10)||0}const kle={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function KF(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflow}const Ble=V.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:a,value:s}=e,l=_t(e,Fle),{current:u}=V.useRef(s!=null),c=V.useRef(null),f=Jr(n,c),d=V.useRef(null),p=V.useRef(0),[y,x]=V.useState({outerHeightStyle:0}),_=V.useCallback(()=>{const E=c.current,A=Zu(E).getComputedStyle(E);if(A.width==="0px")return{outerHeightStyle:0};const D=d.current;D.style.width=A.width,D.value=E.value||e.placeholder||"x",D.value.slice(-1)===` +`&&(D.value+=" ");const I=A.boxSizing,P=_w(A.paddingBottom)+_w(A.paddingTop),N=_w(A.borderBottomWidth)+_w(A.borderTopWidth),B=D.scrollHeight;D.value="x";const G=D.scrollHeight;let Z=B;o&&(Z=Math.max(Number(o)*G,Z)),i&&(Z=Math.min(Number(i)*G,Z)),Z=Math.max(Z,G);const j=Z+(I==="border-box"?P+N:0),J=Math.abs(Z-B)<=1;return{outerHeightStyle:j,overflow:J}},[i,o,e.placeholder]),v=(E,T)=>{const{outerHeightStyle:A,overflow:D}=T;return p.current<20&&(A>0&&Math.abs((E.outerHeightStyle||0)-A)>1||E.overflow!==D)?(p.current+=1,{overflow:D,outerHeightStyle:A}):E},S=V.useCallback(()=>{const E=_();KF(E)||x(T=>v(T,E))},[_]);vl(()=>{const E=()=>{const B=_();KF(B)||qd.flushSync(()=>{x(G=>v(G,B))})},T=()=>{p.current=0,E()};let A;const D=gM(T),I=c.current,P=Zu(I);P.addEventListener("resize",D);let N;return typeof ResizeObserver<"u"&&(N=new ResizeObserver(T),N.observe(I)),()=>{D.clear(),cancelAnimationFrame(A),P.removeEventListener("resize",D),N&&N.disconnect()}},[_]),vl(()=>{S()}),V.useEffect(()=>{p.current=0},[s]);const w=E=>{p.current=0,u||S(),r&&r(E)};return k.jsxs(V.Fragment,{children:[k.jsx("textarea",ee({value:s,onChange:w,ref:f,rows:o,style:ee({height:y.outerHeightStyle,overflow:y.overflow?"hidden":void 0},a)},l)),k.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:d,tabIndex:-1,style:ee({},kle.shadow,a,{paddingTop:0,paddingBottom:0})})]})});function ZF(t){return typeof t.normalize<"u"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t}function Ule(t={}){const{ignoreAccents:e=!0,ignoreCase:n=!0,limit:r,matchFrom:i="any",stringify:o,trim:a=!1}=t;return(s,{inputValue:l,getOptionLabel:u})=>{let c=a?l.trim():l;n&&(c=c.toLowerCase()),e&&(c=ZF(c));const f=c?s.filter(d=>{let p=(o||u)(d);return n&&(p=p.toLowerCase()),e&&(p=ZF(p)),i==="start"?p.indexOf(c)===0:p.indexOf(c)>-1}):s;return typeof r=="number"?f.slice(0,r):f}}function PT(t,e){for(let n=0;n{var e;return t.current!==null&&((e=t.current.parentElement)==null?void 0:e.contains(document.activeElement))};function Hle(t){const{unstable_isActiveElementInListbox:e=$le,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:i=!1,autoSelect:o=!1,blurOnSelect:a=!1,clearOnBlur:s=!t.freeSolo,clearOnEscape:l=!1,componentName:u="useAutocomplete",defaultValue:c=t.multiple?[]:null,disableClearable:f=!1,disableCloseOnSelect:d=!1,disabled:p,disabledItemsFocusable:y=!1,disableListWrap:x=!1,filterOptions:_=zle,filterSelectedOptions:v=!1,freeSolo:S=!1,getOptionDisabled:w,getOptionLabel:E=Ze=>{var Ge;return(Ge=Ze.label)!=null?Ge:Ze},groupBy:T,handleHomeEndKeys:A=!t.freeSolo,id:D,includeInputInList:I=!1,inputValue:P,isOptionEqualToValue:N=(Ze,Ge)=>Ze===Ge,multiple:B=!1,onChange:G,onClose:Z,onHighlightChange:j,onInputChange:J,onOpen:Y,open:$,openOnFocus:W=!1,options:U,readOnly:ne=!1,selectOnFocus:re=!t.freeSolo,value:ue}=t,ce=ab(D);let Ce=E;Ce=Ze=>{const Ge=E(Ze);return typeof Ge!="string"?String(Ge):Ge};const Re=V.useRef(!1),Ie=V.useRef(!0),He=V.useRef(null),tt=V.useRef(null),[Qe,ut]=V.useState(null),[Xe,le]=V.useState(-1),De=i?0:-1,Ee=V.useRef(De),[X,te]=Ed({controlled:ue,default:c,name:u}),[me,we]=Ed({controlled:P,default:"",name:u,state:"inputValue"}),[Ne,Ue]=V.useState(!1),We=V.useCallback((Ze,Ge)=>{if(!(B?X.length!(v&&(B?X:[X]).some(Ge=>Ge!==null&&N(Ze,Ge)))),{inputValue:ge&&F?"":me,getOptionLabel:Ce}):[],ve=zne({filteredOptions:de,value:X,inputValue:me});V.useEffect(()=>{const Ze=X!==ve.value;Ne&&!Ze||S&&!Ze||We(null,X)},[X,We,Ne,ve.value,S]);const Se=st&&de.length>0&&!ne,Pe=Yl(Ze=>{Ze===-1?He.current.focus():Qe.querySelector(`[data-tag-index="${Ze}"]`).focus()});V.useEffect(()=>{B&&Xe>X.length-1&&(le(-1),Pe(-1))},[X,B,Xe,Pe]);function Be(Ze,Ge){if(!tt.current||Ze<0||Ze>=de.length)return-1;let it=Ze;for(;;){const K=tt.current.querySelector(`[data-option-index="${it}"]`),_e=y?!1:!K||K.disabled||K.getAttribute("aria-disabled")==="true";if(K&&K.hasAttribute("tabindex")&&!_e)return it;if(Ge==="next"?it=(it+1)%de.length:it=(it-1+de.length)%de.length,it===Ze)return-1}}const je=Yl(({event:Ze,index:Ge,reason:it="auto"})=>{if(Ee.current=Ge,Ge===-1?He.current.removeAttribute("aria-activedescendant"):He.current.setAttribute("aria-activedescendant",`${ce}-option-${Ge}`),j&&j(Ze,Ge===-1?null:de[Ge],it),!tt.current)return;const K=tt.current.querySelector(`[role="option"].${n}-focused`);K&&(K.classList.remove(`${n}-focused`),K.classList.remove(`${n}-focusVisible`));let _e=tt.current;if(tt.current.getAttribute("role")!=="listbox"&&(_e=tt.current.parentElement.querySelector('[role="listbox"]')),!_e)return;if(Ge===-1){_e.scrollTop=0;return}const Oe=tt.current.querySelector(`[data-option-index="${Ge}"]`);if(Oe&&(Oe.classList.add(`${n}-focused`),it==="keyboard"&&Oe.classList.add(`${n}-focusVisible`),_e.scrollHeight>_e.clientHeight&&it!=="mouse"&&it!=="touch")){const ke=Oe,ze=_e.clientHeight+_e.scrollTop,Et=ke.offsetTop+ke.offsetHeight;Et>ze?_e.scrollTop=Et-_e.clientHeight:ke.offsetTop-ke.offsetHeight*(T?1.3:0)<_e.scrollTop&&(_e.scrollTop=ke.offsetTop-ke.offsetHeight*(T?1.3:0))}}),Fe=Yl(({event:Ze,diff:Ge,direction:it="next",reason:K="auto"})=>{if(!pe)return;const Oe=Be((()=>{const ke=de.length-1;if(Ge==="reset")return De;if(Ge==="start")return 0;if(Ge==="end")return ke;const ze=Ee.current+Ge;return ze<0?ze===-1&&I?-1:x&&Ee.current!==-1||Math.abs(Ge)>1?0:ke:ze>ke?ze===ke+1&&I?-1:x||Math.abs(Ge)>1?ke:0:ze})(),it);if(je({index:Oe,reason:K,event:Ze}),r&&Ge!=="reset")if(Oe===-1)He.current.value=me;else{const ke=Ce(de[Oe]);He.current.value=ke,ke.toLowerCase().indexOf(me.toLowerCase())===0&&me.length>0&&He.current.setSelectionRange(me.length,ke.length)}}),xt=()=>{const Ze=(Ge,it)=>{const K=Ge?Ce(Ge):"",_e=it?Ce(it):"";return K===_e};if(Ee.current!==-1&&ve.filteredOptions&&ve.filteredOptions.length!==de.length&&ve.inputValue===me&&(B?X.length===ve.value.length&&ve.value.every((Ge,it)=>Ce(X[it])===Ce(Ge)):Ze(ve.value,X))){const Ge=ve.filteredOptions[Ee.current];if(Ge&&de.some(K=>Ce(K)===Ce(Ge)))return!0}return!1},yt=V.useCallback(()=>{if(!pe||xt())return;const Ze=B?X[0]:X;if(de.length===0||Ze==null){Fe({diff:"reset"});return}if(tt.current){if(Ze!=null){const Ge=de[Ee.current];if(B&&Ge&&PT(X,K=>N(Ge,K))!==-1)return;const it=PT(de,K=>N(K,Ze));it===-1?Fe({diff:"reset"}):je({index:it});return}if(Ee.current>=de.length-1){je({index:de.length-1});return}je({index:Ee.current})}},[de.length,B?!1:X,v,Fe,je,pe,me,B]),bt=Yl(Ze=>{fx(tt,Ze),Ze&&yt()});V.useEffect(()=>{yt()},[yt]);const Ct=Ze=>{st||(z(!0),oe(!0),Y&&Y(Ze))},ht=(Ze,Ge)=>{st&&(z(!1),Z&&Z(Ze,Ge))},jt=(Ze,Ge,it,K)=>{if(B){if(X.length===Ge.length&&X.every((_e,Oe)=>_e===Ge[Oe]))return}else if(X===Ge)return;G&&G(Ze,Ge,it,K),te(Ge)},be=V.useRef(!1),gt=(Ze,Ge,it="selectOption",K="options")=>{let _e=it,Oe=Ge;if(B){Oe=Array.isArray(X)?X.slice():[];const ke=PT(Oe,ze=>N(Ge,ze));ke===-1?Oe.push(Ge):K!=="freeSolo"&&(Oe.splice(ke,1),_e="removeOption")}We(Ze,Oe),jt(Ze,Oe,_e,{option:Ge}),!d&&(!Ze||!Ze.ctrlKey&&!Ze.metaKey)&&ht(Ze,_e),(a===!0||a==="touch"&&be.current||a==="mouse"&&!be.current)&&He.current.blur()};function ct(Ze,Ge){if(Ze===-1)return-1;let it=Ze;for(;;){if(Ge==="next"&&it===X.length||Ge==="previous"&&it===-1)return-1;const K=Qe.querySelector(`[data-tag-index="${it}"]`);if(!K||!K.hasAttribute("tabindex")||K.disabled||K.getAttribute("aria-disabled")==="true")it+=Ge==="next"?1:-1;else return it}}const Ye=(Ze,Ge)=>{if(!B)return;me===""&&ht(Ze,"toggleInput");let it=Xe;Xe===-1?me===""&&Ge==="previous"&&(it=X.length-1):(it+=Ge==="next"?1:-1,it<0&&(it=0),it===X.length&&(it=-1)),it=ct(it,Ge),le(it),Pe(it)},pt=Ze=>{Re.current=!0,we(""),J&&J(Ze,"","clear"),jt(Ze,B?[]:null,"clear")},Vt=Ze=>Ge=>{if(Ze.onKeyDown&&Ze.onKeyDown(Ge),!Ge.defaultMuiPrevented&&(Xe!==-1&&["ArrowLeft","ArrowRight"].indexOf(Ge.key)===-1&&(le(-1),Pe(-1)),Ge.which!==229))switch(Ge.key){case"Home":pe&&A&&(Ge.preventDefault(),Fe({diff:"start",direction:"next",reason:"keyboard",event:Ge}));break;case"End":pe&&A&&(Ge.preventDefault(),Fe({diff:"end",direction:"previous",reason:"keyboard",event:Ge}));break;case"PageUp":Ge.preventDefault(),Fe({diff:-JF,direction:"previous",reason:"keyboard",event:Ge}),Ct(Ge);break;case"PageDown":Ge.preventDefault(),Fe({diff:JF,direction:"next",reason:"keyboard",event:Ge}),Ct(Ge);break;case"ArrowDown":Ge.preventDefault(),Fe({diff:1,direction:"next",reason:"keyboard",event:Ge}),Ct(Ge);break;case"ArrowUp":Ge.preventDefault(),Fe({diff:-1,direction:"previous",reason:"keyboard",event:Ge}),Ct(Ge);break;case"ArrowLeft":Ye(Ge,"previous");break;case"ArrowRight":Ye(Ge,"next");break;case"Enter":if(Ee.current!==-1&&pe){const it=de[Ee.current],K=w?w(it):!1;if(Ge.preventDefault(),K)return;gt(Ge,it,"selectOption"),r&&He.current.setSelectionRange(He.current.value.length,He.current.value.length)}else S&&me!==""&&ge===!1&&(B&&Ge.preventDefault(),gt(Ge,me,"createOption","freeSolo"));break;case"Escape":pe?(Ge.preventDefault(),Ge.stopPropagation(),ht(Ge,"escape")):l&&(me!==""||B&&X.length>0)&&(Ge.preventDefault(),Ge.stopPropagation(),pt(Ge));break;case"Backspace":if(B&&!ne&&me===""&&X.length>0){const it=Xe===-1?X.length-1:Xe,K=X.slice();K.splice(it,1),jt(Ge,K,"removeOption",{option:X[it]})}break;case"Delete":if(B&&!ne&&me===""&&X.length>0&&Xe!==-1){const it=Xe,K=X.slice();K.splice(it,1),jt(Ge,K,"removeOption",{option:X[it]})}break}},xn=Ze=>{Ue(!0),W&&!Re.current&&Ct(Ze)},Zn=Ze=>{if(e(tt)){He.current.focus();return}Ue(!1),Ie.current=!0,Re.current=!1,o&&Ee.current!==-1&&pe?gt(Ze,de[Ee.current],"blur"):o&&S&&me!==""?gt(Ze,me,"blur","freeSolo"):s&&We(Ze,X),ht(Ze,"blur")},Cr=Ze=>{const Ge=Ze.target.value;me!==Ge&&(we(Ge),oe(!1),J&&J(Ze,Ge,"input")),Ge===""?!f&&!B&&jt(Ze,null,"clear"):Ct(Ze)},sn=Ze=>{const Ge=Number(Ze.currentTarget.getAttribute("data-option-index"));Ee.current!==Ge&&je({event:Ze,index:Ge,reason:"mouse"})},Sn=Ze=>{je({event:Ze,index:Number(Ze.currentTarget.getAttribute("data-option-index")),reason:"touch"}),be.current=!0},ur=Ze=>{const Ge=Number(Ze.currentTarget.getAttribute("data-option-index"));gt(Ze,de[Ge],"selectOption"),be.current=!1},Sa=Ze=>Ge=>{const it=X.slice();it.splice(Ze,1),jt(Ge,it,"removeOption",{option:X[Ze]})},Ea=Ze=>{st?ht(Ze,"toggleInput"):Ct(Ze)},Ka=Ze=>{Ze.currentTarget.contains(Ze.target)&&Ze.target.getAttribute("id")!==ce&&Ze.preventDefault()},Ro=Ze=>{Ze.currentTarget.contains(Ze.target)&&(He.current.focus(),re&&Ie.current&&He.current.selectionEnd-He.current.selectionStart===0&&He.current.select(),Ie.current=!1)},Zo=Ze=>{!p&&(me===""||!st)&&Ea(Ze)};let Po=S&&me.length>0;Po=Po||(B?X.length>0:X!==null);let Jo=de;return T&&(Jo=de.reduce((Ze,Ge,it)=>{const K=T(Ge);return Ze.length>0&&Ze[Ze.length-1].group===K?Ze[Ze.length-1].options.push(Ge):Ze.push({key:it,index:it,group:K,options:[Ge]}),Ze},[])),p&&Ne&&Zn(),{getRootProps:(Ze={})=>ee({"aria-owns":Se?`${ce}-listbox`:null},Ze,{onKeyDown:Vt(Ze),onMouseDown:Ka,onClick:Ro}),getInputLabelProps:()=>({id:`${ce}-label`,htmlFor:ce}),getInputProps:()=>({id:ce,value:me,onBlur:Zn,onFocus:xn,onChange:Cr,onMouseDown:Zo,"aria-activedescendant":pe?"":null,"aria-autocomplete":r?"both":"list","aria-controls":Se?`${ce}-listbox`:void 0,"aria-expanded":Se,autoComplete:"off",ref:He,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:p}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:pt}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Ea}),getTagProps:({index:Ze})=>ee({key:Ze,"data-tag-index":Ze,tabIndex:-1},!ne&&{onDelete:Sa(Ze)}),getListboxProps:()=>({role:"listbox",id:`${ce}-listbox`,"aria-labelledby":`${ce}-label`,ref:bt,onMouseDown:Ze=>{Ze.preventDefault()}}),getOptionProps:({index:Ze,option:Ge})=>{const it=(B?X:[X]).some(_e=>_e!=null&&N(Ge,_e)),K=w?w(Ge):!1;return{key:Ce(Ge),tabIndex:-1,role:"option",id:`${ce}-option-${Ze}`,onMouseMove:sn,onClick:ur,onTouchStart:Sn,"data-option-index":Ze,"aria-disabled":K,"aria-selected":it}},id:ce,inputValue:me,value:X,dirty:Po,expanded:pe&&Qe,popupOpen:pe,focused:Ne||Xe!==-1,anchorEl:Qe,setAnchorEl:ut,focusedTag:Xe,groupedOptions:Jo}}const Vle=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],Wle=mt(Cle,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Gle=V.forwardRef(function(e,n){var r;const i=z$(),o=pn({props:e,name:"MuiPopper"}),{anchorEl:a,component:s,components:l,componentsProps:u,container:c,disablePortal:f,keepMounted:d,modifiers:p,open:y,placement:x,popperOptions:_,popperRef:v,transition:S,slots:w,slotProps:E}=o,T=_t(o,Vle),A=(r=w==null?void 0:w.root)!=null?r:l==null?void 0:l.Root,D=ee({anchorEl:a,container:c,disablePortal:f,keepMounted:d,modifiers:p,open:y,placement:x,popperOptions:_,popperRef:v,transition:S},T);return k.jsx(Wle,ee({as:s,direction:i==null?void 0:i.direction,slots:{root:A},slotProps:E??u},D,{ref:n}))}),sH=Gle;function jle(t){return cn("MuiListSubheader",t)}an("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const qle=["className","color","component","disableGutters","disableSticky","inset"],Xle=t=>{const{classes:e,color:n,disableGutters:r,inset:i,disableSticky:o}=t,a={root:["root",n!=="default"&&`color${lt(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return fn(a,jle,e)},Yle=mt("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${lt(n.color)}`],!n.disableGutters&&e.gutters,n.inset&&e.inset,!n.disableSticky&&e.sticky]}})(({theme:t,ownerState:e})=>ee({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},e.color==="primary"&&{color:(t.vars||t).palette.primary.main},e.color==="inherit"&&{color:"inherit"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.inset&&{paddingLeft:72},!e.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})),lH=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiListSubheader"}),{className:i,color:o="default",component:a="li",disableGutters:s=!1,disableSticky:l=!1,inset:u=!1}=r,c=_t(r,qle),f=ee({},r,{color:o,component:a,disableGutters:s,disableSticky:l,inset:u}),d=Xle(f);return k.jsx(Yle,ee({as:a,className:Mt(d.root,i),ref:n,ownerState:f},c))});lH.muiSkipListHighlight=!0;const Kle=lH,Zle=uf(k.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Jle(t){return cn("MuiChip",t)}const Qle=an("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Yn=Qle,eue=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],tue=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:a,clickable:s,variant:l}=t,u={root:["root",l,n&&"disabled",`size${lt(r)}`,`color${lt(i)}`,s&&"clickable",s&&`clickableColor${lt(i)}`,a&&"deletable",a&&`deletableColor${lt(i)}`,`${l}${lt(i)}`],label:["label",`label${lt(r)}`],avatar:["avatar",`avatar${lt(r)}`,`avatarColor${lt(i)}`],icon:["icon",`icon${lt(r)}`,`iconColor${lt(o)}`],deleteIcon:["deleteIcon",`deleteIcon${lt(r)}`,`deleteIconColor${lt(i)}`,`deleteIcon${lt(l)}Color${lt(i)}`]};return fn(u,Jle,e)},nue=mt("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:a,size:s,variant:l}=n;return[{[`& .${Yn.avatar}`]:e.avatar},{[`& .${Yn.avatar}`]:e[`avatar${lt(s)}`]},{[`& .${Yn.avatar}`]:e[`avatarColor${lt(r)}`]},{[`& .${Yn.icon}`]:e.icon},{[`& .${Yn.icon}`]:e[`icon${lt(s)}`]},{[`& .${Yn.icon}`]:e[`iconColor${lt(i)}`]},{[`& .${Yn.deleteIcon}`]:e.deleteIcon},{[`& .${Yn.deleteIcon}`]:e[`deleteIcon${lt(s)}`]},{[`& .${Yn.deleteIcon}`]:e[`deleteIconColor${lt(r)}`]},{[`& .${Yn.deleteIcon}`]:e[`deleteIcon${lt(l)}Color${lt(r)}`]},e.root,e[`size${lt(s)}`],e[`color${lt(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${lt(r)})`],a&&e.deletable,a&&r!=="default"&&e[`deletableColor${lt(r)}`],e[l],e[`${l}${lt(r)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return ee({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Yn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Yn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:n,fontSize:t.typography.pxToRem(12)},[`& .${Yn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${Yn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${Yn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${Yn.icon}`]:ee({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&ee({color:t.vars?t.vars.palette.Chip.defaultIconColor:n},e.color!=="default"&&{color:"inherit"})),[`& .${Yn.deleteIcon}`]:ee({WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:Un(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:Un(t.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:t.vars?`rgba(${t.vars.palette[e.color].contrastTextChannel} / 0.7)`:Un(t.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(t.vars||t).palette[e.color].main,color:(t.vars||t).palette[e.color].contrastText},e.onDelete&&{[`&.${Yn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Un(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${Yn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}})},({theme:t,ownerState:e})=>ee({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Un(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${Yn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Un(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${Yn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}}),({theme:t,ownerState:e})=>ee({},e.variant==="outlined"&&{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${Yn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Yn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${Yn.avatar}`]:{marginLeft:4},[`& .${Yn.avatarSmall}`]:{marginLeft:2},[`& .${Yn.icon}`]:{marginLeft:4},[`& .${Yn.iconSmall}`]:{marginLeft:2},[`& .${Yn.deleteIcon}`]:{marginRight:5},[`& .${Yn.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(t.vars||t).palette[e.color].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:Un(t.palette[e.color].main,.7)}`,[`&.${Yn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Un(t.palette[e.color].main,t.palette.action.hoverOpacity)},[`&.${Yn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.focusOpacity})`:Un(t.palette[e.color].main,t.palette.action.focusOpacity)},[`& .${Yn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:Un(t.palette[e.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].main}}})),rue=mt("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${lt(r)}`]]}})(({ownerState:t})=>ee({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},t.variant==="outlined"&&{paddingLeft:11,paddingRight:11},t.size==="small"&&{paddingLeft:8,paddingRight:8},t.size==="small"&&t.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function QF(t){return t.key==="Backspace"||t.key==="Delete"}const iue=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:a,color:s="default",component:l,deleteIcon:u,disabled:c=!1,icon:f,label:d,onClick:p,onDelete:y,onKeyDown:x,onKeyUp:_,size:v="medium",variant:S="filled",tabIndex:w,skipFocusWhenDisabled:E=!1}=r,T=_t(r,eue),A=V.useRef(null),D=Jr(A,n),I=U=>{U.stopPropagation(),y&&y(U)},P=U=>{U.currentTarget===U.target&&QF(U)&&U.preventDefault(),x&&x(U)},N=U=>{U.currentTarget===U.target&&(y&&QF(U)?y(U):U.key==="Escape"&&A.current&&A.current.blur()),_&&_(U)},B=a!==!1&&p?!0:a,G=B||y?Fp:l||"div",Z=ee({},r,{component:G,disabled:c,size:v,color:s,iconColor:V.isValidElement(f)&&f.props.color||s,onDelete:!!y,clickable:B,variant:S}),j=tue(Z),J=G===Fp?ee({component:l||"div",focusVisibleClassName:j.focusVisible},y&&{disableRipple:!0}):{};let Y=null;y&&(Y=u&&V.isValidElement(u)?V.cloneElement(u,{className:Mt(u.props.className,j.deleteIcon),onClick:I}):k.jsx(Zle,{className:Mt(j.deleteIcon),onClick:I}));let $=null;i&&V.isValidElement(i)&&($=V.cloneElement(i,{className:Mt(j.avatar,i.props.className)}));let W=null;return f&&V.isValidElement(f)&&(W=V.cloneElement(f,{className:Mt(j.icon,f.props.className)})),k.jsxs(nue,ee({as:G,className:Mt(j.root,o),disabled:B&&c?!0:void 0,onClick:p,onKeyDown:P,onKeyUp:N,ref:D,tabIndex:E&&c?-1:w,ownerState:Z},J,T,{children:[$||W,k.jsx(rue,{className:Mt(j.label),ownerState:Z,children:d}),Y]}))}),oue=iue;function Yd({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 aue=V.createContext(void 0),NO=aue;function ff(){return V.useContext(NO)}function sue(t){return k.jsx(Vie,ee({},t,{defaultTheme:HM,themeId:sb}))}function e8(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function qE(t,e=!1){return t&&(e8(t.value)&&t.value!==""||e&&e8(t.defaultValue)&&t.defaultValue!=="")}function lue(t){return t.startAdornment}function uue(t){return cn("MuiInputBase",t)}const cue=an("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),xs=cue,fue=["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"],jM=(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${lt(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},qM=(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]},due=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:a,formControl:s,fullWidth:l,hiddenLabel:u,multiline:c,readOnly:f,size:d,startAdornment:p,type:y}=t,x={root:["root",`color${lt(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",d&&d!=="medium"&&`size${lt(d)}`,c&&"multiline",p&&"adornedStart",o&&"adornedEnd",u&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",y==="search"&&"inputTypeSearch",c&&"inputMultiline",d==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return fn(x,uue,e)},XM=mt("div",{name:"MuiInputBase",slot:"Root",overridesResolver:jM})(({theme:t,ownerState:e})=>ee({},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",[`&.${xs.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&ee({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),YM=mt("input",{name:"MuiInputBase",slot:"Input",overridesResolver:qM})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=ee({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 ee({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] + .${xs.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},[`&.${xs.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"})}),hue=k.jsx(sue,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),pue=V.forwardRef(function(e,n){var r;const i=pn({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:s,className:l,components:u={},componentsProps:c={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:p,endAdornment:y,fullWidth:x=!1,id:_,inputComponent:v="input",inputProps:S={},inputRef:w,maxRows:E,minRows:T,multiline:A=!1,name:D,onBlur:I,onChange:P,onClick:N,onFocus:B,onKeyDown:G,onKeyUp:Z,placeholder:j,readOnly:J,renderSuffix:Y,rows:$,slotProps:W={},slots:U={},startAdornment:ne,type:re="text",value:ue}=i,ce=_t(i,fue),Ce=S.value!=null?S.value:ue,{current:Re}=V.useRef(Ce!=null),Ie=V.useRef(),He=V.useCallback(de=>{},[]),tt=Jr(Ie,w,S.ref,He),[Qe,ut]=V.useState(!1),Xe=ff(),le=Yd({props:i,muiFormControl:Xe,states:["color","disabled","error","hiddenLabel","size","required","filled"]});le.focused=Xe?Xe.focused:Qe,V.useEffect(()=>{!Xe&&d&&Qe&&(ut(!1),I&&I())},[Xe,d,Qe,I]);const De=Xe&&Xe.onFilled,Ee=Xe&&Xe.onEmpty,X=V.useCallback(de=>{qE(de)?De&&De():Ee&&Ee()},[De,Ee]);vl(()=>{Re&&X({value:Ce})},[Ce,X,Re]);const te=de=>{if(le.disabled){de.stopPropagation();return}B&&B(de),S.onFocus&&S.onFocus(de),Xe&&Xe.onFocus?Xe.onFocus(de):ut(!0)},me=de=>{I&&I(de),S.onBlur&&S.onBlur(de),Xe&&Xe.onBlur?Xe.onBlur(de):ut(!1)},we=(de,...ve)=>{if(!Re){const Se=de.target||Ie.current;if(Se==null)throw new Error(Od(1));X({value:Se.value})}S.onChange&&S.onChange(de,...ve),P&&P(de,...ve)};V.useEffect(()=>{X(Ie.current)},[]);const Ne=de=>{Ie.current&&de.currentTarget===de.target&&Ie.current.focus(),N&&N(de)};let Ue=v,We=S;A&&Ue==="input"&&($?We=ee({type:void 0,minRows:$,maxRows:$},We):We=ee({type:void 0,maxRows:E,minRows:T},We),Ue=Ble);const st=de=>{X(de.animationName==="mui-auto-fill-cancel"?Ie.current:{value:"x"})};V.useEffect(()=>{Xe&&Xe.setAdornedStart(!!ne)},[Xe,ne]);const z=ee({},i,{color:le.color||"primary",disabled:le.disabled,endAdornment:y,error:le.error,focused:le.focused,formControl:Xe,fullWidth:x,hiddenLabel:le.hiddenLabel,multiline:A,size:le.size,startAdornment:ne,type:re}),F=due(z),oe=U.root||u.Root||XM,ge=W.root||c.root||{},pe=U.input||u.Input||YM;return We=ee({},We,(r=W.input)!=null?r:c.input),k.jsxs(V.Fragment,{children:[!p&&hue,k.jsxs(oe,ee({},ge,!Vg(oe)&&{ownerState:ee({},z,ge.ownerState)},{ref:n,onClick:Ne},ce,{className:Mt(F.root,ge.className,l,J&&"MuiInputBase-readOnly"),children:[ne,k.jsx(NO.Provider,{value:null,children:k.jsx(pe,ee({ownerState:z,"aria-invalid":le.error,"aria-describedby":o,autoComplete:a,autoFocus:s,defaultValue:f,disabled:le.disabled,id:_,onAnimationStart:st,name:D,placeholder:j,readOnly:J,required:le.required,rows:$,value:Ce,onKeyDown:G,onKeyUp:Z,type:re},We,!Vg(pe)&&{as:Ue,ownerState:ee({},z,We.ownerState)},{ref:tt,className:Mt(F.input,We.className,J&&"MuiInputBase-readOnly"),onBlur:me,onChange:we,onFocus:te}))}),y,Y?Y(ee({},le,{startAdornment:ne})):null]}))]})}),OO=pue;function mue(t){return cn("MuiInput",t)}const gue=ee({},xs,an("MuiInput",["root","underline","input"])),fd=gue;function vue(t){return cn("MuiOutlinedInput",t)}const yue=ee({},xs,an("MuiOutlinedInput",["root","notchedOutline","input"])),Nu=yue;function xue(t){return cn("MuiFilledInput",t)}const bue=ee({},xs,an("MuiFilledInput",["root","underline","input"])),bs=bue,uH=uf(k.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function _ue(t){return cn("MuiAutocomplete",t)}const wue=an("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),kn=wue;var t8,n8;const Sue=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],Eue=["ref"],Mue=t=>{const{classes:e,disablePortal:n,expanded:r,focused:i,fullWidth:o,hasClearIcon:a,hasPopupIcon:s,inputFocused:l,popupOpen:u,size:c}=t,f={root:["root",r&&"expanded",i&&"focused",o&&"fullWidth",a&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${lt(c)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return fn(f,_ue,e)},Cue=mt("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{fullWidth:r,hasClearIcon:i,hasPopupIcon:o,inputFocused:a,size:s}=n;return[{[`& .${kn.tag}`]:e.tag},{[`& .${kn.tag}`]:e[`tagSize${lt(s)}`]},{[`& .${kn.inputRoot}`]:e.inputRoot},{[`& .${kn.input}`]:e.input},{[`& .${kn.input}`]:a&&e.inputFocused},e.root,r&&e.fullWidth,o&&e.hasPopupIcon,i&&e.hasClearIcon]}})(({ownerState:t})=>ee({[`&.${kn.focused} .${kn.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${kn.clearIndicator}`]:{visibility:"visible"}}},t.fullWidth&&{width:"100%"},{[`& .${kn.tag}`]:ee({margin:3,maxWidth:"calc(100% - 6px)"},t.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${kn.inputRoot}`]:{flexWrap:"wrap",[`.${kn.hasPopupIcon}&, .${kn.hasClearIcon}&`]:{paddingRight:26+4},[`.${kn.hasPopupIcon}.${kn.hasClearIcon}&`]:{paddingRight:52+4},[`& .${kn.input}`]:{width:0,minWidth:30}},[`& .${fd.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${fd.root}.${xs.sizeSmall}`]:{[`& .${fd.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Nu.root}`]:{padding:9,[`.${kn.hasPopupIcon}&, .${kn.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${kn.hasPopupIcon}.${kn.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${kn.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${kn.endAdornment}`]:{right:9}},[`& .${Nu.root}.${xs.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${kn.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${bs.root}`]:{paddingTop:19,paddingLeft:8,[`.${kn.hasPopupIcon}&, .${kn.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${kn.hasPopupIcon}.${kn.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${bs.input}`]:{padding:"7px 4px"},[`& .${kn.endAdornment}`]:{right:9}},[`& .${bs.root}.${xs.sizeSmall}`]:{paddingBottom:1,[`& .${bs.input}`]:{padding:"2.5px 4px"}},[`& .${xs.hiddenLabel}`]:{paddingTop:8},[`& .${bs.root}.${xs.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${kn.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${bs.root}.${xs.hiddenLabel}.${xs.sizeSmall}`]:{[`& .${kn.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${kn.input}`]:ee({flexGrow:1,textOverflow:"ellipsis",opacity:0},t.inputFocused&&{opacity:1})})),Aue=mt("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,e)=>e.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),Tue=mt(WM,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,e)=>e.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),Due=mt(WM,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:t},e)=>ee({},e.popupIndicator,t.popupOpen&&e.popupIndicatorOpen)})(({ownerState:t})=>ee({padding:2,marginRight:-2},t.popupOpen&&{transform:"rotate(180deg)"})),Rue=mt(sH,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${kn.option}`]:e.option},e.popper,n.disablePortal&&e.popperDisablePortal]}})(({theme:t,ownerState:e})=>ee({zIndex:(t.vars||t).zIndex.modal},e.disablePortal&&{position:"absolute"})),Pue=mt(Xp,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({theme:t})=>ee({},t.typography.body1,{overflow:"auto"})),Nue=mt("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,e)=>e.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),Oue=mt("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),Iue=mt("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${kn.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${kn.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${kn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Un(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${kn.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Un(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${kn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Un(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}})),Lue=mt(Kle,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,e)=>e.groupLabel})(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8})),Fue=mt("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,e)=>e.groupUl})({padding:0,[`& .${kn.option}`]:{paddingLeft:24}}),kue=V.forwardRef(function(e,n){var r,i,o,a;const s=pn({props:e,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:u=!1,autoSelect:c=!1,blurOnSelect:f=!1,ChipProps:d,className:p,clearIcon:y=t8||(t8=k.jsx(kae,{fontSize:"small"})),clearOnBlur:x=!s.freeSolo,clearOnEscape:_=!1,clearText:v="Clear",closeText:S="Close",componentsProps:w={},defaultValue:E=s.multiple?[]:null,disableClearable:T=!1,disableCloseOnSelect:A=!1,disabled:D=!1,disabledItemsFocusable:I=!1,disableListWrap:P=!1,disablePortal:N=!1,filterSelectedOptions:B=!1,forcePopupIcon:G="auto",freeSolo:Z=!1,fullWidth:j=!1,getLimitTagsText:J=it=>`+${it}`,getOptionLabel:Y,groupBy:$,handleHomeEndKeys:W=!s.freeSolo,includeInputInList:U=!1,limitTags:ne=-1,ListboxComponent:re="ul",ListboxProps:ue,loading:ce=!1,loadingText:Ce="Loading…",multiple:Re=!1,noOptionsText:Ie="No options",openOnFocus:He=!1,openText:tt="Open",PaperComponent:Qe=Xp,PopperComponent:ut=sH,popupIcon:Xe=n8||(n8=k.jsx(uH,{})),readOnly:le=!1,renderGroup:De,renderInput:Ee,renderOption:X,renderTags:te,selectOnFocus:me=!s.freeSolo,size:we="medium",slotProps:Ne={}}=s,Ue=_t(s,Sue),{getRootProps:We,getInputProps:st,getInputLabelProps:z,getPopupIndicatorProps:F,getClearProps:oe,getTagProps:ge,getListboxProps:pe,getOptionProps:de,value:ve,dirty:Se,expanded:Pe,id:Be,popupOpen:je,focused:Fe,focusedTag:xt,anchorEl:yt,setAnchorEl:bt,inputValue:Ct,groupedOptions:ht}=Hle(ee({},s,{componentName:"Autocomplete"})),jt=!T&&!D&&Se&&!le,be=(!Z||G===!0)&&G!==!1,{onMouseDown:gt}=st(),{ref:ct}=ue??{},Ye=pe(),{ref:pt}=Ye,Vt=_t(Ye,Eue),xn=Jr(pt,ct),Cr=Y||(it=>{var K;return(K=it.label)!=null?K:it}),sn=ee({},s,{disablePortal:N,expanded:Pe,focused:Fe,fullWidth:j,getOptionLabel:Cr,hasClearIcon:jt,hasPopupIcon:be,inputFocused:xt===-1,popupOpen:je,size:we}),Sn=Mue(sn);let ur;if(Re&&ve.length>0){const it=K=>ee({className:Sn.tag,disabled:D},ge(K));te?ur=te(ve,it,sn):ur=ve.map((K,_e)=>k.jsx(oue,ee({label:Cr(K),size:we},it({index:_e}),d)))}if(ne>-1&&Array.isArray(ur)){const it=ur.length-ne;!Fe&&it>0&&(ur=ur.splice(0,ne),ur.push(k.jsx("span",{className:Sn.tag,children:J(it)},ur.length)))}const Ea=De||(it=>k.jsxs("li",{children:[k.jsx(Lue,{className:Sn.groupLabel,ownerState:sn,component:"div",children:it.group}),k.jsx(Fue,{className:Sn.groupUl,ownerState:sn,children:it.children})]},it.key)),Ro=X||((it,K)=>k.jsx("li",ee({},it,{children:Cr(K)}))),Zo=(it,K)=>{const _e=de({option:it,index:K});return Ro(ee({},_e,{className:Sn.option}),it,{selected:_e["aria-selected"],index:K,inputValue:Ct},sn)},Po=(r=Ne.clearIndicator)!=null?r:w.clearIndicator,Jo=(i=Ne.paper)!=null?i:w.paper,Ze=(o=Ne.popper)!=null?o:w.popper,Ge=(a=Ne.popupIndicator)!=null?a:w.popupIndicator;return k.jsxs(V.Fragment,{children:[k.jsx(Cue,ee({ref:n,className:Mt(Sn.root,p),ownerState:sn},We(Ue),{children:Ee({id:Be,disabled:D,fullWidth:!0,size:we==="small"?"small":void 0,InputLabelProps:z(),InputProps:ee({ref:bt,className:Sn.inputRoot,startAdornment:ur,onClick:it=>{it.target===it.currentTarget&>(it)}},(jt||be)&&{endAdornment:k.jsxs(Aue,{className:Sn.endAdornment,ownerState:sn,children:[jt?k.jsx(Tue,ee({},oe(),{"aria-label":v,title:v,ownerState:sn},Po,{className:Mt(Sn.clearIndicator,Po==null?void 0:Po.className),children:y})):null,be?k.jsx(Due,ee({},F(),{disabled:D,"aria-label":je?S:tt,title:je?S:tt,ownerState:sn},Ge,{className:Mt(Sn.popupIndicator,Ge==null?void 0:Ge.className),children:Xe})):null]})}),inputProps:ee({className:Sn.input,disabled:D,readOnly:le},st())})})),yt?k.jsx(Rue,ee({as:ut,disablePortal:N,style:{width:yt?yt.clientWidth:null},ownerState:sn,role:"presentation",anchorEl:yt,open:je},Ze,{className:Mt(Sn.popper,Ze==null?void 0:Ze.className),children:k.jsxs(Pue,ee({ownerState:sn,as:Qe},Jo,{className:Mt(Sn.paper,Jo==null?void 0:Jo.className),children:[ce&&ht.length===0?k.jsx(Nue,{className:Sn.loading,ownerState:sn,children:Ce}):null,ht.length===0&&!Z&&!ce?k.jsx(Oue,{className:Sn.noOptions,ownerState:sn,role:"presentation",onMouseDown:it=>{it.preventDefault()},children:Ie}):null,ht.length>0?k.jsx(Iue,ee({as:re,className:Sn.listbox,ownerState:sn},Vt,ue,{ref:xn,children:ht.map((it,K)=>$?Ea({key:it.key,group:it.group,children:it.options.map((_e,Oe)=>Zo(_e,it.index+Oe))}):Zo(it,K))})):null]}))})):null]})}),cH=kue,Bue=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],Uue={entering:{opacity:1},entered:{opacity:1}},zue=V.forwardRef(function(e,n){const r=cb(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,easing:l,in:u,onEnter:c,onEntered:f,onEntering:d,onExit:p,onExited:y,onExiting:x,style:_,timeout:v=i,TransitionComponent:S=_O}=e,w=_t(e,Bue),E=V.useRef(null),T=Jr(E,s.ref,n),A=j=>J=>{if(j){const Y=E.current;J===void 0?j(Y):j(Y,J)}},D=A(d),I=A((j,J)=>{EO(j);const Y=Hg({style:_,timeout:v,easing:l},{mode:"enter"});j.style.webkitTransition=r.transitions.create("opacity",Y),j.style.transition=r.transitions.create("opacity",Y),c&&c(j,J)}),P=A(f),N=A(x),B=A(j=>{const J=Hg({style:_,timeout:v,easing:l},{mode:"exit"});j.style.webkitTransition=r.transitions.create("opacity",J),j.style.transition=r.transitions.create("opacity",J),p&&p(j)}),G=A(y),Z=j=>{o&&o(E.current,j)};return k.jsx(S,ee({appear:a,in:u,nodeRef:E,onEnter:I,onEntered:P,onEntering:D,onExit:B,onExited:G,onExiting:N,addEndListener:Z,timeout:v},w,{children:(j,J)=>V.cloneElement(s,ee({style:ee({opacity:0,visibility:j==="exited"&&!u?"hidden":void 0},Uue[j],_,s.props.style),ref:T},J))}))}),$ue=zue;function Hue(t){return cn("MuiBackdrop",t)}an("MuiBackdrop",["root","invisible"]);const Vue=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Wue=t=>{const{classes:e,invisible:n}=t;return fn({root:["root",n&&"invisible"]},Hue,e)},Gue=mt("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>ee({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"})),jue=V.forwardRef(function(e,n){var r,i,o;const a=pn({props:e,name:"MuiBackdrop"}),{children:s,className:l,component:u="div",components:c={},componentsProps:f={},invisible:d=!1,open:p,slotProps:y={},slots:x={},TransitionComponent:_=$ue,transitionDuration:v}=a,S=_t(a,Vue),w=ee({},a,{component:u,invisible:d}),E=Wue(w),T=(r=y.root)!=null?r:f.root;return k.jsx(_,ee({in:p,timeout:v},S,{children:k.jsx(Gue,ee({"aria-hidden":!0},T,{as:(i=(o=x.root)!=null?o:c.Root)!=null?i:u,className:Mt(E.root,l,T==null?void 0:T.className),ownerState:ee({},w,T==null?void 0:T.ownerState),classes:E,ref:n,children:s}))}))}),que=jue,Xue=X$(),Yue=qie({themeId:sb,defaultTheme:Xue,defaultClassName:"MuiBox-root",generateClassName:rO.generate}),tf=Yue;function Kue(t){return cn("MuiButton",t)}const Zue=an("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","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),ww=Zue,Jue=V.createContext({}),Que=Jue,ece=V.createContext(void 0),tce=ece,nce=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],rce=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:a}=t,s={root:["root",o,`${o}${lt(e)}`,`size${lt(i)}`,`${o}Size${lt(i)}`,e==="inherit"&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${lt(i)}`],endIcon:["endIcon",`iconSize${lt(i)}`]},l=fn(s,Kue,a);return ee({},a,l)},fH=t=>ee({},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}}),ice=mt(Fp,{shouldForwardProp:t=>Ao(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${lt(n.color)}`],e[`size${lt(n.size)}`],e[`${n.variant}Size${lt(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 ee({},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":ee({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Un(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})`:Un(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})`:Un(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":ee({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${ww.focusVisible}`]:ee({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${ww.disabled}`]:ee({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 ${Un(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"},[`&.${ww.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${ww.disabled}`]:{boxShadow:"none"}}),oce=mt("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${lt(n.size)}`]]}})(({ownerState:t})=>ee({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},fH(t))),ace=mt("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${lt(n.size)}`]]}})(({ownerState:t})=>ee({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},fH(t))),sce=V.forwardRef(function(e,n){const r=V.useContext(Que),i=V.useContext(tce),o=nO(r,e),a=pn({props:o,name:"MuiButton"}),{children:s,color:l="primary",component:u="button",className:c,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:p=!1,endIcon:y,focusVisibleClassName:x,fullWidth:_=!1,size:v="medium",startIcon:S,type:w,variant:E="text"}=a,T=_t(a,nce),A=ee({},a,{color:l,component:u,disabled:f,disableElevation:d,disableFocusRipple:p,fullWidth:_,size:v,type:w,variant:E}),D=rce(A),I=S&&k.jsx(oce,{className:D.startIcon,ownerState:A,children:S}),P=y&&k.jsx(ace,{className:D.endIcon,ownerState:A,children:y}),N=i||"";return k.jsxs(ice,ee({ownerState:A,className:Mt(r.className,D.root,c,N),component:u,disabled:f,focusRipple:!p,focusVisibleClassName:Mt(D.focusVisible,x),ref:n,type:w},T,{classes:D,children:[I,s,P]}))}),r8=sce;function lce(t){return cn("MuiCard",t)}an("MuiCard",["root"]);const uce=["className","raised"],cce=t=>{const{classes:e}=t;return fn({root:["root"]},lce,e)},fce=mt(Xp,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),dce=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,a=_t(r,uce),s=ee({},r,{raised:o}),l=cce(s);return k.jsx(fce,ee({className:Mt(l.root,i),elevation:o?8:void 0,ref:n,ownerState:s},a))}),KM=dce;function hce(t){return cn("MuiCardContent",t)}an("MuiCardContent",["root"]);const pce=["className","component"],mce=t=>{const{classes:e}=t;return fn({root:["root"]},hce,e)},gce=mt("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),vce=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,a=_t(r,pce),s=ee({},r,{component:o}),l=mce(s);return k.jsx(gce,ee({as:o,className:Mt(l.root,i),ownerState:s,ref:n},a))}),ZM=vce;function yce(t){return cn("PrivateSwitchBase",t)}an("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const xce=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],bce=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${lt(i)}`],input:["input"]};return fn(o,yce,e)},_ce=mt(Fp)(({ownerState:t})=>ee({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),wce=mt("input",{shouldForwardProp:Ao})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Sce=V.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:a,defaultChecked:s,disabled:l,disableFocusRipple:u=!1,edge:c=!1,icon:f,id:d,inputProps:p,inputRef:y,name:x,onBlur:_,onChange:v,onFocus:S,readOnly:w,required:E=!1,tabIndex:T,type:A,value:D}=e,I=_t(e,xce),[P,N]=Ed({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),B=ff(),G=U=>{S&&S(U),B&&B.onFocus&&B.onFocus(U)},Z=U=>{_&&_(U),B&&B.onBlur&&B.onBlur(U)},j=U=>{if(U.nativeEvent.defaultPrevented)return;const ne=U.target.checked;N(ne),v&&v(U,ne)};let J=l;B&&typeof J>"u"&&(J=B.disabled);const Y=A==="checkbox"||A==="radio",$=ee({},e,{checked:P,disabled:J,disableFocusRipple:u,edge:c}),W=bce($);return k.jsxs(_ce,ee({component:"span",className:Mt(W.root,a),centerRipple:!0,focusRipple:!u,disabled:J,tabIndex:null,role:void 0,onFocus:G,onBlur:Z,ownerState:$,ref:n},I,{children:[k.jsx(wce,ee({autoFocus:r,checked:i,defaultChecked:s,className:W.input,disabled:J,id:Y?d:void 0,name:x,onChange:j,readOnly:w,ref:y,required:E,ownerState:$,tabIndex:T,type:A},A==="checkbox"&&D===void 0?{}:{value:D},p)),P?o:f]}))}),dH=Sce,Ece=uf(k.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"),Mce=uf(k.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"),Cce=uf(k.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 Ace(t){return cn("MuiCheckbox",t)}const Tce=an("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),NT=Tce,Dce=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],Rce=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${lt(r)}`,`size${lt(i)}`]},a=fn(o,Ace,e);return ee({},e,a)},Pce=mt(dH,{shouldForwardProp:t=>Ao(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${lt(n.size)}`],n.color!=="default"&&e[`color${lt(n.color)}`]]}})(({theme:t,ownerState:e})=>ee({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})`:Un(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${NT.checked}, &.${NT.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${NT.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),Nce=k.jsx(Mce,{}),Oce=k.jsx(Ece,{}),Ice=k.jsx(Cce,{}),Lce=V.forwardRef(function(e,n){var r,i;const o=pn({props:e,name:"MuiCheckbox"}),{checkedIcon:a=Nce,color:s="primary",icon:l=Oce,indeterminate:u=!1,indeterminateIcon:c=Ice,inputProps:f,size:d="medium",className:p}=o,y=_t(o,Dce),x=u?c:l,_=u?c:a,v=ee({},o,{color:s,indeterminate:u,size:d}),S=Rce(v);return k.jsx(Pce,ee({type:"checkbox",inputProps:ee({"data-indeterminate":u},f),icon:V.cloneElement(x,{fontSize:(r=x.props.fontSize)!=null?r:d}),checkedIcon:V.cloneElement(_,{fontSize:(i=_.props.fontSize)!=null?i:d}),ownerState:v,ref:n,className:Mt(S.root,p)},y,{classes:S}))}),Uh=Lce;function Fce(t){return cn("MuiModal",t)}an("MuiModal",["root","hidden","backdrop"]);const kce=["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"],Bce=t=>{const{open:e,exited:n,classes:r}=t;return fn({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},Fce,r)},Uce=mt("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})=>ee({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),zce=mt(que,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),$ce=V.forwardRef(function(e,n){var r,i,o,a,s,l;const u=pn({name:"MuiModal",props:e}),{BackdropComponent:c=zce,BackdropProps:f,className:d,closeAfterTransition:p=!1,children:y,container:x,component:_,components:v={},componentsProps:S={},disableAutoFocus:w=!1,disableEnforceFocus:E=!1,disableEscapeKeyDown:T=!1,disablePortal:A=!1,disableRestoreFocus:D=!1,disableScrollLock:I=!1,hideBackdrop:P=!1,keepMounted:N=!1,onBackdropClick:B,open:G,slotProps:Z,slots:j}=u,J=_t(u,kce),Y=ee({},u,{closeAfterTransition:p,disableAutoFocus:w,disableEnforceFocus:E,disableEscapeKeyDown:T,disablePortal:A,disableRestoreFocus:D,disableScrollLock:I,hideBackdrop:P,keepMounted:N}),{getRootProps:$,getBackdropProps:W,getTransitionProps:U,portalRef:ne,isTopModal:re,exited:ue,hasTransition:ce}=Lle(ee({},Y,{rootRef:n})),Ce=ee({},Y,{exited:ue}),Re=Bce(Ce),Ie={};if(y.props.tabIndex===void 0&&(Ie.tabIndex="-1"),ce){const{onEnter:De,onExited:Ee}=U();Ie.onEnter=De,Ie.onExited=Ee}const He=(r=(i=j==null?void 0:j.root)!=null?i:v.Root)!=null?r:Uce,tt=(o=(a=j==null?void 0:j.backdrop)!=null?a:v.Backdrop)!=null?o:c,Qe=(s=Z==null?void 0:Z.root)!=null?s:S.root,ut=(l=Z==null?void 0:Z.backdrop)!=null?l:S.backdrop,Xe=kp({elementType:He,externalSlotProps:Qe,externalForwardedProps:J,getSlotProps:$,additionalProps:{ref:n,as:_},ownerState:Ce,className:Mt(d,Qe==null?void 0:Qe.className,Re==null?void 0:Re.root,!Ce.open&&Ce.exited&&(Re==null?void 0:Re.hidden))}),le=kp({elementType:tt,externalSlotProps:ut,additionalProps:f,getSlotProps:De=>W(ee({},De,{onClick:Ee=>{B&&B(Ee),De!=null&&De.onClick&&De.onClick(Ee)}})),className:Mt(ut==null?void 0:ut.className,f==null?void 0:f.className,Re==null?void 0:Re.backdrop),ownerState:Ce});return!N&&!G&&(!ce||ue)?null:k.jsx(aH,{ref:ne,container:x,disablePortal:A,children:k.jsxs(He,ee({},Xe,{children:[!P&&c?k.jsx(tt,ee({},le)):null,k.jsx(cse,{disableEnforceFocus:E,disableAutoFocus:w,disableRestoreFocus:D,isEnabled:re,open:G,children:V.cloneElement(y,Ie)})]}))})}),hH=$ce;function Hce(t){return cn("MuiDivider",t)}const Vce=an("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),i8=Vce,Wce=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],Gce=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=t;return fn({root:["root",e&&"absolute",l,o&&"light",a==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&a==="vertical"&&"withChildrenVertical",s==="right"&&a!=="vertical"&&"textAlignRight",s==="left"&&a!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",a==="vertical"&&"wrapperVertical"]},Hce,r)},jce=mt("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>ee({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:Un(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>ee({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>ee({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>ee({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>ee({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),qce=mt("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>ee({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),pH=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:a,component:s=o?"div":"hr",flexItem:l=!1,light:u=!1,orientation:c="horizontal",role:f=s!=="hr"?"separator":void 0,textAlign:d="center",variant:p="fullWidth"}=r,y=_t(r,Wce),x=ee({},r,{absolute:i,component:s,flexItem:l,light:u,orientation:c,role:f,textAlign:d,variant:p}),_=Gce(x);return k.jsx(jce,ee({as:s,className:Mt(_.root,a),role:f,ref:n,ownerState:x},y,{children:o?k.jsx(qce,{className:_.wrapper,ownerState:x,children:o}):null}))});pH.muiSkipListHighlight=!0;const bp=pH,Xce=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Yce(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=Zu(e);let a;if(e.fakeTransform)a=e.fakeTransform;else{const u=o.getComputedStyle(e);a=u.getPropertyValue("-webkit-transform")||u.getPropertyValue("transform")}let s=0,l=0;if(a&&a!=="none"&&typeof a=="string"){const u=a.split("(")[1].split(")")[0].split(",");s=parseInt(u[4],10),l=parseInt(u[5],10)}return t==="left"?i?`translateX(${i.right+s-r.left}px)`:`translateX(${o.innerWidth+s-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:t==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function Kce(t){return typeof t=="function"?t():t}function Sw(t,e,n){const r=Kce(n),i=Yce(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const Zce=V.forwardRef(function(e,n){const r=cb(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:l,container:u,direction:c="down",easing:f=i,in:d,onEnter:p,onEntered:y,onEntering:x,onExit:_,onExited:v,onExiting:S,style:w,timeout:E=o,TransitionComponent:T=_O}=e,A=_t(e,Xce),D=V.useRef(null),I=Jr(l.ref,D,n),P=W=>U=>{W&&(U===void 0?W(D.current):W(D.current,U))},N=P((W,U)=>{Sw(c,W,u),EO(W),p&&p(W,U)}),B=P((W,U)=>{const ne=Hg({timeout:E,style:w,easing:f},{mode:"enter"});W.style.webkitTransition=r.transitions.create("-webkit-transform",ee({},ne)),W.style.transition=r.transitions.create("transform",ee({},ne)),W.style.webkitTransform="none",W.style.transform="none",x&&x(W,U)}),G=P(y),Z=P(S),j=P(W=>{const U=Hg({timeout:E,style:w,easing:f},{mode:"exit"});W.style.webkitTransition=r.transitions.create("-webkit-transform",U),W.style.transition=r.transitions.create("transform",U),Sw(c,W,u),_&&_(W)}),J=P(W=>{W.style.webkitTransition="",W.style.transition="",v&&v(W)}),Y=W=>{a&&a(D.current,W)},$=V.useCallback(()=>{D.current&&Sw(c,D.current,u)},[c,u]);return V.useEffect(()=>{if(d||c==="down"||c==="right")return;const W=gM(()=>{D.current&&Sw(c,D.current,u)}),U=Zu(D.current);return U.addEventListener("resize",W),()=>{W.clear(),U.removeEventListener("resize",W)}},[c,d,u]),V.useEffect(()=>{d||$()},[d,$]),k.jsx(T,ee({nodeRef:D,onEnter:N,onEntered:G,onEntering:B,onExit:j,onExited:J,onExiting:Z,addEndListener:Y,appear:s,in:d,timeout:E},A,{children:(W,U)=>V.cloneElement(l,ee({ref:I,style:ee({visibility:W==="exited"&&!d?"hidden":void 0},w,l.props.style)},U))}))}),Jce=Zce;function Qce(t){return cn("MuiDrawer",t)}an("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const efe=["BackdropProps"],tfe=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],mH=(t,e)=>{const{ownerState:n}=t;return[e.root,(n.variant==="permanent"||n.variant==="persistent")&&e.docked,e.modal]},nfe=t=>{const{classes:e,anchor:n,variant:r}=t,i={root:["root"],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${lt(n)}`,r!=="temporary"&&`paperAnchorDocked${lt(n)}`]};return fn(i,Qce,e)},rfe=mt(hH,{name:"MuiDrawer",slot:"Root",overridesResolver:mH})(({theme:t})=>({zIndex:(t.vars||t).zIndex.drawer})),o8=mt("div",{shouldForwardProp:Ao,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:mH})({flex:"0 0 auto"}),ife=mt(Xp,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`paperAnchor${lt(n.anchor)}`],n.variant!=="temporary"&&e[`paperAnchorDocked${lt(n.anchor)}`]]}})(({theme:t,ownerState:e})=>ee({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},e.anchor==="left"&&{left:0},e.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="right"&&{right:0},e.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="left"&&e.variant!=="temporary"&&{borderRight:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="top"&&e.variant!=="temporary"&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="right"&&e.variant!=="temporary"&&{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="bottom"&&e.variant!=="temporary"&&{borderTop:`1px solid ${(t.vars||t).palette.divider}`})),gH={left:"right",right:"left",top:"down",bottom:"up"};function ofe(t){return["left","right"].indexOf(t)!==-1}function afe(t,e){return t.direction==="rtl"&&ofe(e)?gH[e]:e}const sfe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiDrawer"}),i=cb(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:s,children:l,className:u,elevation:c=16,hideBackdrop:f=!1,ModalProps:{BackdropProps:d}={},onClose:p,open:y=!1,PaperProps:x={},SlideProps:_,TransitionComponent:v=Jce,transitionDuration:S=o,variant:w="temporary"}=r,E=_t(r.ModalProps,efe),T=_t(r,tfe),A=V.useRef(!1);V.useEffect(()=>{A.current=!0},[]);const D=afe(i,a),P=ee({},r,{anchor:a,elevation:c,open:y,variant:w},T),N=nfe(P),B=k.jsx(ife,ee({elevation:w==="temporary"?c:0,square:!0},x,{className:Mt(N.paper,x.className),ownerState:P,children:l}));if(w==="permanent")return k.jsx(o8,ee({className:Mt(N.root,N.docked,u),ownerState:P,ref:n},T,{children:B}));const G=k.jsx(v,ee({in:y,direction:gH[D],timeout:S,appear:A.current},_,{children:B}));return w==="persistent"?k.jsx(o8,ee({className:Mt(N.root,N.docked,u),ownerState:P,ref:n},T,{children:G})):k.jsx(rfe,ee({BackdropProps:ee({},s,d,{transitionDuration:S}),className:Mt(N.root,N.modal,u),open:y,ownerState:P,onClose:p,hideBackdrop:f,ref:n},T,E,{children:G}))}),lfe=sfe,ufe=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],cfe=t=>{const{classes:e,disableUnderline:n}=t,i=fn({root:["root",!n&&"underline"],input:["input"]},xue,e);return ee({},e,i)},ffe=mt(XM,{shouldForwardProp:t=>Ao(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...jM(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)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return ee({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:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${bs.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${bs.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:s}},!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"},[`&.${bs.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${bs.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(.${bs.disabled}, .${bs.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${bs.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&ee({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17}))}),dfe=mt(YM,{name:"MuiFilledInput",slot:"Input",overridesResolver:qM})(({theme:t,ownerState:e})=>ee({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.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9})),vH=V.forwardRef(function(e,n){var r,i,o,a;const s=pn({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:u,fullWidth:c=!1,inputComponent:f="input",multiline:d=!1,slotProps:p,slots:y={},type:x="text"}=s,_=_t(s,ufe),v=ee({},s,{fullWidth:c,inputComponent:f,multiline:d,type:x}),S=cfe(s),w={root:{ownerState:v},input:{ownerState:v}},E=p??u?Go(p??u,w):w,T=(r=(i=y.root)!=null?i:l.Root)!=null?r:ffe,A=(o=(a=y.input)!=null?a:l.Input)!=null?o:dfe;return k.jsx(OO,ee({slots:{root:T,input:A},componentsProps:E,fullWidth:c,inputComponent:f,multiline:d,ref:n,type:x},_,{classes:S}))});vH.muiName="Input";const yH=vH;function hfe(t){return cn("MuiFormControl",t)}an("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const pfe=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],mfe=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${lt(n)}`,r&&"fullWidth"]};return fn(i,hfe,e)},gfe=mt("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>ee({},e.root,e[`margin${lt(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>ee({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%"})),vfe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiFormControl"}),{children:i,className:o,color:a="primary",component:s="div",disabled:l=!1,error:u=!1,focused:c,fullWidth:f=!1,hiddenLabel:d=!1,margin:p="none",required:y=!1,size:x="medium",variant:_="outlined"}=r,v=_t(r,pfe),S=ee({},r,{color:a,component:s,disabled:l,error:u,fullWidth:f,hiddenLabel:d,margin:p,required:y,size:x,variant:_}),w=mfe(S),[E,T]=V.useState(()=>{let Z=!1;return i&&V.Children.forEach(i,j=>{if(!C1(j,["Input","Select"]))return;const J=C1(j,["Select"])?j.props.input:j;J&&lue(J.props)&&(Z=!0)}),Z}),[A,D]=V.useState(()=>{let Z=!1;return i&&V.Children.forEach(i,j=>{C1(j,["Input","Select"])&&(qE(j.props,!0)||qE(j.props.inputProps,!0))&&(Z=!0)}),Z}),[I,P]=V.useState(!1);l&&I&&P(!1);const N=c!==void 0&&!l?c:I;let B;const G=V.useMemo(()=>({adornedStart:E,setAdornedStart:T,color:a,disabled:l,error:u,filled:A,focused:N,fullWidth:f,hiddenLabel:d,size:x,onBlur:()=>{P(!1)},onEmpty:()=>{D(!1)},onFilled:()=>{D(!0)},onFocus:()=>{P(!0)},registerEffect:B,required:y,variant:_}),[E,a,l,u,A,N,f,d,B,y,x,_]);return k.jsx(NO.Provider,{value:G,children:k.jsx(gfe,ee({as:s,ownerState:S,className:Mt(w.root,o),ref:n},v,{children:i}))})}),pl=vfe,yfe=q$({createStyledComponent:mt("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>pn({props:t,name:"MuiStack"})}),Wn=yfe;function xfe(t){return cn("MuiFormControlLabel",t)}const bfe=an("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),s1=bfe,_fe=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],wfe=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,a={root:["root",n&&"disabled",`labelPlacement${lt(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return fn(a,xfe,e)},Sfe=mt("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${s1.label}`]:e.label},e.root,e[`labelPlacement${lt(n.labelPlacement)}`]]}})(({theme:t,ownerState:e})=>ee({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${s1.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${s1.label}`]:{[`&.${s1.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),Efe=mt("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${s1.error}`]:{color:(t.vars||t).palette.error.main}})),Mfe=V.forwardRef(function(e,n){var r,i;const o=pn({props:e,name:"MuiFormControlLabel"}),{className:a,componentsProps:s={},control:l,disabled:u,disableTypography:c,label:f,labelPlacement:d="end",required:p,slotProps:y={}}=o,x=_t(o,_fe),_=ff(),v=(r=u??l.props.disabled)!=null?r:_==null?void 0:_.disabled,S=p??l.props.required,w={disabled:v,required:S};["checked","name","onChange","value","inputRef"].forEach(P=>{typeof l.props[P]>"u"&&typeof o[P]<"u"&&(w[P]=o[P])});const E=Yd({props:o,muiFormControl:_,states:["error"]}),T=ee({},o,{disabled:v,labelPlacement:d,required:S,error:E.error}),A=wfe(T),D=(i=y.typography)!=null?i:s.typography;let I=f;return I!=null&&I.type!==An&&!c&&(I=k.jsx(An,ee({component:"span"},D,{className:Mt(A.label,D==null?void 0:D.className),children:I}))),k.jsxs(Sfe,ee({className:Mt(A.root,a),ownerState:T,ref:n},x,{children:[V.cloneElement(l,w),S?k.jsxs(Wn,{direction:"row",alignItems:"center",children:[I,k.jsxs(Efe,{ownerState:T,"aria-hidden":!0,className:A.asterisk,children:[" ","*"]})]}):I]}))}),vs=Mfe;function Cfe(t){return cn("MuiFormGroup",t)}an("MuiFormGroup",["root","row","error"]);const Afe=["className","row"],Tfe=t=>{const{classes:e,row:n,error:r}=t;return fn({root:["root",n&&"row",r&&"error"]},Cfe,e)},Dfe=mt("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})(({ownerState:t})=>ee({display:"flex",flexDirection:"column",flexWrap:"wrap"},t.row&&{flexDirection:"row"})),Rfe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1}=r,a=_t(r,Afe),s=ff(),l=Yd({props:r,muiFormControl:s,states:["error"]}),u=ee({},r,{row:o,error:l.error}),c=Tfe(u);return k.jsx(Dfe,ee({className:Mt(c.root,i),ownerState:u,ref:n},a))}),xH=Rfe;function Pfe(t){return cn("MuiFormHelperText",t)}const Nfe=an("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),a8=Nfe;var s8;const Ofe=["children","className","component","disabled","error","filled","focused","margin","required","variant"],Ife=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:a,focused:s,required:l}=t,u={root:["root",i&&"disabled",o&&"error",r&&`size${lt(r)}`,n&&"contained",s&&"focused",a&&"filled",l&&"required"]};return fn(u,Pfe,e)},Lfe=mt("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${lt(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>ee({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${a8.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${a8.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),Ffe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:a="p"}=r,s=_t(r,Ofe),l=ff(),u=Yd({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),c=ee({},r,{component:a,contained:u.variant==="filled"||u.variant==="outlined",variant:u.variant,size:u.size,disabled:u.disabled,error:u.error,filled:u.filled,focused:u.focused,required:u.required}),f=Ife(c);return k.jsx(Lfe,ee({as:a,ownerState:c,className:Mt(f.root,o),ref:n},s,{children:i===" "?s8||(s8=k.jsx("span",{className:"notranslate",children:"​"})):i}))}),kfe=Ffe;function Bfe(t){return cn("MuiFormLabel",t)}const Ufe=an("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),N1=Ufe,zfe=["children","className","color","component","disabled","error","filled","focused","required"],$fe=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:a,required:s}=t,l={root:["root",`color${lt(n)}`,i&&"disabled",o&&"error",a&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",o&&"error"]};return fn(l,Bfe,e)},Hfe=mt("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>ee({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>ee({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${N1.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${N1.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${N1.error}`]:{color:(t.vars||t).palette.error.main}})),Vfe=mt("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${N1.error}`]:{color:(t.vars||t).palette.error.main}})),Wfe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:a="label"}=r,s=_t(r,zfe),l=ff(),u=Yd({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),c=ee({},r,{color:u.color||"primary",component:a,disabled:u.disabled,error:u.error,filled:u.filled,focused:u.focused,required:u.required}),f=$fe(c);return k.jsxs(Hfe,ee({as:a,ownerState:c,className:Mt(f.root,o),ref:n},s,{children:[i,u.required&&k.jsxs(Vfe,{ownerState:c,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),IO=Wfe,Gfe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function yR(t){return`scale(${t}, ${t**2})`}const jfe={entering:{opacity:1,transform:yR(1)},entered:{opacity:1,transform:"none"}},OT=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),bH=V.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:a,in:s,onEnter:l,onEntered:u,onEntering:c,onExit:f,onExited:d,onExiting:p,style:y,timeout:x="auto",TransitionComponent:_=_O}=e,v=_t(e,Gfe),S=V.useRef(),w=V.useRef(),E=cb(),T=V.useRef(null),A=Jr(T,o.ref,n),D=J=>Y=>{if(J){const $=T.current;Y===void 0?J($):J($,Y)}},I=D(c),P=D((J,Y)=>{EO(J);const{duration:$,delay:W,easing:U}=Hg({style:y,timeout:x,easing:a},{mode:"enter"});let ne;x==="auto"?(ne=E.transitions.getAutoHeightDuration(J.clientHeight),w.current=ne):ne=$,J.style.transition=[E.transitions.create("opacity",{duration:ne,delay:W}),E.transitions.create("transform",{duration:OT?ne:ne*.666,delay:W,easing:U})].join(","),l&&l(J,Y)}),N=D(u),B=D(p),G=D(J=>{const{duration:Y,delay:$,easing:W}=Hg({style:y,timeout:x,easing:a},{mode:"exit"});let U;x==="auto"?(U=E.transitions.getAutoHeightDuration(J.clientHeight),w.current=U):U=Y,J.style.transition=[E.transitions.create("opacity",{duration:U,delay:$}),E.transitions.create("transform",{duration:OT?U:U*.666,delay:OT?$:$||U*.333,easing:W})].join(","),J.style.opacity=0,J.style.transform=yR(.75),f&&f(J)}),Z=D(d),j=J=>{x==="auto"&&(S.current=setTimeout(J,w.current||0)),r&&r(T.current,J)};return V.useEffect(()=>()=>{clearTimeout(S.current)},[]),k.jsx(_,ee({appear:i,in:s,nodeRef:T,onEnter:P,onEntered:N,onEntering:I,onExit:G,onExited:Z,onExiting:B,addEndListener:j,timeout:x==="auto"?null:x},v,{children:(J,Y)=>V.cloneElement(o,ee({style:ee({opacity:0,transform:yR(.75),visibility:J==="exited"&&!s?"hidden":void 0},jfe[J],y,o.props.style),ref:A},Y))}))});bH.muiSupportAuto=!0;const qfe=bH,Xfe=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],Yfe=t=>{const{classes:e,disableUnderline:n}=t,i=fn({root:["root",!n&&"underline"],input:["input"]},mue,e);return ee({},e,i)},Kfe=mt(XM,{shouldForwardProp:t=>Ao(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...jM(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})`),ee({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"},[`&.${fd.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${fd.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(.${fd.disabled}, .${fd.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${fd.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Zfe=mt(YM,{name:"MuiInput",slot:"Input",overridesResolver:qM})({}),_H=V.forwardRef(function(e,n){var r,i,o,a;const s=pn({props:e,name:"MuiInput"}),{disableUnderline:l,components:u={},componentsProps:c,fullWidth:f=!1,inputComponent:d="input",multiline:p=!1,slotProps:y,slots:x={},type:_="text"}=s,v=_t(s,Xfe),S=Yfe(s),E={root:{ownerState:{disableUnderline:l}}},T=y??c?Go(y??c,E):E,A=(r=(i=x.root)!=null?i:u.Root)!=null?r:Kfe,D=(o=(a=x.input)!=null?a:u.Input)!=null?o:Zfe;return k.jsx(OO,ee({slots:{root:A,input:D},slotProps:T,fullWidth:f,inputComponent:d,multiline:p,ref:n,type:_},v,{classes:S}))});_H.muiName="Input";const wH=_H;function Jfe(t){return cn("MuiInputLabel",t)}an("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Qfe=["disableAnimation","margin","shrink","variant","className"],ede=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:a,required:s}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${lt(r)}`,a],asterisk:[s&&"asterisk"]},u=fn(l,Jfe,e);return ee({},e,u)},tde=mt(IO,{shouldForwardProp:t=>Ao(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${N1.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})=>ee({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"&&ee({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&&ee({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"&&ee({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)"}))),nde=V.forwardRef(function(e,n){const r=pn({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:a}=r,s=_t(r,Qfe),l=ff();let u=o;typeof u>"u"&&l&&(u=l.filled||l.focused||l.adornedStart);const c=Yd({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=ee({},r,{disableAnimation:i,formControl:l,shrink:u,size:c.size,variant:c.variant,required:c.required,focused:c.focused}),d=ede(f);return k.jsx(tde,ee({"data-shrink":u,ownerState:f,ref:n,className:Mt(d.root,a)},s,{classes:d}))}),Wu=nde,rde=V.createContext({}),_p=rde;function ide(t){return cn("MuiList",t)}an("MuiList",["root","padding","dense","subheader"]);const ode=["children","className","component","dense","disablePadding","subheader"],ade=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return fn({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},ide,e)},sde=mt("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})=>ee({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),lde=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiList"}),{children:i,className:o,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:u}=r,c=_t(r,ode),f=V.useMemo(()=>({dense:s}),[s]),d=ee({},r,{component:a,dense:s,disablePadding:l}),p=ade(d);return k.jsx(_p.Provider,{value:f,children:k.jsxs(sde,ee({as:a,className:Mt(p.root,o),ref:n,ownerState:d},c,{children:[u,i]}))})}),SH=lde;function ude(t){return cn("MuiListItem",t)}const cde=an("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),D0=cde,fde=an("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),dde=fde;function hde(t){return cn("MuiListItemSecondaryAction",t)}an("MuiListItemSecondaryAction",["root","disableGutters"]);const pde=["className"],mde=t=>{const{disableGutters:e,classes:n}=t;return fn({root:["root",e&&"disableGutters"]},hde,n)},gde=mt("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})(({ownerState:t})=>ee({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),EH=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,o=_t(r,pde),a=V.useContext(_p),s=ee({},r,{disableGutters:a.disableGutters}),l=mde(s);return k.jsx(gde,ee({className:Mt(l.root,i),ownerState:s,ref:n},o))});EH.muiName="ListItemSecondaryAction";const vde=EH,yde=["className"],xde=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],bde=(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]},_de=t=>{const{alignItems:e,button:n,classes:r,dense:i,disabled:o,disableGutters:a,disablePadding:s,divider:l,hasSecondaryAction:u,selected:c}=t;return fn({root:["root",i&&"dense",!a&&"gutters",!s&&"padding",l&&"divider",o&&"disabled",n&&"button",e==="flex-start"&&"alignItemsFlexStart",u&&"secondaryAction",c&&"selected"],container:["container"]},ude,r)},wde=mt("div",{name:"MuiListItem",slot:"Root",overridesResolver:bde})(({theme:t,ownerState:e})=>ee({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&ee({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${dde.root}`]:{paddingRight:48}},{[`&.${D0.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${D0.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Un(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${D0.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Un(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${D0.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"}},[`&.${D0.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Un(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})`:Un(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),Sde=mt("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),Ede=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiListItem"}),{alignItems:i="center",autoFocus:o=!1,button:a=!1,children:s,className:l,component:u,components:c={},componentsProps:f={},ContainerComponent:d="li",ContainerProps:{className:p}={},dense:y=!1,disabled:x=!1,disableGutters:_=!1,disablePadding:v=!1,divider:S=!1,focusVisibleClassName:w,secondaryAction:E,selected:T=!1,slotProps:A={},slots:D={}}=r,I=_t(r.ContainerProps,yde),P=_t(r,xde),N=V.useContext(_p),B=V.useMemo(()=>({dense:y||N.dense||!1,alignItems:i,disableGutters:_}),[i,N.dense,y,_]),G=V.useRef(null);vl(()=>{o&&G.current&&G.current.focus()},[o]);const Z=V.Children.toArray(s),j=Z.length&&C1(Z[Z.length-1],["ListItemSecondaryAction"]),J=ee({},r,{alignItems:i,autoFocus:o,button:a,dense:B.dense,disabled:x,disableGutters:_,disablePadding:v,divider:S,hasSecondaryAction:j,selected:T}),Y=_de(J),$=Jr(G,n),W=D.root||c.Root||wde,U=A.root||f.root||{},ne=ee({className:Mt(Y.root,U.className,l),disabled:x},P);let re=u||"li";return a&&(ne.component=u||"div",ne.focusVisibleClassName=Mt(D0.focusVisible,w),re=Fp),j?(re=!ne.component&&!u?"div":re,d==="li"&&(re==="li"?re="div":ne.component==="li"&&(ne.component="div")),k.jsx(_p.Provider,{value:B,children:k.jsxs(Sde,ee({as:d,className:Mt(Y.container,p),ref:$,ownerState:J},I,{children:[k.jsx(W,ee({},U,!Vg(W)&&{as:re,ownerState:ee({},J,U.ownerState)},ne,{children:Z})),Z.pop()]}))})):k.jsx(_p.Provider,{value:B,children:k.jsxs(W,ee({},U,{as:re,ref:$},!Vg(W)&&{ownerState:ee({},J,U.ownerState)},ne,{children:[Z,E&&k.jsx(vde,{children:E})]}))})}),Mde=Ede,Cde=an("MuiListItemIcon",["root","alignItemsFlexStart"]),l8=Cde,Ade=an("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),u8=Ade,Tde=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function IT(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function c8(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function MH(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 Ny(t,e,n,r,i,o){let a=!1,s=i(t,e,e?n:!1);for(;s;){if(s===t.firstChild){if(a)return!1;a=!0}const l=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!MH(s,o)||l)s=i(t,s,n);else return s.focus(),!0}return!1}const Dde=V.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:c,variant:f="selectedMenu"}=e,d=_t(e,Tde),p=V.useRef(null),y=V.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});vl(()=>{i&&p.current.focus()},[i]),V.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(w,E)=>{const T=!p.current.style.width;if(w.clientHeight{const E=p.current,T=w.key,A=jo(E).activeElement;if(T==="ArrowDown")w.preventDefault(),Ny(E,A,u,l,IT);else if(T==="ArrowUp")w.preventDefault(),Ny(E,A,u,l,c8);else if(T==="Home")w.preventDefault(),Ny(E,null,u,l,IT);else if(T==="End")w.preventDefault(),Ny(E,null,u,l,c8);else if(T.length===1){const D=y.current,I=T.toLowerCase(),P=performance.now();D.keys.length>0&&(P-D.lastTime>500?(D.keys=[],D.repeating=!0,D.previousKeyMatched=!0):D.repeating&&I!==D.keys[0]&&(D.repeating=!1)),D.lastTime=P,D.keys.push(I);const N=A&&!D.repeating&&MH(A,D);D.previousKeyMatched&&(N||Ny(E,A,!1,l,IT,D))?w.preventDefault():D.previousKeyMatched=!1}c&&c(w)},_=Jr(p,n);let v=-1;V.Children.forEach(a,(w,E)=>{if(!V.isValidElement(w)){v===E&&(v+=1,v>=a.length&&(v=-1));return}w.props.disabled||(f==="selectedMenu"&&w.props.selected||v===-1)&&(v=E),v===E&&(w.props.disabled||w.props.muiSkipListHighlight||w.type.muiSkipListHighlight)&&(v+=1,v>=a.length&&(v=-1))});const S=V.Children.map(a,(w,E)=>{if(E===v){const T={};return o&&(T.autoFocus=!0),w.props.tabIndex===void 0&&f==="selectedMenu"&&(T.tabIndex=0),V.cloneElement(w,T)}return w});return k.jsx(SH,ee({role:"menu",ref:_,className:s,onKeyDown:x,tabIndex:i?0:-1},d,{children:S}))}),Rde=Dde;function Pde(t){return cn("MuiPopover",t)}an("MuiPopover",["root","paper"]);const Nde=["onEntering"],Ode=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],Ide=["slotProps"];function f8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function d8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function h8(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function LT(t){return typeof t=="function"?t():t}const Lde=t=>{const{classes:e}=t;return fn({root:["root"],paper:["paper"]},Pde,e)},Fde=mt(hH,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),CH=mt(Xp,{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}),kde=V.forwardRef(function(e,n){var r,i,o;const a=pn({props:e,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:u={vertical:"top",horizontal:"left"},anchorPosition:c,anchorReference:f="anchorEl",children:d,className:p,container:y,elevation:x=8,marginThreshold:_=16,open:v,PaperProps:S={},slots:w,slotProps:E,transformOrigin:T={vertical:"top",horizontal:"left"},TransitionComponent:A=qfe,transitionDuration:D="auto",TransitionProps:{onEntering:I}={},disableScrollLock:P=!1}=a,N=_t(a.TransitionProps,Nde),B=_t(a,Ode),G=(r=E==null?void 0:E.paper)!=null?r:S,Z=V.useRef(),j=Jr(Z,G.ref),J=ee({},a,{anchorOrigin:u,anchorReference:f,elevation:x,marginThreshold:_,externalPaperSlotProps:G,transformOrigin:T,TransitionComponent:A,transitionDuration:D,TransitionProps:N}),Y=Lde(J),$=V.useCallback(()=>{if(f==="anchorPosition")return c;const De=LT(l),X=(De&&De.nodeType===1?De:jo(Z.current).body).getBoundingClientRect();return{top:X.top+f8(X,u.vertical),left:X.left+d8(X,u.horizontal)}},[l,u.horizontal,u.vertical,c,f]),W=V.useCallback(De=>({vertical:f8(De,T.vertical),horizontal:d8(De,T.horizontal)}),[T.horizontal,T.vertical]),U=V.useCallback(De=>{const Ee={width:De.offsetWidth,height:De.offsetHeight},X=W(Ee);if(f==="none")return{top:null,left:null,transformOrigin:h8(X)};const te=$();let me=te.top-X.vertical,we=te.left-X.horizontal;const Ne=me+Ee.height,Ue=we+Ee.width,We=Zu(LT(l)),st=We.innerHeight-_,z=We.innerWidth-_;if(_!==null&&me<_){const F=me-_;me-=F,X.vertical+=F}else if(_!==null&&Ne>st){const F=Ne-st;me-=F,X.vertical+=F}if(_!==null&&we<_){const F=we-_;we-=F,X.horizontal+=F}else if(Ue>z){const F=Ue-z;we-=F,X.horizontal+=F}return{top:`${Math.round(me)}px`,left:`${Math.round(we)}px`,transformOrigin:h8(X)}},[l,f,$,W,_]),[ne,re]=V.useState(v),ue=V.useCallback(()=>{const De=Z.current;if(!De)return;const Ee=U(De);Ee.top!==null&&(De.style.top=Ee.top),Ee.left!==null&&(De.style.left=Ee.left),De.style.transformOrigin=Ee.transformOrigin,re(!0)},[U]);V.useEffect(()=>(P&&window.addEventListener("scroll",ue),()=>window.removeEventListener("scroll",ue)),[l,P,ue]);const ce=(De,Ee)=>{I&&I(De,Ee),ue()},Ce=()=>{re(!1)};V.useEffect(()=>{v&&ue()}),V.useImperativeHandle(s,()=>v?{updatePosition:()=>{ue()}}:null,[v,ue]),V.useEffect(()=>{if(!v)return;const De=gM(()=>{ue()}),Ee=Zu(l);return Ee.addEventListener("resize",De),()=>{De.clear(),Ee.removeEventListener("resize",De)}},[l,v,ue]);let Re=D;D==="auto"&&!A.muiSupportAuto&&(Re=void 0);const Ie=y||(l?jo(LT(l)).body:void 0),He=(i=w==null?void 0:w.root)!=null?i:Fde,tt=(o=w==null?void 0:w.paper)!=null?o:CH,Qe=kp({elementType:tt,externalSlotProps:ee({},G,{style:ne?G.style:ee({},G.style,{opacity:0})}),additionalProps:{elevation:x,ref:j},ownerState:J,className:Mt(Y.paper,G==null?void 0:G.className)}),ut=kp({elementType:He,externalSlotProps:(E==null?void 0:E.root)||{},externalForwardedProps:B,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:Ie,open:v},ownerState:J,className:Mt(Y.root,p)}),{slotProps:Xe}=ut,le=_t(ut,Ide);return k.jsx(He,ee({},le,!Vg(He)&&{slotProps:Xe,disableScrollLock:P},{children:k.jsx(A,ee({appear:!0,in:v,onEntering:ce,onExited:Ce,timeout:Re},N,{children:k.jsx(tt,ee({},Qe,{children:d}))}))}))}),AH=kde;function Bde(t){return cn("MuiMenu",t)}an("MuiMenu",["root","paper","list"]);const Ude=["onEntering"],zde=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],$de={vertical:"top",horizontal:"right"},Hde={vertical:"top",horizontal:"left"},Vde=t=>{const{classes:e}=t;return fn({root:["root"],paper:["paper"],list:["list"]},Bde,e)},Wde=mt(AH,{shouldForwardProp:t=>Ao(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Gde=mt(CH,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),jde=mt(Rde,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),qde=V.forwardRef(function(e,n){var r,i;const o=pn({props:e,name:"MuiMenu"}),{autoFocus:a=!0,children:s,className:l,disableAutoFocusItem:u=!1,MenuListProps:c={},onClose:f,open:d,PaperProps:p={},PopoverClasses:y,transitionDuration:x="auto",TransitionProps:{onEntering:_}={},variant:v="selectedMenu",slots:S={},slotProps:w={}}=o,E=_t(o.TransitionProps,Ude),T=_t(o,zde),A=cb(),D=A.direction==="rtl",I=ee({},o,{autoFocus:a,disableAutoFocusItem:u,MenuListProps:c,onEntering:_,PaperProps:p,transitionDuration:x,TransitionProps:E,variant:v}),P=Vde(I),N=a&&!u&&d,B=V.useRef(null),G=(U,ne)=>{B.current&&B.current.adjustStyleForScrollbar(U,A),_&&_(U,ne)},Z=U=>{U.key==="Tab"&&(U.preventDefault(),f&&f(U,"tabKeyDown"))};let j=-1;V.Children.map(s,(U,ne)=>{V.isValidElement(U)&&(U.props.disabled||(v==="selectedMenu"&&U.props.selected||j===-1)&&(j=ne))});const J=(r=S.paper)!=null?r:Gde,Y=(i=w.paper)!=null?i:p,$=kp({elementType:S.root,externalSlotProps:w.root,ownerState:I,className:[P.root,l]}),W=kp({elementType:J,externalSlotProps:Y,ownerState:I,className:P.paper});return k.jsx(Wde,ee({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:D?"right":"left"},transformOrigin:D?$de:Hde,slots:{paper:J,root:S.root},slotProps:{root:$,paper:W},open:d,ref:n,transitionDuration:x,TransitionProps:ee({onEntering:G},E),ownerState:I},T,{classes:y,children:k.jsx(jde,ee({onKeyDown:Z,actions:B,autoFocus:a&&(j===-1||u),autoFocusItem:N,variant:v},c,{className:Mt(P.list,c.className),children:s}))}))}),Xde=qde;function Yde(t){return cn("MuiMenuItem",t)}const Kde=an("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Oy=Kde,Zde=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],Jde=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},Qde=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=t,l=fn({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},Yde,a);return ee({},a,l)},ehe=mt(Fp,{shouldForwardProp:t=>Ao(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:Jde})(({theme:t,ownerState:e})=>ee({},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"}},[`&.${Oy.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Un(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Oy.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Un(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Oy.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Un(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})`:Un(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Oy.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Oy.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${i8.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${i8.inset}`]:{marginLeft:52},[`& .${u8.root}`]:{marginTop:0,marginBottom:0},[`& .${u8.inset}`]:{paddingLeft:36},[`& .${l8.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&ee({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${l8.root} svg`]:{fontSize:"1.25rem"}}))),the=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:u,role:c="menuitem",tabIndex:f,className:d}=r,p=_t(r,Zde),y=V.useContext(_p),x=V.useMemo(()=>({dense:a||y.dense||!1,disableGutters:l}),[y.dense,a,l]),_=V.useRef(null);vl(()=>{i&&_.current&&_.current.focus()},[i]);const v=ee({},r,{dense:x.dense,divider:s,disableGutters:l}),S=Qde(r),w=Jr(_,n);let E;return r.disabled||(E=f!==void 0?f:-1),k.jsx(_p.Provider,{value:x,children:k.jsx(ehe,ee({ref:w,role:c,tabIndex:E,component:o,focusVisibleClassName:Mt(S.focusVisible,u),className:Mt(S.root,d)},p,{ownerState:v,classes:S}))})}),oo=the;function nhe(t){return cn("MuiNativeSelect",t)}const rhe=an("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),LO=rhe,ihe=["className","disabled","error","IconComponent","inputRef","variant"],ohe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${lt(n)}`,o&&"iconOpen",r&&"disabled"]};return fn(s,nhe,e)},TH=({ownerState:t,theme:e})=>ee({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":ee({},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"},[`&.${LO.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}}),ahe=mt("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Ao,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${LO.multiple}`]:e.multiple}]}})(TH),DH=({ownerState:t,theme:e})=>ee({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${LO.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),she=mt("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${lt(n.variant)}`],n.open&&e.iconOpen]}})(DH),lhe=V.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:a,inputRef:s,variant:l="standard"}=e,u=_t(e,ihe),c=ee({},e,{disabled:i,variant:l,error:o}),f=ohe(c);return k.jsxs(V.Fragment,{children:[k.jsx(ahe,ee({ownerState:c,className:Mt(f.select,r),disabled:i,ref:s||n},u)),e.multiple?null:k.jsx(she,{as:a,ownerState:c,className:f.icon})]})}),uhe=lhe;var p8;const che=["children","classes","className","label","notched"],fhe=mt("fieldset",{shouldForwardProp:Ao})({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%"}),dhe=mt("legend",{shouldForwardProp:Ao})(({ownerState:t,theme:e})=>ee({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&&ee({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 hhe(t){const{className:e,label:n,notched:r}=t,i=_t(t,che),o=n!=null&&n!=="",a=ee({},t,{notched:r,withLabel:o});return k.jsx(fhe,ee({"aria-hidden":!0,className:e,ownerState:a},i,{children:k.jsx(dhe,{ownerState:a,children:o?k.jsx("span",{children:n}):p8||(p8=k.jsx("span",{className:"notranslate",children:"​"}))})}))}const phe=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],mhe=t=>{const{classes:e}=t,r=fn({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},vue,e);return ee({},e,r)},ghe=mt(XM,{shouldForwardProp:t=>Ao(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:jM})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return ee({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Nu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Nu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Nu.focused} .${Nu.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${Nu.error} .${Nu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Nu.disabled} .${Nu.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&ee({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),vhe=mt(hhe,{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}}),yhe=mt(YM,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:qM})(({theme:t,ownerState:e})=>ee({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})),RH=V.forwardRef(function(e,n){var r,i,o,a,s;const l=pn({props:e,name:"MuiOutlinedInput"}),{components:u={},fullWidth:c=!1,inputComponent:f="input",label:d,multiline:p=!1,notched:y,slots:x={},type:_="text"}=l,v=_t(l,phe),S=mhe(l),w=ff(),E=Yd({props:l,muiFormControl:w,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),T=ee({},l,{color:E.color||"primary",disabled:E.disabled,error:E.error,focused:E.focused,formControl:w,fullWidth:c,hiddenLabel:E.hiddenLabel,multiline:p,size:E.size,type:_}),A=(r=(i=x.root)!=null?i:u.Root)!=null?r:ghe,D=(o=(a=x.input)!=null?a:u.Input)!=null?o:yhe;return k.jsx(OO,ee({slots:{root:A,input:D},renderSuffix:I=>k.jsx(vhe,{ownerState:T,className:S.notchedOutline,label:d!=null&&d!==""&&E.required?s||(s=k.jsxs(V.Fragment,{children:[d," ","*"]})):d,notched:typeof y<"u"?y:!!(I.startAdornment||I.filled||I.focused)}),fullWidth:c,inputComponent:f,multiline:p,ref:n,type:_},v,{classes:ee({},S,{notchedOutline:null})}))});RH.muiName="Input";const PH=RH,xhe=uf(k.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),bhe=uf(k.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),_he=mt("span",{shouldForwardProp:Ao})({position:"relative",display:"flex"}),whe=mt(xhe)({transform:"scale(1)"}),She=mt(bhe)(({theme:t,ownerState:e})=>ee({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest})},e.checked&&{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}));function NH(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i=ee({},t,{checked:e});return k.jsxs(_he,{className:n.root,ownerState:i,children:[k.jsx(whe,{fontSize:r,className:n.background,ownerState:i}),k.jsx(She,{fontSize:r,className:n.dot,ownerState:i})]})}const Ehe=V.createContext(void 0),OH=Ehe;function Mhe(){return V.useContext(OH)}function Che(t){return cn("MuiRadio",t)}const Ahe=an("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),m8=Ahe,The=["checked","checkedIcon","color","icon","name","onChange","size","className"],Dhe=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${lt(n)}`,r!=="medium"&&`size${lt(r)}`]};return ee({},e,fn(i,Che,e))},Rhe=mt(dH,{shouldForwardProp:t=>Ao(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${lt(n.size)}`],e[`color${lt(n.color)}`]]}})(({theme:t,ownerState:e})=>ee({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})`:Un(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${m8.checked}`]:{color:(t.vars||t).palette[e.color].main}},{[`&.${m8.disabled}`]:{color:(t.vars||t).palette.action.disabled}}));function Phe(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const g8=k.jsx(NH,{checked:!0}),v8=k.jsx(NH,{}),Nhe=V.forwardRef(function(e,n){var r,i;const o=pn({props:e,name:"MuiRadio"}),{checked:a,checkedIcon:s=g8,color:l="primary",icon:u=v8,name:c,onChange:f,size:d="medium",className:p}=o,y=_t(o,The),x=ee({},o,{color:l,size:d}),_=Dhe(x),v=Mhe();let S=a;const w=zE(f,v&&v.onChange);let E=c;return v&&(typeof S>"u"&&(S=Phe(v.value,o.value)),typeof E>"u"&&(E=v.name)),k.jsx(Rhe,ee({type:"radio",icon:V.cloneElement(u,{fontSize:(r=v8.props.fontSize)!=null?r:d}),checkedIcon:V.cloneElement(s,{fontSize:(i=g8.props.fontSize)!=null?i:d}),ownerState:x,classes:_,name:E,checked:S,onChange:w,ref:n,className:Mt(_.root,p)},y))}),Mg=Nhe,Ohe=["actions","children","defaultValue","name","onChange","value"],Ihe=V.forwardRef(function(e,n){const{actions:r,children:i,defaultValue:o,name:a,onChange:s,value:l}=e,u=_t(e,Ohe),c=V.useRef(null),[f,d]=Ed({controlled:l,default:o,name:"RadioGroup"});V.useImperativeHandle(r,()=>({focus:()=>{let _=c.current.querySelector("input:not(:disabled):checked");_||(_=c.current.querySelector("input:not(:disabled)")),_&&_.focus()}}),[]);const p=Jr(n,c),y=ab(a),x=V.useMemo(()=>({name:y,onChange(_){d(_.target.value),s&&s(_,_.target.value)},value:f}),[y,s,d,f]);return k.jsx(OH.Provider,{value:x,children:k.jsx(xH,ee({role:"radiogroup",ref:p},u,{children:i}))})}),IH=Ihe;function Lhe(t){return cn("MuiSelect",t)}const Fhe=an("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Iy=Fhe;var y8;const khe=["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"],Bhe=mt("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${Iy.select}`]:e.select},{[`&.${Iy.select}`]:e[n.variant]},{[`&.${Iy.error}`]:e.error},{[`&.${Iy.multiple}`]:e.multiple}]}})(TH,{[`&.${Iy.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Uhe=mt("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${lt(n.variant)}`],n.open&&e.iconOpen]}})(DH),zhe=mt("input",{shouldForwardProp:t=>Woe(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 x8(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function $he(t){return t==null||typeof t=="string"&&!t.trim()}const Hhe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${lt(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return fn(s,Lhe,e)},Vhe=V.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":o,autoFocus:a,autoWidth:s,children:l,className:u,defaultOpen:c,defaultValue:f,disabled:d,displayEmpty:p,error:y=!1,IconComponent:x,inputRef:_,labelId:v,MenuProps:S={},multiple:w,name:E,onBlur:T,onChange:A,onClose:D,onFocus:I,onOpen:P,open:N,readOnly:B,renderValue:G,SelectDisplayProps:Z={},tabIndex:j,value:J,variant:Y="standard"}=e,$=_t(e,khe),[W,U]=Ed({controlled:J,default:f,name:"Select"}),[ne,re]=Ed({controlled:N,default:c,name:"Select"}),ue=V.useRef(null),ce=V.useRef(null),[Ce,Re]=V.useState(null),{current:Ie}=V.useRef(N!=null),[He,tt]=V.useState(),Qe=Jr(n,_),ut=V.useCallback(je=>{ce.current=je,je&&Re(je)},[]),Xe=Ce==null?void 0:Ce.parentNode;V.useImperativeHandle(Qe,()=>({focus:()=>{ce.current.focus()},node:ue.current,value:W}),[W]),V.useEffect(()=>{c&&ne&&Ce&&!Ie&&(tt(s?null:Xe.clientWidth),ce.current.focus())},[Ce,s]),V.useEffect(()=>{a&&ce.current.focus()},[a]),V.useEffect(()=>{if(!v)return;const je=jo(ce.current).getElementById(v);if(je){const Fe=()=>{getSelection().isCollapsed&&ce.current.focus()};return je.addEventListener("click",Fe),()=>{je.removeEventListener("click",Fe)}}},[v]);const le=(je,Fe)=>{je?P&&P(Fe):D&&D(Fe),Ie||(tt(s?null:Xe.clientWidth),re(je))},De=je=>{je.button===0&&(je.preventDefault(),ce.current.focus(),le(!0,je))},Ee=je=>{le(!1,je)},X=V.Children.toArray(l),te=je=>{const Fe=X.find(xt=>xt.props.value===je.target.value);Fe!==void 0&&(U(Fe.props.value),A&&A(je,Fe))},me=je=>Fe=>{let xt;if(Fe.currentTarget.hasAttribute("tabindex")){if(w){xt=Array.isArray(W)?W.slice():[];const yt=W.indexOf(je.props.value);yt===-1?xt.push(je.props.value):xt.splice(yt,1)}else xt=je.props.value;if(je.props.onClick&&je.props.onClick(Fe),W!==xt&&(U(xt),A)){const yt=Fe.nativeEvent||Fe,bt=new yt.constructor(yt.type,yt);Object.defineProperty(bt,"target",{writable:!0,value:{value:xt,name:E}}),A(bt,je)}w||le(!1,Fe)}},we=je=>{B||[" ","ArrowUp","ArrowDown","Enter"].indexOf(je.key)!==-1&&(je.preventDefault(),le(!0,je))},Ne=Ce!==null&&ne,Ue=je=>{!Ne&&T&&(Object.defineProperty(je,"target",{writable:!0,value:{value:W,name:E}}),T(je))};delete $["aria-invalid"];let We,st;const z=[];let F=!1;(qE({value:W})||p)&&(G?We=G(W):F=!0);const oe=X.map(je=>{if(!V.isValidElement(je))return null;let Fe;if(w){if(!Array.isArray(W))throw new Error(Od(2));Fe=W.some(xt=>x8(xt,je.props.value)),Fe&&F&&z.push(je.props.children)}else Fe=x8(W,je.props.value),Fe&&F&&(st=je.props.children);return V.cloneElement(je,{"aria-selected":Fe?"true":"false",onClick:me(je),onKeyUp:xt=>{xt.key===" "&&xt.preventDefault(),je.props.onKeyUp&&je.props.onKeyUp(xt)},role:"option",selected:Fe,value:void 0,"data-value":je.props.value})});F&&(w?z.length===0?We=null:We=z.reduce((je,Fe,xt)=>(je.push(Fe),xt{const{classes:e}=t;return e},FO={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>Ao(t)&&t!=="variant",slot:"Root"},Xhe=mt(wH,FO)(""),Yhe=mt(PH,FO)(""),Khe=mt(yH,FO)(""),LH=V.forwardRef(function(e,n){const r=pn({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:c=uH,id:f,input:d,inputProps:p,label:y,labelId:x,MenuProps:_,multiple:v=!1,native:S=!1,onClose:w,onOpen:E,open:T,renderValue:A,SelectDisplayProps:D,variant:I="outlined"}=r,P=_t(r,Ghe),N=S?uhe:Whe,B=ff(),G=Yd({props:r,muiFormControl:B,states:["variant","error"]}),Z=G.variant||I,j=ee({},r,{variant:Z,classes:a}),J=qhe(j),Y=_t(J,jhe),$=d||{standard:k.jsx(Xhe,{ownerState:j}),outlined:k.jsx(Yhe,{label:y,ownerState:j}),filled:k.jsx(Khe,{ownerState:j})}[Z],W=Jr(n,$.ref);return k.jsx(V.Fragment,{children:V.cloneElement($,ee({inputComponent:N,inputProps:ee({children:o,error:G.error,IconComponent:c,variant:Z,type:void 0,multiple:v},S?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:u,labelId:x,MenuProps:_,onClose:w,onOpen:E,open:T,renderValue:A,SelectDisplayProps:ee({id:f},D)},p,{classes:p?Go(Y,p.classes):Y},d?d.props.inputProps:{})},v&&S&&Z==="outlined"?{notched:!0}:{},{ref:W,className:Mt($.props.className,s,J.root)},!d&&{variant:Z},P))})});LH.muiName="Select";const Gu=LH,Zhe=V.createContext(),FH=Zhe;function Jhe(t){return cn("MuiTable",t)}an("MuiTable",["root","stickyHeader"]);const Qhe=["className","component","padding","size","stickyHeader"],epe=t=>{const{classes:e,stickyHeader:n}=t;return fn({root:["root",n&&"stickyHeader"]},Jhe,e)},tpe=mt("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>ee({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":ee({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),b8="table",npe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiTable"}),{className:i,component:o=b8,padding:a="normal",size:s="medium",stickyHeader:l=!1}=r,u=_t(r,Qhe),c=ee({},r,{component:o,padding:a,size:s,stickyHeader:l}),f=epe(c),d=V.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return k.jsx(FH.Provider,{value:d,children:k.jsx(tpe,ee({as:o,role:o===b8?null:"table",ref:n,className:Mt(f.root,i),ownerState:c},u))})}),rpe=npe,ipe=V.createContext(),JM=ipe;function ope(t){return cn("MuiTableBody",t)}an("MuiTableBody",["root"]);const ape=["className","component"],spe=t=>{const{classes:e}=t;return fn({root:["root"]},ope,e)},lpe=mt("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),upe={variant:"body"},_8="tbody",cpe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiTableBody"}),{className:i,component:o=_8}=r,a=_t(r,ape),s=ee({},r,{component:o}),l=spe(s);return k.jsx(JM.Provider,{value:upe,children:k.jsx(lpe,ee({className:Mt(l.root,i),as:o,ref:n,role:o===_8?null:"rowgroup",ownerState:s},a))})}),fpe=cpe;function dpe(t){return cn("MuiTableCell",t)}const hpe=an("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),ppe=hpe,mpe=["align","className","component","padding","scope","size","sortDirection","variant"],gpe=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:a}=t,s={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${lt(r)}`,i!=="normal"&&`padding${lt(i)}`,`size${lt(o)}`]};return fn(s,dpe,e)},vpe=mt("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${lt(n.size)}`],n.padding!=="normal"&&e[`padding${lt(n.padding)}`],n.align!=="inherit"&&e[`align${lt(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>ee({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid + ${t.palette.mode==="light"?j$(Un(t.palette.divider,1),.88):G$(Un(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",[`&.${ppe.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})),ype=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:a,padding:s,scope:l,size:u,sortDirection:c,variant:f}=r,d=_t(r,mpe),p=V.useContext(FH),y=V.useContext(JM),x=y&&y.variant==="head";let _;a?_=a:_=x?"th":"td";let v=l;_==="td"?v=void 0:!v&&x&&(v="col");const S=f||y&&y.variant,w=ee({},r,{align:i,component:_,padding:s||(p&&p.padding?p.padding:"normal"),size:u||(p&&p.size?p.size:"medium"),sortDirection:c,stickyHeader:S==="head"&&p&&p.stickyHeader,variant:S}),E=gpe(w);let T=null;return c&&(T=c==="asc"?"ascending":"descending"),k.jsx(vpe,ee({as:_,ref:n,className:Mt(E.root,o),"aria-sort":T,scope:v,ownerState:w},d))}),Uo=ype;function xpe(t){return cn("MuiTableContainer",t)}an("MuiTableContainer",["root"]);const bpe=["className","component"],_pe=t=>{const{classes:e}=t;return fn({root:["root"]},xpe,e)},wpe=mt("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),Spe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,a=_t(r,bpe),s=ee({},r,{component:o}),l=_pe(s);return k.jsx(wpe,ee({ref:n,as:o,className:Mt(l.root,i),ownerState:s},a))}),Epe=Spe;function Mpe(t){return cn("MuiTableHead",t)}an("MuiTableHead",["root"]);const Cpe=["className","component"],Ape=t=>{const{classes:e}=t;return fn({root:["root"]},Mpe,e)},Tpe=mt("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),Dpe={variant:"head"},w8="thead",Rpe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiTableHead"}),{className:i,component:o=w8}=r,a=_t(r,Cpe),s=ee({},r,{component:o}),l=Ape(s);return k.jsx(JM.Provider,{value:Dpe,children:k.jsx(Tpe,ee({as:o,className:Mt(l.root,i),ref:n,role:o===w8?null:"rowgroup",ownerState:s},a))})}),Ppe=Rpe;function Npe(t){return cn("MuiToolbar",t)}an("MuiToolbar",["root","gutters","regular","dense"]);const Ope=["className","component","disableGutters","variant"],Ipe=t=>{const{classes:e,disableGutters:n,variant:r}=t;return fn({root:["root",!n&&"gutters",r]},Npe,e)},Lpe=mt("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})=>ee({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),Fpe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:a=!1,variant:s="regular"}=r,l=_t(r,Ope),u=ee({},r,{component:o,disableGutters:a,variant:s}),c=Ipe(u);return k.jsx(Lpe,ee({as:o,className:Mt(c.root,i),ref:n,ownerState:u},l))}),kpe=Fpe;function Bpe(t){return cn("MuiTableRow",t)}const Upe=an("MuiTableRow",["root","selected","hover","head","footer"]),S8=Upe,zpe=["className","component","hover","selected"],$pe=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return fn({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},Bpe,e)},Hpe=mt("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,[`&.${S8.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${S8.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Un(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}))`:Un(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),E8="tr",Vpe=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiTableRow"}),{className:i,component:o=E8,hover:a=!1,selected:s=!1}=r,l=_t(r,zpe),u=V.useContext(JM),c=ee({},r,{component:o,hover:a,selected:s,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),f=$pe(c);return k.jsx(Hpe,ee({as:o,ref:n,className:Mt(f.root,i),role:o===E8?null:"row",ownerState:c},l))}),Ew=Vpe;function Wpe(t){return cn("MuiTextField",t)}an("MuiTextField",["root"]);const Gpe=["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"],jpe={standard:wH,filled:yH,outlined:PH},qpe=t=>{const{classes:e}=t;return fn({root:["root"]},Wpe,e)},Xpe=mt(pl,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Ype=V.forwardRef(function(e,n){const r=pn({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:a,className:s,color:l="primary",defaultValue:u,disabled:c=!1,error:f=!1,FormHelperTextProps:d,fullWidth:p=!1,helperText:y,id:x,InputLabelProps:_,inputProps:v,InputProps:S,inputRef:w,label:E,maxRows:T,minRows:A,multiline:D=!1,name:I,onBlur:P,onChange:N,onFocus:B,placeholder:G,required:Z=!1,rows:j,select:J=!1,SelectProps:Y,type:$,value:W,variant:U="outlined"}=r,ne=_t(r,Gpe),re=ee({},r,{autoFocus:o,color:l,disabled:c,error:f,fullWidth:p,multiline:D,required:Z,select:J,variant:U}),ue=qpe(re),ce={};U==="outlined"&&(_&&typeof _.shrink<"u"&&(ce.notched=_.shrink),ce.label=E),J&&((!Y||!Y.native)&&(ce.id=void 0),ce["aria-describedby"]=void 0);const Ce=ab(x),Re=y&&Ce?`${Ce}-helper-text`:void 0,Ie=E&&Ce?`${Ce}-label`:void 0,He=jpe[U],tt=k.jsx(He,ee({"aria-describedby":Re,autoComplete:i,autoFocus:o,defaultValue:u,fullWidth:p,multiline:D,name:I,rows:j,maxRows:T,minRows:A,type:$,value:W,id:Ce,inputRef:w,onBlur:P,onChange:N,onFocus:B,placeholder:G,inputProps:v},ce,S));return k.jsxs(Xpe,ee({className:Mt(ue.root,s),disabled:c,error:f,fullWidth:p,ref:n,required:Z,color:l,variant:U,ownerState:re},ne,{children:[E!=null&&E!==""&&k.jsx(Wu,ee({htmlFor:Ce,id:Ie},_,{children:E})),J?k.jsx(Gu,ee({"aria-describedby":Re,id:Ce,labelId:Ie,value:W,input:tt},Y,{children:a})):tt,y&&k.jsx(kfe,ee({id:Re},d,{children:y}))]}))}),Cs=Ype;var kH={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function Br(t){return typeof t=="number"}function lo(t){return!t||typeof t!="object"||typeof t.constructor!="function"?!1:t.isBigNumber===!0&&typeof t.constructor.prototype=="object"&&t.constructor.prototype.isBigNumber===!0||typeof t.constructor.isDecimal=="function"&&t.constructor.isDecimal(t)===!0}function O1(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isComplex===!0||!1}function BH(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isFraction===!0||!1}function ad(t){return t&&t.constructor.prototype.isUnit===!0||!1}function Lu(t){return typeof t=="string"}var jr=Array.isArray;function di(t){return t&&t.constructor.prototype.isMatrix===!0||!1}function vx(t){return Array.isArray(t)||di(t)}function Kpe(t){return t&&t.isDenseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function Zpe(t){return t&&t.isSparseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function Jpe(t){return t&&t.constructor.prototype.isRange===!0||!1}function kO(t){return t&&t.constructor.prototype.isIndex===!0||!1}function Qpe(t){return typeof t=="boolean"}function eme(t){return t&&t.constructor.prototype.isResultSet===!0||!1}function tme(t){return t&&t.constructor.prototype.isHelp===!0||!1}function nme(t){return typeof t=="function"}function rme(t){return t instanceof Date}function ime(t){return t instanceof RegExp}function UH(t){return!!(t&&typeof t=="object"&&t.constructor===Object&&!O1(t)&&!BH(t))}function ome(t){return t===null}function ame(t){return t===void 0}function sme(t){return t&&t.isAccessorNode===!0&&t.constructor.prototype.isNode===!0||!1}function lme(t){return t&&t.isArrayNode===!0&&t.constructor.prototype.isNode===!0||!1}function ume(t){return t&&t.isAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function cme(t){return t&&t.isBlockNode===!0&&t.constructor.prototype.isNode===!0||!1}function fme(t){return t&&t.isConditionalNode===!0&&t.constructor.prototype.isNode===!0||!1}function dme(t){return t&&t.isConstantNode===!0&&t.constructor.prototype.isNode===!0||!1}function hme(t){return t&&t.isFunctionAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function pme(t){return t&&t.isFunctionNode===!0&&t.constructor.prototype.isNode===!0||!1}function mme(t){return t&&t.isIndexNode===!0&&t.constructor.prototype.isNode===!0||!1}function gme(t){return t&&t.isNode===!0&&t.constructor.prototype.isNode===!0||!1}function vme(t){return t&&t.isObjectNode===!0&&t.constructor.prototype.isNode===!0||!1}function yme(t){return t&&t.isOperatorNode===!0&&t.constructor.prototype.isNode===!0||!1}function xme(t){return t&&t.isParenthesisNode===!0&&t.constructor.prototype.isNode===!0||!1}function bme(t){return t&&t.isRangeNode===!0&&t.constructor.prototype.isNode===!0||!1}function _me(t){return t&&t.isRelationalNode===!0&&t.constructor.prototype.isNode===!0||!1}function wme(t){return t&&t.isSymbolNode===!0&&t.constructor.prototype.isNode===!0||!1}function Sme(t){return t&&t.constructor.prototype.isChain===!0||!1}function fl(t){var e=typeof t;return e==="object"?t===null?"null":lo(t)?"BigNumber":t.constructor&&t.constructor.name?t.constructor.name:"Object":e}function Fr(t){var e=typeof t;if(e==="number"||e==="string"||e==="boolean"||t===null||t===void 0)return t;if(typeof t.clone=="function")return t.clone();if(Array.isArray(t))return t.map(function(n){return Fr(n)});if(t instanceof Date)return new Date(t.valueOf());if(lo(t))return t;if(UH(t))return Eme(t,Fr);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(t,")"))}function Eme(t,e){var n={};for(var r in t)dr(t,r)&&(n[r]=e(t[r]));return n}function zH(t,e){for(var n in e)dr(e,n)&&(t[n]=e[n]);return t}function Xg(t,e){var n,r,i;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(r=0,i=t.length;r1&&arguments[1]!==void 0?arguments[1]:"any";const oe=F?s(F).index:i.length,ge=[];for(let de=0;de{const ge=r.get(oe);return!ge.isAny&&ge.test(z)});return F.length?F:["any"]}function d(z){return z&&typeof z=="function"&&"_typedFunctionData"in z}function p(z,F,oe){if(!d(z))throw new TypeError(C8);const ge=oe&&oe.exact,pe=Array.isArray(F)?F.join(","):F,de=E(pe),ve=_(de);if(!ge||ve in z.signatures){const je=z._typedFunctionData.signatureMap.get(ve);if(je)return je}const Se=de.length;let Pe;if(ge){Pe=[];let je;for(je in z.signatures)Pe.push(z._typedFunctionData.signatureMap.get(je))}else Pe=z._typedFunctionData.signatures;for(let je=0;je!Ct.has(ht.name)))continue}xt.push(yt)}}if(Pe=xt,Pe.length===0)break}let Be;for(Be of Pe)if(Be.params.length<=Se)return Be;throw new TypeError("Signature not found (signature: "+(z.name||"unnamed")+"("+_(de,", ")+"))")}function y(z,F,oe){return p(z,F,oe).implementation}function x(z,F){const oe=s(F);if(oe.test(z))return z;const ge=oe.conversionsTo;if(ge.length===0)throw new Error("There are no conversions to "+F+" defined.");for(let pe=0;pe1&&arguments[1]!==void 0?arguments[1]:",";return z.map(oe=>oe.name).join(F)}function v(z){const F=z.indexOf("...")===0,ge=(F?z.length>3?z.slice(3):"any":z).split("|").map(Se=>s(Se.trim()));let pe=!1,de=F?"...":"";return{types:ge.map(function(Se){return pe=Se.isAny||pe,de+=Se.name+"|",{name:Se.name,typeIndex:Se.index,test:Se.test,isAny:Se.isAny,conversion:null,conversionIndex:-1}}),name:de.slice(0,-1),hasAny:pe,hasConversion:!1,restParam:F}}function S(z){const F=z.types.map(ve=>ve.name),oe=$(F);let ge=z.hasAny,pe=z.name;const de=oe.map(function(ve){const Se=s(ve.from);return ge=Se.isAny||ge,pe+="|"+ve.from,{name:ve.from,typeIndex:Se.index,test:Se.test,isAny:Se.isAny,conversion:ve,conversionIndex:ve.index}});return{types:z.types.concat(de),name:pe,hasAny:ge,hasConversion:de.length>0,restParam:z.restParam}}function w(z){return z.typeSet||(z.typeSet=new Set,z.types.forEach(F=>z.typeSet.add(F.name))),z.typeSet}function E(z){const F=[];if(typeof z!="string")throw new TypeError("Signatures must be strings");const oe=z.trim();if(oe==="")return F;const ge=oe.split(",");for(let pe=0;pe=pe+1}}else return z.length===0?function(de){return de.length===0}:z.length===1?(oe=A(z[0]),function(de){return oe(de[0])&&de.length===1}):z.length===2?(oe=A(z[0]),ge=A(z[1]),function(de){return oe(de[0])&&ge(de[1])&&de.length===2}):(F=z.map(A),function(de){for(let ve=0;ve{const pe=P(ge.params,F);let de;for(de of pe)oe.add(de)}),oe.has("any")?["any"]:Array.from(oe)}function G(z,F,oe){let ge,pe;const de=z||"unnamed";let ve=oe,Se;for(Se=0;Se{const yt=I(xt.params,Se),bt=A(yt);(Se0){const xt=f(F[Se]);return ge=new TypeError("Unexpected type of argument in function "+de+" (expected: "+pe.join(" or ")+", actual: "+xt.join(" | ")+", index: "+Se+")"),ge.data={category:"wrongType",fn:de,index:Se,actual:xt,expected:pe},ge}}else ve=Fe}const Pe=ve.map(function(Fe){return T(Fe.params)?1/0:Fe.params.length});if(F.lengthBe)return ge=new TypeError("Too many arguments in function "+de+" (expected: "+Be+", actual: "+F.length+")"),ge.data={category:"tooManyArgs",fn:de,index:F.length,expectedLength:Be},ge;const je=[];for(let Fe=0;Fe0)return 1;const ge=j(z)-j(F);return ge<0?-1:ge>0?1:0}function Y(z,F){const oe=z.params,ge=F.params,pe=Qe(oe),de=Qe(ge),ve=T(oe),Se=T(ge);if(ve&&pe.hasAny){if(!Se||!de.hasAny)return 1}else if(Se&&de.hasAny)return-1;let Pe=0,Be=0,je;for(je of oe)je.hasAny&&++Pe,je.hasConversion&&++Be;let Fe=0,xt=0;for(je of ge)je.hasAny&&++Fe,je.hasConversion&&++xt;if(Pe!==Fe)return Pe-Fe;if(ve&&pe.hasConversion){if(!Se||!de.hasConversion)return 1}else if(Se&&de.hasConversion)return-1;if(Be!==xt)return Be-xt;if(ve){if(!Se)return 1}else if(Se)return-1;const yt=(oe.length-ge.length)*(ve?-1:1);if(yt!==0)return yt;const bt=[];let Ct=0;for(let jt=0;jt1&&F.sort((pe,de)=>pe.index-de.index);let oe=F[0].conversionsTo;if(z.length===1)return oe;oe=oe.concat([]);const ge=new Set(z);for(let pe=1;pepe.hasConversion)){const pe=T(z),de=z.map(U);oe=function(){const Se=[],Pe=pe?arguments.length-1:arguments.length;for(let Be=0;BePe.name).join("|"),hasAny:Se.some(Pe=>Pe.isAny),hasConversion:!1,restParam:!0}),ve.push(de)}else ve=de.types.map(function(Se){return{types:[Se],name:Se.name,hasAny:Se.isAny,hasConversion:Se.conversion,restParam:!1}});return le(ve,function(Se){return F(oe,ge+1,pe.concat([Se]))})}else return[pe]}return F(z,0,[])}function re(z,F){const oe=Math.max(z.length,F.length);for(let Se=0;Se=ge:ve?ge>=pe:ge===pe}function ue(z){return z.map(F=>me(F)?X(F.referToSelf.callback):te(F)?Ee(F.referTo.references,F.referTo.callback):F)}function ce(z,F,oe){const ge=[];let pe;for(pe of z){let de=oe[pe];if(typeof de!="number")throw new TypeError('No definition for referenced signature "'+pe+'"');if(de=F[de],typeof de!="function")return!1;ge.push(de)}return ge}function Ce(z,F,oe){const ge=ue(z),pe=new Array(ge.length).fill(!1);let de=!0;for(;de;){de=!1;let ve=!0;for(let Se=0;Se{const ge=z[oe];if(F.test(ge.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Ie(z,F){if(a.createCount++,Object.keys(F).length===0)throw new SyntaxError("No signatures provided");a.warnAgainstDeprecatedThis&&Re(F);const oe=[],ge=[],pe={},de=[];let ve;for(ve in F){if(!Object.prototype.hasOwnProperty.call(F,ve))continue;const vt=E(ve);if(!vt)continue;oe.forEach(function(Xn){if(re(Xn,vt))throw new TypeError('Conflicting signatures "'+_(Xn)+'" and "'+_(vt)+'".')}),oe.push(vt);const Ft=ge.length;ge.push(F[ve]);const en=vt.map(S);let Zt;for(Zt of ne(en)){const Xn=_(Zt);de.push({params:Zt,name:Xn,fn:Ft}),Zt.every(Qr=>!Qr.hasConversion)&&(pe[Xn]=Ft)}}de.sort(Y);const Se=Ce(ge,pe,Wt);let Pe;for(Pe in pe)Object.prototype.hasOwnProperty.call(pe,Pe)&&(pe[Pe]=Se[pe[Pe]]);const Be=[],je=new Map;for(Pe of de)je.has(Pe.name)||(Pe.fn=Se[Pe.fn],Be.push(Pe),je.set(Pe.name,Pe));const Fe=Be[0]&&Be[0].params.length<=2&&!T(Be[0].params),xt=Be[1]&&Be[1].params.length<=2&&!T(Be[1].params),yt=Be[2]&&Be[2].params.length<=2&&!T(Be[2].params),bt=Be[3]&&Be[3].params.length<=2&&!T(Be[3].params),Ct=Be[4]&&Be[4].params.length<=2&&!T(Be[4].params),ht=Be[5]&&Be[5].params.length<=2&&!T(Be[5].params),jt=Fe&&xt&&yt&&bt&&Ct&&ht;for(let vt=0;vtvt.test),Et=Be.map(vt=>vt.implementation),Lt=function(){for(let Ft=Oe;Ft_(E(oe))),F=Qe(arguments);if(typeof F!="function")throw new TypeError("Callback function expected as last argument");return Ee(z,F)}function Ee(z,F){return{referTo:{references:z,callback:F}}}function X(z){if(typeof z!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:z}}}function te(z){return z&&typeof z.referTo=="object"&&Array.isArray(z.referTo.references)&&typeof z.referTo.callback=="function"}function me(z){return z&&typeof z.referToSelf=="object"&&typeof z.referToSelf.callback=="function"}function we(z,F){if(!z)return F;if(F&&F!==z){const oe=new Error("Function names do not match (expected: "+z+", actual: "+F+")");throw oe.data={actual:F,expected:z},oe}return z}function Ne(z){let F;for(const oe in z)Object.prototype.hasOwnProperty.call(z,oe)&&(d(z[oe])||typeof z[oe].signature=="string")&&(F=we(F,z[oe].name));return F}function Ue(z,F){let oe;for(oe in F)if(Object.prototype.hasOwnProperty.call(F,oe)){if(oe in z&&F[oe]!==z[oe]){const ge=new Error('Signature "'+oe+'" is defined twice');throw ge.data={signature:oe,sourceFunction:F[oe],destFunction:z[oe]},ge}z[oe]=F[oe]}}const We=a;a=function(z){const F=typeof z=="string",oe=F?1:0;let ge=F?z:"";const pe={};for(let de=oe;depe.from===z.from);if(!oe)throw new Error("Attempt to remove nonexistent conversion from "+z.from+" to "+z.to);if(oe.convert!==z.convert)throw new Error("Conversion to remove does not match existing conversion");const ge=F.conversionsTo.indexOf(oe);F.conversionsTo.splice(ge,1)},a.resolve=function(z,F){if(!d(z))throw new TypeError(C8);const oe=z._typedFunctionData.signatures;for(let ge=0;ge2**(n-1)-1||t<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!Pr(t))throw new Error("Value must be an integer");t<0&&(t=t+2**n),o="i".concat(n)}var a="";return t<0&&(t=-t,a="-"),"".concat(a).concat(i).concat(t.toString(e)).concat(o)}function xR(t,e){if(typeof e=="function")return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var n="auto",r,i;if(e&&(e.notation&&(n=e.notation),Br(e)?r=e:Br(e.precision)&&(r=e.precision),e.wordSize&&(i=e.wordSize,typeof i!="number")))throw new Error('Option "wordSize" must be a number');switch(n){case"fixed":return HH(t,r);case"exponential":return VH(t,r);case"engineering":return Tme(t,r);case"bin":return FT(t,2,i);case"oct":return FT(t,8,i);case"hex":return FT(t,16,i);case"auto":return Dme(t,r,e&&e).replace(/((\.\d*?)(0+))($|e)/,function(){var o=arguments[2],a=arguments[4];return o!=="."?o+a:a});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function QM(t){var e=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var n=e[1],r=e[2],i=parseFloat(e[4]||"0"),o=r.indexOf(".");i+=o!==-1?o-1:r.length-1;var a=r.replace(".","").replace(/^0*/,function(s){return i-=s.length,""}).replace(/0*$/,"").split("").map(function(s){return parseInt(s)});return a.length===0&&(a.push(0),i++),{sign:n,coefficients:a,exponent:i}}function Tme(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=QM(t),r=eC(n,e),i=r.exponent,o=r.coefficients,a=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Br(e))for(;e>o.length||i-a+1>o.length;)o.push(0);else for(var s=Math.abs(i-a)-(o.length-1),l=0;l0;)c++,u--;var f=o.slice(c).join(""),d=Br(e)&&f.length||f.match(/[1-9]/)?"."+f:"",p=o.slice(0,c).join("")+d+"e"+(i>=0?"+":"")+a.toString();return r.sign+p}function HH(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=QM(t),r=typeof e=="number"?eC(n,n.exponent+1+e):n,i=r.coefficients,o=r.exponent+1,a=o+(e||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function Dme(t,e,n){if(isNaN(t)||!isFinite(t))return String(t);var r=n&&n.lowerExp!==void 0?n.lowerExp:-3,i=n&&n.upperExp!==void 0?n.upperExp:5,o=QM(t),a=e?eC(o,e):o;if(a.exponent=i)return VH(t,e);var s=a.coefficients,l=a.exponent;s.length0?l:0;return ue){var i=r.splice(e,r.length-e);if(i[0]>=5){var o=e-1;for(r[o]++;r[o]===10;)r.pop(),o===0&&(r.unshift(0),n.exponent++,o++),o--,r[o]++}}return n}function Cg(t){for(var e=[],n=0;n=o&&u=0?"+":"")+r.toString()}function T8(t,e){return e!==void 0?t.toExponential(e-1):t.toExponential()}function Ime(t,e){return t.toFixed(e)}function Lme(t,e){var n=t.length-e.length,r=t.length;return t.substring(n,r)===e}function ui(t,e){var n=Fme(t,e);return e&&typeof e=="object"&&"truncate"in e&&n.length>e.truncate?n.substring(0,e.truncate-3)+"...":n}function Fme(t,e){if(typeof t=="number")return xR(t,e);if(lo(t))return Nme(t,e);if(kme(t))return!e||e.fraction!=="decimal"?t.s*t.n+"/"+t.d:t.toString();if(Array.isArray(t))return WH(t,e);if(Lu(t))return D8(t);if(typeof t=="function")return t.syntax?String(t.syntax):"function";if(t&&typeof t=="object"){if(typeof t.format=="function")return t.format(e);if(t&&t.toString(e)!=={}.toString())return t.toString(e);var n=Object.keys(t).map(r=>D8(r)+": "+ui(t[r],e));return"{"+n.join(", ")+"}"}return String(t)}function D8(t){for(var e=String(t),n="",r=0;r=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Kd.prototype=new RangeError;Kd.prototype.constructor=RangeError;Kd.prototype.name="IndexError";Kd.prototype.isIndexError=!0;function ya(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e}function GH(t,e,n){var r,i=t.length;if(i!==e[n])throw new ir(i,e[n]);if(n")}function P8(t,e){var n=e.length===0;if(n){if(Array.isArray(t))throw new ir(t.length,0)}else GH(t,e,0)}function qr(t,e){if(t!==void 0){if(!Br(t)||!Pr(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||typeof e=="number"&&t>=e)throw new Kd(t,e)}}function XE(t,e,n){if(!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new Error("Resizing to scalar is not supported");e.forEach(function(i){if(!Br(i)||!Pr(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ui(e)+")")}),(Br(t)||lo(t))&&(t=[t]);var r=n!==void 0?n:0;return bR(t,e,0,r),t}function bR(t,e,n,r){var i,o,a=t.length,s=e[n],l=Math.min(a,s);if(t.length=s,n=0,l=e%n===0;if(s)if(l)r[o]=-e/n;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-n);return r}function qH(t){return t.reduce((e,n)=>e*n,1)}function Bme(t,e){for(var n=t,r,i=e.length-1;i>0;i--){var o=e[i];r=[];for(var a=n.length/o,s=0;s1)return t.slice(1).reduce(function(n,r){return KH(n,r,e,0)},t[0]);throw new Error("Wrong number of arguments in function concat")}function zme(){for(var t=arguments.length,e=new Array(t),n=0;nd.length),i=Math.max(...r),o=new Array(i).fill(null),a=0;ao[c]&&(o[c]=s[u])}for(var f=0;f1||t[i]>e[o])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(r," with size ").concat(t[i]," to size ").concat(e[o]))}}function N8(t,e){var n=ya(t);if(Xg(n,e))return t;KE(n,e);var r=zme(n,e),i=r.length,o=[...Array(i-n.length).fill(1),...n],a=Hme(t);n.length!Wme(o)).every(o=>n[o]!==void 0);if(!r){var i=e.filter(o=>n[o]===void 0);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(i.map(o=>'"'.concat(o,'"')).join(", "),"."))}}function Wme(t){return t&&t[0]==="?"}function Gme(t){return t&&t[0]==="?"?t.slice(1):t}function jme(t,e){if(QH(t)&&JH(t,e))return t[e];throw typeof t[e]=="function"&&Yme(t,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function qme(t,e,n){if(QH(t)&&JH(t,e))return t[e]=n,n;throw new Error('No access to property "'+e+'"')}function Xme(t,e){return e in t}function JH(t,e){return!t||typeof t!="object"?!1:dr(Kme,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Yme(t,e){return t==null||typeof t[e]!="function"||dr(t,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(t)?!1:dr(Zme,e)?!0:!(e in Object.prototype||e in Function.prototype)}function QH(t){return typeof t=="object"&&t&&t.constructor===Object}var Kme={length:!0,name:!0},Zme={toString:!0,valueOf:!0,toLocaleString:!0};class Jme{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){return jme(this.wrappedObject,e)}set(e,n){return qme(this.wrappedObject,e,n),this}has(e){return Xme(this.wrappedObject,e)}}function Qme(t){return t?t instanceof Map||t instanceof Jme||typeof t.set=="function"&&typeof t.get=="function"&&typeof t.keys=="function"&&typeof t.has=="function":!1}var eV=function(){return eV=A8.create,A8},e0e=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],t0e=Dt("typed",e0e,function(e){var{BigNumber:n,Complex:r,DenseMatrix:i,Fraction:o}=e,a=eV();return a.clear(),a.addTypes([{name:"number",test:Br},{name:"Complex",test:O1},{name:"BigNumber",test:lo},{name:"Fraction",test:BH},{name:"Unit",test:ad},{name:"identifier",test:s=>Lu&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(s)},{name:"string",test:Lu},{name:"Chain",test:Sme},{name:"Array",test:jr},{name:"Matrix",test:di},{name:"DenseMatrix",test:Kpe},{name:"SparseMatrix",test:Zpe},{name:"Range",test:Jpe},{name:"Index",test:kO},{name:"boolean",test:Qpe},{name:"ResultSet",test:eme},{name:"Help",test:tme},{name:"function",test:nme},{name:"Date",test:rme},{name:"RegExp",test:ime},{name:"null",test:ome},{name:"undefined",test:ame},{name:"AccessorNode",test:sme},{name:"ArrayNode",test:lme},{name:"AssignmentNode",test:ume},{name:"BlockNode",test:cme},{name:"ConditionalNode",test:fme},{name:"ConstantNode",test:dme},{name:"FunctionNode",test:pme},{name:"FunctionAssignmentNode",test:hme},{name:"IndexNode",test:mme},{name:"Node",test:gme},{name:"ObjectNode",test:vme},{name:"OperatorNode",test:yme},{name:"ParenthesisNode",test:xme},{name:"RangeNode",test:bme},{name:"RelationalNode",test:_me},{name:"SymbolNode",test:wme},{name:"Map",test:Qme},{name:"Object",test:UH}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(n||BT(l),Rme(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new n(l)}},{from:"number",to:"Complex",convert:function(l){return r||Mw(l),new r(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return r||Mw(l),new r(l.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(l){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(l){return r||Mw(l),new r(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){o||UT(l);var u=new o(l);if(u.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return u}},{from:"string",to:"number",convert:function(l){var u=Number(l);if(isNaN(u))throw new Error('Cannot convert "'+l+'" to a number');return u}},{from:"string",to:"BigNumber",convert:function(l){n||BT(l);try{return new n(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(l){o||UT(l);try{return new o(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){r||Mw(l);try{return new r(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return n||BT(l),new n(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return o||UT(l),new o(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return i||n0e(),new i(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),a.onMismatch=(s,l,u)=>{var c=a.createError(s,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&vx(l[0])&&u.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(s,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(s,")'."));throw f.data=c.data,f}throw c},a.onMismatch=(s,l,u)=>{var c=a.createError(s,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&vx(l[0])&&u.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(s,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(s,")'."));throw f.data=c.data,f}throw c},a});function BT(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function Mw(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function n0e(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function UT(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}/*! + * decimal.js v10.4.3 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */var sg=9e15,Zd=1e9,_R="0123456789abcdef",ZE="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",JE="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",wR={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-sg,maxE:sg,crypto:!1},tV,Vc,hn=!0,tC="[DecimalError] ",Id=tC+"Invalid argument: ",nV=tC+"Precision limit exceeded",rV=tC+"crypto unavailable",iV="[object Decimal]",Xo=Math.floor,Ui=Math.pow,r0e=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,i0e=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,o0e=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,oV=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,nu=1e7,Qt=7,a0e=9007199254740991,s0e=ZE.length-1,SR=JE.length-1,rt={toStringTag:iV};rt.absoluteValue=rt.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),qt(t)};rt.ceil=function(){return qt(new this.constructor(this),this.e+1,2)};rt.clampedTo=rt.clamp=function(t,e){var n,r=this,i=r.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error(Id+e);return n=r.cmp(t),n<0?t:r.cmp(e)>0?e:new i(r)};rt.comparedTo=rt.cmp=function(t){var e,n,r,i,o=this,a=o.d,s=(t=new o.constructor(t)).d,l=o.s,u=t.s;if(!a||!s)return!l||!u?NaN:l!==u?l:a===s?0:!a^l<0?1:-1;if(!a[0]||!s[0])return a[0]?l:s[0]?-u:0;if(l!==u)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(r=a.length,i=s.length,e=0,n=rs[e]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1};rt.cosine=rt.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+Qt,r.rounding=1,n=l0e(r,cV(r,n)),r.precision=t,r.rounding=e,qt(Vc==2||Vc==3?n.neg():n,t,e,!0)):new r(1):new r(NaN)};rt.cubeRoot=rt.cbrt=function(){var t,e,n,r,i,o,a,s,l,u,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(hn=!1,o=c.s*Ui(c.s*c,1/3),!o||Math.abs(o)==1/0?(n=wo(c.d),t=c.e,(o=(t-n.length+1)%3)&&(n+=o==1||o==-2?"0":"00"),o=Ui(n,1/3),t=Xo((t+1)/3)-(t%3==(t<0?-1:2)),o==1/0?n="5e"+t:(n=o.toExponential(),n=n.slice(0,n.indexOf("e")+1)+t),r=new f(n),r.s=c.s):r=new f(o.toString()),a=(t=f.precision)+3;;)if(s=r,l=s.times(s).times(s),u=l.plus(c),r=yr(u.plus(c).times(s),u.plus(l),a+2,1),wo(s.d).slice(0,a)===(n=wo(r.d)).slice(0,a))if(n=n.slice(a-3,a+1),n=="9999"||!i&&n=="4999"){if(!i&&(qt(s,t+1,0),s.times(s).times(s).eq(c))){r=s;break}a+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(qt(r,t+1,1),e=!r.times(r).times(r).eq(c));break}return hn=!0,qt(r,t,f.rounding,e)};rt.decimalPlaces=rt.dp=function(){var t,e=this.d,n=NaN;if(e){if(t=e.length-1,n=(t-Xo(this.e/Qt))*Qt,t=e[t],t)for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n};rt.dividedBy=rt.div=function(t){return yr(this,new this.constructor(t))};rt.dividedToIntegerBy=rt.divToInt=function(t){var e=this,n=e.constructor;return qt(yr(e,new n(t),0,1,1),n.precision,n.rounding)};rt.equals=rt.eq=function(t){return this.cmp(t)===0};rt.floor=function(){return qt(new this.constructor(this),this.e+1,3)};rt.greaterThan=rt.gt=function(t){return this.cmp(t)>0};rt.greaterThanOrEqualTo=rt.gte=function(t){var e=this.cmp(t);return e==1||e===0};rt.hyperbolicCosine=rt.cosh=function(){var t,e,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,i=o.d.length,i<32?(t=Math.ceil(i/3),e=(1/rC(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),o=Yg(a,1,o.times(e),new a(1),!0);for(var l,u=t,c=new a(8);u--;)l=o.times(o),o=s.minus(l.times(c.minus(l.times(c))));return qt(o,a.precision=n,a.rounding=r,!0)};rt.hyperbolicSine=rt.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,r=i.d.length,r<3)i=Yg(o,2,i,i,!0);else{t=1.4*Math.sqrt(r),t=t>16?16:t|0,i=i.times(1/rC(5,t)),i=Yg(o,2,i,i,!0);for(var a,s=new o(5),l=new o(16),u=new o(20);t--;)a=i.times(i),i=i.times(s.plus(a.times(l.times(a).plus(u))))}return o.precision=e,o.rounding=n,qt(i,e,n,!0)};rt.hyperbolicTangent=rt.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,yr(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)};rt.inverseCosine=rt.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return r!==-1?r===0?e.isNeg()?Kl(n,i,o):new n(0):new n(NaN):e.isZero()?Kl(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=Kl(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))};rt.inverseHyperbolicCosine=rt.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,hn=!1,n=n.times(n).minus(1).sqrt().plus(n),hn=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)};rt.inverseHyperbolicSine=rt.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,hn=!1,n=n.times(n).plus(1).sqrt().plus(n),hn=!0,r.precision=t,r.rounding=e,n.ln())};rt.inverseHyperbolicTangent=rt.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?qt(new o(i),t,e,!0):(o.precision=n=r-i.e,i=yr(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)};rt.inverseSine=rt.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,e!==-1?e===0?(t=Kl(o,n+4,r).times(.5),t.s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))};rt.inverseTangent=rt.atan=function(){var t,e,n,r,i,o,a,s,l,u=this,c=u.constructor,f=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&f+4<=SR)return a=Kl(c,f+4,d).times(.25),a.s=u.s,a}else{if(!u.s)return new c(NaN);if(f+4<=SR)return a=Kl(c,f+4,d).times(.5),a.s=u.s,a}for(c.precision=s=f+10,c.rounding=1,n=Math.min(28,s/Qt+2|0),t=n;t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(hn=!1,e=Math.ceil(s/Qt),r=1,l=u.times(u),a=new c(u),i=u;t!==-1;)if(i=i.times(l),o=a.minus(i.div(r+=2)),i=i.times(l),a=o.plus(i.div(r+=2)),a.d[e]!==void 0)for(t=e;a.d[t]===o.d[t]&&t--;);return n&&(a=a.times(2<this.d.length-2};rt.isNaN=function(){return!this.s};rt.isNegative=rt.isNeg=function(){return this.s<0};rt.isPositive=rt.isPos=function(){return this.s>0};rt.isZero=function(){return!!this.d&&this.d[0]===0};rt.lessThan=rt.lt=function(t){return this.cmp(t)<0};rt.lessThanOrEqualTo=rt.lte=function(t){return this.cmp(t)<1};rt.logarithm=rt.log=function(t){var e,n,r,i,o,a,s,l,u=this,c=u.constructor,f=c.precision,d=c.rounding,p=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),n=t.d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=u.d,u.s<0||!n||!n[0]||u.eq(1))return new c(n&&!n[0]?-1/0:u.s!=1?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10===0;)i/=10;o=i!==1}if(hn=!1,s=f+p,a=md(u,s),r=e?QE(c,s+10):md(t,s),l=yr(a,r,s,1),yx(l.d,i=f,d))do if(s+=10,a=md(u,s),r=e?QE(c,s+10):md(t,s),l=yr(a,r,s,1),!o){+wo(l.d).slice(i+1,i+15)+1==1e14&&(l=qt(l,f+1,0));break}while(yx(l.d,i+=10,d));return hn=!0,qt(l,f,d)};rt.minus=rt.sub=function(t){var e,n,r,i,o,a,s,l,u,c,f,d,p=this,y=p.constructor;if(t=new y(t),!p.d||!t.d)return!p.s||!t.s?t=new y(NaN):p.d?t.s=-t.s:t=new y(t.d||p.s!==t.s?p:NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(u=p.d,d=t.d,s=y.precision,l=y.rounding,!u[0]||!d[0]){if(d[0])t.s=-t.s;else if(u[0])t=new y(p);else return new y(l===3?-0:0);return hn?qt(t,s,l):t}if(n=Xo(t.e/Qt),c=Xo(p.e/Qt),u=u.slice(),o=c-n,o){for(f=o<0,f?(e=u,o=-o,a=d.length):(e=d,n=c,a=u.length),r=Math.max(Math.ceil(s/Qt),a)+2,o>r&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for(r=u.length,a=d.length,f=r0;--r)u[a++]=0;for(r=d.length;r>o;){if(u[--r]a?o+1:a+1,i>a&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(a=u.length,i=c.length,a-i<0&&(i=a,n=c,c=u,u=n),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/nu|0,u[i]%=nu;for(e&&(u.unshift(e),++r),a=u.length;u[--a]==0;)u.pop();return t.d=u,t.e=nC(u,r),hn?qt(t,s,l):t};rt.precision=rt.sd=function(t){var e,n=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Id+t);return n.d?(e=aV(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e};rt.round=function(){var t=this,e=t.constructor;return qt(new e(t),t.e+1,e.rounding)};rt.sine=rt.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+Qt,r.rounding=1,n=c0e(r,cV(r,n)),r.precision=t,r.rounding=e,qt(Vc>2?n.neg():n,t,e,!0)):new r(NaN)};rt.squareRoot=rt.sqrt=function(){var t,e,n,r,i,o,a=this,s=a.d,l=a.e,u=a.s,c=a.constructor;if(u!==1||!s||!s[0])return new c(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);for(hn=!1,u=Math.sqrt(+a),u==0||u==1/0?(e=wo(s),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=Xo((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),r=new c(e)):r=new c(u.toString()),n=(l=c.precision)+3;;)if(o=r,r=o.plus(yr(a,o,n+2,1)).times(.5),wo(o.d).slice(0,n)===(e=wo(r.d)).slice(0,n))if(e=e.slice(n-3,n+1),e=="9999"||!i&&e=="4999"){if(!i&&(qt(o,l+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(qt(r,l+1,1),t=!r.times(r).eq(a));break}return hn=!0,qt(r,l,c.rounding,t)};rt.tangent=rt.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,n=n.sin(),n.s=1,n=yr(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,qt(Vc==2||Vc==4?n.neg():n,t,e,!0)):new r(NaN)};rt.times=rt.mul=function(t){var e,n,r,i,o,a,s,l,u,c=this,f=c.constructor,d=c.d,p=(t=new f(t)).d;if(t.s*=c.s,!d||!d[0]||!p||!p[0])return new f(!t.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:!d||!p?t.s/0:t.s*0);for(n=Xo(c.e/Qt)+Xo(t.e/Qt),l=d.length,u=p.length,l=0;){for(e=0,i=l+r;i>r;)s=o[i]+p[r]*d[i-r-1]+e,o[i--]=s%nu|0,e=s/nu|0;o[i]=(o[i]+e)%nu|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=nC(o,n),hn?qt(t,f.precision,f.rounding):t};rt.toBinary=function(t,e){return UO(this,2,t,e)};rt.toDecimalPlaces=rt.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(ja(t,0,Zd),e===void 0?e=r.rounding:ja(e,0,8),qt(n,t+n.e+1,e))};rt.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=Qu(r,!0):(ja(t,0,Zd),e===void 0?e=i.rounding:ja(e,0,8),r=qt(new i(r),t+1,e),n=Qu(r,!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n};rt.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?n=Qu(i):(ja(t,0,Zd),e===void 0?e=o.rounding:ja(e,0,8),r=qt(new o(i),t+i.e+1,e),n=Qu(r,!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n};rt.toFraction=function(t){var e,n,r,i,o,a,s,l,u,c,f,d,p=this,y=p.d,x=p.constructor;if(!y)return new x(p);if(u=n=new x(1),r=l=new x(0),e=new x(r),o=e.e=aV(y)-p.e-1,a=o%Qt,e.d[0]=Ui(10,a<0?Qt+a:a),t==null)t=o>0?e:u;else{if(s=new x(t),!s.isInt()||s.lt(u))throw Error(Id+s);t=s.gt(e)?o>0?e:u:s}for(hn=!1,s=new x(wo(y)),c=x.precision,x.precision=o=y.length*Qt*2;f=yr(s,e,0,1,1),i=n.plus(f.times(r)),i.cmp(t)!=1;)n=r,r=i,i=u,u=l.plus(f.times(i)),l=i,i=e,e=s.minus(f.times(i)),s=i;return i=yr(t.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=p.s,d=yr(u,r,o,1).minus(p).abs().cmp(yr(l,n,o,1).minus(p).abs())<1?[u,r]:[l,n],x.precision=c,hn=!0,d};rt.toHexadecimal=rt.toHex=function(t,e){return UO(this,16,t,e)};rt.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),t==null){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),e===void 0?e=r.rounding:ja(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(hn=!1,n=yr(n,t,0,e,1).times(t),hn=!0,qt(n)):(t.s=n.s,n=t),n};rt.toNumber=function(){return+this};rt.toOctal=function(t,e){return UO(this,8,t,e)};rt.toPower=rt.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,u=+(t=new l(t));if(!s.d||!t.d||!s.d[0]||!t.d[0])return new l(Ui(+s,u));if(s=new l(s),s.eq(1))return s;if(r=l.precision,o=l.rounding,t.eq(1))return qt(s,r,o);if(e=Xo(t.e/Qt),e>=t.d.length-1&&(n=u<0?-u:u)<=a0e)return i=sV(l,s,n,r),t.s<0?new l(1).div(i):qt(i,r,o);if(a=s.s,a<0){if(el.maxE+1||e0?a/0:0):(hn=!1,l.rounding=s.s=1,n=Math.min(12,(e+"").length),i=ER(t.times(md(s,r+n)),r),i.d&&(i=qt(i,r+5,1),yx(i.d,r,o)&&(e=r+10,i=qt(ER(t.times(md(s,e+n)),e),e+5,1),+wo(i.d).slice(r+1,r+15)+1==1e14&&(i=qt(i,r+1,0)))),i.s=a,hn=!0,l.rounding=o,qt(i,r,o))};rt.toPrecision=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=Qu(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(ja(t,1,Zd),e===void 0?e=i.rounding:ja(e,0,8),r=qt(new i(r),t,e),n=Qu(r,t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n};rt.toSignificantDigits=rt.toSD=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(ja(t,1,Zd),e===void 0?e=r.rounding:ja(e,0,8)),qt(new r(n),t,e)};rt.toString=function(){var t=this,e=t.constructor,n=Qu(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n};rt.truncated=rt.trunc=function(){return qt(new this.constructor(this),this.e+1,1)};rt.valueOf=rt.toJSON=function(){var t=this,e=t.constructor,n=Qu(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};function wo(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;en)throw Error(Id+t)}function yx(t,e,n,r){var i,o,a,s;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=Qt,i=0):(i=Math.ceil((e+1)/Qt),e%=Qt),o=Ui(10,Qt-e),s=t[i]%o|0,r==null?e<3?(e==0?s=s/100|0:e==1&&(s=s/10|0),a=n<4&&s==99999||n>3&&s==49999||s==5e4||s==0):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(t[i+1]/o/100|0)==Ui(10,e-2)-1||(s==o/2||s==0)&&(t[i+1]/o/100|0)==0:e<4?(e==0?s=s/1e3|0:e==1?s=s/100|0:e==2&&(s=s/10|0),a=(r||n<4)&&s==9999||!r&&n>3&&s==4999):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(t[i+1]/o/1e3|0)==Ui(10,e-3)-1,a}function tE(t,e,n){for(var r,i=[0],o,a=0,s=t.length;an-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function l0e(t,e){var n,r,i;if(e.isZero())return e;r=e.d.length,r<32?(n=Math.ceil(r/3),i=(1/rC(4,n)).toString()):(n=16,i="2.3283064365386962890625e-10"),t.precision+=n,e=Yg(t,1,e.times(i),new t(1));for(var o=n;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=n,e}var yr=function(){function t(r,i,o){var a,s=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+s,r[l]=a%o|0,s=a/o|0;return s&&r.unshift(s),r}function e(r,i,o,a){var s,l;if(o!=a)l=o>a?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,o,a){for(var s=0;o--;)r[o]-=s,s=r[o]1;)r.shift()}return function(r,i,o,a,s,l){var u,c,f,d,p,y,x,_,v,S,w,E,T,A,D,I,P,N,B,G,Z=r.constructor,j=r.s==i.s?1:-1,J=r.d,Y=i.d;if(!J||!J[0]||!Y||!Y[0])return new Z(!r.s||!i.s||(J?Y&&J[0]==Y[0]:!Y)?NaN:J&&J[0]==0||!Y?j*0:j/0);for(l?(p=1,c=r.e-i.e):(l=nu,p=Qt,c=Xo(r.e/p)-Xo(i.e/p)),B=Y.length,P=J.length,v=new Z(j),S=v.d=[],f=0;Y[f]==(J[f]||0);f++);if(Y[f]>(J[f]||0)&&c--,o==null?(A=o=Z.precision,a=Z.rounding):s?A=o+(r.e-i.e)+1:A=o,A<0)S.push(1),y=!0;else{if(A=A/p+2|0,f=0,B==1){for(d=0,Y=Y[0],A++;(f1&&(Y=t(Y,d,l),J=t(J,d,l),B=Y.length,P=J.length),I=B,w=J.slice(0,B),E=w.length;E=l/2&&++N;do d=0,u=e(Y,w,B,E),u<0?(T=w[0],B!=E&&(T=T*l+(w[1]||0)),d=T/N|0,d>1?(d>=l&&(d=l-1),x=t(Y,d,l),_=x.length,E=w.length,u=e(x,w,_,E),u==1&&(d--,n(x,B<_?G:Y,_,l))):(d==0&&(u=d=1),x=Y.slice()),_=x.length,_=10;d/=10)f++;v.e=f+c*p-1,qt(v,s?o+v.e+1:o,a,y)}return v}}();function qt(t,e,n,r){var i,o,a,s,l,u,c,f,d,p=t.constructor;e:if(e!=null){if(f=t.d,!f)return t;for(i=1,s=f[0];s>=10;s/=10)i++;if(o=e-i,o<0)o+=Qt,a=e,c=f[d=0],l=c/Ui(10,i-a-1)%10|0;else if(d=Math.ceil((o+1)/Qt),s=f.length,d>=s)if(r){for(;s++<=d;)f.push(0);c=l=0,i=1,o%=Qt,a=o-Qt+1}else break e;else{for(c=s=f[d],i=1;s>=10;s/=10)i++;o%=Qt,a=o-Qt+i,l=a<0?0:c/Ui(10,i-a-1)%10|0}if(r=r||e<0||f[d+1]!==void 0||(a<0?c:c%Ui(10,i-a-1)),u=n<4?(l||r)&&(n==0||n==(t.s<0?3:2)):l>5||l==5&&(n==4||r||n==6&&(o>0?a>0?c/Ui(10,i-a):0:f[d-1])%10&1||n==(t.s<0?8:7)),e<1||!f[0])return f.length=0,u?(e-=t.e+1,f[0]=Ui(10,(Qt-e%Qt)%Qt),t.e=-e||0):f[0]=t.e=0,t;if(o==0?(f.length=d,s=1,d--):(f.length=d+1,s=Ui(10,Qt-o),f[d]=a>0?(c/Ui(10,i-a)%Ui(10,a)|0)*s:0),u)for(;;)if(d==0){for(o=1,a=f[0];a>=10;a/=10)o++;for(a=f[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(t.e++,f[0]==nu&&(f[0]=1));break}else{if(f[d]+=s,f[d]!=nu)break;f[d--]=0,s=1}for(o=f.length;f[--o]===0;)f.pop()}return hn&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+sd(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+sd(-i-1)+o,n&&(r=n-a)>0&&(o+=sd(r))):i>=a?(o+=sd(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+sd(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=sd(r))),o}function nC(t,e){var n=t[0];for(e*=Qt;n>=10;n/=10)e++;return e}function QE(t,e,n){if(e>s0e)throw hn=!0,n&&(t.precision=n),Error(nV);return qt(new t(ZE),e,1,!0)}function Kl(t,e,n){if(e>SR)throw Error(nV);return qt(new t(JE),e,n,!0)}function aV(t){var e=t.length-1,n=e*Qt+1;if(e=t[e],e){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function sd(t){for(var e="";t--;)e+="0";return e}function sV(t,e,n,r){var i,o=new t(1),a=Math.ceil(r/Qt+4);for(hn=!1;;){if(n%2&&(o=o.times(e),I8(o.d,a)&&(i=!0)),n=Xo(n/2),n===0){n=o.d.length-1,i&&o.d[n]===0&&++o.d[n];break}e=e.times(e),I8(e.d,a)}return hn=!0,o}function O8(t){return t.d[t.d.length-1]&1}function lV(t,e,n){for(var r,i=new t(e[0]),o=0;++o17)return new d(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:0/0);for(e==null?(hn=!1,l=y):l=e,s=new d(.03125);t.e>-2;)t=t.times(s),f+=5;for(r=Math.log(Ui(2,f))/Math.LN10*2+5|0,l+=r,n=o=a=new d(1),d.precision=l;;){if(o=qt(o.times(t),l,1),n=n.times(++c),s=a.plus(yr(o,n,l,1)),wo(s.d).slice(0,l)===wo(a.d).slice(0,l)){for(i=f;i--;)a=qt(a.times(a),l,1);if(e==null)if(u<3&&yx(a.d,l-r,p,u))d.precision=l+=10,n=o=s=new d(1),c=0,u++;else return qt(a,d.precision=y,p,hn=!0);else return d.precision=y,a}a=s}}function md(t,e){var n,r,i,o,a,s,l,u,c,f,d,p=1,y=10,x=t,_=x.d,v=x.constructor,S=v.rounding,w=v.precision;if(x.s<0||!_||!_[0]||!x.e&&_[0]==1&&_.length==1)return new v(_&&!_[0]?-1/0:x.s!=1?NaN:_?0:x);if(e==null?(hn=!1,c=w):c=e,v.precision=c+=y,n=wo(_),r=n.charAt(0),Math.abs(o=x.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(t),n=wo(x.d),r=n.charAt(0),p++;o=x.e,r>1?(x=new v("0."+n),o++):x=new v(r+"."+n.slice(1))}else return u=QE(v,c+2,w).times(o+""),x=md(new v(r+"."+n.slice(1)),c-y).plus(u),v.precision=w,e==null?qt(x,w,S,hn=!0):x;for(f=x,l=a=x=yr(x.minus(1),x.plus(1),c,1),d=qt(x.times(x),c,1),i=3;;){if(a=qt(a.times(d),c,1),u=l.plus(yr(a,new v(i),c,1)),wo(u.d).slice(0,c)===wo(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(QE(v,c+2,w).times(o+""))),l=yr(l,new v(p),c,1),e==null)if(yx(l.d,c-y,S,s))v.precision=c+=y,u=a=x=yr(f.minus(1),f.plus(1),c,1),d=qt(x.times(x),c,1),i=s=1;else return qt(l,v.precision=w,S,hn=!0);else return v.precision=w,l;l=u,i+=2}}function uV(t){return String(t.s*t.s/0)}function MR(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;r++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(r,i),e){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%Qt,n<0&&(r+=Qt),rt.constructor.maxE?(t.d=null,t.e=NaN):t.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),oV.test(e))return MR(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(i0e.test(e))n=16,e=e.toLowerCase();else if(r0e.test(e))n=2;else if(o0e.test(e))n=8;else throw Error(Id+e);for(o=e.search(/p/i),o>0?(l=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),a=o>=0,r=t.constructor,a&&(e=e.replace(".",""),s=e.length,o=s-o,i=sV(r,new r(n),o,o*2)),u=tE(e,n,nu),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new r(t.s*0):(t.e=nC(u,c),t.d=u,hn=!1,a&&(t=yr(t,i,s*4)),l&&(t=t.times(Math.abs(l)<54?Ui(2,l):Ld.pow(2,l))),hn=!0,t)}function c0e(t,e){var n,r=e.d.length;if(r<3)return e.isZero()?e:Yg(t,2,e,e);n=1.4*Math.sqrt(r),n=n>16?16:n|0,e=e.times(1/rC(5,n)),e=Yg(t,2,e,e);for(var i,o=new t(5),a=new t(16),s=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(a.times(i).minus(s))));return e}function Yg(t,e,n,r,i){var o,a,s,l,u=t.precision,c=Math.ceil(u/Qt);for(hn=!1,l=n.times(n),s=new t(r);;){if(a=yr(s.times(l),new t(e++*e++),u,1),s=i?r.plus(a):r.minus(a),r=yr(a.times(l),new t(e++*e++),u,1),a=s.plus(r),a.d[c]!==void 0){for(o=c;a.d[o]===s.d[o]&&o--;);if(o==-1)break}o=s,s=r,r=a,a=o}return hn=!0,a.d.length=c+1,a}function rC(t,e){for(var n=t;--e;)n*=t;return n}function cV(t,e){var n,r=e.s<0,i=Kl(t,t.precision,1),o=i.times(.5);if(e=e.abs(),e.lte(o))return Vc=r?4:1,e;if(n=e.divToInt(i),n.isZero())Vc=r?3:2;else{if(e=e.minus(n.times(i)),e.lte(o))return Vc=O8(n)?r?2:3:r?4:1,e;Vc=O8(n)?r?1:4:r?3:2}return e.minus(i).abs()}function UO(t,e,n,r){var i,o,a,s,l,u,c,f,d,p=t.constructor,y=n!==void 0;if(y?(ja(n,1,Zd),r===void 0?r=p.rounding:ja(r,0,8)):(n=p.precision,r=p.rounding),!t.isFinite())c=uV(t);else{for(c=Qu(t),a=c.indexOf("."),y?(i=2,e==16?n=n*4-3:e==8&&(n=n*3-2)):i=e,a>=0&&(c=c.replace(".",""),d=new p(1),d.e=c.length-a,d.d=tE(Qu(d),10,i),d.e=d.d.length),f=tE(c,10,i),o=l=f.length;f[--l]==0;)f.pop();if(!f[0])c=y?"0p+0":"0";else{if(a<0?o--:(t=new p(t),t.d=f,t.e=o,t=yr(t,d,n,r,0,i),f=t.d,o=t.e,u=tV),a=f[n],s=i/2,u=u||f[n+1]!==void 0,u=r<4?(a!==void 0||u)&&(r===0||r===(t.s<0?3:2)):a>s||a===s&&(r===4||u||r===6&&f[n-1]&1||r===(t.s<0?8:7)),f.length=n,u)for(;++f[--n]>i-1;)f[n]=0,n||(++o,f.unshift(1));for(l=f.length;!f[l-1];--l);for(a=0,c="";a1)if(e==16||e==8){for(a=e==16?4:3,--l;l%a;l++)c+="0";for(f=tE(c,i,e),l=f.length;!f[l-1];--l);for(a=1,c="1.";al)for(o-=l;o--;)c+="0";else oe)return t.length=e,!0}function f0e(t){return new this(t).abs()}function d0e(t){return new this(t).acos()}function h0e(t){return new this(t).acosh()}function p0e(t,e){return new this(t).plus(e)}function m0e(t){return new this(t).asin()}function g0e(t){return new this(t).asinh()}function v0e(t){return new this(t).atan()}function y0e(t){return new this(t).atanh()}function x0e(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return!t.s||!e.s?n=new this(NaN):!t.d&&!e.d?(n=Kl(this,o,1).times(e.s>0?.25:.75),n.s=t.s):!e.d||t.isZero()?(n=e.s<0?Kl(this,r,i):new this(0),n.s=t.s):!t.d||e.isZero()?(n=Kl(this,o,1).times(.5),n.s=t.s):e.s<0?(this.precision=o,this.rounding=1,n=this.atan(yr(t,e,o,1)),e=Kl(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(yr(t,e,o,1)),n}function b0e(t){return new this(t).cbrt()}function _0e(t){return qt(t=new this(t),t.e+1,2)}function w0e(t,e,n){return new this(t).clamp(e,n)}function S0e(t){if(!t||typeof t!="object")throw Error(tC+"Object expected");var e,n,r,i=t.defaults===!0,o=["precision",1,Zd,"rounding",0,8,"toExpNeg",-sg,0,"toExpPos",0,sg,"maxE",0,sg,"minE",-sg,0,"modulo",0,9];for(e=0;e=o[e+1]&&r<=o[e+2])this[n]=r;else throw Error(Id+n+": "+r);if(n="crypto",i&&(this[n]=wR[n]),(r=t[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(rV);else this[n]=!1;else throw Error(Id+n+": "+r);return this}function E0e(t){return new this(t).cos()}function M0e(t){return new this(t).cosh()}function fV(t){var e,n,r;function i(o){var a,s,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,L8(o)){u.s=o.s,hn?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;s/=10)a++;hn?a>i.maxE?(u.e=NaN,u.d=null):a=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(r*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(s.push(i%1e7),o+=4);o=r/4}else throw Error(rV);else for(;o=10;i/=10)r++;r{var{on:e,config:n}=t,r=Ld.clone({precision:n.precision,modulo:Ld.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(i){return new r(i.value)},e&&e("config",function(i,o){i.precision!==o.precision&&r.config({precision:i.precision})}),r},{isClass:!0}),dV={exports:{}};/** + * @license Complex.js v2.1.1 12/05/2020 + * + * Copyright (c) 2020, Robert Eisele (robert@xarg.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/(function(t,e){(function(n){var r=Math.cosh||function(f){return Math.abs(f)<1e-9?1-f:(Math.exp(f)+Math.exp(-f))*.5},i=Math.sinh||function(f){return Math.abs(f)<1e-9?f:(Math.exp(f)-Math.exp(-f))*.5},o=function(f){var d=Math.PI/4;if(-d>f||f>d)return Math.cos(f)-1;var p=f*f;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},a=function(f,d){var p=Math.abs(f),y=Math.abs(d);return p<3e3&&y<3e3?Math.sqrt(p*p+y*y):(p0&&s();break;case"number":p.im=0,p.re=f;break;default:s()}return isNaN(p.re)||isNaN(p.im),p};function c(f,d){if(!(this instanceof c))return new c(f,d);var p=u(f,d);this.re=p.re,this.im=p.im}c.prototype={re:0,im:0,sign:function(){var f=this.abs();return new c(this.re/f,this.im/f)},add:function(f,d){var p=new c(f,d);return this.isInfinite()&&p.isInfinite()?c.NAN:this.isInfinite()||p.isInfinite()?c.INFINITY:new c(this.re+p.re,this.im+p.im)},sub:function(f,d){var p=new c(f,d);return this.isInfinite()&&p.isInfinite()?c.NAN:this.isInfinite()||p.isInfinite()?c.INFINITY:new c(this.re-p.re,this.im-p.im)},mul:function(f,d){var p=new c(f,d);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?c.NAN:this.isInfinite()||p.isInfinite()?c.INFINITY:p.im===0&&this.im===0?new c(this.re*p.re,0):new c(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(f,d){var p=new c(f,d);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return c.NAN;if(this.isInfinite()||p.isZero())return c.INFINITY;if(this.isZero()||p.isInfinite())return c.ZERO;f=this.re,d=this.im;var y=p.re,x=p.im,_,v;return x===0?new c(f/y,d/y):Math.abs(y)0)return new c(Math.pow(f,p.re),0);if(f===0)switch((p.re%4+4)%4){case 0:return new c(Math.pow(d,p.re),0);case 1:return new c(0,Math.pow(d,p.re));case 2:return new c(-Math.pow(d,p.re),0);case 3:return new c(0,-Math.pow(d,p.re))}}if(f===0&&d===0&&p.re>0&&p.im>=0)return c.ZERO;var y=Math.atan2(d,f),x=l(f,d);return f=Math.exp(p.re*x-p.im*y),d=p.im*x+p.re*y,new c(f*Math.cos(d),f*Math.sin(d))},sqrt:function(){var f=this.re,d=this.im,p=this.abs(),y,x;if(f>=0){if(d===0)return new c(Math.sqrt(f),0);y=.5*Math.sqrt(2*(p+f))}else y=Math.abs(d)/Math.sqrt(2*(p-f));return f<=0?x=.5*Math.sqrt(2*(p-f)):x=Math.abs(d)/Math.sqrt(2*(p+f)),new c(y,d<0?-x:x)},exp:function(){var f=Math.exp(this.re);return this.im,new c(f*Math.cos(this.im),f*Math.sin(this.im))},expm1:function(){var f=this.re,d=this.im;return new c(Math.expm1(f)*Math.cos(d)+o(d),Math.exp(f)*Math.sin(d))},log:function(){var f=this.re,d=this.im;return new c(l(f,d),Math.atan2(d,f))},abs:function(){return a(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var f=this.re,d=this.im;return new c(Math.sin(f)*r(d),Math.cos(f)*i(d))},cos:function(){var f=this.re,d=this.im;return new c(Math.cos(f)*r(d),-Math.sin(f)*i(d))},tan:function(){var f=2*this.re,d=2*this.im,p=Math.cos(f)+r(d);return new c(Math.sin(f)/p,i(d)/p)},cot:function(){var f=2*this.re,d=2*this.im,p=Math.cos(f)-r(d);return new c(-Math.sin(f)/p,i(d)/p)},sec:function(){var f=this.re,d=this.im,p=.5*r(2*d)+.5*Math.cos(2*f);return new c(Math.cos(f)*r(d)/p,Math.sin(f)*i(d)/p)},csc:function(){var f=this.re,d=this.im,p=.5*r(2*d)-.5*Math.cos(2*f);return new c(Math.sin(f)*r(d)/p,-Math.cos(f)*i(d)/p)},asin:function(){var f=this.re,d=this.im,p=new c(d*d-f*f+1,-2*f*d).sqrt(),y=new c(p.re-d,p.im+f).log();return new c(y.im,-y.re)},acos:function(){var f=this.re,d=this.im,p=new c(d*d-f*f+1,-2*f*d).sqrt(),y=new c(p.re-d,p.im+f).log();return new c(Math.PI/2-y.im,y.re)},atan:function(){var f=this.re,d=this.im;if(f===0){if(d===1)return new c(0,1/0);if(d===-1)return new c(0,-1/0)}var p=f*f+(1-d)*(1-d),y=new c((1-d*d-f*f)/p,-2*f/p).log();return new c(-.5*y.im,.5*y.re)},acot:function(){var f=this.re,d=this.im;if(d===0)return new c(Math.atan2(1,f),0);var p=f*f+d*d;return p!==0?new c(f/p,-d/p).atan():new c(f!==0?f/0:0,d!==0?-d/0:0).atan()},asec:function(){var f=this.re,d=this.im;if(f===0&&d===0)return new c(0,1/0);var p=f*f+d*d;return p!==0?new c(f/p,-d/p).acos():new c(f!==0?f/0:0,d!==0?-d/0:0).acos()},acsc:function(){var f=this.re,d=this.im;if(f===0&&d===0)return new c(Math.PI/2,1/0);var p=f*f+d*d;return p!==0?new c(f/p,-d/p).asin():new c(f!==0?f/0:0,d!==0?-d/0:0).asin()},sinh:function(){var f=this.re,d=this.im;return new c(i(f)*Math.cos(d),r(f)*Math.sin(d))},cosh:function(){var f=this.re,d=this.im;return new c(r(f)*Math.cos(d),i(f)*Math.sin(d))},tanh:function(){var f=2*this.re,d=2*this.im,p=r(f)+Math.cos(d);return new c(i(f)/p,Math.sin(d)/p)},coth:function(){var f=2*this.re,d=2*this.im,p=r(f)-Math.cos(d);return new c(i(f)/p,-Math.sin(d)/p)},csch:function(){var f=this.re,d=this.im,p=Math.cos(2*d)-r(2*f);return new c(-2*i(f)*Math.cos(d)/p,2*r(f)*Math.sin(d)/p)},sech:function(){var f=this.re,d=this.im,p=Math.cos(2*d)+r(2*f);return new c(2*r(f)*Math.cos(d)/p,-2*i(f)*Math.sin(d)/p)},asinh:function(){var f=this.im;this.im=-this.re,this.re=f;var d=this.asin();return this.re=-this.im,this.im=f,f=d.re,d.re=-d.im,d.im=f,d},acosh:function(){var f=this.acos();if(f.im<=0){var d=f.re;f.re=-f.im,f.im=d}else{var d=f.im;f.im=-f.re,f.re=d}return f},atanh:function(){var f=this.re,d=this.im,p=f>1&&d===0,y=1-f,x=1+f,_=y*y+d*d,v=_!==0?new c((x*y-d*d)/_,(d*y+x*d)/_):new c(f!==-1?f/0:0,d!==0?d/0:0),S=v.re;return v.re=l(v.re,v.im)/2,v.im=Math.atan2(v.im,S)/2,p&&(v.im=-v.im),v},acoth:function(){var f=this.re,d=this.im;if(f===0&&d===0)return new c(0,Math.PI/2);var p=f*f+d*d;return p!==0?new c(f/p,-d/p).atanh():new c(f!==0?f/0:0,d!==0?-d/0:0).atanh()},acsch:function(){var f=this.re,d=this.im;if(d===0)return new c(f!==0?Math.log(f+Math.sqrt(f*f+1)):1/0,0);var p=f*f+d*d;return p!==0?new c(f/p,-d/p).asinh():new c(f!==0?f/0:0,d!==0?-d/0:0).asinh()},asech:function(){var f=this.re,d=this.im;if(this.isZero())return c.INFINITY;var p=f*f+d*d;return p!==0?new c(f/p,-d/p).acosh():new c(f!==0?f/0:0,d!==0?-d/0:0).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO;var f=this.re,d=this.im,p=f*f+d*d;return new c(f/p,-d/p)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(f){return f=Math.pow(10,f||0),new c(Math.ceil(this.re*f)/f,Math.ceil(this.im*f)/f)},floor:function(f){return f=Math.pow(10,f||0),new c(Math.floor(this.re*f)/f,Math.floor(this.im*f)/f)},round:function(f){return f=Math.pow(10,f||0),new c(Math.round(this.re*f)/f,Math.round(this.im*f)/f)},equals:function(f,d){var p=new c(f,d);return Math.abs(p.re-this.re)<=c.EPSILON&&Math.abs(p.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){var f=this.re,d=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(f)(Object.defineProperty(yo,"name",{value:"Complex"}),yo.prototype.constructor=yo,yo.prototype.type="Complex",yo.prototype.isComplex=!0,yo.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},yo.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},yo.prototype.format=function(t){var e="",n=this.im,r=this.re,i=xR(this.re,t),o=xR(this.im,t),a=Br(t)?t:t?t.precision:null;if(a!==null){var s=Math.pow(10,-a);Math.abs(r/n)e.re?1:t.ree.im?1:t.im1&&(S[w]=(S[w]||0)+1):S[v]=(S[v]||0)+1,S}var l=function(v,S){var w=0,E=1,T=1,A=0,D=0,I=0,P=1,N=1,B=0,G=1,Z=1,j=1,J=1e7,Y;if(v!=null)if(S!==void 0){if(w=v,E=S,T=w*E,w%1!==0||E%1!==0)throw _()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)w=v.n,E=v.d,"s"in v&&(w*=v.s);else if(0 in v)w=v[0],1 in v&&(E=v[1]);else throw x();T=w*E;break}case"number":{if(v<0&&(T=v,v=-v),v%1===0)w=v;else if(v>0){for(v>=1&&(N=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=N);G<=J&&j<=J;)if(Y=(B+Z)/(G+j),v===Y){G+j<=J?(w=B+Z,E=G+j):j>G?(w=Z,E=j):(w=B,E=G);break}else v>Y?(B+=Z,G+=j):(Z+=B,j+=G),G>J?(w=Z,E=j):(w=B,E=G);w*=N}else(isNaN(v)||isNaN(S))&&(E=w=NaN);break}case"string":{if(G=v.match(/\d+|./g),G===null)throw x();if(G[B]==="-"?(T=-1,B++):G[B]==="+"&&B++,G.length===B+1?D=o(G[B++],T):G[B+1]==="."||G[B]==="."?(G[B]!=="."&&(A=o(G[B++],T)),B++,(B+1===G.length||G[B+1]==="("&&G[B+3]===")"||G[B+1]==="'"&&G[B+3]==="'")&&(D=o(G[B],T),P=Math.pow(10,G[B].length),B++),(G[B]==="("&&G[B+2]===")"||G[B]==="'"&&G[B+2]==="'")&&(I=o(G[B+1],T),N=Math.pow(10,G[B+1].length)-1,B+=3)):G[B+1]==="/"||G[B+1]===":"?(D=o(G[B],T),P=o(G[B+2],1),B+=3):G[B+3]==="/"&&G[B+1]===" "&&(A=o(G[B],T),D=o(G[B+2],T),P=o(G[B+4],1),B+=5),G.length<=B){E=P*N,T=w=I+E*A+N*D;break}}default:throw x()}if(E===0)throw y();i.s=T<0?-1:1,i.n=Math.abs(w),i.d=Math.abs(E)};function u(v,S,w){for(var E=1;S>0;v=v*v%w,S>>=1)S&1&&(E=E*v%w);return E}function c(v,S){for(;S%2===0;S/=2);for(;S%5===0;S/=5);if(S===1)return 0;for(var w=10%S,E=1;w!==1;E++)if(w=w*10%S,E>r)return 0;return E}function f(v,S,w){for(var E=1,T=u(10,w,S),A=0;A<300;A++){if(E===T)return A;E=E*10%S,T=T*10%S}return 0}function d(v,S){if(!v)return S;if(!S)return v;for(;;){if(v%=S,!v)return S;if(S%=v,!S)return v}}function p(v,S){if(l(v,S),this instanceof p)v=d(i.d,i.n),this.s=i.s,this.n=i.n/v,this.d=i.d/v;else return a(i.s*i.n,i.d)}var y=function(){return new Error("Division by Zero")},x=function(){return new Error("Invalid argument")},_=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return a(this.n,this.d)},neg:function(){return a(-this.s*this.n,this.d)},add:function(v,S){return l(v,S),a(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(v,S){return l(v,S),a(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(v,S){return l(v,S),a(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(v,S){return l(v,S),a(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return a(this.s*this.n,this.d)},mod:function(v,S){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(v===void 0)return a(this.s*this.n%this.d,1);if(l(v,S),i.n===0&&this.d===0)throw y();return a(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(v,S){return l(v,S),a(d(i.n,this.n)*d(i.d,this.d),i.d*this.d)},lcm:function(v,S){return l(v,S),i.n===0&&this.n===0?a(0,1):a(i.n*this.n,d(i.n,this.n)*d(i.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):a(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):a(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):a(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return a(this.s*this.d,this.n)},pow:function(v,S){if(l(v,S),i.d===1)return i.s<0?a(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):a(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var w=s(this.n),E=s(this.d),T=1,A=1;for(var D in w)if(D!=="1"){if(D==="0"){T=0;break}if(w[D]*=i.n,w[D]%i.d===0)w[D]/=i.d;else return null;T*=Math.pow(D,w[D])}for(var D in E)if(D!=="1"){if(E[D]*=i.n,E[D]%i.d===0)E[D]/=i.d;else return null;A*=Math.pow(D,E[D])}return i.s<0?a(A,T):a(T,A)},equals:function(v,S){return l(v,S),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(v,S){l(v,S);var w=this.s*this.n*i.d-i.s*i.n*this.d;return(0=0;A--)T=T.inverse().add(w[A]);if(Math.abs(T.sub(S).valueOf())0&&(w+=S,w+=" ",E%=T),w+=E,w+="/",w+=T),w},toLatex:function(v){var S,w="",E=this.n,T=this.d;return this.s<0&&(w+="-"),T===1?w+=E:(v&&(S=Math.floor(E/T))>0&&(w+=S,E%=T),w+="\\frac{",w+=E,w+="}{",w+=T,w+="}"),w},toContinued:function(){var v,S=this.n,w=this.d,E=[];if(isNaN(S)||isNaN(w))return E;do E.push(Math.floor(S/w)),v=S%w,S=w,w=v;while(S!==1);return E},toString:function(v){var S=this.n,w=this.d;if(isNaN(S)||isNaN(w))return"NaN";v=v||15;var E=c(S,w),T=f(S,w,E),A=this.s<0?"-":"";if(A+=S/w|0,S%=w,S*=10,S&&(A+="."),E){for(var D=T;D--;)A+=S/w|0,S%=w,S*=10;A+="(";for(var D=E;D--;)A+=S/w|0,S%=w,S*=10;A+=")"}else for(var D=v;S&&D--;)A+=S/w|0,S%=w,S*=10;return A}},Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,t.exports=p})()})(hV);var rge=hV.exports;const Mc=su(rge);var ige="Fraction",oge=[],age=Dt(ige,oge,()=>(Object.defineProperty(Mc,"name",{value:"Fraction"}),Mc.prototype.constructor=Mc,Mc.prototype.type="Fraction",Mc.prototype.isFraction=!0,Mc.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Mc.fromJSON=function(t){return new Mc(t)},Mc),{isClass:!0}),sge="Matrix",lge=[],uge=Dt(sge,lge,()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(e,n){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(e,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(e,n,r){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(e,n){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(e,n){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(e,n){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0});function cge(t){var e=0,n=1,r=Object.create(null),i=Object.create(null),o=0,a=function(l){var u=i[l];if(u&&(delete r[u],delete i[l],--e,n===u)){if(!e){o=0,n=1;return}for(;!Object.prototype.hasOwnProperty.call(r,++n););}};return t=Math.abs(t),{hit:function(l){var u=i[l],c=++o;if(r[c]=l,i[l]=c,!u)return++e,e<=t?void 0:(l=r[n],a(l),l);if(delete r[u],n===u)for(;!Object.prototype.hasOwnProperty.call(r,++n););},delete:a,clear:function(){e=o=0,n=1,r=Object.create(null),i=Object.create(null)}}}function hb(t){var{hasher:e,limit:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=n??Number.POSITIVE_INFINITY,e=e??JSON.stringify,function r(){typeof r.cache!="object"&&(r.cache={values:new Map,lru:cge(n||Number.POSITIVE_INFINITY)});for(var i=[],o=0;o{var{Matrix:e}=t;function n(c,f){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Lu(f))throw new Error("Invalid datatype: "+f);if(di(c))c.type==="DenseMatrix"?(this._data=Fr(c._data),this._size=Fr(c._size),this._datatype=f||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=f||c._datatype);else if(c&&jr(c.data)&&jr(c.size))this._data=c.data,this._size=c.size,P8(this._data,this._size),this._datatype=f||c.datatype;else if(jr(c))this._data=u(c),this._size=ya(this._data),P8(this._data,this._size),this._datatype=f;else{if(c)throw new TypeError("Unsupported type of data ("+fl(c)+")");this._data=[],this._size=[0],this._datatype=f}}n.prototype=new e,n.prototype.createDenseMatrix=function(c,f){return new n(c,f)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return YE(this._data,fl)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,f){return new n(c,f)},n.prototype.subset=function(c,f,d){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return o(this,c,f,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){if(!jr(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new ir(c.length,this._size.length);for(var f=0;f");var w=f.max().map(function(A){return A+1});l(c,w,p);var E=y.length,T=0;a(c._data,f,d,E,T)}return c}function a(c,f,d,p,y){var x=y===p-1,_=f.dimension(y);x?_.forEach(function(v,S){qr(v),c[v]=d[S[0]]}):_.forEach(function(v,S){qr(v),a(c[v],f,d[S[0]],p,y+1)})}n.prototype.resize=function(c,f,d){if(!vx(c))throw new TypeError("Array or Matrix expected");var p=c.valueOf().map(x=>Array.isArray(x)&&x.length===1?x[0]:x),y=d?this.clone():this;return s(y,p,f)};function s(c,f,d){if(f.length===0){for(var p=c._data;jr(p);)p=p[0];return p}return c._size=f.slice(0),c._data=XE(c._data,c._size,d),c}n.prototype.reshape=function(c,f){var d=f?this.clone():this;d._data=jH(d._data,c);var p=d._size.reduce((y,x)=>y*x);return d._size=BO(c,p),d};function l(c,f,d){for(var p=c._size.slice(0),y=!1;p.lengthp[x]&&(p[x]=f[x],y=!0);y&&s(c,p,d)}n.prototype.clone=function(){var c=new n({data:Fr(this._data),size:Fr(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var f=this,d=pV(c),p=function _(v,S){return jr(v)?v.map(function(w,E){return _(w,S.concat(E))}):d===1?c(v):d===2?c(v,S):c(v,S,f)},y=p(this._data,[]),x=this._datatype!==void 0?YE(y,fl):void 0;return new n(y,x)},n.prototype.forEach=function(c){var f=this,d=function p(y,x){jr(y)?y.forEach(function(_,v){p(_,x.concat(v))}):c(y,x,f)};d(this._data,[])},n.prototype[Symbol.iterator]=function*(){var c=function*f(d,p){if(jr(d))for(var y=0;y[w[v]]);f.push(new n(S,c._datatype))},x=0;x0?c:0,d=c<0?-c:0,p=this._size[0],y=this._size[1],x=Math.min(p-d,y-f),_=[],v=0;v0?d:0,x=d<0?-d:0,_=c[0],v=c[1],S=Math.min(_-x,v-y),w;if(jr(f)){if(f.length!==S)throw new Error("Invalid value array length");w=function(I){return f[I]}}else if(di(f)){var E=f.size();if(E.length!==1||E[0]!==S)throw new Error("Invalid matrix length");w=function(I){return f.get([I])}}else w=function(){return f};p||(p=lo(w(0))?w(0).mul(0):0);var T=[];if(c.length>0){T=XE(T,c,p);for(var A=0;A=r.length)throw new Kd(e,r.length);return di(t)?t.create(e2(t.valueOf(),e,n)):e2(t,e,n)}function e2(t,e,n){var r,i,o,a;if(e<=0)if(Array.isArray(t[0])){for(a=pge(t),i=[],r=0;r{var{typed:e}=t;return e(F8,{number:Pr,BigNumber:function(r){return r.isInt()},Fraction:function(r){return r.d===1&&isFinite(r.n)},"Array | Matrix":e.referToSelf(n=>r=>Hi(r,n))})}),vV="number",iC="number, number";function yV(t){return Math.abs(t)}yV.signature=vV;function xV(t,e){return t+e}xV.signature=iC;function bV(t,e){return t-e}bV.signature=iC;function _V(t,e){return t*e}_V.signature=iC;function wV(t){return-t}wV.signature=vV;function SV(t,e){return t*t<1&&e===1/0||t*t>1&&e===-1/0?0:Math.pow(t,e)}SV.signature=iC;function k8(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Pr(e)||e<0||e>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(HH(t,e))}var vge="number";function EV(t){return t===0}EV.signature=vge;var B8="isNumeric",yge=["typed"],xge=Dt(B8,yge,t=>{var{typed:e}=t;return e(B8,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(n=>r=>Hi(r,n))})}),U8="isZero",bge=["typed"],_ge=Dt(U8,bge,t=>{var{typed:e}=t;return e(U8,{number:EV,BigNumber:function(r){return r.isZero()},Complex:function(r){return r.re===0&&r.im===0},Fraction:function(r){return r.d===1&&r.n===0},Unit:e.referToSelf(n=>r=>e.find(n,r.valueType())(r.value)),"Array | Matrix":e.referToSelf(n=>r=>Hi(r,n))})});function nf(t,e,n){if(n==null)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var r=t.minus(e).abs();if(r.isZero())return!0;var i=t.constructor.max(t.abs(),e.abs());return r.lte(i.times(n))}return!1}function wge(t,e,n){return bl(t.re,e.re,n)&&bl(t.im,e.im,n)}var pb=Dt("compareUnits",["typed"],t=>{var{typed:e}=t;return{"Unit, Unit":e.referToSelf(n=>(r,i)=>{if(!r.equalBase(i))throw new Error("Cannot compare units with different base");return e.find(n,[r.valueType(),i.valueType()])(r.value,i.value)})}}),t2="equalScalar",Sge=["typed","config"],Ege=Dt(t2,Sge,t=>{var{typed:e,config:n}=t,r=pb({typed:e});return e(t2,{"boolean, boolean":function(o,a){return o===a},"number, number":function(o,a){return bl(o,a,n.epsilon)},"BigNumber, BigNumber":function(o,a){return o.eq(a)||nf(o,a,n.epsilon)},"Fraction, Fraction":function(o,a){return o.equals(a)},"Complex, Complex":function(o,a){return wge(o,a,n.epsilon)}},r)});Dt(t2,["typed","config"],t=>{var{typed:e,config:n}=t;return e(t2,{"number, number":function(i,o){return bl(i,o,n.epsilon)}})});var Mge="SparseMatrix",Cge=["typed","equalScalar","Matrix"],Age=Dt(Mge,Cge,t=>{var{typed:e,equalScalar:n,Matrix:r}=t;function i(x,_){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(_&&!Lu(_))throw new Error("Invalid datatype: "+_);if(di(x))o(this,x,_);else if(x&&jr(x.index)&&jr(x.ptr)&&jr(x.size))this._values=x.values,this._index=x.index,this._ptr=x.ptr,this._size=x.size,this._datatype=_||x.datatype;else if(jr(x))a(this,x,_);else{if(x)throw new TypeError("Unsupported type of data ("+fl(x)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=_}}function o(x,_,v){_.type==="SparseMatrix"?(x._values=_._values?Fr(_._values):void 0,x._index=Fr(_._index),x._ptr=Fr(_._ptr),x._size=Fr(_._size),x._datatype=v||_._datatype):a(x,_.valueOf(),v||_._datatype)}function a(x,_,v){x._values=[],x._index=[],x._ptr=[],x._datatype=v;var S=_.length,w=0,E=n,T=0;if(Lu(v)&&(E=e.find(n,[v,v])||n,T=e.convert(0,v)),S>0){var A=0;do{x._ptr.push(x._index.length);for(var D=0;D");if(w.length===1){var I=_.dimension(0);I.forEach(function(B,G){qr(B),x.set([B,0],v[G[0]],S)})}else{var P=_.dimension(0),N=_.dimension(1);P.forEach(function(B,G){qr(B),N.forEach(function(Z,j){qr(Z),x.set([B,Z],v[G[0]][j[0]],S)})})}}return x}i.prototype.get=function(x){if(!jr(x))throw new TypeError("Array expected");if(x.length!==this._size.length)throw new ir(x.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var _=x[0],v=x[1];qr(_,this._size[0]),qr(v,this._size[1]);var S=u(_,this._ptr[v],this._ptr[v+1],this._index);return SE-1||w>T-1)&&(d(this,Math.max(S+1,E),Math.max(w+1,T),v),E=this._size[0],T=this._size[1]),qr(S,E),qr(w,T);var I=u(S,this._ptr[w],this._ptr[w+1],this._index);return IArray.isArray(E)&&E.length===1?E[0]:E);if(S.length!==2)throw new Error("Only two dimensions matrix are supported");S.forEach(function(E){if(!Br(E)||!Pr(E)||E<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ui(S)+")")});var w=v?this.clone():this;return d(w,S[0],S[1],_)};function d(x,_,v,S){var w=S||0,E=n,T=0;Lu(x._datatype)&&(E=e.find(n,[x._datatype,x._datatype])||n,T=e.convert(0,x._datatype),w=e.convert(w,x._datatype));var A=!E(w,T),D=x._size[0],I=x._size[1],P,N,B;if(v>I){for(N=I;ND){if(A){var G=0;for(N=0;N_-1&&(x._values.splice(B,1),x._index.splice(B,1),j++)}x._ptr[N]=x._values.length}return x._size[0]=_,x._size[1]=v,x}i.prototype.reshape=function(x,_){if(!jr(x))throw new TypeError("Array expected");if(x.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");x.forEach(function(U){if(!Br(U)||!Pr(U)||U<=-2||U===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+ui(x)+")")});var v=this._size[0]*this._size[1];x=BO(x,v);var S=x[0]*x[1];if(v!==S)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var w=_?this.clone():this;if(this._size[0]===x[0]&&this._size[1]===x[1])return w;for(var E=[],T=0;T=_&&Y<=v&&B(x._values[J],Y-_,G-S)}else{for(var $={},W=Z;W "+(this._values?ui(this._values[D],x):"X")}return w},i.prototype.toString=function(){return ui(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(x){if(x){if(lo(x)&&(x=x.toNumber()),!Br(x)||!Pr(x))throw new TypeError("The parameter k must be an integer number")}else x=0;var _=x>0?x:0,v=x<0?-x:0,S=this._size[0],w=this._size[1],E=Math.min(S-v,w-_),T=[],A=[],D=[];D[0]=0;for(var I=_;I0?v:0,D=v<0?-v:0,I=x[0],P=x[1],N=Math.min(I-D,P-A),B;if(jr(_)){if(_.length!==N)throw new Error("Invalid value array length");B=function(ne){return _[ne]}}else if(di(_)){var G=_.size();if(G.length!==1||G[0]!==N)throw new Error("Invalid matrix length");B=function(ne){return _.get([ne])}}else B=function(){return _};for(var Z=[],j=[],J=[],Y=0;Y=0&&$=D||w[P]!==_)){var B=S?S[I]:void 0;w.splice(P,0,_),S&&S.splice(P,0,B),w.splice(P<=I?I+1:I,1),S&&S.splice(P<=I?I+1:I,1);continue}if(P=D||w[I]!==x)){var G=S?S[P]:void 0;w.splice(I,0,x),S&&S.splice(I,0,G),w.splice(I<=P?P+1:P,1),S&&S.splice(I<=P?P+1:P,1)}}},i},{isClass:!0}),Tge="number",Dge=["typed"];function Rge(t){var e=t.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var n={"0b":2,"0o":8,"0x":16}[e[1]],r=e[2],i=e[3];return{input:t,radix:n,integerPart:r,fractionalPart:i}}else return null}function Pge(t){for(var e=parseInt(t.integerPart,t.radix),n=0,r=0;r{var{typed:e}=t,n=e("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var o=Rge(i);if(o)return Pge(o);var a=0,s=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);s&&(a=Number(s[2]),i=s[1]);var l=Number(i);if(isNaN(l))throw new SyntaxError('String "'+i+'" is not a valid number');if(s){if(l>2**a-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));l>=2**(a-1)&&(l=l-2**a)}return l},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:e.referToSelf(r=>i=>{var o=i.clone();return o.value=r(i.value),o}),null:function(i){return 0},"Unit, string | Unit":function(i,o){return i.toNumber(o)},"Array | Matrix":e.referToSelf(r=>i=>Hi(i,r))});return n.fromJSON=function(r){return parseFloat(r.value)},n}),Oge="bignumber",Ige=["typed","BigNumber"],Lge=Dt(Oge,Ige,t=>{var{typed:e,BigNumber:n}=t;return e("bignumber",{"":function(){return new n(0)},number:function(i){return new n(i+"")},string:function(i){var o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(o){var a=o[2],s=n(o[1]),l=new n(2).pow(Number(a));if(s.gt(l.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var u=new n(2).pow(Number(a)-1);return s.gte(u)?s.sub(l):s}return new n(i)},BigNumber:function(i){return i},Unit:e.referToSelf(r=>i=>{var o=i.clone();return o.value=r(i.value),o}),Fraction:function(i){return new n(i.n).div(i.d).times(i.s)},null:function(i){return new n(0)},"Array | Matrix":e.referToSelf(r=>i=>Hi(i,r))})}),Fge="fraction",kge=["typed","Fraction"],Bge=Dt(Fge,kge,t=>{var{typed:e,Fraction:n}=t;return e("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new n(i)},string:function(i){return new n(i)},"number, number":function(i,o){return new n(i,o)},null:function(i){return new n(0)},BigNumber:function(i){return new n(i.toString())},Fraction:function(i){return i},Unit:e.referToSelf(r=>i=>{var o=i.clone();return o.value=r(i.value),o}),Object:function(i){return new n(i)},"Array | Matrix":e.referToSelf(r=>i=>Hi(i,r))})}),z8="matrix",Uge=["typed","Matrix","DenseMatrix","SparseMatrix"],zge=Dt(z8,Uge,t=>{var{typed:e,Matrix:n,DenseMatrix:r,SparseMatrix:i}=t;return e(z8,{"":function(){return o([])},string:function(s){return o([],s)},"string, string":function(s,l){return o([],s,l)},Array:function(s){return o(s)},Matrix:function(s){return o(s,s.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(a,s,l){if(s==="dense"||s==="default"||s===void 0)return new r(a,l);if(s==="sparse")return new i(a,l);throw new TypeError("Unknown matrix type "+JSON.stringify(s)+".")}}),$8="unaryMinus",$ge=["typed"],Hge=Dt($8,$ge,t=>{var{typed:e}=t;return e($8,{number:wV,"Complex | BigNumber | Fraction":n=>n.neg(),Unit:e.referToSelf(n=>r=>{var i=r.clone();return i.value=e.find(n,i.valueType())(r.value),i}),"Array | Matrix":e.referToSelf(n=>r=>Hi(r,n))})}),H8="abs",Vge=["typed"],Wge=Dt(H8,Vge,t=>{var{typed:e}=t;return e(H8,{number:yV,"Complex | BigNumber | Fraction | Unit":n=>n.abs(),"Array | Matrix":e.referToSelf(n=>r=>Hi(r,n))})}),V8="addScalar",Gge=["typed"],jge=Dt(V8,Gge,t=>{var{typed:e}=t;return e(V8,{"number, number":xV,"Complex, Complex":function(r,i){return r.add(i)},"BigNumber, BigNumber":function(r,i){return r.plus(i)},"Fraction, Fraction":function(r,i){return r.add(i)},"Unit, Unit":e.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var o=r.clone();return o.value=e.find(n,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})}),W8="subtractScalar",qge=["typed"],Xge=Dt(W8,qge,t=>{var{typed:e}=t;return e(W8,{"number, number":bV,"Complex, Complex":function(r,i){return r.sub(i)},"BigNumber, BigNumber":function(r,i){return r.minus(i)},"Fraction, Fraction":function(r,i){return r.sub(i)},"Unit, Unit":e.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var o=r.clone();return o.value=e.find(n,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})}),Yge="matAlgo11xS0s",Kge=["typed","equalScalar"],mb=Dt(Yge,Kge,t=>{var{typed:e,equalScalar:n}=t;return function(i,o,a,s){var l=i._values,u=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],y=f[1],x,_=n,v=0,S=a;typeof d=="string"&&(x=d,_=e.find(n,[x,x]),v=e.convert(0,x),o=e.convert(o,x),S=e.find(a,[x,x]));for(var w=[],E=[],T=[],A=0;A{var{typed:e,DenseMatrix:n}=t;return function(i,o,a,s){var l=i._values,u=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],y=f[1],x,_=a;typeof d=="string"&&(x=d,o=e.convert(o,x),_=e.find(a,[x,x]));for(var v=[],S=[],w=[],E=0;E{var{typed:e}=t;return function(i,o,a,s){var l=i._data,u=i._size,c=i._datatype,f,d=a;typeof c=="string"&&(f=c,o=e.convert(o,f),d=e.find(a,[f,f]));var p=u.length>0?n(d,0,u,u[0],l,o,s):[];return i.createDenseMatrix({data:p,size:Fr(u),datatype:f})};function n(r,i,o,a,s,l,u){var c=[];if(i===o.length-1)for(var f=0;f{var{typed:e,config:n,round:r}=t;return e(CR,{number:function(o){return bl(o,r(o),n.epsilon)?r(o):Math.ceil(o)},"number, number":function(o,a){if(bl(o,r(o,a),n.epsilon))return r(o,a);var[s,l]="".concat(o,"e").split("e"),u=Math.ceil(Number("".concat(s,"e").concat(Number(l)+a)));return[s,l]="".concat(u,"e").split("e"),Number("".concat(s,"e").concat(Number(l)-a))}})}),rve=Dt(CR,tve,t=>{var{typed:e,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}=t,l=mb({typed:e,equalScalar:o}),u=df({typed:e,DenseMatrix:s}),c=Yp({typed:e}),f=nve({typed:e,config:n,round:r});return e("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.ceil()},"Complex, number":function(p,y){return p.ceil(y)},"Complex, BigNumber":function(p,y){return p.ceil(y.toNumber())},BigNumber:function(p){return nf(p,r(p),n.epsilon)?r(p):p.ceil()},"BigNumber, BigNumber":function(p,y){return nf(p,r(p,y),n.epsilon)?r(p,y):p.toDecimalPlaces(y.toNumber(),Ld.ROUND_CEIL)},Fraction:function(p){return p.ceil()},"Fraction, number":function(p,y){return p.ceil(y)},"Fraction, BigNumber":function(p,y){return p.ceil(y.toNumber())},"Array | Matrix":e.referToSelf(d=>p=>Hi(p,d)),"Array, number | BigNumber":e.referToSelf(d=>(p,y)=>Hi(p,x=>d(x,y))),"SparseMatrix, number | BigNumber":e.referToSelf(d=>(p,y)=>l(p,y,d,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(d=>(p,y)=>c(p,y,d,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(d=>(p,y)=>c(i(y),p,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(d=>(p,y)=>o(p,0)?a(y.size(),y.storage()):y.storage()==="dense"?c(y,p,d,!0):u(y,p,d,!0))})}),AR="fix",ive=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],ove=Dt(AR,["typed","ceil","floor"],t=>{var{typed:e,ceil:n,floor:r}=t;return e(AR,{number:function(o){return o>0?r(o):n(o)},"number, number":function(o,a){return o>0?r(o,a):n(o,a)}})}),ave=Dt(AR,ive,t=>{var{typed:e,Complex:n,matrix:r,ceil:i,floor:o,equalScalar:a,zeros:s,DenseMatrix:l}=t,u=df({typed:e,DenseMatrix:l}),c=Yp({typed:e}),f=ove({typed:e,ceil:i,floor:o});return e("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(p){return new n(p.re>0?Math.floor(p.re):Math.ceil(p.re),p.im>0?Math.floor(p.im):Math.ceil(p.im))},"Complex, number":function(p,y){return new n(p.re>0?o(p.re,y):i(p.re,y),p.im>0?o(p.im,y):i(p.im,y))},"Complex, BigNumber":function(p,y){var x=y.toNumber();return new n(p.re>0?o(p.re,x):i(p.re,x),p.im>0?o(p.im,x):i(p.im,x))},BigNumber:function(p){return p.isNegative()?i(p):o(p)},"BigNumber, number | BigNumber":function(p,y){return p.isNegative()?i(p,y):o(p,y)},Fraction:function(p){return p.s<0?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,y){return p.s<0?i(p,y):o(p,y)},"Array | Matrix":e.referToSelf(d=>p=>Hi(p,d)),"Array | Matrix, number | BigNumber":e.referToSelf(d=>(p,y)=>Hi(p,x=>d(x,y))),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(d=>(p,y)=>c(r(y),p,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(d=>(p,y)=>a(p,0)?s(y.size(),y.storage()):y.storage()==="dense"?c(y,p,d,!0):u(y,p,d,!0))})}),TR="floor",sve=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],lve=Dt(TR,["typed","config","round"],t=>{var{typed:e,config:n,round:r}=t;return e(TR,{number:function(o){return bl(o,r(o),n.epsilon)?r(o):Math.floor(o)},"number, number":function(o,a){if(bl(o,r(o,a),n.epsilon))return r(o,a);var[s,l]="".concat(o,"e").split("e"),u=Math.floor(Number("".concat(s,"e").concat(Number(l)+a)));return[s,l]="".concat(u,"e").split("e"),Number("".concat(s,"e").concat(Number(l)-a))}})}),uve=Dt(TR,sve,t=>{var{typed:e,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}=t,l=mb({typed:e,equalScalar:o}),u=df({typed:e,DenseMatrix:s}),c=Yp({typed:e}),f=lve({typed:e,config:n,round:r});return e("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.floor()},"Complex, number":function(p,y){return p.floor(y)},"Complex, BigNumber":function(p,y){return p.floor(y.toNumber())},BigNumber:function(p){return nf(p,r(p),n.epsilon)?r(p):p.floor()},"BigNumber, BigNumber":function(p,y){return nf(p,r(p,y),n.epsilon)?r(p,y):p.toDecimalPlaces(y.toNumber(),Ld.ROUND_FLOOR)},Fraction:function(p){return p.floor()},"Fraction, number":function(p,y){return p.floor(y)},"Fraction, BigNumber":function(p,y){return p.floor(y.toNumber())},"Array | Matrix":e.referToSelf(d=>p=>Hi(p,d)),"Array, number | BigNumber":e.referToSelf(d=>(p,y)=>Hi(p,x=>d(x,y))),"SparseMatrix, number | BigNumber":e.referToSelf(d=>(p,y)=>l(p,y,d,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(d=>(p,y)=>c(p,y,d,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(d=>(p,y)=>c(i(y),p,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(d=>(p,y)=>o(p,0)?a(y.size(),y.storage()):y.storage()==="dense"?c(y,p,d,!0):u(y,p,d,!0))})}),cve="matAlgo03xDSf",fve=["typed"],gb=Dt(cve,fve,t=>{var{typed:e}=t;return function(r,i,o,a){var s=r._data,l=r._size,u=r._datatype,c=i._values,f=i._index,d=i._ptr,p=i._size,y=i._datatype;if(l.length!==p.length)throw new ir(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var x=l[0],_=l[1],v,S=0,w=o;typeof u=="string"&&u===y&&(v=u,S=e.convert(0,v),w=e.find(o,[v,v]));for(var E=[],T=0;T{var{typed:e}=t;return function(i,o,a){var s=i._data,l=i._size,u=i._datatype,c=o._data,f=o._size,d=o._datatype,p=[];if(l.length!==f.length)throw new ir(l.length,f.length);for(var y=0;y0?n(_,0,p,p[0],s,c):[];return i.createDenseMatrix({data:v,size:p,datatype:x})};function n(r,i,o,a,s,l){var u=[];if(i===o.length-1)for(var c=0;c{var{concat:e}=t;return function(i,o){var a=Math.max(i._size.length,o._size.length);if(i._size.length===o._size.length&&i._size.every((y,x)=>y===o._size[x]))return[i,o];for(var s=n(i._size,a,0),l=n(o._size,a,0),u=[],c=0;c{var{typed:e,matrix:n,concat:r}=t,i=pve({typed:e}),o=Yp({typed:e}),a=vve({concat:r});return function(l){var u=l.elop,c=l.SD||l.DS,f;u?(f={"DenseMatrix, DenseMatrix":(x,_)=>i(...a(x,_),u),"Array, Array":(x,_)=>i(...a(n(x),n(_)),u).valueOf(),"Array, DenseMatrix":(x,_)=>i(...a(n(x),_),u),"DenseMatrix, Array":(x,_)=>i(...a(x,n(_)),u)},l.SS&&(f["SparseMatrix, SparseMatrix"]=(x,_)=>l.SS(...a(x,_),u,!1)),l.DS&&(f["DenseMatrix, SparseMatrix"]=(x,_)=>l.DS(...a(x,_),u,!1),f["Array, SparseMatrix"]=(x,_)=>l.DS(...a(n(x),_),u,!1)),c&&(f["SparseMatrix, DenseMatrix"]=(x,_)=>c(...a(_,x),u,!0),f["SparseMatrix, Array"]=(x,_)=>c(...a(n(_),x),u,!0))):(f={"DenseMatrix, DenseMatrix":e.referToSelf(x=>(_,v)=>i(...a(_,v),x)),"Array, Array":e.referToSelf(x=>(_,v)=>i(...a(n(_),n(v)),x).valueOf()),"Array, DenseMatrix":e.referToSelf(x=>(_,v)=>i(...a(n(_),v),x)),"DenseMatrix, Array":e.referToSelf(x=>(_,v)=>i(...a(_,n(v)),x))},l.SS&&(f["SparseMatrix, SparseMatrix"]=e.referToSelf(x=>(_,v)=>l.SS(...a(_,v),x,!1))),l.DS&&(f["DenseMatrix, SparseMatrix"]=e.referToSelf(x=>(_,v)=>l.DS(...a(_,v),x,!1)),f["Array, SparseMatrix"]=e.referToSelf(x=>(_,v)=>l.DS(...a(n(_),v),x,!1))),c&&(f["SparseMatrix, DenseMatrix"]=e.referToSelf(x=>(_,v)=>c(...a(v,_),x,!0)),f["SparseMatrix, Array"]=e.referToSelf(x=>(_,v)=>c(...a(n(v),_),x,!0))));var d=l.scalar||"any",p=l.Ds||l.Ss;p&&(u?(f["DenseMatrix,"+d]=(x,_)=>o(x,_,u,!1),f[d+", DenseMatrix"]=(x,_)=>o(_,x,u,!0),f["Array,"+d]=(x,_)=>o(n(x),_,u,!1).valueOf(),f[d+", Array"]=(x,_)=>o(n(_),x,u,!0).valueOf()):(f["DenseMatrix,"+d]=e.referToSelf(x=>(_,v)=>o(_,v,x,!1)),f[d+", DenseMatrix"]=e.referToSelf(x=>(_,v)=>o(v,_,x,!0)),f["Array,"+d]=e.referToSelf(x=>(_,v)=>o(n(_),v,x,!1).valueOf()),f[d+", Array"]=e.referToSelf(x=>(_,v)=>o(n(v),_,x,!0).valueOf())));var y=l.sS!==void 0?l.sS:l.Ss;return u?(l.Ss&&(f["SparseMatrix,"+d]=(x,_)=>l.Ss(x,_,u,!1)),y&&(f[d+", SparseMatrix"]=(x,_)=>y(_,x,u,!0))):(l.Ss&&(f["SparseMatrix,"+d]=e.referToSelf(x=>(_,v)=>l.Ss(_,v,x,!1))),y&&(f[d+", SparseMatrix"]=e.referToSelf(x=>(_,v)=>y(v,_,x,!0)))),u&&u.signatures&&zH(f,u.signatures),f}}),bve="matAlgo01xDSid",_ve=["typed"],wve=Dt(bve,_ve,t=>{var{typed:e}=t;return function(r,i,o,a){var s=r._data,l=r._size,u=r._datatype,c=i._values,f=i._index,d=i._ptr,p=i._size,y=i._datatype;if(l.length!==p.length)throw new ir(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var x=l[0],_=l[1],v=typeof u=="string"&&u===y?u:void 0,S=v?e.find(o,[v,v]):o,w,E,T=[];for(w=0;w{var{typed:e,equalScalar:n}=t;return function(i,o,a){var s=i._values,l=i._index,u=i._ptr,c=i._size,f=i._datatype,d=o._values,p=o._index,y=o._ptr,x=o._size,_=o._datatype;if(c.length!==x.length)throw new ir(c.length,x.length);if(c[0]!==x[0]||c[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+x+")");var v=c[0],S=c[1],w,E=n,T=0,A=a;typeof f=="string"&&f===_&&(w=f,E=e.find(n,[w,w]),T=e.convert(0,w),A=e.find(a,[w,w]));var D=s&&d?[]:void 0,I=[],P=[],N=s&&d?[]:void 0,B=s&&d?[]:void 0,G=[],Z=[],j,J,Y,$,W;for(J=0;J{var{typed:e,DenseMatrix:n}=t;return function(i,o,a,s){var l=i._values,u=i._index,c=i._ptr,f=i._size,d=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],y=f[1],x,_=a;typeof d=="string"&&(x=d,o=e.convert(o,x),_=e.find(a,[x,x]));for(var v=[],S=[],w=[],E=0;E{var{typed:e}=t;return e("multiplyScalar",{"number, number":_V,"Complex, Complex":function(r,i){return r.mul(i)},"BigNumber, BigNumber":function(r,i){return r.times(i)},"Fraction, Fraction":function(r,i){return r.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(n,r)=>r.multiply(n),"Unit, number | Fraction | BigNumber | Complex | Unit":(n,r)=>n.multiply(r)})}),G8="multiply",Nve=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Ove=Dt(G8,Nve,t=>{var{typed:e,matrix:n,addScalar:r,multiplyScalar:i,equalScalar:o,dot:a}=t,s=mb({typed:e,equalScalar:o}),l=Yp({typed:e});function u(T,A){switch(T.length){case 1:switch(A.length){case 1:if(T[0]!==A[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(T[0]!==A[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+T[0]+") must match Matrix rows ("+A[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+A.length+" dimensions)")}break;case 2:switch(A.length){case 1:if(T[1]!==A[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+T[1]+") must match Vector length ("+A[0]+")");break;case 2:if(T[1]!==A[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+T[1]+") must match Matrix B rows ("+A[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+A.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+T.length+" dimensions)")}}function c(T,A,D){if(D===0)throw new Error("Cannot multiply two empty vectors");return a(T,A)}function f(T,A){if(A.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return d(T,A)}function d(T,A){var D=T._data,I=T._size,P=T._datatype,N=A._data,B=A._size,G=A._datatype,Z=I[0],j=B[1],J,Y=r,$=i;P&&G&&P===G&&typeof P=="string"&&(J=P,Y=e.find(r,[J,J]),$=e.find(i,[J,J]));for(var W=[],U=0;UHe)for(var Qe=0,ut=0;ut(A,D)=>{u(ya(A),ya(D));var I=T(n(A),n(D));return di(I)?I.valueOf():I}),"Matrix, Matrix":function(A,D){var I=A.size(),P=D.size();return u(I,P),I.length===1?P.length===1?c(A,D,I[0]):f(A,D):P.length===1?p(A,D):y(A,D)},"Matrix, Array":e.referTo("Matrix,Matrix",T=>(A,D)=>T(A,n(D))),"Array, Matrix":e.referToSelf(T=>(A,D)=>T(n(A,D.storage()),D)),"SparseMatrix, any":function(A,D){return s(A,D,i,!1)},"DenseMatrix, any":function(A,D){return l(A,D,i,!1)},"any, SparseMatrix":function(A,D){return s(D,A,i,!0)},"any, DenseMatrix":function(A,D){return l(D,A,i,!0)},"Array, any":function(A,D){return l(n(A),D,i,!1).valueOf()},"any, Array":function(A,D){return l(n(D),A,i,!0).valueOf()},"any, any":i,"any, any, ...any":e.referToSelf(T=>(A,D,I)=>{for(var P=T(A,D),N=0;N{var{typed:e,DenseMatrix:n}=t;return function(o,a,s){var l=o._size,u=o._datatype,c=a._size,f=a._datatype;if(l.length!==c.length)throw new ir(l.length,c.length);if(l[0]!==c[0]||l[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+c+")");var d=l[0],p=l[1],y,x=0,_=s;typeof u=="string"&&u===f&&(y=u,x=e.convert(0,y),_=e.find(s,[y,y]));var v,S,w=[];for(v=0;v{var{typed:e}=t;return e(j8,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.conjugate(),"Array | Matrix":e.referToSelf(n=>r=>Hi(r,n))})}),q8="concat",Bve=["typed","matrix","isInteger"],Uve=Dt(q8,Bve,t=>{var{typed:e,matrix:n,isInteger:r}=t;return e(q8,{"...Array | Matrix | number | BigNumber":function(o){var a,s=o.length,l=-1,u,c=!1,f=[];for(a=0;a0&&l>u)throw new Kd(l,u+1)}else{var p=Fr(d).valueOf(),y=ya(p);if(f[a]=p,u=l,l=y.length-1,a>0&&l!==u)throw new ir(u+1,l+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var x=f.shift();f.length;)x=ZH(x,f.shift(),l);return c?n(x):x},"...string":function(o){return o.join("")}})}),X8="identity",zve=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],$ve=Dt(X8,zve,t=>{var{typed:e,config:n,matrix:r,BigNumber:i,DenseMatrix:o,SparseMatrix:a}=t;return e(X8,{"":function(){return n.matrix==="Matrix"?r([]):[]},string:function(c){return r(c)},"number | BigNumber":function(c){return l(c,c,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return l(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return l(c,f,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,d){return l(c,f,d)},Array:function(c){return s(c)},"Array, string":function(c,f){return s(c,f)},Matrix:function(c){return s(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return s(c.valueOf(),f)}});function s(u,c){switch(u.length){case 0:return c?r(c):[];case 1:return l(u[0],u[0],c);case 2:return l(u[0],u[1],c);default:throw new Error("Vector containing two values expected")}}function l(u,c,f){var d=lo(u)||lo(c)?i:null;if(lo(u)&&(u=u.toNumber()),lo(c)&&(c=c.toNumber()),!Pr(u)||u<1)throw new Error("Parameters in function identity must be positive integers");if(!Pr(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var p=d?new i(1):1,y=d?new d(0):0,x=[u,c];if(f){if(f==="sparse")return a.diagonal(x,p,0,y);if(f==="dense")return o.diagonal(x,p,0,y);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var _=XE([],x,y),v=u{var{typed:e,config:n,matrix:r}=t;return e(Y8,{Matrix:function(o){return o.create(o.size())},Array:ya,string:function(o){return n.matrix==="Array"?[o.length]:r([o.length])},"number | Complex | BigNumber | Unit | boolean | null":function(o){return n.matrix==="Array"?[]:r?r([]):Wve()}})}),K8="zeros",qve=["typed","config","matrix","BigNumber"],Xve=Dt(K8,qve,t=>{var{typed:e,config:n,matrix:r,BigNumber:i}=t;return e(K8,{"":function(){return n.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(u){var c=u[u.length-1];if(typeof c=="string"){var f=u.pop();return o(u,f)}else return n.matrix==="Array"?o(u):o(u,"default")},Array:o,Matrix:function(u){var c=u.storage();return o(u.valueOf(),c)},"Array | Matrix, string":function(u,c){return o(u.valueOf(),c)}});function o(l,u){var c=a(l),f=c?new i(0):0;if(s(l),u){var d=r(u);return l.length>0?d.resize(l,f):d}else{var p=[];return l.length>0?XE(p,l,f):p}}function a(l){var u=!1;return l.forEach(function(c,f,d){lo(c)&&(u=!0,d[f]=c.toNumber())}),u}function s(l){l.forEach(function(u){if(typeof u!="number"||!Pr(u)||u<0)throw new Error("Parameters in function zeros must be positive integers")})}});function xx(t){"@babel/helpers - typeof";return xx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xx(t)}function Yve(t,e){if(xx(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(xx(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Kve(t){var e=Yve(t,"string");return xx(e)==="symbol"?e:String(e)}function Zve(t,e,n){return e=Kve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n2(t,e,n){var r;return String(t).indexOf("Unexpected type")!==-1?(r=arguments.length>2?" (type: "+fl(n)+", value: "+JSON.stringify(n)+")":" (type: "+t.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+r)):String(t).indexOf("complex numbers")!==-1?(r=arguments.length>2?" (type: "+fl(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+r)):t}var Z8="format",Jve=["typed"],Qve=Dt(Z8,Jve,t=>{var{typed:e}=t;return e(Z8,{any:ui,"any, Object | function | number":ui})}),eye="numeric",tye=["number","?bignumber","?fraction"],nye=Dt(eye,tye,t=>{var{number:e,bignumber:n,fraction:r}=t,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:a=>e(a),BigNumber:n?a=>n(a):Hve,Fraction:r?a=>r(a):Vve};return function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",u=arguments.length>2?arguments[2]:void 0;if(u!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=fl(s);if(!(c in i))throw new TypeError("Cannot convert "+s+' of type "'+c+'"; valid input types are '+Object.keys(i).join(", "));if(!(l in o))throw new TypeError("Cannot convert "+s+' to type "'+l+'"; valid output types are '+Object.keys(o).join(", "));return l===c?s:o[l](s)}}),J8="divideScalar",rye=["typed","numeric"],iye=Dt(J8,rye,t=>{var{typed:e,numeric:n}=t;return e(J8,{"number, number":function(i,o){return i/o},"Complex, Complex":function(i,o){return i.div(o)},"BigNumber, BigNumber":function(i,o){return i.div(o)},"Fraction, Fraction":function(i,o){return i.div(o)},"Unit, number | Complex | Fraction | BigNumber | Unit":(r,i)=>r.divide(i),"number | Fraction | Complex | BigNumber, Unit":(r,i)=>i.divideInto(r)})}),Q8="pow",oye=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],aye=Dt(Q8,oye,t=>{var{typed:e,config:n,identity:r,multiply:i,matrix:o,inv:a,number:s,fraction:l,Complex:u}=t;return e(Q8,{"number, number":c,"Complex, Complex":function(y,x){return y.pow(x)},"BigNumber, BigNumber":function(y,x){return x.isInteger()||y>=0||n.predictable?y.pow(x):new u(y.toNumber(),0).pow(x.toNumber(),0)},"Fraction, Fraction":function(y,x){var _=y.pow(x);if(_!=null)return _;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(y.valueOf(),x.valueOf())},"Array, number":f,"Array, BigNumber":function(y,x){return f(y,x.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(y,x){return d(y,x.toNumber())},"Unit, number | BigNumber":function(y,x){return y.pow(x)}});function c(p,y){if(n.predictable&&!Pr(y)&&p<0)try{var x=l(y),_=s(x);if((y===_||Math.abs((y-_)/y)<1e-14)&&x.d%2===1)return(x.n%2===0?1:-1)*Math.pow(-p,y)}catch{}return n.predictable&&(p<-1&&y===1/0||p>-1&&p<0&&y===-1/0)?NaN:Pr(y)||p>=0||n.predictable?SV(p,y):p*p<1&&y===1/0||p*p>1&&y===-1/0?0:new u(p,0).pow(y,0)}function f(p,y){if(!Pr(y))throw new TypeError("For A^b, b must be an integer (value is "+y+")");var x=ya(p);if(x.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+x.length+" dimensions)");if(x[0]!==x[1])throw new Error("For A^b, A must be square (size is "+x[0]+"x"+x[1]+")");if(y<0)try{return f(a(p),-y)}catch(S){throw S.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+y+")"):S}for(var _=r(x[0]).valueOf(),v=p;y>=1;)(y&1)===1&&(_=i(v,_)),y>>=1,v=i(v,v);return _}function d(p,y){return o(f(p.valueOf(),y))}}),e0="Number of decimals in function round must be an integer",ek="round",sye=["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],lye=Dt(ek,sye,t=>{var{typed:e,matrix:n,equalScalar:r,zeros:i,BigNumber:o,DenseMatrix:a}=t,s=mb({typed:e,equalScalar:r}),l=df({typed:e,DenseMatrix:a}),u=Yp({typed:e});return e(ek,{number:k8,"number, number":k8,"number, BigNumber":function(f,d){if(!d.isInteger())throw new TypeError(e0);return new o(f).toDecimalPlaces(d.toNumber())},Complex:function(f){return f.round()},"Complex, number":function(f,d){if(d%1)throw new TypeError(e0);return f.round(d)},"Complex, BigNumber":function(f,d){if(!d.isInteger())throw new TypeError(e0);var p=d.toNumber();return f.round(p)},BigNumber:function(f){return f.toDecimalPlaces(0)},"BigNumber, BigNumber":function(f,d){if(!d.isInteger())throw new TypeError(e0);return f.toDecimalPlaces(d.toNumber())},Fraction:function(f){return f.round()},"Fraction, number":function(f,d){if(d%1)throw new TypeError(e0);return f.round(d)},"Fraction, BigNumber":function(f,d){if(!d.isInteger())throw new TypeError(e0);return f.round(d.toNumber())},"Unit, number, Unit":e.referToSelf(c=>function(f,d,p){var y=f.toNumeric(p);return p.multiply(c(y,d))}),"Unit, BigNumber, Unit":e.referToSelf(c=>(f,d,p)=>c(f,d.toNumber(),p)),"Unit, Unit":e.referToSelf(c=>(f,d)=>c(f,0,d)),"Array | Matrix, number, Unit":e.referToSelf(c=>(f,d,p)=>Hi(f,y=>c(y,d,p))),"Array | Matrix, BigNumber, Unit":e.referToSelf(c=>(f,d,p)=>c(f,d.toNumber(),p)),"Array | Matrix, Unit":e.referToSelf(c=>(f,d)=>c(f,0,d)),"Array | Matrix":e.referToSelf(c=>f=>Hi(f,c)),"SparseMatrix, number | BigNumber":e.referToSelf(c=>(f,d)=>s(f,d,c,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(c=>(f,d)=>u(f,d,c,!1)),"Array, number | BigNumber":e.referToSelf(c=>(f,d)=>u(n(f),d,c,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":e.referToSelf(c=>(f,d)=>r(f,0)?i(d.size(),d.storage()):l(d,f,c,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":e.referToSelf(c=>(f,d)=>r(f,0)?i(d.size(),d.storage()):u(d,f,c,!0)),"number | Complex | BigNumber | Fraction, Array":e.referToSelf(c=>(f,d)=>u(n(d),f,c,!0).valueOf())})}),r2="equal",uye=["typed","matrix","equalScalar","DenseMatrix","concat"],cye=Dt(r2,uye,t=>{var{typed:e,matrix:n,equalScalar:r,DenseMatrix:i,concat:o}=t,a=gb({typed:e}),s=vb({typed:e,DenseMatrix:i}),l=df({typed:e,DenseMatrix:i}),u=cv({typed:e,matrix:n,concat:o});return e(r2,fye({typed:e,equalScalar:r}),u({elop:r,SS:s,DS:a,Ss:l}))}),fye=Dt(r2,["typed","equalScalar"],t=>{var{typed:e,equalScalar:n}=t;return e(r2,{"any, any":function(i,o){return i===null?o===null:o===null?i===null:i===void 0?o===void 0:o===void 0?i===void 0:n(i,o)}})}),i2="smaller",dye=["typed","config","matrix","DenseMatrix","concat"],hye=Dt(i2,dye,t=>{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,a=gb({typed:e}),s=vb({typed:e,DenseMatrix:i}),l=df({typed:e,DenseMatrix:i}),u=cv({typed:e,matrix:r,concat:o}),c=pb({typed:e});return e(i2,pye({typed:e,config:n}),{"boolean, boolean":(f,d)=>ff.compare(d)===-1,"Complex, Complex":function(d,p){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:s,DS:a,Ss:l}))}),pye=Dt(i2,["typed","config"],t=>{var{typed:e,config:n}=t;return e(i2,{"number, number":function(i,o){return i{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,a=gb({typed:e}),s=vb({typed:e,DenseMatrix:i}),l=df({typed:e,DenseMatrix:i}),u=cv({typed:e,matrix:r,concat:o}),c=pb({typed:e});return e(o2,vye({typed:e,config:n}),{"boolean, boolean":(f,d)=>f<=d,"BigNumber, BigNumber":function(d,p){return d.lte(p)||nf(d,p,n.epsilon)},"Fraction, Fraction":(f,d)=>f.compare(d)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:s,DS:a,Ss:l}))}),vye=Dt(o2,["typed","config"],t=>{var{typed:e,config:n}=t;return e(o2,{"number, number":function(i,o){return i<=o||bl(i,o,n.epsilon)}})}),a2="larger",yye=["typed","config","matrix","DenseMatrix","concat"],xye=Dt(a2,yye,t=>{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,a=gb({typed:e}),s=vb({typed:e,DenseMatrix:i}),l=df({typed:e,DenseMatrix:i}),u=cv({typed:e,matrix:r,concat:o}),c=pb({typed:e});return e(a2,bye({typed:e,config:n}),{"boolean, boolean":(f,d)=>f>d,"BigNumber, BigNumber":function(d,p){return d.gt(p)&&!nf(d,p,n.epsilon)},"Fraction, Fraction":(f,d)=>f.compare(d)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:s,DS:a,Ss:l}))}),bye=Dt(a2,["typed","config"],t=>{var{typed:e,config:n}=t;return e(a2,{"number, number":function(i,o){return i>o&&!bl(i,o,n.epsilon)}})}),s2="largerEq",_ye=["typed","config","matrix","DenseMatrix","concat"],wye=Dt(s2,_ye,t=>{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,a=gb({typed:e}),s=vb({typed:e,DenseMatrix:i}),l=df({typed:e,DenseMatrix:i}),u=cv({typed:e,matrix:r,concat:o}),c=pb({typed:e});return e(s2,Sye({typed:e,config:n}),{"boolean, boolean":(f,d)=>f>=d,"BigNumber, BigNumber":function(d,p){return d.gte(p)||nf(d,p,n.epsilon)},"Fraction, Fraction":(f,d)=>f.compare(d)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:s,DS:a,Ss:l}))}),Sye=Dt(s2,["typed","config"],t=>{var{typed:e,config:n}=t;return e(s2,{"number, number":function(i,o){return i>=o||bl(i,o,n.epsilon)}})}),tk="max",Eye=["typed","config","numeric","larger"],Mye=Dt(tk,Eye,t=>{var{typed:e,config:n,numeric:r,larger:i}=t;return e(tk,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(l,u){return gV(l,u.valueOf(),o)},"...":function(l){if(mV(l))throw new TypeError("Scalar values expected in function max");return a(l)}});function o(s,l){try{return i(s,l)?s:l}catch(u){throw n2(u,"max",l)}}function a(s){var l;if(zO(s,function(u){try{isNaN(u)&&typeof u=="number"?l=NaN:(l===void 0||i(u,l))&&(l=u)}catch(c){throw n2(c,"max",u)}}),l===void 0)throw new Error("Cannot calculate max of an empty array");return typeof l=="string"&&(l=r(l,n.number)),l}}),nk="min",Cye=["typed","config","numeric","smaller"],Aye=Dt(nk,Cye,t=>{var{typed:e,config:n,numeric:r,smaller:i}=t;return e(nk,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(l,u){return gV(l,u.valueOf(),o)},"...":function(l){if(mV(l))throw new TypeError("Scalar values expected in function min");return a(l)}});function o(s,l){try{return i(s,l)?s:l}catch(u){throw n2(u,"min",l)}}function a(s){var l;if(zO(s,function(u){try{isNaN(u)&&typeof u=="number"?l=NaN:(l===void 0||i(u,l))&&(l=u)}catch(c){throw n2(c,"min",u)}}),l===void 0)throw new Error("Cannot calculate min of an empty array");return typeof l=="string"&&(l=r(l,n.number)),l}});hb(function(t){return new t(1).exp()},{hasher:oC});hb(function(t){return new t(1).plus(new t(5).sqrt()).div(2)},{hasher:oC});var MV=hb(function(t){return t.acos(-1)},{hasher:oC});hb(function(t){return MV(t).times(2)},{hasher:oC});function oC(t){return t[0].precision}function rk(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function zT(t){for(var e=1;e{var{on:e,config:n,addScalar:r,subtractScalar:i,multiplyScalar:o,divideScalar:a,pow:s,abs:l,fix:u,round:c,equal:f,isNumeric:d,format:p,number:y,Complex:x,BigNumber:_,Fraction:v}=t,S=y;function w(X,te){if(!(this instanceof w))throw new Error("Constructor must be called with the new operator");if(!(X==null||d(X)||O1(X)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,te===void 0)this.units=[],this.dimensions=W.map(we=>0);else if(typeof te=="string"){var me=w.parse(te);this.units=me.units,this.dimensions=me.dimensions}else if(ad(te)&&te.value===null)this.fixPrefix=te.fixPrefix,this.skipAutomaticSimplification=te.skipAutomaticSimplification,this.dimensions=te.dimensions.slice(0),this.units=te.units.map(we=>ee({},we));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(X)}Object.defineProperty(w,"name",{value:"Unit"}),w.prototype.constructor=w,w.prototype.type="Unit",w.prototype.isUnit=!0;var E,T,A;function D(){for(;A===" "||A===" ";)N()}function I(X){return X>="0"&&X<="9"||X==="."}function P(X){return X>="0"&&X<="9"}function N(){T++,A=E.charAt(T)}function B(X){T=X,A=E.charAt(T)}function G(){var X="",te=T;if(A==="+"?N():A==="-"&&(X+=A,N()),!I(A))return B(te),null;if(A==="."){if(X+=A,N(),!P(A))return B(te),null}else{for(;P(A);)X+=A,N();A==="."&&(X+=A,N())}for(;P(A);)X+=A,N();if(A==="E"||A==="e"){var me="",we=T;if(me+=A,N(),(A==="+"||A==="-")&&(me+=A,N()),!P(A))return B(we),X;for(X=X+me;P(A);)X+=A,N()}return X}function Z(){for(var X="";P(A)||w.isValidAlpha(A);)X+=A,N();var te=X.charAt(0);return w.isValidAlpha(te)?X:null}function j(X){return A===X?(N(),X):null}w.parse=function(X,te){if(te=te||{},E=X,T=-1,A="",typeof E!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var me=new w;me.units=[];var we=1,Ne=!1;N(),D();var Ue=G(),We=null;if(Ue){if(n.number==="BigNumber")We=new _(Ue);else if(n.number==="Fraction")try{We=new v(Ue)}catch{We=parseFloat(Ue)}else We=parseFloat(Ue);D(),j("*")?(we=1,Ne=!0):j("/")&&(we=-1,Ne=!0)}for(var st=[],z=1;;){for(D();A==="(";)st.push(we),z*=we,we=1,N(),D();var F=void 0;if(A){var oe=A;if(F=Z(),F===null)throw new SyntaxError('Unexpected "'+oe+'" in "'+E+'" at index '+T.toString())}else break;var ge=J(F);if(ge===null)throw new SyntaxError('Unit "'+F+'" not found.');var pe=we*z;if(D(),j("^")){D();var de=G();if(de===null)throw new SyntaxError('In "'+X+'", "^" must be followed by a floating-point number');pe*=de}me.units.push({unit:ge.unit,prefix:ge.prefix,power:pe});for(var ve=0;ve1||Math.abs(this.units[0].power-1)>1e-15},w.prototype._normalize=function(X){if(X==null||this.units.length===0)return X;for(var te=X,me=w._getNumberConverter(fl(X)),we=0;we{if(dr(ce,X)){var te=ce[X],me=te.prefixes[""];return{unit:te,prefix:me}}for(var we in ce)if(dr(ce,we)&&Lme(X,we)){var Ne=ce[we],Ue=X.length-we.length,We=X.substring(0,Ue),st=dr(Ne.prefixes,We)?Ne.prefixes[We]:void 0;if(st!==void 0)return{unit:Ne,prefix:st}}return null},{hasher:X=>X[0],limit:100});w.isValuelessUnit=function(X){return J(X)!==null},w.prototype.hasBase=function(X){if(typeof X=="string"&&(X=U[X]),!X)return!1;for(var te=0;te1e-12)return!1;return!0},w.prototype.equalBase=function(X){for(var te=0;te1e-12)return!1;return!0},w.prototype.equals=function(X){return this.equalBase(X)&&f(this.value,X.value)},w.prototype.multiply=function(X){for(var te=this.clone(),me=ad(X)?X:new w(X),we=0;we1e-12&&(dr(He,st)?te.push({unit:He[st].unit,prefix:He[st].prefix,power:X.dimensions[We]||0}):Ue=!0)}te.length1e-12)if(dr(Ie.si,we))te.push({unit:Ie.si[we].unit,prefix:Ie.si[we].prefix,power:X.dimensions[me]||0});else throw new Error("Cannot express custom unit "+we+" in SI units")}return X.units=te,X.fixPrefix=!0,X.skipAutomaticSimplification=!0,X},w.prototype.formatUnits=function(){for(var X="",te="",me=0,we=0,Ne=0;Ne0?(me++,X+=" "+this.units[Ne].prefix.name+this.units[Ne].unit.name,Math.abs(this.units[Ne].power-1)>1e-15&&(X+="^"+this.units[Ne].power)):this.units[Ne].power<0&&we++;if(we>0)for(var Ue=0;Ue0?(te+=" "+this.units[Ue].prefix.name+this.units[Ue].unit.name,Math.abs(this.units[Ue].power+1)>1e-15&&(te+="^"+-this.units[Ue].power)):(te+=" "+this.units[Ue].prefix.name+this.units[Ue].unit.name,te+="^"+this.units[Ue].power));X=X.substr(1),te=te.substr(1),me>1&&we>0&&(X="("+X+")"),we>1&&me>0&&(te="("+te+")");var We=X;return me>0&&we>0&&(We+=" / "),We+=te,We},w.prototype.format=function(X){var te=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),me=!1;typeof te.value<"u"&&te.value!==null&&O1(te.value)&&(me=Math.abs(te.value.re)<1e-14);for(var we in te.units)dr(te.units,we)&&te.units[we].unit&&(te.units[we].unit.name==="VA"&&me?te.units[we].unit=ce.VAR:te.units[we].unit.name==="VAR"&&!me&&(te.units[we].unit=ce.VA));te.units.length===1&&!te.fixPrefix&&Math.abs(te.units[0].power-Math.round(te.units[0].power))<1e-14&&(te.units[0].prefix=te._bestPrefix());var Ne=te._denormalize(te.value),Ue=te.value!==null?p(Ne,X||{}):"",We=te.formatUnits();return te.value&&O1(te.value)&&(Ue="("+Ue+")"),We.length>0&&Ue.length>0&&(Ue+=" "),Ue+=We,Ue},w.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var X=this.value!==null?l(this.value):0,te=l(this.units[0].unit.value),me=this.units[0].prefix;if(X===0)return me;var we=this.units[0].power,Ne=Math.log(X/Math.pow(me.value*te,we))/Math.LN10-1.2;if(Ne>-2.200001&&Ne<1.800001)return me;Ne=Math.abs(Ne);var Ue=this.units[0].unit.prefixes;for(var We in Ue)if(dr(Ue,We)){var st=Ue[We];if(st.scientific){var z=Math.abs(Math.log(X/Math.pow(st.value*te,we))/Math.LN10-1.2);(z0)},ce={meter:{name:"meter",base:U.LENGTH,prefixes:$.LONG,value:1,offset:0},inch:{name:"inch",base:U.LENGTH,prefixes:$.NONE,value:.0254,offset:0},foot:{name:"foot",base:U.LENGTH,prefixes:$.NONE,value:.3048,offset:0},yard:{name:"yard",base:U.LENGTH,prefixes:$.NONE,value:.9144,offset:0},mile:{name:"mile",base:U.LENGTH,prefixes:$.NONE,value:1609.344,offset:0},link:{name:"link",base:U.LENGTH,prefixes:$.NONE,value:.201168,offset:0},rod:{name:"rod",base:U.LENGTH,prefixes:$.NONE,value:5.0292,offset:0},chain:{name:"chain",base:U.LENGTH,prefixes:$.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:U.LENGTH,prefixes:$.NONE,value:1e-10,offset:0},m:{name:"m",base:U.LENGTH,prefixes:$.SHORT,value:1,offset:0},in:{name:"in",base:U.LENGTH,prefixes:$.NONE,value:.0254,offset:0},ft:{name:"ft",base:U.LENGTH,prefixes:$.NONE,value:.3048,offset:0},yd:{name:"yd",base:U.LENGTH,prefixes:$.NONE,value:.9144,offset:0},mi:{name:"mi",base:U.LENGTH,prefixes:$.NONE,value:1609.344,offset:0},li:{name:"li",base:U.LENGTH,prefixes:$.NONE,value:.201168,offset:0},rd:{name:"rd",base:U.LENGTH,prefixes:$.NONE,value:5.02921,offset:0},ch:{name:"ch",base:U.LENGTH,prefixes:$.NONE,value:20.1168,offset:0},mil:{name:"mil",base:U.LENGTH,prefixes:$.NONE,value:254e-7,offset:0},m2:{name:"m2",base:U.SURFACE,prefixes:$.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:U.SURFACE,prefixes:$.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:U.SURFACE,prefixes:$.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:U.SURFACE,prefixes:$.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:U.SURFACE,prefixes:$.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:U.SURFACE,prefixes:$.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:U.SURFACE,prefixes:$.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:U.SURFACE,prefixes:$.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:U.SURFACE,prefixes:$.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:U.SURFACE,prefixes:$.NONE,value:1e4,offset:0},m3:{name:"m3",base:U.VOLUME,prefixes:$.CUBIC,value:1,offset:0},L:{name:"L",base:U.VOLUME,prefixes:$.SHORT,value:.001,offset:0},l:{name:"l",base:U.VOLUME,prefixes:$.SHORT,value:.001,offset:0},litre:{name:"litre",base:U.VOLUME,prefixes:$.LONG,value:.001,offset:0},cuin:{name:"cuin",base:U.VOLUME,prefixes:$.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:U.VOLUME,prefixes:$.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:U.VOLUME,prefixes:$.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:U.VOLUME,prefixes:$.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:U.VOLUME,prefixes:$.NONE,value:15e-6,offset:0},drop:{name:"drop",base:U.VOLUME,prefixes:$.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:U.VOLUME,prefixes:$.NONE,value:5e-8,offset:0},minim:{name:"minim",base:U.VOLUME,prefixes:$.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:U.VOLUME,prefixes:$.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:U.VOLUME,prefixes:$.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:U.VOLUME,prefixes:$.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:U.VOLUME,prefixes:$.NONE,value:1e-6,offset:0},cup:{name:"cup",base:U.VOLUME,prefixes:$.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:U.VOLUME,prefixes:$.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:U.VOLUME,prefixes:$.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:U.VOLUME,prefixes:$.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:U.VOLUME,prefixes:$.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:U.VOLUME,prefixes:$.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:U.VOLUME,prefixes:$.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:U.VOLUME,prefixes:$.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:U.VOLUME,prefixes:$.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:U.VOLUME,prefixes:$.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:U.VOLUME,prefixes:$.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:U.VOLUME,prefixes:$.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:U.VOLUME,prefixes:$.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:U.VOLUME,prefixes:$.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:U.VOLUME,prefixes:$.NONE,value:.1173478,offset:0},obl:{name:"obl",base:U.VOLUME,prefixes:$.NONE,value:.1589873,offset:0},g:{name:"g",base:U.MASS,prefixes:$.SHORT,value:.001,offset:0},gram:{name:"gram",base:U.MASS,prefixes:$.LONG,value:.001,offset:0},ton:{name:"ton",base:U.MASS,prefixes:$.SHORT,value:907.18474,offset:0},t:{name:"t",base:U.MASS,prefixes:$.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:U.MASS,prefixes:$.LONG,value:1e3,offset:0},grain:{name:"grain",base:U.MASS,prefixes:$.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:U.MASS,prefixes:$.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:U.MASS,prefixes:$.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:U.MASS,prefixes:$.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:U.MASS,prefixes:$.NONE,value:45.359237,offset:0},stick:{name:"stick",base:U.MASS,prefixes:$.NONE,value:.115,offset:0},stone:{name:"stone",base:U.MASS,prefixes:$.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:U.MASS,prefixes:$.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:U.MASS,prefixes:$.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:U.MASS,prefixes:$.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:U.MASS,prefixes:$.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:U.MASS,prefixes:$.NONE,value:45.359237,offset:0},s:{name:"s",base:U.TIME,prefixes:$.SHORT,value:1,offset:0},min:{name:"min",base:U.TIME,prefixes:$.NONE,value:60,offset:0},h:{name:"h",base:U.TIME,prefixes:$.NONE,value:3600,offset:0},second:{name:"second",base:U.TIME,prefixes:$.LONG,value:1,offset:0},sec:{name:"sec",base:U.TIME,prefixes:$.LONG,value:1,offset:0},minute:{name:"minute",base:U.TIME,prefixes:$.NONE,value:60,offset:0},hour:{name:"hour",base:U.TIME,prefixes:$.NONE,value:3600,offset:0},day:{name:"day",base:U.TIME,prefixes:$.NONE,value:86400,offset:0},week:{name:"week",base:U.TIME,prefixes:$.NONE,value:7*86400,offset:0},month:{name:"month",base:U.TIME,prefixes:$.NONE,value:2629800,offset:0},year:{name:"year",base:U.TIME,prefixes:$.NONE,value:31557600,offset:0},decade:{name:"decade",base:U.TIME,prefixes:$.NONE,value:315576e3,offset:0},century:{name:"century",base:U.TIME,prefixes:$.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:U.TIME,prefixes:$.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:U.FREQUENCY,prefixes:$.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:U.FREQUENCY,prefixes:$.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:U.ANGLE,prefixes:$.SHORT,value:1,offset:0},radian:{name:"radian",base:U.ANGLE,prefixes:$.LONG,value:1,offset:0},deg:{name:"deg",base:U.ANGLE,prefixes:$.SHORT,value:null,offset:0},degree:{name:"degree",base:U.ANGLE,prefixes:$.LONG,value:null,offset:0},grad:{name:"grad",base:U.ANGLE,prefixes:$.SHORT,value:null,offset:0},gradian:{name:"gradian",base:U.ANGLE,prefixes:$.LONG,value:null,offset:0},cycle:{name:"cycle",base:U.ANGLE,prefixes:$.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:U.ANGLE,prefixes:$.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:U.ANGLE,prefixes:$.NONE,value:null,offset:0},A:{name:"A",base:U.CURRENT,prefixes:$.SHORT,value:1,offset:0},ampere:{name:"ampere",base:U.CURRENT,prefixes:$.LONG,value:1,offset:0},K:{name:"K",base:U.TEMPERATURE,prefixes:$.SHORT,value:1,offset:0},degC:{name:"degC",base:U.TEMPERATURE,prefixes:$.SHORT,value:1,offset:273.15},degF:{name:"degF",base:U.TEMPERATURE,prefixes:$.SHORT,value:new v(5,9),offset:459.67},degR:{name:"degR",base:U.TEMPERATURE,prefixes:$.SHORT,value:new v(5,9),offset:0},kelvin:{name:"kelvin",base:U.TEMPERATURE,prefixes:$.LONG,value:1,offset:0},celsius:{name:"celsius",base:U.TEMPERATURE,prefixes:$.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:U.TEMPERATURE,prefixes:$.LONG,value:new v(5,9),offset:459.67},rankine:{name:"rankine",base:U.TEMPERATURE,prefixes:$.LONG,value:new v(5,9),offset:0},mol:{name:"mol",base:U.AMOUNT_OF_SUBSTANCE,prefixes:$.SHORT,value:1,offset:0},mole:{name:"mole",base:U.AMOUNT_OF_SUBSTANCE,prefixes:$.LONG,value:1,offset:0},cd:{name:"cd",base:U.LUMINOUS_INTENSITY,prefixes:$.SHORT,value:1,offset:0},candela:{name:"candela",base:U.LUMINOUS_INTENSITY,prefixes:$.LONG,value:1,offset:0},N:{name:"N",base:U.FORCE,prefixes:$.SHORT,value:1,offset:0},newton:{name:"newton",base:U.FORCE,prefixes:$.LONG,value:1,offset:0},dyn:{name:"dyn",base:U.FORCE,prefixes:$.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:U.FORCE,prefixes:$.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:U.FORCE,prefixes:$.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:U.FORCE,prefixes:$.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:U.FORCE,prefixes:$.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:U.FORCE,prefixes:$.NONE,value:9.80665,offset:0},J:{name:"J",base:U.ENERGY,prefixes:$.SHORT,value:1,offset:0},joule:{name:"joule",base:U.ENERGY,prefixes:$.LONG,value:1,offset:0},erg:{name:"erg",base:U.ENERGY,prefixes:$.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:U.ENERGY,prefixes:$.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:U.ENERGY,prefixes:$.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:U.ENERGY,prefixes:$.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:U.ENERGY,prefixes:$.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:U.POWER,prefixes:$.SHORT,value:1,offset:0},watt:{name:"watt",base:U.POWER,prefixes:$.LONG,value:1,offset:0},hp:{name:"hp",base:U.POWER,prefixes:$.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:U.POWER,prefixes:$.SHORT,value:x.I,offset:0},VA:{name:"VA",base:U.POWER,prefixes:$.SHORT,value:1,offset:0},Pa:{name:"Pa",base:U.PRESSURE,prefixes:$.SHORT,value:1,offset:0},psi:{name:"psi",base:U.PRESSURE,prefixes:$.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:U.PRESSURE,prefixes:$.NONE,value:101325,offset:0},bar:{name:"bar",base:U.PRESSURE,prefixes:$.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:U.PRESSURE,prefixes:$.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:U.PRESSURE,prefixes:$.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:U.PRESSURE,prefixes:$.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:U.PRESSURE,prefixes:$.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:U.ELECTRIC_CHARGE,prefixes:$.LONG,value:1,offset:0},C:{name:"C",base:U.ELECTRIC_CHARGE,prefixes:$.SHORT,value:1,offset:0},farad:{name:"farad",base:U.ELECTRIC_CAPACITANCE,prefixes:$.LONG,value:1,offset:0},F:{name:"F",base:U.ELECTRIC_CAPACITANCE,prefixes:$.SHORT,value:1,offset:0},volt:{name:"volt",base:U.ELECTRIC_POTENTIAL,prefixes:$.LONG,value:1,offset:0},V:{name:"V",base:U.ELECTRIC_POTENTIAL,prefixes:$.SHORT,value:1,offset:0},ohm:{name:"ohm",base:U.ELECTRIC_RESISTANCE,prefixes:$.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:U.ELECTRIC_INDUCTANCE,prefixes:$.LONG,value:1,offset:0},H:{name:"H",base:U.ELECTRIC_INDUCTANCE,prefixes:$.SHORT,value:1,offset:0},siemens:{name:"siemens",base:U.ELECTRIC_CONDUCTANCE,prefixes:$.LONG,value:1,offset:0},S:{name:"S",base:U.ELECTRIC_CONDUCTANCE,prefixes:$.SHORT,value:1,offset:0},weber:{name:"weber",base:U.MAGNETIC_FLUX,prefixes:$.LONG,value:1,offset:0},Wb:{name:"Wb",base:U.MAGNETIC_FLUX,prefixes:$.SHORT,value:1,offset:0},tesla:{name:"tesla",base:U.MAGNETIC_FLUX_DENSITY,prefixes:$.LONG,value:1,offset:0},T:{name:"T",base:U.MAGNETIC_FLUX_DENSITY,prefixes:$.SHORT,value:1,offset:0},b:{name:"b",base:U.BIT,prefixes:$.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:U.BIT,prefixes:$.BINARY_LONG,value:1,offset:0},B:{name:"B",base:U.BIT,prefixes:$.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:U.BIT,prefixes:$.BINARY_LONG,value:8,offset:0}},Ce={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function Re(X){if(X.number==="BigNumber"){var te=MV(_);ce.rad.value=new _(1),ce.deg.value=te.div(180),ce.grad.value=te.div(200),ce.cycle.value=te.times(2),ce.arcsec.value=te.div(648e3),ce.arcmin.value=te.div(10800)}else ce.rad.value=1,ce.deg.value=Math.PI/180,ce.grad.value=Math.PI/200,ce.cycle.value=Math.PI*2,ce.arcsec.value=Math.PI/648e3,ce.arcmin.value=Math.PI/10800;ce.radian.value=ce.rad.value,ce.degree.value=ce.deg.value,ce.gradian.value=ce.grad.value}Re(n),e&&e("config",function(X,te){X.number!==te.number&&Re(X)});var Ie={si:{NONE:{unit:ue,prefix:$.NONE[""]},LENGTH:{unit:ce.m,prefix:$.SHORT[""]},MASS:{unit:ce.g,prefix:$.SHORT.k},TIME:{unit:ce.s,prefix:$.SHORT[""]},CURRENT:{unit:ce.A,prefix:$.SHORT[""]},TEMPERATURE:{unit:ce.K,prefix:$.SHORT[""]},LUMINOUS_INTENSITY:{unit:ce.cd,prefix:$.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:ce.mol,prefix:$.SHORT[""]},ANGLE:{unit:ce.rad,prefix:$.SHORT[""]},BIT:{unit:ce.bits,prefix:$.SHORT[""]},FORCE:{unit:ce.N,prefix:$.SHORT[""]},ENERGY:{unit:ce.J,prefix:$.SHORT[""]},POWER:{unit:ce.W,prefix:$.SHORT[""]},PRESSURE:{unit:ce.Pa,prefix:$.SHORT[""]},ELECTRIC_CHARGE:{unit:ce.C,prefix:$.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:ce.F,prefix:$.SHORT[""]},ELECTRIC_POTENTIAL:{unit:ce.V,prefix:$.SHORT[""]},ELECTRIC_RESISTANCE:{unit:ce.ohm,prefix:$.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:ce.H,prefix:$.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:ce.S,prefix:$.SHORT[""]},MAGNETIC_FLUX:{unit:ce.Wb,prefix:$.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:ce.T,prefix:$.SHORT[""]},FREQUENCY:{unit:ce.Hz,prefix:$.SHORT[""]}}};Ie.cgs=JSON.parse(JSON.stringify(Ie.si)),Ie.cgs.LENGTH={unit:ce.m,prefix:$.SHORT.c},Ie.cgs.MASS={unit:ce.g,prefix:$.SHORT[""]},Ie.cgs.FORCE={unit:ce.dyn,prefix:$.SHORT[""]},Ie.cgs.ENERGY={unit:ce.erg,prefix:$.NONE[""]},Ie.us=JSON.parse(JSON.stringify(Ie.si)),Ie.us.LENGTH={unit:ce.ft,prefix:$.NONE[""]},Ie.us.MASS={unit:ce.lbm,prefix:$.NONE[""]},Ie.us.TEMPERATURE={unit:ce.degF,prefix:$.NONE[""]},Ie.us.FORCE={unit:ce.lbf,prefix:$.NONE[""]},Ie.us.ENERGY={unit:ce.BTU,prefix:$.BTU[""]},Ie.us.POWER={unit:ce.hp,prefix:$.NONE[""]},Ie.us.PRESSURE={unit:ce.psi,prefix:$.NONE[""]},Ie.auto=JSON.parse(JSON.stringify(Ie.si));var He=Ie.auto;w.setUnitSystem=function(X){if(dr(Ie,X))He=Ie[X];else throw new Error("Unit system "+X+" does not exist. Choices are: "+Object.keys(Ie).join(", "))},w.getUnitSystem=function(){for(var X in Ie)if(dr(Ie,X)&&Ie[X]===He)return X},w.typeConverters={BigNumber:function(te){return te!=null&&te.isFraction?new _(te.n).div(te.d).times(te.s):new _(te+"")},Fraction:function(te){return new v(te)},Complex:function(te){return te},number:function(te){return te!=null&&te.isFraction?y(te):te}},w.prototype._numberConverter=function(){var X=w.typeConverters[this.valueType()];if(X)return X;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},w._getNumberConverter=function(X){if(!w.typeConverters[X])throw new TypeError('Unsupported type "'+X+'"');return w.typeConverters[X]};for(var tt in ce)if(dr(ce,tt)){var Qe=ce[tt];Qe.dimensions=Qe.base.dimensions}for(var ut in Ce)if(dr(Ce,ut)){var Xe=ce[Ce[ut]],le={};for(var De in Xe)dr(Xe,De)&&(le[De]=Xe[De]);le.name=ut,ce[ut]=le}w.isValidAlpha=function(te){return/^[a-zA-Z]$/.test(te)};function Ee(X){for(var te=0;te0&&!(w.isValidAlpha(A)||P(A)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+X+'"')}}return w.createUnit=function(X,te){if(typeof X!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(te&&te.override){for(var me in X)if(dr(X,me)&&w.deleteUnit(me),X[me].aliases)for(var we=0;we"u"||te===null)&&(te={}),typeof X!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(dr(ce,X))throw new Error('Cannot create unit "'+X+'": a unit with that name already exists');Ee(X);var me=null,we=[],Ne=0,Ue,We,st;if(te&&te.type==="Unit")me=te.clone();else if(typeof te=="string")te!==""&&(Ue=te);else if(typeof te=="object")Ue=te.definition,We=te.prefixes,Ne=te.offset,st=te.baseName,te.aliases&&(we=te.aliases.valueOf());else throw new TypeError('Cannot create unit "'+X+'" from "'+te.toString()+'": expecting "string" or "Unit" or "Object"');if(we){for(var z=0;z1e-12){Se=!1;break}if(Se){de=!0,F.base=U[ve];break}}if(!de){st=st||X+"_STUFF";var Be={dimensions:me.dimensions.slice(0)};Be.key=st,U[st]=Be,He[st]={unit:F,prefix:$.NONE[""]},F.base=U[st]}}else{if(st=st||X+"_STUFF",W.indexOf(st)>=0)throw new Error('Cannot create new base unit "'+X+'": a base unit with that name already exists (and cannot be overridden)');W.push(st);for(var oe in U)dr(U,oe)&&(U[oe].dimensions[W.length-1]=0);for(var ge={dimensions:[]},pe=0;pe{var{typed:e,Unit:n}=t;return e(ik,{Unit:function(i){return i.clone()},string:function(i){return n.isValuelessUnit(i)?new n(null,i):n.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,o){return new n(i,o)},"number | BigNumber | Fraction":function(i){return new n(i)},"Array | Matrix":e.referToSelf(r=>i=>Hi(i,r))})}),ok="createUnit",Oye=["typed","Unit"],Iye=Dt(ok,Oye,t=>{var{typed:e,Unit:n}=t;return e(ok,{"Object, Object":function(i,o){return n.createUnit(i,o)},Object:function(i){return n.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,o,a){var s={};return s[i]=o,n.createUnit(s,a)},"string, Unit | string | Object":function(i,o){var a={};return a[i]=o,n.createUnit(a,{})},string:function(i){var o={};return o[i]={},n.createUnit(o,{})}})}),CV=Dt("trigUnit",["typed"],t=>{var{typed:e}=t;return{Unit:e.referToSelf(n=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return e.find(n,r.valueType())(r.value)})}}),ak="cos",Lye=["typed"],Fye=Dt(ak,Lye,t=>{var{typed:e}=t,n=CV({typed:e});return e(ak,{number:Math.cos,"Complex | BigNumber":r=>r.cos()},n)}),sk="sin",kye=["typed"],Bye=Dt(sk,kye,t=>{var{typed:e}=t,n=CV({typed:e});return e(sk,{number:Math.sin,"Complex | BigNumber":r=>r.sin()},n)}),lk="add",Uye=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],zye=Dt(lk,Uye,t=>{var{typed:e,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:o,SparseMatrix:a,concat:s}=t,l=wve({typed:e}),u=Mve({typed:e,equalScalar:i}),c=Tve({typed:e,DenseMatrix:o}),f=cv({typed:e,matrix:n,concat:s});return e(lk,{"any, any":r,"any, any, ...any":e.referToSelf(d=>(p,y,x)=>{for(var _=d(p,y),v=0;v{var{typed:e,addScalar:n,multiplyScalar:r,conj:i,size:o}=t;return e(uk,{"Array | DenseMatrix, Array | DenseMatrix":s,"SparseMatrix, SparseMatrix":l});function a(c,f){var d=u(c),p=u(f),y,x;if(d.length===1)y=d[0];else if(d.length===2&&d[1]===1)y=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(p.length===1)x=p[0];else if(p.length===2&&p[1]===1)x=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(y!==x)throw new RangeError("Vectors must have equal length ("+y+" != "+x+")");if(y===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return y}function s(c,f){var d=a(c,f),p=di(c)?c._data:c,y=di(c)?c._datatype:void 0,x=di(f)?f._data:f,_=di(f)?f._datatype:void 0,v=u(c).length===2,S=u(f).length===2,w=n,E=r;if(y&&_&&y===_&&typeof y=="string"){var T=y;w=e.find(n,[T,T]),E=e.find(r,[T,T])}if(!v&&!S){for(var A=E(i(p[0]),x[0]),D=1;DA){E++;continue}T===A&&(_=v(_,S(p[w],x[E])),w++,E++)}return _}function u(c){return di(c)?c.size():o(c)}}),ck="det",Vye=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],Wye=Dt(ck,Vye,t=>{var{typed:e,matrix:n,subtractScalar:r,multiply:i,divideScalar:o,isZero:a,unaryMinus:s}=t;return e(ck,{any:function(c){return Fr(c)},"Array | Matrix":function(c){var f;switch(di(c)?f=c.size():Array.isArray(c)?(c=n(c),f=c.size()):f=[],f.length){case 0:return Fr(c);case 1:if(f[0]===1)return Fr(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+ui(f)+")");case 2:{var d=f[0],p=f[1];if(d===p)return l(c.clone().valueOf(),d);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+ui(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ui(f)+")")}}});function l(u,c,f){if(c===1)return Fr(u[0][0]);if(c===2)return r(i(u[0][0],u[1][1]),i(u[1][0],u[0][1]));for(var d=!1,p=new Array(c).fill(0).map((D,I)=>I),y=0;y{var{typed:e,matrix:n,divideScalar:r,addScalar:i,multiply:o,unaryMinus:a,det:s,identity:l,abs:u}=t;return e(fk,{"Array | Matrix":function(d){var p=di(d)?d.size():ya(d);switch(p.length){case 1:if(p[0]===1)return di(d)?n([r(1,d.valueOf()[0])]):[r(1,d[0])];throw new RangeError("Matrix must be square (size: "+ui(p)+")");case 2:{var y=p[0],x=p[1];if(y===x)return di(d)?n(c(d.valueOf(),y,x),d.storage()):c(d,y,x);throw new RangeError("Matrix must be square (size: "+ui(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ui(p)+")")}},any:function(d){return r(1,d)}});function c(f,d,p){var y,x,_,v,S;if(d===1){if(v=f[0][0],v===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,v)]]}else if(d===2){var w=s(f);if(w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(f[1][1],w),r(a(f[0][1]),w)],[r(a(f[1][0]),w),r(f[0][0],w)]]}else{var E=f.concat();for(y=0;yD&&(D=u(E[y][A]),I=y),y++;if(D===0)throw Error("Cannot calculate inverse, determinant is zero");y=I,y!==A&&(S=E[A],E[A]=E[y],E[y]=S,S=T[A],T[A]=T[y],T[y]=S);var P=E[A],N=T[A];for(y=0;y{var{typed:e,matrix:n,multiply:r,equalScalar:i,divideScalar:o,inv:a}=t,s=mb({typed:e,equalScalar:i}),l=Yp({typed:e});return e("divide",zH({"Array | Matrix, Array | Matrix":function(c,f){return r(c,a(f))},"DenseMatrix, any":function(c,f){return l(c,f,o,!1)},"SparseMatrix, any":function(c,f){return s(c,f,o,!1)},"Array, any":function(c,f){return l(n(c),f,o,!1).valueOf()},"any, Array | Matrix":function(c,f){return r(c,a(f))}},o.signatures))}),fv=J0e({config:Ko}),aC=nge({}),$O=age({}),HO=uge({}),Us=hge({Matrix:HO}),wn=t0e({BigNumber:fv,Complex:aC,DenseMatrix:Us,Fraction:$O}),AV=Wge({typed:wn}),yb=jge({typed:wn}),Kye=Lge({BigNumber:fv,typed:wn}),Zye=kve({typed:wn}),dk=Fye({typed:wn}),hf=Ege({config:Ko,typed:wn}),Jye=Qve({typed:wn}),Qye=gge({typed:wn}),e1e=_ge({typed:wn}),VO=Pve({typed:wn}),WO=Nge({typed:wn}),hk=Bye({typed:wn}),GO=Age({Matrix:HO,equalScalar:hf,typed:wn}),TV=Xge({typed:wn}),DV=Hge({typed:wn}),RV=Bge({Fraction:$O,typed:wn}),t1e=xge({typed:wn}),Gi=zge({DenseMatrix:Us,Matrix:HO,SparseMatrix:GO,typed:wn}),jO=nye({bignumber:Kye,fraction:RV,number:WO}),n1e=jve({matrix:Gi,config:Ko,typed:wn}),sC=Xve({BigNumber:fv,config:Ko,matrix:Gi,typed:wn}),dv=Uve({isInteger:Qye,matrix:Gi,typed:wn}),lC=iye({numeric:jO,typed:wn}),DR=cye({DenseMatrix:Us,concat:dv,equalScalar:hf,matrix:Gi,typed:wn}),PV=$ve({BigNumber:fv,DenseMatrix:Us,SparseMatrix:GO,config:Ko,matrix:Gi,typed:wn}),$T=wye({DenseMatrix:Us,concat:dv,config:Ko,matrix:Gi,typed:wn}),qO=lye({BigNumber:fv,DenseMatrix:Us,equalScalar:hf,matrix:Gi,typed:wn,zeros:sC}),r1e=hye({DenseMatrix:Us,concat:dv,config:Ko,matrix:Gi,typed:wn}),Cw=zye({DenseMatrix:Us,SparseMatrix:GO,addScalar:yb,concat:dv,equalScalar:hf,matrix:Gi,typed:wn}),i1e=Hye({addScalar:yb,conj:Zye,multiplyScalar:VO,size:n1e,typed:wn}),o1e=uve({DenseMatrix:Us,config:Ko,equalScalar:hf,matrix:Gi,round:qO,typed:wn,zeros:sC}),nE=xye({DenseMatrix:Us,concat:dv,config:Ko,matrix:Gi,typed:wn}),a1e=Aye({config:Ko,numeric:jO,smaller:r1e,typed:wn}),Fd=Ove({addScalar:yb,dot:i1e,equalScalar:hf,matrix:Gi,multiplyScalar:VO,typed:wn}),s1e=rve({DenseMatrix:Us,config:Ko,equalScalar:hf,matrix:Gi,round:qO,typed:wn,zeros:sC}),l1e=Wye({divideScalar:lC,isZero:e1e,matrix:Gi,multiply:Fd,subtractScalar:TV,typed:wn,unaryMinus:DV}),u1e=ave({Complex:aC,DenseMatrix:Us,ceil:s1e,equalScalar:hf,floor:o1e,matrix:Gi,typed:wn,zeros:sC}),c1e=Mye({config:Ko,larger:nE,numeric:jO,typed:wn}),f1e=gye({DenseMatrix:Us,concat:dv,config:Ko,matrix:Gi,typed:wn}),NV=jye({abs:AV,addScalar:yb,det:l1e,divideScalar:lC,identity:PV,matrix:Gi,multiply:Fd,typed:wn,unaryMinus:DV}),d1e=aye({Complex:aC,config:Ko,fraction:RV,identity:PV,inv:NV,matrix:Gi,multiply:Fd,number:WO,typed:wn}),lg=Rye({BigNumber:fv,Complex:aC,Fraction:$O,abs:AV,addScalar:yb,config:Ko,divideScalar:lC,equal:DR,fix:u1e,format:Jye,isNumeric:t1e,multiplyScalar:VO,number:WO,pow:d1e,round:qO,subtractScalar:TV}),pk=Iye({Unit:lg,typed:wn}),ru=Yye({divideScalar:lC,equalScalar:hf,inv:NV,matrix:Gi,multiply:Fd,typed:wn}),un=Nye({Unit:lg,typed:wn});const OV=un(299792458,"m/s"),IV=un(662607015e-42,"J s");var Gl=(t=>(t.millimetre="mm",t.micrometre="um",t))(Gl||{}),l1=(t=>(t.electronVolts="eV",t.kiloElectronVolts="keV",t))(l1||{}),ll=(t=>(t.nanmometres="nm",t.angstroms="angstrom",t))(ll||{}),l2=(t=>(t.nanmometres="nm^-1",t.angstroms="angstrom^-1",t))(l2||{}),u1=(t=>(t.radians="rad",t.degrees="deg",t))(u1||{});const h1e=t=>{const e=ru(Fd(IV,OV),t.toSI());if(typeof e=="number")throw TypeError("units for constants h and c are wrong");return e},RR=t=>{const e=ru(Fd(IV,OV),t.toSI());if(typeof e=="number")throw TypeError("units for constants h and c are wrong");return e},ug=t=>{const e=parseFloat(t.trim());return!e&&e!=0?null:e},mk=t=>{let e;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const f=e;e=u??typeof c!="object"?c:Object.assign({},e,c),n.forEach(d=>d(e,f))}},i=()=>e,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return e=t(r,i,s),s},p1e=t=>t?mk(t):mk;var LV={exports:{}},FV={},kV={exports:{}},BV={};/** + * @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 Kg=V;function m1e(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var g1e=typeof Object.is=="function"?Object.is:m1e,v1e=Kg.useState,y1e=Kg.useEffect,x1e=Kg.useLayoutEffect,b1e=Kg.useDebugValue;function _1e(t,e){var n=e(),r=v1e({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return x1e(function(){i.value=n,i.getSnapshot=e,HT(i)&&o({inst:i})},[t,n,e]),y1e(function(){return HT(i)&&o({inst:i}),t(function(){HT(i)&&o({inst:i})})},[t]),b1e(n),n}function HT(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!g1e(t,n)}catch{return!0}}function w1e(t,e){return e()}var S1e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w1e:_1e;BV.useSyncExternalStore=Kg.useSyncExternalStore!==void 0?Kg.useSyncExternalStore:S1e;kV.exports=BV;var E1e=kV.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 uC=V,M1e=E1e;function C1e(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var A1e=typeof Object.is=="function"?Object.is:C1e,T1e=M1e.useSyncExternalStore,D1e=uC.useRef,R1e=uC.useEffect,P1e=uC.useMemo,N1e=uC.useDebugValue;FV.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=D1e(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=P1e(function(){function l(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&a.hasValue){var y=a.value;if(i(y,p))return f=y}return f=p}if(y=f,A1e(c,p))return y;var x=r(p);return i!==void 0&&i(y,x)?y:(c=p,f=x)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(e())},d===null?void 0:function(){return l(d())}]},[e,n,r,i]);var s=T1e(t,o[0],o[1]);return R1e(function(){a.hasValue=!0,a.value=s},[s]),N1e(s),s};LV.exports=FV;var O1e=LV.exports;const UV=su(O1e),{useDebugValue:I1e}=se,{useSyncExternalStoreWithSelector:L1e}=UV;function F1e(t,e=t.getState,n){const r=L1e(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return I1e(r),r}const gk=t=>{const e=typeof t=="function"?p1e(t):t,n=(r,i)=>F1e(e,r,i);return Object.assign(n,e),n},hv=t=>t?gk(t):gk,k1e={"Pilatus P3-2M":{resolution:{width:1475,height:1679},pixelSize:{width:.172,height:.172}},"long boy":{resolution:{width:1475,height:679},pixelSize:{width:.2,height:.2}}},B1e={"I22 SAXS Isotropic":{detector:"Pilatus P3-2M",beamstop:{centre:{x:738,y:100},diameter:4,clearance:10},cameraTube:{centre:{x:738,y:840},diameter:310},angle:1.57,wavelength:null,cameraLength:1.9,minWavelength:.062,maxWavelength:.335,minCameraLength:1.9,maxCameraLength:9.9,cameraLengthStep:1},"I22 SAXS Anisotropic":{detector:"Pilatus P3-2M",beamstop:{centre:{x:738,y:840},diameter:4,clearance:10},cameraTube:{centre:{x:738,y:840},diameter:310},angle:1.57,wavelength:null,cameraLength:1.9,minWavelength:.062,maxWavelength:.335,minCameraLength:1.9,maxCameraLength:9.9,cameraLengthStep:2}},vk=Object.fromEntries(Object.entries(k1e).map(([t,e])=>[t,{...e,pixelSize:{height:un(e.pixelSize.height,"mm"),width:un(e.pixelSize.height,"mm")}}])),bx=Object.fromEntries(Object.entries(B1e).map(([t,e])=>[t,{...e,beamstop:{...e.beamstop,diameter:un(e.beamstop.diameter,"mm")},cameraTube:{...e.cameraTube,diameter:un(e.cameraTube.diameter,"mm")},minWavelength:un(e.minWavelength,"nm"),maxWavelength:un(e.maxWavelength,"nm"),minCameraLength:un(e.minCameraLength,"m"),maxCameraLength:un(e.maxCameraLength,"m"),cameraLengthStep:un(e.cameraLengthStep,"m"),wavelength:un(e.wavelength??NaN,"nm"),angle:un(e.angle??NaN,"rad")}])),Bc=bx[Object.keys(bx)[0]],XO=hv(t=>({...Bc.beamstop,updateCentre:e=>t(n=>({centre:{...n.centre,...e}})),updateDiameter:(e,n)=>t({diameter:un(e,n)}),updateDiameterUnits:e=>t(n=>({diameter:n.diameter.to(e)})),updateClearance:e=>t({clearance:e}),updateBeamstop:e=>t(e)})),_x=hv(t=>({name:Bc.detector,...vk[Bc.detector],detectorList:vk,updateDetector:e=>t(n=>({current:n.detectorList[e],name:e})),updatePixelUnits:e=>t(n=>({pixelSize:{height:n.pixelSize.height.to(e),width:n.pixelSize.width.to(e)}}))}));function U1e(){const t=XO(),e=s=>{t.updateCentre({x:parseFloat(s.target.value)})},n=s=>{t.updateCentre({y:parseFloat(s.target.value)})},r=s=>{t.updateClearance(parseFloat(s.target.value))},i=_x(),o=()=>{t.updateCentre({x:i.resolution.width/2,y:i.resolution.height/2})},a=()=>{t.updateCentre({x:i.resolution.width/2,y:0})};return k.jsxs(Wn,{spacing:1,children:[k.jsx(An,{variant:"h6",children:" Beamstop "}),k.jsxs(Wn,{direction:"row",children:[k.jsxs(An,{flexGrow:2,children:[" ","Diameter: ",t.diameter.toNumber()," "]}),k.jsxs(pl,{children:[k.jsx(Wu,{children:"units "}),k.jsxs(Gu,{size:"small",label:"units",value:t.diameter.formatUnits(),onChange:s=>t.updateDiameterUnits(s.target.value),children:[k.jsx(oo,{value:Gl.millimetre,children:"mm"}),k.jsx(oo,{value:Gl.micrometre,children:"μm"})]})]})]}),k.jsx(An,{children:"Position:"}),k.jsxs(Wn,{direction:"row",spacing:2,children:[k.jsx(An,{flexGrow:2,children:"x: "}),k.jsx(Cs,{type:"number",size:"small",value:t.centre.x,onChange:e}),k.jsxs(An,{flexGrow:2,align:"center",children:[" ","px"]}),k.jsx(r8,{size:"small",variant:"outlined",onClick:o,children:"Centre detector"})]}),k.jsxs(Wn,{direction:"row",spacing:1,children:[k.jsx(An,{flexGrow:2,children:"y: "}),k.jsx(Cs,{type:"number",size:"small",value:t.centre.y,onChange:n}),k.jsxs(An,{flexGrow:2,align:"center",children:[" ","px"]}),k.jsx(r8,{size:"small",variant:"outlined",onClick:a,children:"Centre top edge"})]}),k.jsx(Wn,{direction:"row",children:k.jsxs(Wn,{direction:"row",spacing:1,children:[k.jsx(An,{flexGrow:1,children:"Clearance: "}),k.jsx(Cs,{type:"number",size:"small",value:t.clearance,onChange:r}),k.jsx(An,{children:"px"})]})})]})}const YO=hv(t=>({...Bc.cameraTube,updateCentre:e=>t(n=>({centre:{...n.centre,...e}})),updateDiameterUnits:e=>t(n=>({diameter:n.diameter.to(e)})),updateCameraTube:e=>t(e)}));function z1e(){const t=YO(),e=r=>{t.updateCentre({x:parseFloat(r.target.value)})},n=r=>{t.updateCentre({y:parseFloat(r.target.value)})};return k.jsxs(yw,{spacing:1,children:[k.jsx(An,{variant:"h6",children:" CameraTube "}),k.jsxs(yw,{direction:"row",children:[k.jsxs(An,{flexGrow:2,children:[" ","Diameter: ",t.diameter.toNumber()," "]}),k.jsxs(pl,{children:[k.jsx(Wu,{children:"units "}),k.jsxs(Gu,{size:"small",label:"units",value:t.diameter.formatUnits(),onChange:r=>t.updateDiameterUnits(r.target.value),children:[k.jsx(oo,{value:Gl.millimetre,children:"mm"}),k.jsx(oo,{value:Gl.micrometre,children:"μm"})]})]})]}),k.jsx(An,{children:"Position:"}),k.jsxs(yw,{direction:"row",children:[k.jsx(An,{flexGrow:2,children:"x: "}),k.jsx(Cs,{type:"number",size:"small",value:t.centre.x,onChange:e}),k.jsxs(An,{flexGrow:2,align:"center",children:[" ","px"]})]}),k.jsxs(yw,{direction:"row",children:[k.jsx(An,{flexGrow:2,children:"y: "}),k.jsx(Cs,{type:"number",size:"small",value:t.centre.y,onChange:n}),k.jsxs(An,{flexGrow:2,align:"center",children:[" ","px"]})]})]})}const u2=hv(t=>({preset:Object.keys(bx)[0],...Bc,userEnergy:RR(Bc.wavelength).to("keV").toNumber(),userWavelength:Bc.wavelength.toNumber(),userAngle:Bc.angle.toNumber(),energy:RR(Bc.wavelength).to("keV"),updateAngle:(e,n)=>t({angle:un(e??NaN,n),userAngle:e}),updateAngleUnits:e=>t(n=>({angle:n.angle.to(e),userAngle:n.angle.to(e).toNumber()})),updateCameraLength:e=>t({cameraLength:e}),updateWavelength:(e,n)=>t(r=>({wavelength:un(e??NaN,n),userWavelength:e,minWavelength:r.minWavelength.to(n),maxWavelength:r.maxWavelength.to(n)})),updateWavelengthUnits:e=>t(n=>({wavelength:n.wavelength.to(e),userWavelength:n.wavelength.to(e).toNumber(),minWavelength:n.minWavelength.to(e),maxWavelength:n.maxWavelength.to(e)})),updateEnergy:(e,n)=>t({energy:un(e??NaN,n),userEnergy:e}),updateEnergyUnits:e=>t(n=>({energy:n.energy.to(e),userEnergy:n.energy.to(e).toNumber()})),update:e=>t({...e})}));function $1e(){const t=u2(),e=l=>{t.updateAngleUnits(l.target.value)},n=l=>{t.updateAngle(ug(l.target.value),t.angle.formatUnits())},r=l=>{const u=ug(l.target.value);t.updateWavelength(u,t.wavelength.formatUnits());const c=RR(un(u??NaN,t.wavelength.formatUnits()));t.updateEnergy(c.to(t.energy.formatUnits()).toNumber(),t.energy.formatUnits())},i=l=>{t.updateWavelengthUnits(l.target.value)},o=l=>{const u=ug(l.target.value);t.updateEnergy(u,t.energy.formatUnits());const c=h1e(un(u??NaN,t.energy.formatUnits()));t.updateWavelength(c.to(t.wavelength.formatUnits()).toNumber(),t.wavelength.formatUnits())},a=l=>{t.updateEnergyUnits(l.target.value)},s=l=>{t.updateCameraLength(ug(l.target.value))};return k.jsxs(Wn,{spacing:2,children:[k.jsx(An,{variant:"h6",children:"Beam properties"}),k.jsxs(Wn,{direction:"row",spacing:1,children:[k.jsx(An,{flexGrow:1,children:"Energy: "}),k.jsx(Cs,{type:"number",size:"small",value:t.userEnergy,onChange:o}),k.jsxs(pl,{children:[k.jsx(Wu,{children:"units"}),k.jsxs(Gu,{size:"small",label:"units",value:t.energy.formatUnits(),onChange:a,children:[k.jsx(oo,{value:l1.electronVolts,children:l1.electronVolts}),k.jsx(oo,{value:l1.kiloElectronVolts,children:l1.kiloElectronVolts})]})]})]}),k.jsxs(Wn,{direction:"row",spacing:1,children:[k.jsx(An,{flexGrow:1,children:"Wavelength: "}),k.jsx(Cs,{type:"number",size:"small",value:t.userWavelength,onChange:r}),k.jsxs(pl,{children:[k.jsx(Wu,{children:"units"}),k.jsxs(Gu,{size:"small",label:"units",value:t.wavelength.formatUnits(),onChange:i,children:[k.jsx(oo,{value:ll.nanmometres,children:ll.nanmometres}),k.jsx(oo,{value:ll.angstroms,children:"Å"})]})]})]}),k.jsxs(An,{children:["Minimum allowed wavelength: ",t.minWavelength.toString()]}),k.jsxs(An,{children:["Maximum allowed wavelength: ",t.maxWavelength.toString()]}),k.jsxs(Wn,{direction:"row",spacing:1,children:[k.jsx(An,{children:"Camera Length: "}),k.jsx(Cs,{type:"number",size:"small",value:t.cameraLength??"",InputProps:{inputProps:{max:t.maxCameraLength,min:t.minCameraLength,step:t.cameraLengthStep}},onChange:s}),k.jsx(An,{children:"m"})]}),k.jsxs(Wn,{direction:"row",spacing:1,children:[k.jsx(An,{flexGrow:2,children:"Angle:"}),k.jsx(Cs,{type:"number",size:"small",defaultValue:"",value:t.userAngle??"",onChange:n}),k.jsxs(pl,{children:[k.jsx(Wu,{children:"units"}),k.jsxs(Gu,{size:"small",label:"units",value:t.angle.formatUnits(),onChange:e,children:[k.jsx(oo,{value:u1.radians,children:u1.radians}),k.jsx(oo,{value:u1.degrees,children:u1.degrees})]})]})]})]})}function H1e(){const t=_x(),e=_x(n=>n.detectorList);return k.jsx(KM,{sx:{height:1},children:k.jsx(ZM,{children:k.jsxs(Wn,{spacing:1,children:[k.jsx(An,{variant:"h6",children:"Detector"}),k.jsx(cH,{size:"small",disablePortal:!0,id:"combo-box-demo",options:Object.keys(e),sx:{width:300},renderInput:n=>k.jsx(Cs,{...n,label:"choose detector type"}),value:t.name,onChange:(n,r)=>{r&&t.updateDetector(r)}}),k.jsxs(An,{children:["Resolution (hxw): ",t.resolution.height," x"," ",t.resolution.width]}),k.jsxs(Wn,{direction:"row",children:[k.jsxs(An,{flexGrow:2,children:["Pixel size: ",t.pixelSize.height.toString()," x"," ",t.pixelSize.width.toString()]}),k.jsxs(pl,{children:[k.jsx(Wu,{children:"units"}),k.jsxs(Gu,{size:"small",label:"units",value:t.pixelSize.height.formatUnits(),onChange:n=>t.updatePixelUnits(n.target.value),children:[k.jsxs(oo,{value:Gl.millimetre,children:[Gl.millimetre," x ",Gl.millimetre]}),k.jsxs(oo,{value:Gl.micrometre,children:[Gl.micrometre," x ",Gl.micrometre]})]})]})]}),k.jsx(bp,{}),k.jsx(U1e,{}),k.jsx(bp,{}),k.jsx(z1e,{}),k.jsx(bp,{}),k.jsx($1e,{})]})})})}function _s(t){const e=V.useRef(t);return e.current=t,V.useMemo(()=>Object.freeze({get current(){return e.current}}),[])}function zV(t){const e=_s(t);V.useEffect(()=>()=>{e.current()},[])}const PR=typeof window<"u"&&typeof navigator<"u"&&typeof document<"u";function V1e(t){const e=_s(t),n=V.useRef(0),r=V.useCallback(()=>{PR&&n.current&&(cancelAnimationFrame(n.current),n.current=0)},[]);return zV(r),[V.useMemo(()=>{const i=(...o)=>{PR&&(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 W1e(t,...e){var n;(n=t==null?void 0:t.addEventListener)==null||n.call(t,...e)}function G1e(t,...e){var n;(n=t==null?void 0:t.removeEventListener)==null||n.call(t,...e)}const j1e=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),q1e=()=>!0,X1e=()=>!1;function Y1e(t=!1){const e=V.useRef(t),n=V.useCallback(()=>e.current,[]);return V.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),n}const K1e=t=>(t+1)%Number.MAX_SAFE_INTEGER;function Z1e(){const[,t]=V.useState(0);return V.useCallback(()=>{t(K1e)},[])}function J1e(t,e){return typeof t=="function"?t(e):t}function yk(t){const e=V.useRef();return V.useEffect(()=>{e.current=t}),e.current}function Q1e(t){const[e,n]=V.useState(t),[r,i]=V1e(n);return zV(i),[e,r]}function exe(t=!1,e=!0){const[n,r]=V.useState(t),i=_s(e);return[n,V.useCallback(o=>{r(a=>o===void 0||i.current&&typeof o=="object"&&(o.constructor.name==="SyntheticBaseEvent"||typeof o._reactName=="string")?!a:!!J1e(o,a))},[])]}function wp(t,...e){const n=Y1e(),r=_s(e[1]),i=V.useMemo(()=>function(...o){n()&&(typeof r.current=="function"?r.current.apply(this,o):typeof r.current.handleEvent=="function"&&r.current.handleEvent.apply(this,o))},[]);V.useEffect(()=>{const o=t&&j1e(t,"current")?t.current:t;if(!o)return;const a=e.slice(2);return W1e(o,e[0],i,...a),()=>{G1e(o,e[0],i,...a)}},[t,e[0]])}const txe=t=>typeof t=="function"?t:typeof t=="string"?e=>e.key===t:t?q1e:X1e,nxe=PR?window:null;function rxe(t,e,n,r={}){const{event:i="keydown",target:o=nxe,eventOptions:a}=r,s=_s(e),l=V.useMemo(()=>{const u=txe(t);return function(c){u(c)&&s.current.call(this,c)}},n);wp(o,i,l,a)}var c2={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */c2.exports;(function(t,e){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,c="__lodash_placeholder__",f=1,d=2,p=4,y=1,x=2,_=1,v=2,S=4,w=8,E=16,T=32,A=64,D=128,I=256,P=512,N=30,B="...",G=800,Z=16,j=1,J=2,Y=3,$=1/0,W=9007199254740991,U=17976931348623157e292,ne=0/0,re=4294967295,ue=re-1,ce=re>>>1,Ce=[["ary",D],["bind",_],["bindKey",v],["curry",w],["curryRight",E],["flip",P],["partial",T],["partialRight",A],["rearg",I]],Re="[object Arguments]",Ie="[object Array]",He="[object AsyncFunction]",tt="[object Boolean]",Qe="[object Date]",ut="[object DOMException]",Xe="[object Error]",le="[object Function]",De="[object GeneratorFunction]",Ee="[object Map]",X="[object Number]",te="[object Null]",me="[object Object]",we="[object Promise]",Ne="[object Proxy]",Ue="[object RegExp]",We="[object Set]",st="[object String]",z="[object Symbol]",F="[object Undefined]",oe="[object WeakMap]",ge="[object WeakSet]",pe="[object ArrayBuffer]",de="[object DataView]",ve="[object Float32Array]",Se="[object Float64Array]",Pe="[object Int8Array]",Be="[object Int16Array]",je="[object Int32Array]",Fe="[object Uint8Array]",xt="[object Uint8ClampedArray]",yt="[object Uint16Array]",bt="[object Uint32Array]",Ct=/\b__p \+= '';/g,ht=/\b(__p \+=) '' \+/g,jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,be=/&(?:amp|lt|gt|quot|#39);/g,gt=/[&<>"']/g,ct=RegExp(be.source),Ye=RegExp(gt.source),pt=/<%-([\s\S]+?)%>/g,Vt=/<%([\s\S]+?)%>/g,xn=/<%=([\s\S]+?)%>/g,Zn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cr=/^\w*$/,sn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sn=/[\\^$.*+?()[\]{}|]/g,ur=RegExp(Sn.source),Sa=/^\s+/,Ea=/\s/,Ka=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ro=/\{\n\/\* \[wrapped with (.+)\] \*/,Zo=/,? & /,Po=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Jo=/[()=,{}\[\]\/\s]/,Ze=/\\(\\)?/g,Ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,it=/\w*$/,K=/^[-+]0x[0-9a-f]+$/i,_e=/^0b[01]+$/i,Oe=/^\[object .+?Constructor\]$/,ke=/^0o[0-7]+$/i,ze=/^(?:0|[1-9]\d*)$/,Et=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Lt=/($^)/,Wt=/['\n\r\u2028\u2029\\]/g,vt="\\ud800-\\udfff",Ft="\\u0300-\\u036f",en="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",Xn=Ft+en+Zt,Qr="\\u2700-\\u27bf",cr="a-z\\xdf-\\xf6\\xf8-\\xff",Si="\\xac\\xb1\\xd7\\xf7",tn="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",It="\\u2000-\\u206f",Ma=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nn="A-Z\\xc0-\\xd6\\xd8-\\xde",Ar="\\ufe0e\\ufe0f",Za=Si+tn+It+Ma,No="['’]",Ei="["+vt+"]",$r="["+Za+"]",Qo="["+Xn+"]",sc="\\d+",Mi="["+Qr+"]",lc="["+cr+"]",Oo="[^"+vt+Za+sc+Qr+cr+Nn+"]",yf="\\ud83c[\\udffb-\\udfff]",pA="(?:"+Qo+"|"+yf+")",jb="[^"+vt+"]",xf="(?:\\ud83c[\\udde6-\\uddff]){2}",bf="[\\ud800-\\udbff][\\udc00-\\udfff]",zs="["+Nn+"]",oh="\\u200d",qb="(?:"+lc+"|"+Oo+")",mA="(?:"+zs+"|"+Oo+")",um="(?:"+No+"(?:d|ll|m|re|s|t|ve))?",cm="(?:"+No+"(?:D|LL|M|RE|S|T|VE))?",_f=pA+"?",Xb="["+Ar+"]?",Pv="(?:"+oh+"(?:"+[jb,xf,bf].join("|")+")"+Xb+_f+")*",Vn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",fm=Xb+_f+Pv,Kb="(?:"+[Mi,xf,bf].join("|")+")"+fm,gA="(?:"+[jb+Qo+"?",Qo,xf,bf,Ei].join("|")+")",vA=RegExp(No,"g"),Ci=RegExp(Qo,"g"),ah=RegExp(yf+"(?="+yf+")|"+gA+fm,"g"),yA=RegExp([zs+"?"+lc+"+"+um+"(?="+[$r,zs,"$"].join("|")+")",mA+"+"+cm+"(?="+[$r,zs+qb,"$"].join("|")+")",zs+"?"+qb+"+"+um,zs+"+"+cm,Yb,Vn,sc,Kb].join("|"),"g"),Nv=RegExp("["+oh+vt+Xn+Ar+"]"),xA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,dm=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$s=-1,pr={};pr[ve]=pr[Se]=pr[Pe]=pr[Be]=pr[je]=pr[Fe]=pr[xt]=pr[yt]=pr[bt]=!0,pr[Re]=pr[Ie]=pr[pe]=pr[tt]=pr[de]=pr[Qe]=pr[Xe]=pr[le]=pr[Ee]=pr[X]=pr[me]=pr[Ue]=pr[We]=pr[st]=pr[oe]=!1;var fr={};fr[Re]=fr[Ie]=fr[pe]=fr[de]=fr[tt]=fr[Qe]=fr[ve]=fr[Se]=fr[Pe]=fr[Be]=fr[je]=fr[Ee]=fr[X]=fr[me]=fr[Ue]=fr[We]=fr[st]=fr[z]=fr[Fe]=fr[xt]=fr[yt]=fr[bt]=!0,fr[Xe]=fr[le]=fr[oe]=!1;var Hs={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},El={"&":"&","<":"<",">":">",'"':""","'":"'"},hm={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ov={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zb=parseFloat,bA=parseInt,Ja=typeof Fc=="object"&&Fc&&Fc.Object===Object&&Fc,_A=typeof self=="object"&&self&&self.Object===Object&&self,ei=Ja||_A||Function("return this")(),Iv=e&&!e.nodeType&&e,Oi=Iv&&!0&&t&&!t.nodeType&&t,sh=Oi&&Oi.exports===Iv,wf=sh&&Ja.process,Ii=function(){try{var xe=Oi&&Oi.require&&Oi.require("util").types;return xe||wf&&wf.binding&&wf.binding("util")}catch{}}(),pm=Ii&&Ii.isArrayBuffer,mm=Ii&&Ii.isDate,Lv=Ii&&Ii.isMap,gm=Ii&&Ii.isRegExp,vm=Ii&&Ii.isSet,uc=Ii&&Ii.isTypedArray;function _r(xe,Ke,$e){switch($e.length){case 0:return xe.call(Ke);case 1:return xe.call(Ke,$e[0]);case 2:return xe.call(Ke,$e[0],$e[1]);case 3:return xe.call(Ke,$e[0],$e[1],$e[2])}return xe.apply(Ke,$e)}function Vs(xe,Ke,$e,Rt){for(var ln=-1,vn=xe==null?0:xe.length;++ln-1}function Sf(xe,Ke,$e){for(var Rt=-1,ln=xe==null?0:xe.length;++Rt-1;);return $e}function Cf(xe,Ke){for(var $e=xe.length;$e--&&ts(Ke,xe[$e],0)>-1;);return $e}function rs(xe,Ke){for(var $e=xe.length,Rt=0;$e--;)xe[$e]===Ke&&++Rt;return Rt}var n_=Lo(Hs),r_=Lo(El);function Uv(xe){return"\\"+Ov[xe]}function zv(xe,Ke){return xe==null?n:xe[Ke]}function cc(xe){return Nv.test(xe)}function fh(xe){return xA.test(xe)}function Af(xe){for(var Ke,$e=[];!(Ke=xe.next()).done;)$e.push(Ke.value);return $e}function dh(xe){var Ke=-1,$e=Array(xe.size);return xe.forEach(function(Rt,ln){$e[++Ke]=[ln,Rt]}),$e}function Tf(xe,Ke){return function($e){return xe(Ke($e))}}function is(xe,Ke){for(var $e=-1,Rt=xe.length,ln=0,vn=[];++$e-1}function Mm(h,b){var C=this.__data__,L=xu(C,h);return L<0?(++this.size,C.push([h,b])):C[L][1]=b,this}os.prototype.clear=S_,os.prototype.delete=Yv,os.prototype.get=E_,os.prototype.has=M_,os.prototype.set=Mm;function Ca(h){var b=-1,C=h==null?0:h.length;for(this.clear();++b=b?h:b)),h}function na(h,b,C,L,q,ie){var he,ye=b&f,Te=b&d,et=b&p;if(C&&(he=q?C(h,L,q,ie):C(h)),he!==n)return he;if(!Gr(h))return h;var nt=bn(h);if(nt){if(he=hY(h),!ye)return Qi(h,he)}else{var ot=Fo(h),At=ot==le||ot==De;if(Xf(h))return my(h,ye);if(ot==me||ot==Re||At&&!q){if(he=Te||At?{}:l5(h),!ye)return Te?$_(h,P_(he,h)):PA(h,ty(he,h))}else{if(!fr[ot])return q?h:{};he=pY(h,ot,ye)}}ie||(ie=new vi);var zt=ie.get(h);if(zt)return zt;ie.set(h,he),k5(h)?h.forEach(function(on){he.add(na(on,b,C,on,h,ie))}):L5(h)&&h.forEach(function(on,Fn){he.set(Fn,na(on,b,C,Fn,h,ie))});var rn=et?Te?Bn:ri:Te?Pa:to,On=nt?n:rn(h);return pi(On||h,function(on,Fn){On&&(Fn=on,on=h[Fn]),as(he,Fn,na(on,b,C,Fn,h,ie))}),he}function ny(h){var b=to(h);return function(C){return Dm(C,h,b)}}function Dm(h,b,C){var L=C.length;if(h==null)return!L;for(h=nn(h);L--;){var q=C[L],ie=b[q],he=h[q];if(he===n&&!(q in h)||!ie(he))return!1}return!0}function ry(h,b,C){if(typeof h!="function")throw new vo(a);return xy(function(){h.apply(n,C)},b)}function gc(h,b,C,L){var q=-1,ie=Qa,he=!0,ye=h.length,Te=[],et=b.length;if(!ye)return Te;C&&(b=mr(b,mo(C))),L?(ie=Sf,he=!1):b.length>=i&&(ie=Li,he=!1,b=new yu(b));e:for(;++qq?0:q+C),L=L===n||L>q?q:Tn(L),L<0&&(L+=q),L=C>L?0:U5(L);C0&&C(ye)?b>1?Di(ye,b-1,C,L,q):es(q,ye):L||(q[q.length]=ye)}return q}var Uf=$m(),Ah=$m(!0);function ra(h,b){return h&&Uf(h,b,to)}function zf(h,b){return h&&Ah(h,b,to)}function vc(h,b){return ji(b,function(C){return wc(h[C])})}function ls(h,b){b=Mu(b,h);for(var C=0,L=b.length;h!=null&&Cb}function I_(h,b){return h!=null&&Gn.call(h,b)}function oy(h,b){return h!=null&&b in nn(h)}function DA(h,b,C){return h>=qi(b,C)&&h=120&&nt.length>=120)?new yu(he&&nt):n}nt=h[0];var ot=-1,At=ye[0];e:for(;++ot-1;)ye!==h&&gu.call(ye,Te,1),gu.call(h,Te,1);return h}function Ki(h,b){for(var C=h?b.length:0,L=C-1;C--;){var q=b[C];if(C==L||q!==ie){var ie=q;_c(q)?gu.call(h,q,1):dy(h,q)}}return h}function Ks(h,b){return h+bh(qv()*(b-h+1))}function Aa(h,b,C,L){for(var q=-1,ie=gi(xh((b-h)/(C||1)),0),he=$e(ie);ie--;)he[L?ie:++q]=h,h+=C;return he}function qf(h,b){var C="";if(!h||b<1||b>W)return C;do b%2&&(C+=h),b=bh(b/2),b&&(h+=h);while(b);return C}function Xt(h,b){return BA(f5(h,b,Na),h+"")}function L_(h){return Mh(Gm(h))}function uy(h,b){var C=Gm(h);return W_(C,bu(b,0,C.length))}function xc(h,b,C,L){if(!Gr(h))return h;b=Mu(b,h);for(var q=-1,ie=b.length,he=ie-1,ye=h;ye!=null&&++qq?0:q+b),C=C>q?q:C,C<0&&(C+=q),q=b>C?0:C-b>>>0,b>>>=0;for(var ie=$e(q);++L>>1,he=h[ie];he!==null&&!cs(he)&&(C?he<=b:he=i){var et=b?null:eo(h);if(et)return hh(et);he=!1,q=Li,Te=new yu}else Te=b?[]:ye;e:for(;++L=L?h:oa(h,b,C)}var U_=yh||function(h){return ei.clearTimeout(h)};function my(h,b){if(b)return h.slice();var C=h.length,L=Vv?Vv(C):new h.constructor(C);return h.copy(L),L}function Um(h){var b=new h.constructor(h.byteLength);return new gh(b).set(new gh(h)),b}function RA(h,b){var C=b?Um(h.buffer):h.buffer;return new h.constructor(C,h.byteOffset,h.byteLength)}function Ta(h){var b=new h.constructor(h.source,it.exec(h));return b.lastIndex=h.lastIndex,b}function gy(h){return Tl?nn(Tl.call(h)):{}}function z_(h,b){var C=b?Um(h.buffer):h.buffer;return new h.constructor(C,h.byteOffset,h.length)}function Pl(h,b){if(h!==b){var C=h!==n,L=h===null,q=h===h,ie=cs(h),he=b!==n,ye=b===null,Te=b===b,et=cs(b);if(!ye&&!et&&!ie&&h>b||ie&&he&&Te&&!ye&&!et||L&&he&&Te||!C&&Te||!q)return 1;if(!L&&!ie&&!et&&h=ye)return Te;var et=C[L];return Te*(et=="desc"?-1:1)}}return h.index-b.index}function Au(h,b,C,L){for(var q=-1,ie=h.length,he=C.length,ye=-1,Te=b.length,et=gi(ie-he,0),nt=$e(Te+et),ot=!L;++ye1?C[q-1]:n,he=q>2?C[2]:n;for(ie=h.length>3&&typeof ie=="function"?(q--,ie):n,he&&sa(C[0],C[1],he)&&(ie=q<3?n:ie,q=1),b=nn(b);++L-1?q[ie?b[he]:he]:n}}function O(h){return Cn(function(b){var C=b.length,L=C,q=Xi.prototype.thru;for(h&&b.reverse();L--;){var ie=b[L];if(typeof ie!="function")throw new vo(a);if(q&&!he&&Hm(ie)=="wrapper")var he=new Xi([],!0)}for(L=he?L:C;++L1&&$n.reverse(),nt&&Teye))return!1;var et=ie.get(h),nt=ie.get(b);if(et&&nt)return et==b&&nt==h;var ot=-1,At=!0,zt=C&x?new yu:n;for(ie.set(h,b),ie.set(b,h);++ot1?"& ":"")+b[L],b=b.join(C>2?", ":" "),h.replace(Ka,`{ +/* [wrapped with `+b+`] */ +`)}function gY(h){return bn(h)||Bh(h)||!!(Gv&&h&&h[Gv])}function _c(h,b){var C=typeof h;return b=b??W,!!b&&(C=="number"||C!="symbol"&&ze.test(h))&&h>-1&&h%1==0&&h0){if(++b>=G)return arguments[0]}else b=0;return h.apply(n,arguments)}}function W_(h,b){var C=-1,L=h.length,q=L-1;for(b=b===n?L:b;++C1?h[b-1]:n;return C=typeof C=="function"?(h.pop(),C):n,S5(h,C)});function E5(h){var b=Q(h);return b.__chain__=!0,b}function AK(h,b){return b(h),h}function G_(h,b){return b(h)}var TK=Cn(function(h){var b=h.length,C=b?h[0]:0,L=this.__wrapped__,q=function(ie){return Tm(ie,h)};return b>1||this.__actions__.length||!(L instanceof Yt)||!_c(C)?this.thru(q):(L=L.slice(C,+C+(b?1:0)),L.__actions__.push({func:G_,args:[q],thisArg:n}),new Xi(L,this.__chain__).thru(function(ie){return b&&!ie.length&&ie.push(n),ie}))});function DK(){return E5(this)}function RK(){return new Xi(this.value(),this.__chain__)}function PK(){this.__values__===n&&(this.__values__=B5(this.value()));var h=this.__index__>=this.__values__.length,b=h?n:this.__values__[this.__index__++];return{done:h,value:b}}function NK(){return this}function OK(h){for(var b,C=this;C instanceof Eh;){var L=v5(C);L.__index__=0,L.__values__=n,b?q.__wrapped__=L:b=L;var q=L;C=C.__wrapped__}return q.__wrapped__=h,b}function IK(){var h=this.__wrapped__;if(h instanceof Yt){var b=h;return this.__actions__.length&&(b=new Yt(this)),b=b.reverse(),b.__actions__.push({func:G_,args:[UA],thisArg:n}),new Xi(b,this.__chain__)}return this.thru(UA)}function LK(){return Su(this.__wrapped__,this.__actions__)}var FK=Lh(function(h,b,C){Gn.call(h,C)?++h[C]:Ys(h,C,1)});function kK(h,b,C){var L=bn(h)?kv:TA;return C&&sa(h,b,C)&&(b=n),L(h,Jt(b,3))}function BK(h,b){var C=bn(h)?ji:iy;return C(h,Jt(b,3))}var UK=R(y5),zK=R(x5);function $K(h,b){return Di(j_(h,b),1)}function HK(h,b){return Di(j_(h,b),$)}function VK(h,b,C){return C=C===n?1:Tn(C),Di(j_(h,b),C)}function M5(h,b){var C=bn(h)?pi:ss;return C(h,Jt(b,3))}function C5(h,b){var C=bn(h)?Fv:N_;return C(h,Jt(b,3))}var WK=Lh(function(h,b,C){Gn.call(h,C)?h[C].push(b):Ys(h,C,[b])});function GK(h,b,C,L){h=Ra(h)?h:Gm(h),C=C&&!L?Tn(C):0;var q=h.length;return C<0&&(C=gi(q+C,0)),Z_(h)?C<=q&&h.indexOf(b,C)>-1:!!q&&ts(h,b,C)>-1}var jK=Xt(function(h,b,C){var L=-1,q=typeof b=="function",ie=Ra(h)?$e(h.length):[];return ss(h,function(he){ie[++L]=q?_r(b,he,C):vr(he,b,C)}),ie}),qK=Lh(function(h,b,C){Ys(h,C,b)});function j_(h,b){var C=bn(h)?mr:yc;return C(h,Jt(b,3))}function XK(h,b,C,L){return h==null?[]:(bn(b)||(b=b==null?[]:[b]),C=L?n:C,bn(C)||(C=C==null?[]:[C]),Ph(h,b,C))}var YK=Lh(function(h,b,C){h[C?0:1].push(b)},function(){return[[],[]]});function KK(h,b,C){var L=bn(h)?ym:hu,q=arguments.length<3;return L(h,Jt(b,4),C,q,ss)}function ZK(h,b,C){var L=bn(h)?Jb:hu,q=arguments.length<3;return L(h,Jt(b,4),C,q,N_)}function JK(h,b){var C=bn(h)?ji:iy;return C(h,Y_(Jt(b,3)))}function QK(h){var b=bn(h)?Mh:L_;return b(h)}function eZ(h,b,C){(C?sa(h,b,C):b===n)?b=1:b=Tn(b);var L=bn(h)?Jv:uy;return L(h,b)}function tZ(h){var b=bn(h)?R_:k_;return b(h)}function nZ(h){if(h==null)return 0;if(Ra(h))return Z_(h)?Ws(h):h.length;var b=Fo(h);return b==Ee||b==We?h.size:Yi(h).length}function rZ(h,b,C){var L=bn(h)?lh:cy;return C&&sa(h,b,C)&&(b=n),L(h,Jt(b,3))}var iZ=Xt(function(h,b){if(h==null)return[];var C=b.length;return C>1&&sa(h,b[0],b[1])?b=[]:C>2&&sa(b[0],b[1],b[2])&&(b=[b[0]]),Ph(h,Di(b,1),[])}),q_=s_||function(){return ei.Date.now()};function oZ(h,b){if(typeof b!="function")throw new vo(a);return h=Tn(h),function(){if(--h<1)return b.apply(this,arguments)}}function A5(h,b,C){return b=C?n:b,b=h&&b==null?h.length:b,Le(h,D,n,n,n,n,b)}function T5(h,b){var C;if(typeof b!="function")throw new vo(a);return h=Tn(h),function(){return--h>0&&(C=b.apply(this,arguments)),h<=1&&(b=n),C}}var $A=Xt(function(h,b,C){var L=_;if(C.length){var q=is(C,Vm($A));L|=T}return Le(h,L,b,C,q)}),D5=Xt(function(h,b,C){var L=_|v;if(C.length){var q=is(C,Vm(D5));L|=T}return Le(b,L,h,C,q)});function R5(h,b,C){b=C?n:b;var L=Le(h,w,n,n,n,n,n,b);return L.placeholder=R5.placeholder,L}function P5(h,b,C){b=C?n:b;var L=Le(h,E,n,n,n,n,n,b);return L.placeholder=P5.placeholder,L}function N5(h,b,C){var L,q,ie,he,ye,Te,et=0,nt=!1,ot=!1,At=!0;if(typeof h!="function")throw new vo(a);b=el(b)||0,Gr(C)&&(nt=!!C.leading,ot="maxWait"in C,ie=ot?gi(el(C.maxWait)||0,b):ie,At="trailing"in C?!!C.trailing:At);function zt(xi){var Ol=L,Ec=q;return L=q=n,et=xi,he=h.apply(Ec,Ol),he}function rn(xi){return et=xi,ye=xy(Fn,b),nt?zt(xi):he}function On(xi){var Ol=xi-Te,Ec=xi-et,Z5=b-Ol;return ot?qi(Z5,ie-Ec):Z5}function on(xi){var Ol=xi-Te,Ec=xi-et;return Te===n||Ol>=b||Ol<0||ot&&Ec>=ie}function Fn(){var xi=q_();if(on(xi))return $n(xi);ye=xy(Fn,On(xi))}function $n(xi){return ye=n,At&&L?zt(xi):(L=q=n,he)}function fs(){ye!==n&&U_(ye),et=0,L=Te=q=ye=n}function la(){return ye===n?he:$n(q_())}function ds(){var xi=q_(),Ol=on(xi);if(L=arguments,q=this,Te=xi,Ol){if(ye===n)return rn(Te);if(ot)return U_(ye),ye=xy(Fn,b),zt(Te)}return ye===n&&(ye=xy(Fn,b)),he}return ds.cancel=fs,ds.flush=la,ds}var aZ=Xt(function(h,b){return ry(h,1,b)}),sZ=Xt(function(h,b,C){return ry(h,el(b)||0,C)});function lZ(h){return Le(h,P)}function X_(h,b){if(typeof h!="function"||b!=null&&typeof b!="function")throw new vo(a);var C=function(){var L=arguments,q=b?b.apply(this,L):L[0],ie=C.cache;if(ie.has(q))return ie.get(q);var he=h.apply(this,L);return C.cache=ie.set(q,he)||ie,he};return C.cache=new(X_.Cache||Ca),C}X_.Cache=Ca;function Y_(h){if(typeof h!="function")throw new vo(a);return function(){var b=arguments;switch(b.length){case 0:return!h.call(this);case 1:return!h.call(this,b[0]);case 2:return!h.call(this,b[0],b[1]);case 3:return!h.call(this,b[0],b[1],b[2])}return!h.apply(this,b)}}function uZ(h){return T5(2,h)}var cZ=B_(function(h,b){b=b.length==1&&bn(b[0])?mr(b[0],mo(Jt())):mr(Di(b,1),mo(Jt()));var C=b.length;return Xt(function(L){for(var q=-1,ie=qi(L.length,C);++q=b}),Bh=En(function(){return arguments}())?En:function(h){return ii(h)&&Gn.call(h,"callee")&&!Sm.call(h,"callee")},bn=$e.isArray,MZ=pm?mo(pm):ti;function Ra(h){return h!=null&&K_(h.length)&&!wc(h)}function yi(h){return ii(h)&&Ra(h)}function CZ(h){return h===!0||h===!1||ii(h)&&Fi(h)==tt}var Xf=u_||QA,AZ=mm?mo(mm):ni;function TZ(h){return ii(h)&&h.nodeType===1&&!by(h)}function DZ(h){if(h==null)return!0;if(Ra(h)&&(bn(h)||typeof h=="string"||typeof h.splice=="function"||Xf(h)||Wm(h)||Bh(h)))return!h.length;var b=Fo(h);if(b==Ee||b==We)return!h.size;if(yy(h))return!Yi(h).length;for(var C in h)if(Gn.call(h,C))return!1;return!0}function RZ(h,b){return Vr(h,b)}function PZ(h,b,C){C=typeof C=="function"?C:n;var L=C?C(h,b):n;return L===n?Vr(h,b,n,C):!!L}function VA(h){if(!ii(h))return!1;var b=Fi(h);return b==Xe||b==ut||typeof h.message=="string"&&typeof h.name=="string"&&!by(h)}function NZ(h){return typeof h=="number"&&jv(h)}function wc(h){if(!Gr(h))return!1;var b=Fi(h);return b==le||b==De||b==He||b==Ne}function I5(h){return typeof h=="number"&&h==Tn(h)}function K_(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=W}function Gr(h){var b=typeof h;return h!=null&&(b=="object"||b=="function")}function ii(h){return h!=null&&typeof h=="object"}var L5=Lv?mo(Lv):Hf;function OZ(h,b){return h===b||Wr(h,b,OA(b))}function IZ(h,b,C){return C=typeof C=="function"?C:n,Wr(h,b,OA(b),C)}function LZ(h){return F5(h)&&h!=+h}function FZ(h){if(xY(h))throw new ln(o);return Vf(h)}function kZ(h){return h===null}function BZ(h){return h==null}function F5(h){return typeof h=="number"||ii(h)&&Fi(h)==X}function by(h){if(!ii(h)||Fi(h)!=me)return!1;var b=vh(h);if(b===null)return!0;var C=Gn.call(b,"constructor")&&b.constructor;return typeof C=="function"&&C instanceof C&&If.call(C)==fc}var WA=gm?mo(gm):Wf;function UZ(h){return I5(h)&&h>=-W&&h<=W}var k5=vm?mo(vm):Pm;function Z_(h){return typeof h=="string"||!bn(h)&&ii(h)&&Fi(h)==st}function cs(h){return typeof h=="symbol"||ii(h)&&Fi(h)==z}var Wm=uc?mo(uc):sy;function zZ(h){return h===n}function $Z(h){return ii(h)&&Fo(h)==oe}function HZ(h){return ii(h)&&Fi(h)==ge}var VZ=Gt(Dh),WZ=Gt(function(h,b){return h<=b});function B5(h){if(!h)return[];if(Ra(h))return Z_(h)?Or(h):Qi(h);if(vu&&h[vu])return Af(h[vu]());var b=Fo(h),C=b==Ee?dh:b==We?hh:Gm;return C(h)}function Sc(h){if(!h)return h===0?h:0;if(h=el(h),h===$||h===-$){var b=h<0?-1:1;return b*U}return h===h?h:0}function Tn(h){var b=Sc(h),C=b%1;return b===b?C?b-C:b:0}function U5(h){return h?bu(Tn(h),0,re):0}function el(h){if(typeof h=="number")return h;if(cs(h))return ne;if(Gr(h)){var b=typeof h.valueOf=="function"?h.valueOf():h;h=Gr(b)?b+"":b}if(typeof h!="string")return h===0?h:+h;h=bm(h);var C=_e.test(h);return C||ke.test(h)?bA(h.slice(2),C?2:8):K.test(h)?ne:+h}function z5(h){return Da(h,Pa(h))}function GZ(h){return h?bu(Tn(h),-W,W):h===0?h:0}function nr(h){return h==null?"":Zi(h)}var jZ=bc(function(h,b){if(yy(b)||Ra(b)){Da(b,to(b),h);return}for(var C in b)Gn.call(b,C)&&as(h,C,b[C])}),$5=bc(function(h,b){Da(b,Pa(b),h)}),J_=bc(function(h,b,C,L){Da(b,Pa(b),h,L)}),qZ=bc(function(h,b,C,L){Da(b,to(b),h,L)}),XZ=Cn(Tm);function YZ(h,b){var C=Dl(h);return b==null?C:ty(C,b)}var KZ=Xt(function(h,b){h=nn(h);var C=-1,L=b.length,q=L>2?b[2]:n;for(q&&sa(b[0],b[1],q)&&(L=1);++C1),ie}),Da(h,Bn(h),C),L&&(C=na(C,f|d|p,Tt));for(var q=b.length;q--;)dy(C,b[q]);return C});function pJ(h,b){return V5(h,Y_(Jt(b)))}var mJ=Cn(function(h,b){return h==null?{}:Nh(h,b)});function V5(h,b){if(h==null)return{};var C=mr(Bn(h),function(L){return[L]});return b=Jt(b),Im(h,C,function(L,q){return b(L,q[0])})}function gJ(h,b,C){b=Mu(b,h);var L=-1,q=b.length;for(q||(q=1,h=n);++Lb){var L=h;h=b,b=L}if(C||h%1||b%1){var q=qv();return qi(h+q*(b-h+Zb("1e-"+((q+"").length-1))),b)}return Ks(h,b)}var AJ=m(function(h,b,C){return b=b.toLowerCase(),h+(C?j5(b):b)});function j5(h){return qA(nr(h).toLowerCase())}function q5(h){return h=nr(h),h&&h.replace(Et,n_).replace(Ci,"")}function TJ(h,b,C){h=nr(h),b=Zi(b);var L=h.length;C=C===n?L:bu(Tn(C),0,L);var q=C;return C-=b.length,C>=0&&h.slice(C,q)==b}function DJ(h){return h=nr(h),h&&Ye.test(h)?h.replace(gt,r_):h}function RJ(h){return h=nr(h),h&&ur.test(h)?h.replace(Sn,"\\$&"):h}var PJ=m(function(h,b,C){return h+(C?"-":"")+b.toLowerCase()}),NJ=m(function(h,b,C){return h+(C?" ":"")+b.toLowerCase()}),OJ=H_("toLowerCase");function IJ(h,b,C){h=nr(h),b=Tn(b);var L=b?Ws(h):0;if(!b||L>=b)return h;var q=(b-L)/2;return ft(bh(q),C)+h+ft(xh(q),C)}function LJ(h,b,C){h=nr(h),b=Tn(b);var L=b?Ws(h):0;return b&&L>>0,C?(h=nr(h),h&&(typeof b=="string"||b!=null&&!WA(b))&&(b=Zi(b),!b&&cc(h))?Cu(Or(h),0,C):h.split(b,C)):[]}var HJ=m(function(h,b,C){return h+(C?" ":"")+qA(b)});function VJ(h,b,C){return h=nr(h),C=C==null?0:bu(Tn(C),0,h.length),b=Zi(b),h.slice(C,C+b.length)==b}function WJ(h,b,C){var L=Q.templateSettings;C&&sa(h,b,C)&&(b=n),h=nr(h),b=J_({},b,L,Ae);var q=J_({},b.imports,L.imports,Ae),ie=to(q),he=go(q,ie),ye,Te,et=0,nt=b.interpolate||Lt,ot="__p += '",At=Ai((b.escape||Lt).source+"|"+nt.source+"|"+(nt===xn?Ge:Lt).source+"|"+(b.evaluate||Lt).source+"|$","g"),zt="//# sourceURL="+(Gn.call(b,"sourceURL")?(b.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$s+"]")+` +`;h.replace(At,function(on,Fn,$n,fs,la,ds){return $n||($n=fs),ot+=h.slice(et,ds).replace(Wt,Uv),Fn&&(ye=!0,ot+=`' + +__e(`+Fn+`) + +'`),la&&(Te=!0,ot+=`'; +`+la+`; +__p += '`),$n&&(ot+=`' + +((__t = (`+$n+`)) == null ? '' : __t) + +'`),et=ds+on.length,on}),ot+=`'; +`;var rn=Gn.call(b,"variable")&&b.variable;if(!rn)ot=`with (obj) { +`+ot+` +} +`;else if(Jo.test(rn))throw new ln(s);ot=(Te?ot.replace(Ct,""):ot).replace(ht,"$1").replace(jt,"$1;"),ot="function("+(rn||"obj")+`) { +`+(rn?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(ye?", __e = _.escape":"")+(Te?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+ot+`return __p +}`;var On=Y5(function(){return vn(ie,zt+"return "+ot).apply(n,he)});if(On.source=ot,VA(On))throw On;return On}function GJ(h){return nr(h).toLowerCase()}function jJ(h){return nr(h).toUpperCase()}function qJ(h,b,C){if(h=nr(h),h&&(C||b===n))return bm(h);if(!h||!(b=Zi(b)))return h;var L=Or(h),q=Or(b),ie=gr(L,q),he=Cf(L,q)+1;return Cu(L,ie,he).join("")}function XJ(h,b,C){if(h=nr(h),h&&(C||b===n))return h.slice(0,Rf(h)+1);if(!h||!(b=Zi(b)))return h;var L=Or(h),q=Cf(L,Or(b))+1;return Cu(L,0,q).join("")}function YJ(h,b,C){if(h=nr(h),h&&(C||b===n))return h.replace(Sa,"");if(!h||!(b=Zi(b)))return h;var L=Or(h),q=gr(L,Or(b));return Cu(L,q).join("")}function KJ(h,b){var C=N,L=B;if(Gr(b)){var q="separator"in b?b.separator:q;C="length"in b?Tn(b.length):C,L="omission"in b?Zi(b.omission):L}h=nr(h);var ie=h.length;if(cc(h)){var he=Or(h);ie=he.length}if(C>=ie)return h;var ye=C-Ws(L);if(ye<1)return L;var Te=he?Cu(he,0,ye).join(""):h.slice(0,ye);if(q===n)return Te+L;if(he&&(ye+=Te.length-ye),WA(q)){if(h.slice(ye).search(q)){var et,nt=Te;for(q.global||(q=Ai(q.source,nr(it.exec(q))+"g")),q.lastIndex=0;et=q.exec(nt);)var ot=et.index;Te=Te.slice(0,ot===n?ye:ot)}}else if(h.indexOf(Zi(q),ye)!=ye){var At=Te.lastIndexOf(q);At>-1&&(Te=Te.slice(0,At))}return Te+L}function ZJ(h){return h=nr(h),h&&ct.test(h)?h.replace(be,Pf):h}var JJ=m(function(h,b,C){return h+(C?" ":"")+b.toUpperCase()}),qA=H_("toUpperCase");function X5(h,b,C){return h=nr(h),b=C?n:b,b===n?fh(h)?Nf(h):e_(h):h.match(b)||[]}var Y5=Xt(function(h,b){try{return _r(h,n,b)}catch(C){return VA(C)?C:new ln(C)}}),QJ=Cn(function(h,b){return pi(b,function(C){C=Tu(C),Ys(h,C,$A(h[C],h))}),h});function eQ(h){var b=h==null?0:h.length,C=Jt();return h=b?mr(h,function(L){if(typeof L[1]!="function")throw new vo(a);return[C(L[0]),L[1]]}):[],Xt(function(L){for(var q=-1;++qW)return[];var C=re,L=qi(h,re);b=Jt(b),h-=re;for(var q=Cl(L,b);++C0||b<0)?new Yt(C):(h<0?C=C.takeRight(-h):h&&(C=C.drop(h)),b!==n&&(b=Tn(b),C=b<0?C.dropRight(-b):C.take(b-h)),C)},Yt.prototype.takeRightWhile=function(h){return this.reverse().takeWhile(h).reverse()},Yt.prototype.toArray=function(){return this.take(re)},ra(Yt.prototype,function(h,b){var C=/^(?:filter|find|map|reject)|While$/.test(b),L=/^(?:head|last)$/.test(b),q=Q[L?"take"+(b=="last"?"Right":""):b],ie=L||/^find/.test(b);q&&(Q.prototype[b]=function(){var he=this.__wrapped__,ye=L?[1]:arguments,Te=he instanceof Yt,et=ye[0],nt=Te||bn(he),ot=function(Fn){var $n=q.apply(Q,es([Fn],ye));return L&&At?$n[0]:$n};nt&&C&&typeof et=="function"&&et.length!=1&&(Te=nt=!1);var At=this.__chain__,zt=!!this.__actions__.length,rn=ie&&!At,On=Te&&!zt;if(!ie&&nt){he=On?he:new Yt(this);var on=h.apply(he,ye);return on.__actions__.push({func:G_,args:[ot],thisArg:n}),new Xi(on,At)}return rn&&On?h.apply(this,ye):(on=this.thru(ot),rn?L?on.value()[0]:on.value():on)})}),pi(["pop","push","shift","sort","splice","unshift"],function(h){var b=mu[h],C=/^(?:push|sort|unshift)$/.test(h)?"tap":"thru",L=/^(?:pop|shift)$/.test(h);Q.prototype[h]=function(){var q=arguments;if(L&&!this.__chain__){var ie=this.value();return b.apply(bn(ie)?ie:[],q)}return this[C](function(he){return b.apply(bn(he)?he:[],q)})}}),ra(Yt.prototype,function(h,b){var C=Q[b];if(C){var L=C.name+"";Gn.call(pc,L)||(pc[L]=[]),pc[L].push({name:b,func:C})}}),pc[H(n,v).name]=[{name:"wrapper",func:n}],Yt.prototype.clone=SA,Yt.prototype.reverse=EA,Yt.prototype.value=ta,Q.prototype.at=TK,Q.prototype.chain=DK,Q.prototype.commit=RK,Q.prototype.next=PK,Q.prototype.plant=OK,Q.prototype.reverse=IK,Q.prototype.toJSON=Q.prototype.valueOf=Q.prototype.value=LK,Q.prototype.first=Q.prototype.head,vu&&(Q.prototype[vu]=NK),Q},pu=a_();Oi?((Oi.exports=pu)._=pu,Iv._=pu):ei._=pu}).call(Fc)})(c2,c2.exports);var Yo=c2.exports;/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */const cC="158",ixe={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},oxe={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},$V=0,NR=1,HV=2,axe=3,VV=0,fC=1,I1=2,Hl=3,rf=0,xa=1,ql=2,sxe=2,qc=0,Sp=1,OR=2,IR=3,LR=4,WV=5,dd=100,GV=101,jV=102,FR=103,kR=104,qV=200,XV=201,YV=202,KV=203,f2=204,d2=205,ZV=206,JV=207,QV=208,eW=209,tW=210,nW=211,rW=212,iW=213,oW=214,aW=0,sW=1,lW=2,wx=3,uW=4,cW=5,fW=6,dW=7,xb=0,hW=1,pW=2,ju=0,mW=1,gW=2,vW=3,KO=4,yW=5,BR="attached",xW="detached",bb=300,of=301,kd=302,Sx=303,Ex=304,pv=306,Mx=1e3,so=1001,Cx=1002,ci=1003,h2=1004,lxe=1004,L1=1005,uxe=1005,wi=1006,ZO=1007,cxe=1007,Bd=1008,fxe=1008,Ps=1009,bW=1010,_W=1011,dC=1012,JO=1013,Wc=1014,Zl=1015,Up=1016,QO=1017,e4=1018,Md=1020,wW=1021,ga=1023,SW=1024,EW=1025,Cd=1026,zp=1027,t4=1028,n4=1029,MW=1030,r4=1031,i4=1033,rE=33776,iE=33777,oE=33778,aE=33779,UR=35840,zR=35841,$R=35842,HR=35843,CW=36196,VR=37492,WR=37496,GR=37808,jR=37809,qR=37810,XR=37811,YR=37812,KR=37813,ZR=37814,JR=37815,QR=37816,eP=37817,tP=37818,nP=37819,rP=37820,iP=37821,sE=36492,oP=36494,aP=36495,AW=36283,sP=36284,lP=36285,uP=36286,TW=2200,DW=2201,RW=2202,Ax=2300,Tx=2301,lE=2302,fp=2400,dp=2401,Dx=2402,hC=2500,o4=2501,dxe=0,hxe=1,pxe=2,a4=3e3,Ad=3001,PW=3200,NW=3201,Jd=0,OW=1,Ss="",zi="srgb",ec="srgb-linear",pC="display-p3",_b="display-p3-linear",Rx="linear",Er="srgb",Px="rec709",Nx="p3",mxe=0,ep=7680,gxe=7681,vxe=7682,yxe=7683,xxe=34055,bxe=34056,_xe=5386,wxe=512,Sxe=513,Exe=514,Mxe=515,Cxe=516,Axe=517,Txe=518,cP=519,IW=512,LW=513,FW=514,kW=515,BW=516,UW=517,zW=518,$W=519,Ox=35044,Dxe=35048,Rxe=35040,Pxe=35045,Nxe=35049,Oxe=35041,Ixe=35046,Lxe=35050,Fxe=35042,kxe="100",fP="300 es",p2=1035,Bu=2e3,Ix=2001;class pf{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,a=i.length;o>8&255]+zo[t>>16&255]+zo[t>>24&255]+"-"+zo[e&255]+zo[e>>8&255]+"-"+zo[e>>16&15|64]+zo[e>>24&255]+"-"+zo[n&63|128]+zo[n>>8&255]+"-"+zo[n>>16&255]+zo[n>>24&255]+zo[r&255]+zo[r>>8&255]+zo[r>>16&255]+zo[r>>24&255]).toLowerCase()}function fi(t,e,n){return Math.max(e,Math.min(n,t))}function s4(t,e){return(t%e+e)%e}function Bxe(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function Uxe(t,e,n){return t!==e?(n-t)/(e-t):0}function F1(t,e,n){return(1-n)*t+n*e}function zxe(t,e,n,r){return F1(t,e,1-Math.exp(-n*r))}function $xe(t,e=1){return e-Math.abs(s4(t,e*2)-e)}function Hxe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Vxe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function Wxe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function Gxe(t,e){return t+Math.random()*(e-t)}function jxe(t){return t*(.5-Math.random())}function qxe(t){t!==void 0&&(xk=t);let e=xk+=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 Xxe(t){return t*Ep}function Yxe(t){return t*Zg}function dP(t){return(t&t-1)===0&&t!==0}function HW(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function m2(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Kxe(t,e,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),u=o((e+r)/2),c=a((e+r)/2),f=o((e-r)/2),d=a((e-r)/2),p=o((r-e)/2),y=a((r-e)/2);switch(i){case"XYX":t.set(s*c,l*f,l*d,s*u);break;case"YZY":t.set(l*d,s*c,l*f,s*u);break;case"ZXZ":t.set(l*f,l*d,s*c,s*u);break;case"XZX":t.set(s*c,l*y,l*p,s*u);break;case"YXY":t.set(l*p,s*c,l*y,s*u);break;case"ZYZ":t.set(l*y,l*p,s*c,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function ka(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 Rn(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 Zxe={DEG2RAD:Ep,RAD2DEG:Zg,generateUUID:Ns,clamp:fi,euclideanModulo:s4,mapLinear:Bxe,inverseLerp:Uxe,lerp:F1,damp:zxe,pingpong:$xe,smoothstep:Hxe,smootherstep:Vxe,randInt:Wxe,randFloat:Gxe,randFloatSpread:jxe,seededRandom:qxe,degToRad:Xxe,radToDeg:Yxe,isPowerOfTwo:dP,ceilPowerOfTwo:HW,floorPowerOfTwo:m2,setQuaternionFromProperEuler:Kxe,normalize:Rn,denormalize:ka};class Je{constructor(e=0,n=0){Je.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(fi(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,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class In{constructor(e,n,r,i,o,a,s,l,u){In.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,u)}set(e,n,r,i,o,a,s,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=s,c[3]=n,c[4]=o,c[5]=l,c[6]=r,c[7]=a,c[8]=u,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,a=r[0],s=r[3],l=r[6],u=r[1],c=r[4],f=r[7],d=r[2],p=r[5],y=r[8],x=i[0],_=i[3],v=i[6],S=i[1],w=i[4],E=i[7],T=i[2],A=i[5],D=i[8];return o[0]=a*x+s*S+l*T,o[3]=a*_+s*w+l*A,o[6]=a*v+s*E+l*D,o[1]=u*x+c*S+f*T,o[4]=u*_+c*w+f*A,o[7]=u*v+c*E+f*D,o[2]=d*x+p*S+y*T,o[5]=d*_+p*w+y*A,o[8]=d*v+p*E+y*D,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],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return n*a*c-n*s*u-r*o*c+r*s*l+i*o*u-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=c*a-s*u,d=s*l-c*o,p=u*o-a*l,y=n*f+r*d+i*p;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/y;return e[0]=f*x,e[1]=(i*u-c*r)*x,e[2]=(s*r-i*a)*x,e[3]=d*x,e[4]=(c*n-i*l)*x,e[5]=(i*o-s*n)*x,e[6]=p*x,e[7]=(r*l-u*n)*x,e[8]=(a*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,a,s){const l=Math.cos(o),u=Math.sin(o);return this.set(r*l,r*u,-r*(l*a+u*s)+a+e,-i*u,i*l,-i*(-u*a+l*s)+s+n,0,0,1),this}scale(e,n){return this.premultiply(VT.makeScale(e,n)),this}rotate(e){return this.premultiply(VT.makeRotation(-e)),this}translate(e,n){return this.premultiply(VT.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 VT=new In;function VW(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Jxe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function cg(t,e){return new Jxe[t](e)}function Lx(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function WW(){const t=Lx("canvas");return t.style.display="block",t}const bk={};function k1(t){t in bk||(bk[t]=!0,console.warn(t))}const _k=new In().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),wk=new In().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Aw={[ec]:{transfer:Rx,primaries:Px,toReference:t=>t,fromReference:t=>t},[zi]:{transfer:Er,primaries:Px,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[_b]:{transfer:Rx,primaries:Nx,toReference:t=>t.applyMatrix3(wk),fromReference:t=>t.applyMatrix3(_k)},[pC]:{transfer:Er,primaries:Nx,toReference:t=>t.convertSRGBToLinear().applyMatrix3(wk),fromReference:t=>t.applyMatrix3(_k).convertLinearToSRGB()}},Qxe=new Set([ec,_b]),ar={enabled:!0,_workingColorSpace:ec,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Qxe.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=Aw[e].toReference,i=Aw[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 Aw[t].primaries},getTransfer:function(t){return t===Ss?Rx:Aw[t].transfer}};function Ag(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function WT(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let t0;class l4{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{t0===void 0&&(t0=Lx("canvas")),t0.width=e.width,t0.height=e.height;const r=t0.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=t0}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=Lx("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 a=0;a0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==bb)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Mx:e.x=e.x-Math.floor(e.x);break;case so:e.x=e.x<0?0:1;break;case Cx: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 Mx:e.y=e.y-Math.floor(e.y);break;case so:e.y=e.y<0?0:1;break;case Cx:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return k1("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===zi?Ad:a4}set encoding(e){k1("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Ad?zi:Ss}}hi.DEFAULT_IMAGE=null;hi.DEFAULT_MAPPING=bb;hi.DEFAULT_ANISOTROPY=1;class rr{constructor(e=0,n=0,r=0,i=1){rr.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,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[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,u=l[0],c=l[4],f=l[8],d=l[1],p=l[5],y=l[9],x=l[2],_=l[6],v=l[10];if(Math.abs(c-d)<.01&&Math.abs(f-x)<.01&&Math.abs(y-_)<.01){if(Math.abs(c+d)<.1&&Math.abs(f+x)<.1&&Math.abs(y+_)<.1&&Math.abs(u+p+v-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const w=(u+1)/2,E=(p+1)/2,T=(v+1)/2,A=(c+d)/4,D=(f+x)/4,I=(y+_)/4;return w>E&&w>T?w<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(w),i=A/r,o=D/r):E>T?E<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(E),r=A/i,o=I/i):T<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(T),r=D/o,i=I/o),this.set(r,i,o,n),this}let S=Math.sqrt((_-y)*(_-y)+(f-x)*(f-x)+(d-c)*(d-c));return Math.abs(S)<.001&&(S=1),this.x=(_-y)/S,this.y=(f-x)/S,this.z=(d-c)/S,this.w=Math.acos((u+p+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,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 GW extends pf{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new rr(0,0,e,n),this.scissorTest=!1,this.viewport=new rr(0,0,e,n);const i={width:e,height:n,depth:1};r.encoding!==void 0&&(k1("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===Ad?zi:Ss),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:wi,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new hi(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new hp(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class au extends GW{constructor(e=1,n=1,r={}){super(e,n,r),this.isWebGLRenderTarget=!0}}class mC extends hi{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=ci,this.minFilter=ci,this.wrapR=so,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class nbe extends au{constructor(e=1,n=1,r=1){super(e,n),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new mC(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class u4 extends hi{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=ci,this.minFilter=ci,this.wrapR=so,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class rbe extends au{constructor(e=1,n=1,r=1){super(e,n),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new u4(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class ibe extends au{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isWebGLMultipleRenderTargets=!0;const o=this.texture;this.texture=[];for(let a=0;a=0?1:-1,w=1-v*v;if(w>Number.EPSILON){const T=Math.sqrt(w),A=Math.atan2(T,v*S);_=Math.sin(_*A)/T,s=Math.sin(s*A)/T}const E=s*S;if(l=l*_+d*E,u=u*_+p*E,c=c*_+y*E,f=f*_+x*E,_===1-s){const T=1/Math.sqrt(l*l+u*u+c*c+f*f);l*=T,u*=T,c*=T,f*=T}}e[n]=l,e[n+1]=u,e[n+2]=c,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],u=r[i+2],c=r[i+3],f=o[a],d=o[a+1],p=o[a+2],y=o[a+3];return e[n]=s*y+c*f+l*p-u*d,e[n+1]=l*y+c*d+u*f-s*p,e[n+2]=u*y+c*p+s*d-l*f,e[n+3]=c*y-s*f-l*d-u*p,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){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,u=s(r/2),c=s(i/2),f=s(o/2),d=l(r/2),p=l(i/2),y=l(o/2);switch(a){case"XYZ":this._x=d*c*f+u*p*y,this._y=u*p*f-d*c*y,this._z=u*c*y+d*p*f,this._w=u*c*f-d*p*y;break;case"YXZ":this._x=d*c*f+u*p*y,this._y=u*p*f-d*c*y,this._z=u*c*y-d*p*f,this._w=u*c*f+d*p*y;break;case"ZXY":this._x=d*c*f-u*p*y,this._y=u*p*f+d*c*y,this._z=u*c*y+d*p*f,this._w=u*c*f-d*p*y;break;case"ZYX":this._x=d*c*f-u*p*y,this._y=u*p*f+d*c*y,this._z=u*c*y-d*p*f,this._w=u*c*f+d*p*y;break;case"YZX":this._x=d*c*f+u*p*y,this._y=u*p*f+d*c*y,this._z=u*c*y-d*p*f,this._w=u*c*f-d*p*y;break;case"XZY":this._x=d*c*f-u*p*y,this._y=u*p*f-d*c*y,this._z=u*c*y+d*p*f,this._w=u*c*f+d*p*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n!==!1&&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],a=n[1],s=n[5],l=n[9],u=n[2],c=n[6],f=n[10],d=r+s+f;if(d>0){const p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(c-l)*p,this._y=(o-u)*p,this._z=(a-i)*p}else if(r>s&&r>f){const p=2*Math.sqrt(1+r-s-f);this._w=(c-l)/p,this._x=.25*p,this._y=(i+a)/p,this._z=(o+u)/p}else if(s>f){const p=2*Math.sqrt(1+s-r-f);this._w=(o-u)/p,this._x=(i+a)/p,this._y=.25*p,this._z=(l+c)/p}else{const p=2*Math.sqrt(1+f-r-s);this._w=(a-i)/p,this._x=(o+u)/p,this._y=(l+c)/p,this._z=.25*p}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(fi(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,a=e._w,s=n._x,l=n._y,u=n._z,c=n._w;return this._x=r*c+a*s+i*u-o*l,this._y=i*c+a*l+o*s-r*u,this._z=o*c+a*u+r*l-i*s,this._w=a*c-r*s-i*l-o*u,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,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const p=1-n;return this._w=p*a+n*this._w,this._x=p*r+n*this._x,this._y=p*i+n*this._y,this._z=p*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),c=Math.atan2(u,s),f=Math.sin((1-n)*c)/u,d=Math.sin(n*c)/u;return this._w=a*f+this._w*d,this._x=r*f+this._x*d,this._y=i*f+this._y*d,this._z=o*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}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}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 ae{constructor(e=0,n=0,r=0){ae.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(Sk.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(Sk.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,a=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])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,u=2*(a*i-s*r),c=2*(s*n-o*i),f=2*(o*r-a*n);return this.x=n+l*u+a*f-s*c,this.y=r+l*c+s*u-o*f,this.z=i+l*f+o*c-a*u,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,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,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 jT.copy(this).projectOnVector(e),this.sub(jT)}reflect(e){return this.sub(jT.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(fi(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()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const jT=new ae,Sk=new Wa;class Sl{constructor(e=new ae(1/0,1/0,1/0),n=new ae(-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;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Fl),Fl.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(Ly),Dw.subVectors(this.max,Ly),n0.subVectors(e.a,Ly),r0.subVectors(e.b,Ly),i0.subVectors(e.c,Ly),Kf.subVectors(r0,n0),Zf.subVectors(i0,r0),zh.subVectors(n0,i0);let n=[0,-Kf.z,Kf.y,0,-Zf.z,Zf.y,0,-zh.z,zh.y,Kf.z,0,-Kf.x,Zf.z,0,-Zf.x,zh.z,0,-zh.x,-Kf.y,Kf.x,0,-Zf.y,Zf.x,0,-zh.y,zh.x,0];return!qT(n,n0,r0,i0,Dw)||(n=[1,0,0,0,1,0,0,0,1],!qT(n,n0,r0,i0,Dw))?!1:(Rw.crossVectors(Kf,Zf),n=[Rw.x,Rw.y,Rw.z],qT(n,n0,r0,i0,Dw))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Fl).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Fl).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:(Cc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Cc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Cc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Cc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Cc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Cc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Cc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Cc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Cc),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 Cc=[new ae,new ae,new ae,new ae,new ae,new ae,new ae,new ae],Fl=new ae,Tw=new Sl,n0=new ae,r0=new ae,i0=new ae,Kf=new ae,Zf=new ae,zh=new ae,Ly=new ae,Dw=new ae,Rw=new ae,$h=new ae;function qT(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){$h.fromArray(t,o);const s=i.x*Math.abs($h.x)+i.y*Math.abs($h.y)+i.z*Math.abs($h.z),l=e.dot($h),u=n.dot($h),c=r.dot($h);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}const obe=new Sl,Fy=new ae,XT=new ae;class lu{constructor(e=new ae,n=-1){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):obe.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=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;Fy.subVectors(e,this.center);const n=Fy.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(Fy,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):(XT.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Fy.copy(e.center).add(XT)),this.expandByPoint(Fy.copy(e.center).sub(XT))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ac=new ae,YT=new ae,Pw=new ae,Jf=new ae,KT=new ae,Nw=new ae,ZT=new ae;let mv=class{constructor(e=new ae,n=new ae(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,Ac)),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=Ac.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Ac.copy(this.origin).addScaledVector(this.direction,n),Ac.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){YT.copy(e).add(n).multiplyScalar(.5),Pw.copy(n).sub(e).normalize(),Jf.copy(this.origin).sub(YT);const o=e.distanceTo(n)*.5,a=-this.direction.dot(Pw),s=Jf.dot(this.direction),l=-Jf.dot(Pw),u=Jf.lengthSq(),c=Math.abs(1-a*a);let f,d,p,y;if(c>0)if(f=a*l-s,d=a*s-l,y=o*c,f>=0)if(d>=-y)if(d<=y){const x=1/c;f*=x,d*=x,p=f*(f+a*d+2*s)+d*(a*f+d+2*l)+u}else d=o,f=Math.max(0,-(a*d+s)),p=-f*f+d*(d+2*l)+u;else d=-o,f=Math.max(0,-(a*d+s)),p=-f*f+d*(d+2*l)+u;else d<=-y?(f=Math.max(0,-(-a*o+s)),d=f>0?-o:Math.min(Math.max(-o,-l),o),p=-f*f+d*(d+2*l)+u):d<=y?(f=0,d=Math.min(Math.max(-o,-l),o),p=d*(d+2*l)+u):(f=Math.max(0,-(a*o+s)),d=f>0?o:Math.min(Math.max(-o,-l),o),p=-f*f+d*(d+2*l)+u);else d=a>0?-o:o,f=Math.max(0,-(a*d+s)),p=-f*f+d*(d+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(YT).addScaledVector(Pw,d),p}intersectSphere(e,n){Ac.subVectors(e.center,this.origin);const r=Ac.dot(this.direction),i=Ac.dot(Ac)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return l<0?null:s<0?this.at(l,n):this.at(s,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,a,s,l;const u=1/this.direction.x,c=1/this.direction.y,f=1/this.direction.z,d=this.origin;return u>=0?(r=(e.min.x-d.x)*u,i=(e.max.x-d.x)*u):(r=(e.max.x-d.x)*u,i=(e.min.x-d.x)*u),c>=0?(o=(e.min.y-d.y)*c,a=(e.max.y-d.y)*c):(o=(e.max.y-d.y)*c,a=(e.min.y-d.y)*c),r>a||o>i||((o>r||isNaN(r))&&(r=o),(a=0?(s=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(s=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),r>l||s>i)||((s>r||r!==r)&&(r=s),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Ac)!==null}intersectTriangle(e,n,r,i,o){KT.subVectors(n,e),Nw.subVectors(r,e),ZT.crossVectors(KT,Nw);let a=this.direction.dot(ZT),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;Jf.subVectors(this.origin,e);const l=s*this.direction.dot(Nw.crossVectors(Jf,Nw));if(l<0)return null;const u=s*this.direction.dot(KT.cross(Jf));if(u<0||l+u>a)return null;const c=-s*Jf.dot(ZT);return c<0?null:this.at(c/a,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 yn{constructor(e,n,r,i,o,a,s,l,u,c,f,d,p,y,x,_){yn.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,a,s,l,u,c,f,d,p,y,x,_)}set(e,n,r,i,o,a,s,l,u,c,f,d,p,y,x,_){const v=this.elements;return v[0]=e,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=a,v[9]=s,v[13]=l,v[2]=u,v[6]=c,v[10]=f,v[14]=d,v[3]=p,v[7]=y,v[11]=x,v[15]=_,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new yn().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/o0.setFromMatrixColumn(e,0).length(),o=1/o0.setFromMatrixColumn(e,1).length(),a=1/o0.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]*a,n[9]=r[9]*a,n[10]=r[10]*a,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,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),u=Math.sin(i),c=Math.cos(o),f=Math.sin(o);if(e.order==="XYZ"){const d=a*c,p=a*f,y=s*c,x=s*f;n[0]=l*c,n[4]=-l*f,n[8]=u,n[1]=p+y*u,n[5]=d-x*u,n[9]=-s*l,n[2]=x-d*u,n[6]=y+p*u,n[10]=a*l}else if(e.order==="YXZ"){const d=l*c,p=l*f,y=u*c,x=u*f;n[0]=d+x*s,n[4]=y*s-p,n[8]=a*u,n[1]=a*f,n[5]=a*c,n[9]=-s,n[2]=p*s-y,n[6]=x+d*s,n[10]=a*l}else if(e.order==="ZXY"){const d=l*c,p=l*f,y=u*c,x=u*f;n[0]=d-x*s,n[4]=-a*f,n[8]=y+p*s,n[1]=p+y*s,n[5]=a*c,n[9]=x-d*s,n[2]=-a*u,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const d=a*c,p=a*f,y=s*c,x=s*f;n[0]=l*c,n[4]=y*u-p,n[8]=d*u+x,n[1]=l*f,n[5]=x*u+d,n[9]=p*u-y,n[2]=-u,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const d=a*l,p=a*u,y=s*l,x=s*u;n[0]=l*c,n[4]=x-d*f,n[8]=y*f+p,n[1]=f,n[5]=a*c,n[9]=-s*c,n[2]=-u*c,n[6]=p*f+y,n[10]=d-x*f}else if(e.order==="XZY"){const d=a*l,p=a*u,y=s*l,x=s*u;n[0]=l*c,n[4]=-f,n[8]=u*c,n[1]=d*f+x,n[5]=a*c,n[9]=p*f-y,n[2]=y*f-p,n[6]=s*c,n[10]=x*f+d}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(abe,e,sbe)}lookAt(e,n,r){const i=this.elements;return hs.subVectors(e,n),hs.lengthSq()===0&&(hs.z=1),hs.normalize(),Qf.crossVectors(r,hs),Qf.lengthSq()===0&&(Math.abs(r.z)===1?hs.x+=1e-4:hs.z+=1e-4,hs.normalize(),Qf.crossVectors(r,hs)),Qf.normalize(),Ow.crossVectors(hs,Qf),i[0]=Qf.x,i[4]=Ow.x,i[8]=hs.x,i[1]=Qf.y,i[5]=Ow.y,i[9]=hs.y,i[2]=Qf.z,i[6]=Ow.z,i[10]=hs.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,a=r[0],s=r[4],l=r[8],u=r[12],c=r[1],f=r[5],d=r[9],p=r[13],y=r[2],x=r[6],_=r[10],v=r[14],S=r[3],w=r[7],E=r[11],T=r[15],A=i[0],D=i[4],I=i[8],P=i[12],N=i[1],B=i[5],G=i[9],Z=i[13],j=i[2],J=i[6],Y=i[10],$=i[14],W=i[3],U=i[7],ne=i[11],re=i[15];return o[0]=a*A+s*N+l*j+u*W,o[4]=a*D+s*B+l*J+u*U,o[8]=a*I+s*G+l*Y+u*ne,o[12]=a*P+s*Z+l*$+u*re,o[1]=c*A+f*N+d*j+p*W,o[5]=c*D+f*B+d*J+p*U,o[9]=c*I+f*G+d*Y+p*ne,o[13]=c*P+f*Z+d*$+p*re,o[2]=y*A+x*N+_*j+v*W,o[6]=y*D+x*B+_*J+v*U,o[10]=y*I+x*G+_*Y+v*ne,o[14]=y*P+x*Z+_*$+v*re,o[3]=S*A+w*N+E*j+T*W,o[7]=S*D+w*B+E*J+T*U,o[11]=S*I+w*G+E*Y+T*ne,o[15]=S*P+w*Z+E*$+T*re,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],a=e[1],s=e[5],l=e[9],u=e[13],c=e[2],f=e[6],d=e[10],p=e[14],y=e[3],x=e[7],_=e[11],v=e[15];return y*(+o*l*f-i*u*f-o*s*d+r*u*d+i*s*p-r*l*p)+x*(+n*l*p-n*u*d+o*a*d-i*a*p+i*u*c-o*l*c)+_*(+n*u*f-n*s*p-o*a*f+r*a*p+o*s*c-r*u*c)+v*(-i*s*c-n*l*f+n*s*d+i*a*f-r*a*d+r*l*c)}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],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],d=e[10],p=e[11],y=e[12],x=e[13],_=e[14],v=e[15],S=f*_*u-x*d*u+x*l*p-s*_*p-f*l*v+s*d*v,w=y*d*u-c*_*u-y*l*p+a*_*p+c*l*v-a*d*v,E=c*x*u-y*f*u+y*s*p-a*x*p-c*s*v+a*f*v,T=y*f*l-c*x*l-y*s*d+a*x*d+c*s*_-a*f*_,A=n*S+r*w+i*E+o*T;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/A;return e[0]=S*D,e[1]=(x*d*o-f*_*o-x*i*p+r*_*p+f*i*v-r*d*v)*D,e[2]=(s*_*o-x*l*o+x*i*u-r*_*u-s*i*v+r*l*v)*D,e[3]=(f*l*o-s*d*o-f*i*u+r*d*u+s*i*p-r*l*p)*D,e[4]=w*D,e[5]=(c*_*o-y*d*o+y*i*p-n*_*p-c*i*v+n*d*v)*D,e[6]=(y*l*o-a*_*o-y*i*u+n*_*u+a*i*v-n*l*v)*D,e[7]=(a*d*o-c*l*o+c*i*u-n*d*u-a*i*p+n*l*p)*D,e[8]=E*D,e[9]=(y*f*o-c*x*o-y*r*p+n*x*p+c*r*v-n*f*v)*D,e[10]=(a*x*o-y*s*o+y*r*u-n*x*u-a*r*v+n*s*v)*D,e[11]=(c*s*o-a*f*o-c*r*u+n*f*u+a*r*p-n*s*p)*D,e[12]=T*D,e[13]=(c*x*i-y*f*i+y*r*d-n*x*d-c*r*_+n*f*_)*D,e[14]=(y*s*i-a*x*i-y*r*l+n*x*l+a*r*_-n*s*_)*D,e[15]=(a*f*i-c*s*i+c*r*l-n*f*l-a*r*d+n*s*d)*D,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,a=e.x,s=e.y,l=e.z,u=o*a,c=o*s;return this.set(u*a+r,u*s-i*l,u*l+i*s,0,u*s+i*l,c*s+r,c*l-i*a,0,u*l-i*s,c*l+i*a,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,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,u=o+o,c=a+a,f=s+s,d=o*u,p=o*c,y=o*f,x=a*c,_=a*f,v=s*f,S=l*u,w=l*c,E=l*f,T=r.x,A=r.y,D=r.z;return i[0]=(1-(x+v))*T,i[1]=(p+E)*T,i[2]=(y-w)*T,i[3]=0,i[4]=(p-E)*A,i[5]=(1-(d+v))*A,i[6]=(_+S)*A,i[7]=0,i[8]=(y+w)*D,i[9]=(_-S)*D,i[10]=(1-(d+x))*D,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=o0.set(i[0],i[1],i[2]).length();const a=o0.set(i[4],i[5],i[6]).length(),s=o0.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],kl.copy(this);const u=1/o,c=1/a,f=1/s;return kl.elements[0]*=u,kl.elements[1]*=u,kl.elements[2]*=u,kl.elements[4]*=c,kl.elements[5]*=c,kl.elements[6]*=c,kl.elements[8]*=f,kl.elements[9]*=f,kl.elements[10]*=f,n.setFromRotationMatrix(kl),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a,s=Bu){const l=this.elements,u=2*o/(n-e),c=2*o/(r-i),f=(n+e)/(n-e),d=(r+i)/(r-i);let p,y;if(s===Bu)p=-(a+o)/(a-o),y=-2*a*o/(a-o);else if(s===Ix)p=-a/(a-o),y=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=u,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=c,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,a,s=Bu){const l=this.elements,u=1/(n-e),c=1/(r-i),f=1/(a-o),d=(n+e)*u,p=(r+i)*c;let y,x;if(s===Bu)y=(a+o)*f,x=-2*f;else if(s===Ix)y=o*f,x=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=x,l[14]=-y,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 o0=new ae,kl=new yn,abe=new ae(0,0,0),sbe=new ae(1,1,1),Qf=new ae,Ow=new ae,hs=new ae,Ek=new yn,Mk=new Wa;class wb{constructor(e=0,n=0,r=0,i=wb.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],a=i[4],s=i[8],l=i[1],u=i[5],c=i[9],f=i[2],d=i[6],p=i[10];switch(n){case"XYZ":this._y=Math.asin(fi(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,u),this._z=0);break;case"YXZ":this._x=Math.asin(-fi(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(fi(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,p),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-fi(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,u));break;case"YZX":this._z=Math.asin(fi(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-fi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-c,p),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 Ek.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ek,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return Mk.setFromEuler(this),this.setFromQuaternion(Mk,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}}wb.DEFAULT_ORDER="XYZ";class Mp{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&&(r=r.concat(a))}return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ky,e,ube),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ky,cbe,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let r=0,i=n.length;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()));function o(s,l){return s[l.uuid]===void 0&&(s[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 s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(r.geometries=s),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),c.length>0&&(r.images=c),f.length>0&&(r.shapes=f),d.length>0&&(r.skeletons=d),p.length>0&&(r.animations=p),y.length>0&&(r.nodes=y)}return r.object=i,r;function a(s){const l=[];for(const u in s){const c=s[u];delete c.metadata,l.push(c)}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.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.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){Bl.subVectors(i,n),Dc.subVectors(r,n),JT.subVectors(e,n);const a=Bl.dot(Bl),s=Bl.dot(Dc),l=Bl.dot(JT),u=Dc.dot(Dc),c=Dc.dot(JT),f=a*u-s*s;if(f===0)return o.set(-2,-1,-1);const d=1/f,p=(u*l-s*c)*d,y=(a*c-s*l)*d;return o.set(1-p-y,y,p)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Rc),Rc.x>=0&&Rc.y>=0&&Rc.x+Rc.y<=1}static getUV(e,n,r,i,o,a,s,l){return Lw===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Lw=!0),this.getInterpolation(e,n,r,i,o,a,s,l)}static getInterpolation(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Rc),l.setScalar(0),l.addScaledVector(o,Rc.x),l.addScaledVector(a,Rc.y),l.addScaledVector(s,Rc.z),l}static isFrontFacing(e,n,r,i){return Bl.subVectors(r,n),Dc.subVectors(e,n),Bl.cross(Dc).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 Bl.subVectors(this.c,this.b),Dc.subVectors(this.a,this.b),Bl.cross(Dc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Fa.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Fa.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Lw===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Lw=!0),Fa.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}getInterpolation(e,n,r,i,o){return Fa.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Fa.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Fa.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 a,s;s0.subVectors(i,r),l0.subVectors(o,r),QT.subVectors(e,r);const l=s0.dot(QT),u=l0.dot(QT);if(l<=0&&u<=0)return n.copy(r);e3.subVectors(e,i);const c=s0.dot(e3),f=l0.dot(e3);if(c>=0&&f<=c)return n.copy(i);const d=l*f-c*u;if(d<=0&&l>=0&&c<=0)return a=l/(l-c),n.copy(r).addScaledVector(s0,a);t3.subVectors(e,o);const p=s0.dot(t3),y=l0.dot(t3);if(y>=0&&p<=y)return n.copy(o);const x=p*u-l*y;if(x<=0&&u>=0&&y<=0)return s=u/(u-y),n.copy(r).addScaledVector(l0,s);const _=c*y-p*f;if(_<=0&&f-c>=0&&p-y>=0)return Rk.subVectors(o,i),s=(f-c)/(f-c+(p-y)),n.copy(i).addScaledVector(Rk,s);const v=1/(_+x+d);return a=x*v,s=d*v,n.copy(r).addScaledVector(s0,a).addScaledVector(l0,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const jW={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},ed={h:0,s:0,l:0},Fw={h:0,s:0,l:0};function n3(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 Pt=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=zi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ar.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=ar.workingColorSpace){return this.r=e,this.g=n,this.b=r,ar.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=ar.workingColorSpace){if(e=s4(e,1),n=fi(n,0,1),r=fi(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=n3(a,o,e+1/3),this.g=n3(a,o,e),this.b=n3(a,o,e-1/3)}return ar.toWorkingColorSpace(this,i),this}setStyle(e,n=zi){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 a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))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(s))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(s))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],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(a===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=zi){const r=jW[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=Ag(e.r),this.g=Ag(e.g),this.b=Ag(e.b),this}copyLinearToSRGB(e){return this.r=WT(e.r),this.g=WT(e.g),this.b=WT(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=zi){return ar.fromWorkingColorSpace($o.copy(this),e),Math.round(fi($o.r*255,0,255))*65536+Math.round(fi($o.g*255,0,255))*256+Math.round(fi($o.b*255,0,255))}getHexString(e=zi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=ar.workingColorSpace){ar.fromWorkingColorSpace($o.copy(this),n);const r=$o.r,i=$o.g,o=$o.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,u;const c=(s+a)/2;if(s===a)l=0,u=0;else{const f=a-s;switch(u=c<=.5?f/(a+s):f/(2-a-s),a){case r:l=(i-o)/f+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}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&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.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.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!==Sp&&(r.blending=this.blending),this.side!==rf&&(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!==f2&&(r.blendSrc=this.blendSrc),this.blendDst!==d2&&(r.blendDst=this.blendDst),this.blendEquation!==dd&&(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!==wx&&(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!==cP&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ep&&(r.stencilFail=this.stencilFail),this.stencilZFail!==ep&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==ep&&(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 a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}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++}};class Qd extends To{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=xb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Uc=pbe();function pbe(){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 u=l-127;u<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):u<-14?(r[l]=1024>>-u-14,r[l|256]=1024>>-u-14|32768,i[l]=-u-1,i[l|256]=-u-1):u<=15?(r[l]=u+15<<10,r[l|256]=u+15<<10|32768,i[l]=13,i[l|256]=13):u<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const o=new Uint32Array(2048),a=new Uint32Array(64),s=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,c=0;for(;!(u&8388608);)u<<=1,c-=8388608;u&=-8388609,c+=947912704,o[l]=u|c}for(let l=1024;l<2048;++l)o[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(s[l]=1024);return{floatView:e,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:o,exponentTable:a,offsetTable:s}}function Oa(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=fi(t,-65504,65504),Uc.floatView[0]=t;const e=Uc.uint32View[0],n=e>>23&511;return Uc.baseTable[n]+((e&8388607)>>Uc.shiftTable[n])}function c1(t){const e=t>>10;return Uc.uint32View[0]=Uc.mantissaTable[Uc.offsetTable[e]+(t&1023)]+Uc.exponentTable[e],Uc.floatView[0]}const mbe={toHalfFloat:Oa,fromHalfFloat:c1},Ri=new ae,kw=new Je;class xr{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=Ox,this.updateRange={offset:0,count:-1},this.gpuType=Zl,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,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 u in l)l[u]!==void 0&&(e[u]=l[u]);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 u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let f=0,d=u.length;f0&&(i[l]=c,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.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 u in i){const c=i[u];this.setAttribute(u,c.clone(n))}const o=e.morphAttributes;for(const u in o){const c=[],f=o[u];for(let d=0,p=f.length;d0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o(e.far-e.near)**2))&&(Pk.copy(o).invert(),Hh.copy(e.ray).applyMatrix4(Pk),!(r.boundingBox!==null&&Hh.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Hh)))}_computeIntersections(e,n,r){let i;const o=this.geometry,a=this.material,s=o.index,l=o.attributes.position,u=o.attributes.uv,c=o.attributes.uv1,f=o.attributes.normal,d=o.groups,p=o.drawRange;if(s!==null)if(Array.isArray(a))for(let y=0,x=d.length;yn.far?null:{distance:u,point:Ww.clone(),object:t}}function Gw(t,e,n,r,i,o,a,s,l,u){t.getVertexPosition(s,c0),t.getVertexPosition(l,f0),t.getVertexPosition(u,d0);const c=Ebe(t,e,n,r,c0,f0,d0,Vw);if(c){i&&(zw.fromBufferAttribute(i,s),$w.fromBufferAttribute(i,l),Hw.fromBufferAttribute(i,u),c.uv=Fa.getInterpolation(Vw,c0,f0,d0,zw,$w,Hw,new Je)),o&&(zw.fromBufferAttribute(o,s),$w.fromBufferAttribute(o,l),Hw.fromBufferAttribute(o,u),c.uv1=Fa.getInterpolation(Vw,c0,f0,d0,zw,$w,Hw,new Je),c.uv2=c.uv1),a&&(Ok.fromBufferAttribute(a,s),Ik.fromBufferAttribute(a,l),Lk.fromBufferAttribute(a,u),c.normal=Fa.getInterpolation(Vw,c0,f0,d0,Ok,Ik,Lk,new ae),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const f={a:s,b:l,c:u,normal:new ae,materialIndex:0};Fa.getNormal(c0,f0,d0,f.normal),c.face=f}return c}class Kp extends Ln{constructor(e=1,n=1,r=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};const s=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const l=[],u=[],c=[],f=[];let d=0,p=0;y("z","y","x",-1,-1,r,n,e,a,o,0),y("z","y","x",1,-1,r,n,-e,a,o,1),y("x","z","y",1,1,e,r,n,i,a,2),y("x","z","y",1,-1,e,r,-n,i,a,3),y("x","y","z",1,-1,e,n,r,i,o,4),y("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new Ut(u,3)),this.setAttribute("normal",new Ut(c,3)),this.setAttribute("uv",new Ut(f,2));function y(x,_,v,S,w,E,T,A,D,I,P){const N=E/D,B=T/I,G=E/2,Z=T/2,j=A/2,J=D+1,Y=I+1;let $=0,W=0;const U=new ae;for(let ne=0;ne0?1:-1,c.push(U.x,U.y,U.z),f.push(ue/D),f.push(1-ne/I),$+=1}}for(let ne=0;ne0&&(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 Sb extends Kn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new yn,this.projectionMatrix=new yn,this.projectionMatrixInverse=new yn,this.coordinateSystem=Bu}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)}}class ao extends Sb{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=Zg*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Ep*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Zg*2*Math.atan(Math.tan(Ep*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,o,a){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=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Ep*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,u=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/u,i*=a.width/l,r*=a.height/u}const s=this.filmOffset;s!==0&&(o+=e*s/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 h0=-90,p0=1;class YW extends Kn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ao(h0,p0,e,n);i.layers=this.layers,this.add(i);const o=new ao(h0,p0,e,n);o.layers=this.layers,this.add(o);const a=new ao(h0,p0,e,n);a.layers=this.layers,this.add(a);const s=new ao(h0,p0,e,n);s.layers=this.layers,this.add(s);const l=new ao(h0,p0,e,n);l.layers=this.layers,this.add(l);const u=new ao(h0,p0,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,a,s,l]=n;for(const u of n)this.remove(u);if(e===Bu)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),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ix)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),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of n)this.add(u),u.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,a,s,l,u,c]=this.children,f=e.getRenderTarget(),d=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),y=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,a),e.setRenderTarget(r,2,i),e.render(n,s),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,u),r.texture.generateMipmaps=x,e.setRenderTarget(r,5,i),e.render(n,c),e.setRenderTarget(f,d,p),e.xr.enabled=y,r.texture.needsPMREMUpdate=!0}}class Eb extends hi{constructor(e,n,r,i,o,a,s,l,u,c){e=e!==void 0?e:[],n=n!==void 0?n:of,super(e,n,r,i,o,a,s,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class KW extends au{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];n.encoding!==void 0&&(k1("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Ad?zi:Ss),this.texture=new Eb(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:wi}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 Kp(5,5,5),o=new tc({name:"CubemapFromEquirect",uniforms:Jg(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:xa,blending:qc});o.uniforms.tEquirect.value=n;const a=new So(i,o),s=n.minFilter;return n.minFilter===Bd&&(n.minFilter=wi),new YW(1,10,this).update(e,a),n.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,n,r,i){const o=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,r,i);e.setRenderTarget(o)}}const o3=new ae,Tbe=new ae,Dbe=new In;class ld{constructor(e=new ae(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=o3.subVectors(r,n).cross(Tbe.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(o3),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||Dbe.getNormalMatrix(e),i=this.coplanarPoint(o3).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 Vh=new lu,jw=new ae;class gC{constructor(e=new ld,n=new ld,r=new ld,i=new ld,o=new ld,a=new ld){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),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=Bu){const r=this.planes,i=e.elements,o=i[0],a=i[1],s=i[2],l=i[3],u=i[4],c=i[5],f=i[6],d=i[7],p=i[8],y=i[9],x=i[10],_=i[11],v=i[12],S=i[13],w=i[14],E=i[15];if(r[0].setComponents(l-o,d-u,_-p,E-v).normalize(),r[1].setComponents(l+o,d+u,_+p,E+v).normalize(),r[2].setComponents(l+a,d+c,_+y,E+S).normalize(),r[3].setComponents(l-a,d-c,_-y,E-S).normalize(),r[4].setComponents(l-s,d-f,_-x,E-w).normalize(),n===Bu)r[5].setComponents(l+s,d+f,_+x,E+w).normalize();else if(n===Ix)r[5].setComponents(s,f,x,w).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(),Vh.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Vh.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Vh)}intersectsSprite(e){return Vh.center.set(0,0,0),Vh.radius=.7071067811865476,Vh.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vh)}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,jw.y=i.normal.y>0?e.max.y:e.min.y,jw.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(jw)<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 ZW(){let t=null,e=!1,n=null,r=null;function i(o,a){n(o,a),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 Rbe(t,e){const n=e.isWebGL2,r=new WeakMap;function i(u,c){const f=u.array,d=u.usage,p=t.createBuffer();t.bindBuffer(c,p),t.bufferData(c,f,d),u.onUploadCallback();let y;if(f instanceof Float32Array)y=t.FLOAT;else if(f instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(n)y=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else y=t.UNSIGNED_SHORT;else if(f instanceof Int16Array)y=t.SHORT;else if(f instanceof Uint32Array)y=t.UNSIGNED_INT;else if(f instanceof Int32Array)y=t.INT;else if(f instanceof Int8Array)y=t.BYTE;else if(f instanceof Uint8Array)y=t.UNSIGNED_BYTE;else if(f instanceof Uint8ClampedArray)y=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:p,type:y,bytesPerElement:f.BYTES_PER_ELEMENT,version:u.version}}function o(u,c,f){const d=c.array,p=c.updateRange;t.bindBuffer(f,u),p.count===-1?t.bufferSubData(f,0,d):(n?t.bufferSubData(f,p.offset*d.BYTES_PER_ELEMENT,d,p.offset,p.count):t.bufferSubData(f,p.offset*d.BYTES_PER_ELEMENT,d.subarray(p.offset,p.offset+p.count)),p.count=-1),c.onUploadCallback()}function a(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function s(u){u.isInterleavedBufferAttribute&&(u=u.data);const c=r.get(u);c&&(t.deleteBuffer(c.buffer),r.delete(u))}function l(u,c){if(u.isGLBufferAttribute){const d=r.get(u);(!d||d.version 0 + vec4 plane; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif +#endif`,Gbe=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,jbe=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,qbe=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Xbe=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,Ybe=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Kbe=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,Zbe=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,Jbe=`#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; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,Qbe=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_v0 0.339 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_v1 0.276 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_v4 0.046 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_v5 0.016 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_v6 0.0038 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,e_e=`vec3 transformedNormal = objectNormal; +#ifdef USE_INSTANCING + mat3 m = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); + transformedNormal = m * transformedNormal; +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,t_e=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,n_e=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,r_e=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,i_e=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,o_e="gl_FragColor = linearToOutputTexel( gl_FragColor );",a_e=` +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 ); +} +vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( in vec4 value ) { + return sRGBTransferOETF( value ); +}`,s_e=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,l_e=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,u_e=`#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`,c_e=`#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`,f_e=`#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`,d_e=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,h_e=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,p_e=`#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`,m_e=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,g_e=`#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 +}`,v_e=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,y_e=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,x_e=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,b_e=`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`,__e=`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 ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, 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`,w_e=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,S_e=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,E_e=`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`,M_e=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,C_e=`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`,A_e=`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_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y; +#endif`,T_e=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 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 ); +}`,D_e=` +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.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.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.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`,R_e=`#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`,P_e=`#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`,N_e=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,O_e=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,I_e=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,L_e=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); + #else + if ( isPerspectiveMatrix( projectionMatrix ) ) { + gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; + gl_Position.z *= gl_Position.w; + } + #endif +#endif`,F_e=`#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`,k_e=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,B_e=`#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`,U_e=`#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`,z_e=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,$_e=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,H_e=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,V_e=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,W_e=`#ifdef USE_MORPHTARGETS + uniform float morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,G_e=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,j_e=`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;`,q_e=`#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`,X_e=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Y_e=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,K_e=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Z_e=`#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`,J_e=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,Q_e=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,ewe=`#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`,twe=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,nwe=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,rwe=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; +const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,iwe=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,owe=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,awe=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,swe=`#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`,lwe=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,uwe=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,cwe=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + vec3 lightToPosition = shadowCoord.xyz; + float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + return ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } +#endif`,fwe=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,dwe=`#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`,hwe=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,pwe=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,mwe=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + uniform int boneTextureSize; + mat4 getBoneMatrix( const in float i ) { + float j = i * 4.0; + float x = mod( j, float( boneTextureSize ) ); + float y = floor( j / float( boneTextureSize ) ); + float dx = 1.0 / float( boneTextureSize ); + float dy = 1.0 / float( boneTextureSize ); + y = dy * ( y + 0.5 ); + vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); + vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); + vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); + vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); + mat4 bone = mat4( v1, v2, v3, v4 ); + return bone; + } +#endif`,gwe=`#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`,vwe=`#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`,ywe=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,xwe=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,bwe=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,_we=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 OptimizedCineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,wwe=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,Swe=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,Ewe=`#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`,Mwe=`#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`,Cwe=`#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`,Awe=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const Twe=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,Dwe=`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 +}`,Rwe=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,Pwe=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,Nwe=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,Owe=`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 +}`,Iwe=`#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,Lwe=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + vec4 diffuseColor = vec4( 1.0 ); + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,Fwe=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,kwe=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + #include + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,Bwe=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,Uwe=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,zwe=`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 +}`,$we=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Hwe=`#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #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 +}`,Vwe=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #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 +}`,Wwe=`#define LAMBERT +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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Gwe=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,jwe=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,qwe=`#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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #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 +}`,Xwe=`#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 +void main() { + #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 +}`,Ywe=`#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() { + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Kwe=`#define PHONG +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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Zwe=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Jwe=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,Qwe=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #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 +}`,eSe=`#define TOON +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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,tSe=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,nSe=`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 + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,rSe=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,iSe=`#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,oSe=`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 +}`,aSe=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,sSe=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Dn={alphahash_fragment:Pbe,alphahash_pars_fragment:Nbe,alphamap_fragment:Obe,alphamap_pars_fragment:Ibe,alphatest_fragment:Lbe,alphatest_pars_fragment:Fbe,aomap_fragment:kbe,aomap_pars_fragment:Bbe,begin_vertex:Ube,beginnormal_vertex:zbe,bsdfs:$be,iridescence_fragment:Hbe,bumpmap_pars_fragment:Vbe,clipping_planes_fragment:Wbe,clipping_planes_pars_fragment:Gbe,clipping_planes_pars_vertex:jbe,clipping_planes_vertex:qbe,color_fragment:Xbe,color_pars_fragment:Ybe,color_pars_vertex:Kbe,color_vertex:Zbe,common:Jbe,cube_uv_reflection_fragment:Qbe,defaultnormal_vertex:e_e,displacementmap_pars_vertex:t_e,displacementmap_vertex:n_e,emissivemap_fragment:r_e,emissivemap_pars_fragment:i_e,colorspace_fragment:o_e,colorspace_pars_fragment:a_e,envmap_fragment:s_e,envmap_common_pars_fragment:l_e,envmap_pars_fragment:u_e,envmap_pars_vertex:c_e,envmap_physical_pars_fragment:w_e,envmap_vertex:f_e,fog_vertex:d_e,fog_pars_vertex:h_e,fog_fragment:p_e,fog_pars_fragment:m_e,gradientmap_pars_fragment:g_e,lightmap_fragment:v_e,lightmap_pars_fragment:y_e,lights_lambert_fragment:x_e,lights_lambert_pars_fragment:b_e,lights_pars_begin:__e,lights_toon_fragment:S_e,lights_toon_pars_fragment:E_e,lights_phong_fragment:M_e,lights_phong_pars_fragment:C_e,lights_physical_fragment:A_e,lights_physical_pars_fragment:T_e,lights_fragment_begin:D_e,lights_fragment_maps:R_e,lights_fragment_end:P_e,logdepthbuf_fragment:N_e,logdepthbuf_pars_fragment:O_e,logdepthbuf_pars_vertex:I_e,logdepthbuf_vertex:L_e,map_fragment:F_e,map_pars_fragment:k_e,map_particle_fragment:B_e,map_particle_pars_fragment:U_e,metalnessmap_fragment:z_e,metalnessmap_pars_fragment:$_e,morphcolor_vertex:H_e,morphnormal_vertex:V_e,morphtarget_pars_vertex:W_e,morphtarget_vertex:G_e,normal_fragment_begin:j_e,normal_fragment_maps:q_e,normal_pars_fragment:X_e,normal_pars_vertex:Y_e,normal_vertex:K_e,normalmap_pars_fragment:Z_e,clearcoat_normal_fragment_begin:J_e,clearcoat_normal_fragment_maps:Q_e,clearcoat_pars_fragment:ewe,iridescence_pars_fragment:twe,opaque_fragment:nwe,packing:rwe,premultiplied_alpha_fragment:iwe,project_vertex:owe,dithering_fragment:awe,dithering_pars_fragment:swe,roughnessmap_fragment:lwe,roughnessmap_pars_fragment:uwe,shadowmap_pars_fragment:cwe,shadowmap_pars_vertex:fwe,shadowmap_vertex:dwe,shadowmask_pars_fragment:hwe,skinbase_vertex:pwe,skinning_pars_vertex:mwe,skinning_vertex:gwe,skinnormal_vertex:vwe,specularmap_fragment:ywe,specularmap_pars_fragment:xwe,tonemapping_fragment:bwe,tonemapping_pars_fragment:_we,transmission_fragment:wwe,transmission_pars_fragment:Swe,uv_pars_fragment:Ewe,uv_pars_vertex:Mwe,uv_vertex:Cwe,worldpos_vertex:Awe,background_vert:Twe,background_frag:Dwe,backgroundCube_vert:Rwe,backgroundCube_frag:Pwe,cube_vert:Nwe,cube_frag:Owe,depth_vert:Iwe,depth_frag:Lwe,distanceRGBA_vert:Fwe,distanceRGBA_frag:kwe,equirect_vert:Bwe,equirect_frag:Uwe,linedashed_vert:zwe,linedashed_frag:$we,meshbasic_vert:Hwe,meshbasic_frag:Vwe,meshlambert_vert:Wwe,meshlambert_frag:Gwe,meshmatcap_vert:jwe,meshmatcap_frag:qwe,meshnormal_vert:Xwe,meshnormal_frag:Ywe,meshphong_vert:Kwe,meshphong_frag:Zwe,meshphysical_vert:Jwe,meshphysical_frag:Qwe,meshtoon_vert:eSe,meshtoon_frag:tSe,points_vert:nSe,points_frag:rSe,shadow_vert:iSe,shadow_frag:oSe,sprite_vert:aSe,sprite_frag:sSe},wt={common:{diffuse:{value:new Pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new In},alphaMap:{value:null},alphaMapTransform:{value:new In},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new In}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new In}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new In}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new In},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new In},normalScale:{value:new Je(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new In},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new In}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new In}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new In}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Pt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new In},alphaTest:{value:0},uvTransform:{value:new In}},sprite:{diffuse:{value:new Pt(16777215)},opacity:{value:1},center:{value:new Je(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new In},alphaMap:{value:null},alphaMapTransform:{value:new In},alphaTest:{value:0}}},jl={basic:{uniforms:fa([wt.common,wt.specularmap,wt.envmap,wt.aomap,wt.lightmap,wt.fog]),vertexShader:Dn.meshbasic_vert,fragmentShader:Dn.meshbasic_frag},lambert:{uniforms:fa([wt.common,wt.specularmap,wt.envmap,wt.aomap,wt.lightmap,wt.emissivemap,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.fog,wt.lights,{emissive:{value:new Pt(0)}}]),vertexShader:Dn.meshlambert_vert,fragmentShader:Dn.meshlambert_frag},phong:{uniforms:fa([wt.common,wt.specularmap,wt.envmap,wt.aomap,wt.lightmap,wt.emissivemap,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.fog,wt.lights,{emissive:{value:new Pt(0)},specular:{value:new Pt(1118481)},shininess:{value:30}}]),vertexShader:Dn.meshphong_vert,fragmentShader:Dn.meshphong_frag},standard:{uniforms:fa([wt.common,wt.envmap,wt.aomap,wt.lightmap,wt.emissivemap,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.roughnessmap,wt.metalnessmap,wt.fog,wt.lights,{emissive:{value:new Pt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Dn.meshphysical_vert,fragmentShader:Dn.meshphysical_frag},toon:{uniforms:fa([wt.common,wt.aomap,wt.lightmap,wt.emissivemap,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.gradientmap,wt.fog,wt.lights,{emissive:{value:new Pt(0)}}]),vertexShader:Dn.meshtoon_vert,fragmentShader:Dn.meshtoon_frag},matcap:{uniforms:fa([wt.common,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.fog,{matcap:{value:null}}]),vertexShader:Dn.meshmatcap_vert,fragmentShader:Dn.meshmatcap_frag},points:{uniforms:fa([wt.points,wt.fog]),vertexShader:Dn.points_vert,fragmentShader:Dn.points_frag},dashed:{uniforms:fa([wt.common,wt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Dn.linedashed_vert,fragmentShader:Dn.linedashed_frag},depth:{uniforms:fa([wt.common,wt.displacementmap]),vertexShader:Dn.depth_vert,fragmentShader:Dn.depth_frag},normal:{uniforms:fa([wt.common,wt.bumpmap,wt.normalmap,wt.displacementmap,{opacity:{value:1}}]),vertexShader:Dn.meshnormal_vert,fragmentShader:Dn.meshnormal_frag},sprite:{uniforms:fa([wt.sprite,wt.fog]),vertexShader:Dn.sprite_vert,fragmentShader:Dn.sprite_frag},background:{uniforms:{uvTransform:{value:new In},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Dn.background_vert,fragmentShader:Dn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Dn.backgroundCube_vert,fragmentShader:Dn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Dn.cube_vert,fragmentShader:Dn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Dn.equirect_vert,fragmentShader:Dn.equirect_frag},distanceRGBA:{uniforms:fa([wt.common,wt.displacementmap,{referencePosition:{value:new ae},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Dn.distanceRGBA_vert,fragmentShader:Dn.distanceRGBA_frag},shadow:{uniforms:fa([wt.lights,wt.fog,{color:{value:new Pt(0)},opacity:{value:1}}]),vertexShader:Dn.shadow_vert,fragmentShader:Dn.shadow_frag}};jl.physical={uniforms:fa([jl.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new In},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new In},clearcoatNormalScale:{value:new Je(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new In},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new In},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new In},sheen:{value:0},sheenColor:{value:new Pt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new In},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new In},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new In},transmissionSamplerSize:{value:new Je},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new In},attenuationDistance:{value:0},attenuationColor:{value:new Pt(0)},specularColor:{value:new Pt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new In},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new In},anisotropyVector:{value:new Je},anisotropyMap:{value:null},anisotropyMapTransform:{value:new In}}]),vertexShader:Dn.meshphysical_vert,fragmentShader:Dn.meshphysical_frag};const qw={r:0,b:0,g:0};function lSe(t,e,n,r,i,o,a){const s=new Pt(0);let l=o===!0?0:1,u,c,f=null,d=0,p=null;function y(_,v){let S=!1,w=v.isScene===!0?v.background:null;w&&w.isTexture&&(w=(v.backgroundBlurriness>0?n:e).get(w)),w===null?x(s,l):w&&w.isColor&&(x(w,1),S=!0);const E=t.xr.getEnvironmentBlendMode();E==="additive"?r.buffers.color.setClear(0,0,0,1,a):E==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,a),(t.autoClear||S)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),w&&(w.isCubeTexture||w.mapping===pv)?(c===void 0&&(c=new So(new Kp(1,1,1),new tc({name:"BackgroundCubeMaterial",uniforms:Jg(jl.backgroundCube.uniforms),vertexShader:jl.backgroundCube.vertexShader,fragmentShader:jl.backgroundCube.fragmentShader,side:xa,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(T,A,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=w,c.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=ar.getTransfer(w.colorSpace)!==Er,(f!==w||d!==w.version||p!==t.toneMapping)&&(c.material.needsUpdate=!0,f=w,d=w.version,p=t.toneMapping),c.layers.enableAll(),_.unshift(c,c.geometry,c.material,0,0,null)):w&&w.isTexture&&(u===void 0&&(u=new So(new Mb(2,2),new tc({name:"BackgroundMaterial",uniforms:Jg(jl.background.uniforms),vertexShader:jl.background.vertexShader,fragmentShader:jl.background.fragmentShader,side:rf,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=w,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=ar.getTransfer(w.colorSpace)!==Er,w.matrixAutoUpdate===!0&&w.updateMatrix(),u.material.uniforms.uvTransform.value.copy(w.matrix),(f!==w||d!==w.version||p!==t.toneMapping)&&(u.material.needsUpdate=!0,f=w,d=w.version,p=t.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null))}function x(_,v){_.getRGB(qw,qW(t)),r.buffers.color.setClear(qw.r,qw.g,qw.b,v,a)}return{getClearColor:function(){return s},setClearColor:function(_,v=1){s.set(_),l=v,x(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(_){l=_,x(s,l)},render:y}}function uSe(t,e,n,r){const i=t.getParameter(t.MAX_VERTEX_ATTRIBS),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||o!==null,s={},l=_(null);let u=l,c=!1;function f(j,J,Y,$,W){let U=!1;if(a){const ne=x($,Y,J);u!==ne&&(u=ne,p(u.object)),U=v(j,$,Y,W),U&&S(j,$,Y,W)}else{const ne=J.wireframe===!0;(u.geometry!==$.id||u.program!==Y.id||u.wireframe!==ne)&&(u.geometry=$.id,u.program=Y.id,u.wireframe=ne,U=!0)}W!==null&&n.update(W,t.ELEMENT_ARRAY_BUFFER),(U||c)&&(c=!1,I(j,J,Y,$),W!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(W).buffer))}function d(){return r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function p(j){return r.isWebGL2?t.bindVertexArray(j):o.bindVertexArrayOES(j)}function y(j){return r.isWebGL2?t.deleteVertexArray(j):o.deleteVertexArrayOES(j)}function x(j,J,Y){const $=Y.wireframe===!0;let W=s[j.id];W===void 0&&(W={},s[j.id]=W);let U=W[J.id];U===void 0&&(U={},W[J.id]=U);let ne=U[$];return ne===void 0&&(ne=_(d()),U[$]=ne),ne}function _(j){const J=[],Y=[],$=[];for(let W=0;W=0){const Ce=W[ue];let Re=U[ue];if(Re===void 0&&(ue==="instanceMatrix"&&j.instanceMatrix&&(Re=j.instanceMatrix),ue==="instanceColor"&&j.instanceColor&&(Re=j.instanceColor)),Ce===void 0||Ce.attribute!==Re||Re&&Ce.data!==Re.data)return!0;ne++}return u.attributesNum!==ne||u.index!==$}function S(j,J,Y,$){const W={},U=J.attributes;let ne=0;const re=Y.getAttributes();for(const ue in re)if(re[ue].location>=0){let Ce=U[ue];Ce===void 0&&(ue==="instanceMatrix"&&j.instanceMatrix&&(Ce=j.instanceMatrix),ue==="instanceColor"&&j.instanceColor&&(Ce=j.instanceColor));const Re={};Re.attribute=Ce,Ce&&Ce.data&&(Re.data=Ce.data),W[ue]=Re,ne++}u.attributes=W,u.attributesNum=ne,u.index=$}function w(){const j=u.newAttributes;for(let J=0,Y=j.length;J=0){let ce=W[re];if(ce===void 0&&(re==="instanceMatrix"&&j.instanceMatrix&&(ce=j.instanceMatrix),re==="instanceColor"&&j.instanceColor&&(ce=j.instanceColor)),ce!==void 0){const Ce=ce.normalized,Re=ce.itemSize,Ie=n.get(ce);if(Ie===void 0)continue;const He=Ie.buffer,tt=Ie.type,Qe=Ie.bytesPerElement,ut=r.isWebGL2===!0&&(tt===t.INT||tt===t.UNSIGNED_INT||ce.gpuType===JO);if(ce.isInterleavedBufferAttribute){const Xe=ce.data,le=Xe.stride,De=ce.offset;if(Xe.isInstancedInterleavedBuffer){for(let Ee=0;Ee0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";D="mediump"}return D==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let s=n.precision!==void 0?n.precision:"highp";const l=o(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);const u=a||e.has("WEBGL_draw_buffers"),c=n.logarithmicDepthBuffer===!0,f=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=t.getParameter(t.MAX_TEXTURE_SIZE),y=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),x=t.getParameter(t.MAX_VERTEX_ATTRIBS),_=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),v=t.getParameter(t.MAX_VARYING_VECTORS),S=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),w=d>0,E=a||e.has("OES_texture_float"),T=w&&E,A=a?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:a,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:o,precision:s,logarithmicDepthBuffer:c,maxTextures:f,maxVertexTextures:d,maxTextureSize:p,maxCubemapSize:y,maxAttributes:x,maxVertexUniforms:_,maxVaryings:v,maxFragmentUniforms:S,vertexTextures:w,floatFragmentTextures:E,floatVertexTextures:T,maxSamples:A}}function dSe(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new ld,s=new In,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d){const p=f.length!==0||d||r!==0||i;return i=d,r=f.length,p},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(f,d){n=c(f,d,0)},this.setState=function(f,d,p){const y=f.clippingPlanes,x=f.clipIntersection,_=f.clipShadows,v=t.get(f);if(!i||y===null||y.length===0||o&&!_)o?c(null):u();else{const S=o?0:r,w=S*4;let E=v.clippingState||null;l.value=E,E=c(y,d,w,p);for(let T=0;T!==w;++T)E[T]=n[T];v.clippingState=E,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=S}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function c(f,d,p,y){const x=f!==null?f.length:0;let _=null;if(x!==0){if(_=l.value,y!==!0||_===null){const v=p+x*4,S=d.matrixWorldInverse;s.getNormalMatrix(S),(_===null||_.length0){const u=new KW(l.height/2);return u.fromEquirectangularTexture(t,a),e.set(a,u),a.addEventListener("dispose",i),n(u.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class Cb extends Sb{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=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=a,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,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,a=o+u*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,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 fg=4,Fk=[.125,.215,.35,.446,.526,.582],op=20,a3=new Cb,kk=new Pt;let s3=null,l3=0,u3=0;const tp=(1+Math.sqrt(5))/2,m0=1/tp,Bk=[new ae(1,1,1),new ae(-1,1,1),new ae(1,1,-1),new ae(-1,1,-1),new ae(0,tp,m0),new ae(0,tp,-m0),new ae(m0,0,tp),new ae(-m0,0,tp),new ae(tp,m0,0),new ae(-tp,m0,0)];class hP{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){s3=this._renderer.getRenderTarget(),l3=this._renderer.getActiveCubeFace(),u3=this._renderer.getActiveMipmapLevel(),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=$k(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=zk(),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?w:0,w,w),c.setRenderTarget(i),x&&c.render(y,s),c.render(e,s)}y.geometry.dispose(),y.material.dispose(),c.toneMapping=d,c.autoClear=f,e.background=_}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===of||e.mapping===kd;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=$k()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=zk());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new So(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;Xw(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,a3)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iop&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${op}`);const v=[];let S=0;for(let D=0;Dw-fg?i-w+fg:0),A=4*(this._cubeSize-E);Xw(n,T,A,3*E,2*E),l.setRenderTarget(n),l.render(f,a3)}}function pSe(t){const e=[],n=[],r=[];let i=t;const o=t-fg+1+Fk.length;for(let a=0;at-fg?l=Fk[a-t+fg-1]:a===0&&(l=0),r.push(l);const u=1/(s-2),c=-u,f=1+u,d=[c,c,f,c,f,f,c,c,f,f,c,f],p=6,y=6,x=3,_=2,v=1,S=new Float32Array(x*y*p),w=new Float32Array(_*y*p),E=new Float32Array(v*y*p);for(let A=0;A2?0:-1,P=[D,I,0,D+2/3,I,0,D+2/3,I+1,0,D,I,0,D+2/3,I+1,0,D,I+1,0];S.set(P,x*y*A),w.set(d,_*y*A);const N=[A,A,A,A,A,A];E.set(N,v*y*A)}const T=new Ln;T.setAttribute("position",new xr(S,x)),T.setAttribute("uv",new xr(w,_)),T.setAttribute("faceIndex",new xr(E,v)),e.push(T),i>fg&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function Uk(t,e,n){const r=new au(t,e,n);return r.texture.mapping=pv,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Xw(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function mSe(t,e,n){const r=new Float32Array(op),i=new ae(0,1,0);return new tc({name:"SphericalGaussianBlur",defines:{n:op,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:d4(),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:qc,depthTest:!1,depthWrite:!1})}function zk(){return new tc({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:d4(),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:qc,depthTest:!1,depthWrite:!1})}function $k(){return new tc({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:d4(),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:qc,depthTest:!1,depthWrite:!1})}function d4(){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 gSe(t){let e=new WeakMap,n=null;function r(s){if(s&&s.isTexture){const l=s.mapping,u=l===Sx||l===Ex,c=l===of||l===kd;if(u||c)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let f=e.get(s);return n===null&&(n=new hP(t)),f=u?n.fromEquirectangular(s,f):n.fromCubemap(s,f),e.set(s,f),f.texture}else{if(e.has(s))return e.get(s).texture;{const f=s.image;if(u&&f&&f.height>0||c&&f&&i(f)){n===null&&(n=new hP(t));const d=u?n.fromEquirectangular(s):n.fromCubemap(s);return e.set(s,d),s.addEventListener("dispose",o),d.texture}else return null}}}return s}function i(s){let l=0;const u=6;for(let c=0;ce.maxTextureSize&&(B=Math.ceil(N/e.maxTextureSize),N=e.maxTextureSize);const G=new Float32Array(N*B*4*x),Z=new mC(G,N,B,x);Z.type=Zl,Z.needsUpdate=!0;const j=P*4;for(let Y=0;Y0)return t;const i=e*n;let o=Hk[i];if(o===void 0&&(o=new Float32Array(i),Hk[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Vi(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${s}: ${n[a]}`)}return r.join(` +`)}function yEe(t){const e=ar.getPrimaries(ar.workingColorSpace),n=ar.getPrimaries(t);let r;switch(e===n?r="":e===Nx&&n===Px?r="LinearDisplayP3ToLinearSRGB":e===Px&&n===Nx&&(r="LinearSRGBToLinearDisplayP3"),t){case ec:case _b:return[r,"LinearTransferOETF"];case zi:case pC:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}function Yk(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 a=parseInt(o[1]);return n.toUpperCase()+` + +`+i+` + +`+vEe(t.getShaderSource(e),a)}else return i}function xEe(t,e){const n=yEe(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function bEe(t,e){let n;switch(e){case mW:n="Linear";break;case gW:n="Reinhard";break;case vW:n="OptimizedCineon";break;case KO:n="ACESFilmic";break;case yW:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function _Ee(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(f1).join(` +`)}function wEe(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` +`)}function SEe(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function pP(t){return t.replace(EEe,CEe)}const MEe=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function CEe(t,e){let n=Dn[e];if(n===void 0){const r=MEe.get(e);if(r!==void 0)n=Dn[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 pP(n)}const AEe=/#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 Jk(t){return t.replace(AEe,TEe)}function TEe(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(_+=` +`),v=[p,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y].filter(f1).join(` +`),v.length>0&&(v+=` +`)):(_=[Qk(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",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 "+c:"",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&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#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.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(f1).join(` +`),v=[p,Qk(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+c:"",n.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.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.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?"#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.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==ju?"#define TONE_MAPPING":"",n.toneMapping!==ju?Dn.tonemapping_pars_fragment:"",n.toneMapping!==ju?bEe("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Dn.colorspace_pars_fragment,xEe("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(f1).join(` +`)),a=pP(a),a=Kk(a,n),a=Zk(a,n),s=pP(s),s=Kk(s,n),s=Zk(s,n),a=Jk(a),s=Jk(s),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(S=`#version 300 es +`,_=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+_,v=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===fP?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===fP?"":"#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(` +`)+` +`+v);const w=S+_+a,E=S+v+s,T=Xk(i,i.VERTEX_SHADER,w),A=Xk(i,i.FRAGMENT_SHADER,E);i.attachShader(x,T),i.attachShader(x,A),n.index0AttributeName!==void 0?i.bindAttribLocation(x,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(x,0,"position"),i.linkProgram(x);function D(B){if(t.debug.checkShaderErrors){const G=i.getProgramInfoLog(x).trim(),Z=i.getShaderInfoLog(T).trim(),j=i.getShaderInfoLog(A).trim();let J=!0,Y=!0;if(i.getProgramParameter(x,i.LINK_STATUS)===!1)if(J=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,x,T,A);else{const $=Yk(i,T,"vertex"),W=Yk(i,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(x,i.VALIDATE_STATUS)+` + +Program Info Log: `+G+` +`+$+` +`+W)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(Z===""||j==="")&&(Y=!1);Y&&(B.diagnostics={runnable:J,programLog:G,vertexShader:{log:Z,prefix:_},fragmentShader:{log:j,prefix:v}})}i.deleteShader(T),i.deleteShader(A),I=new uE(i,x),P=SEe(i,x)}let I;this.getUniforms=function(){return I===void 0&&D(this),I};let P;this.getAttributes=function(){return P===void 0&&D(this),P};let N=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return N===!1&&(N=i.getProgramParameter(x,mEe)),N},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(x),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=gEe++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=T,this.fragmentShader=A,this}let LEe=0;class FEe{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),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.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 kEe(e),n.set(e,r)),r}}class kEe{constructor(e){this.id=LEe++,this.code=e,this.usedTimes=0}}function BEe(t,e,n,r,i,o,a){const s=new Mp,l=new FEe,u=[],c=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let p=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(P){return P===0?"uv":`uv${P}`}function _(P,N,B,G,Z){const j=G.fog,J=Z.geometry,Y=P.isMeshStandardMaterial?G.environment:null,$=(P.isMeshStandardMaterial?n:e).get(P.envMap||Y),W=$&&$.mapping===pv?$.image.height:null,U=y[P.type];P.precision!==null&&(p=i.getMaxPrecision(P.precision),p!==P.precision&&console.warn("THREE.WebGLProgram.getParameters:",P.precision,"not supported, using",p,"instead."));const ne=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,re=ne!==void 0?ne.length:0;let ue=0;J.morphAttributes.position!==void 0&&(ue=1),J.morphAttributes.normal!==void 0&&(ue=2),J.morphAttributes.color!==void 0&&(ue=3);let ce,Ce,Re,Ie;if(U){const Zn=jl[U];ce=Zn.vertexShader,Ce=Zn.fragmentShader}else ce=P.vertexShader,Ce=P.fragmentShader,l.update(P),Re=l.getVertexShaderID(P),Ie=l.getFragmentShaderID(P);const He=t.getRenderTarget(),tt=Z.isInstancedMesh===!0,Qe=!!P.map,ut=!!P.matcap,Xe=!!$,le=!!P.aoMap,De=!!P.lightMap,Ee=!!P.bumpMap,X=!!P.normalMap,te=!!P.displacementMap,me=!!P.emissiveMap,we=!!P.metalnessMap,Ne=!!P.roughnessMap,Ue=P.anisotropy>0,We=P.clearcoat>0,st=P.iridescence>0,z=P.sheen>0,F=P.transmission>0,oe=Ue&&!!P.anisotropyMap,ge=We&&!!P.clearcoatMap,pe=We&&!!P.clearcoatNormalMap,de=We&&!!P.clearcoatRoughnessMap,ve=st&&!!P.iridescenceMap,Se=st&&!!P.iridescenceThicknessMap,Pe=z&&!!P.sheenColorMap,Be=z&&!!P.sheenRoughnessMap,je=!!P.specularMap,Fe=!!P.specularColorMap,xt=!!P.specularIntensityMap,yt=F&&!!P.transmissionMap,bt=F&&!!P.thicknessMap,Ct=!!P.gradientMap,ht=!!P.alphaMap,jt=P.alphaTest>0,be=!!P.alphaHash,gt=!!P.extensions,ct=!!J.attributes.uv1,Ye=!!J.attributes.uv2,pt=!!J.attributes.uv3;let Vt=ju;return P.toneMapped&&(He===null||He.isXRRenderTarget===!0)&&(Vt=t.toneMapping),{isWebGL2:c,shaderID:U,shaderType:P.type,shaderName:P.name,vertexShader:ce,fragmentShader:Ce,defines:P.defines,customVertexShaderID:Re,customFragmentShaderID:Ie,isRawShaderMaterial:P.isRawShaderMaterial===!0,glslVersion:P.glslVersion,precision:p,instancing:tt,instancingColor:tt&&Z.instanceColor!==null,supportsVertexTextures:d,outputColorSpace:He===null?t.outputColorSpace:He.isXRRenderTarget===!0?He.texture.colorSpace:ec,map:Qe,matcap:ut,envMap:Xe,envMapMode:Xe&&$.mapping,envMapCubeUVHeight:W,aoMap:le,lightMap:De,bumpMap:Ee,normalMap:X,displacementMap:d&&te,emissiveMap:me,normalMapObjectSpace:X&&P.normalMapType===OW,normalMapTangentSpace:X&&P.normalMapType===Jd,metalnessMap:we,roughnessMap:Ne,anisotropy:Ue,anisotropyMap:oe,clearcoat:We,clearcoatMap:ge,clearcoatNormalMap:pe,clearcoatRoughnessMap:de,iridescence:st,iridescenceMap:ve,iridescenceThicknessMap:Se,sheen:z,sheenColorMap:Pe,sheenRoughnessMap:Be,specularMap:je,specularColorMap:Fe,specularIntensityMap:xt,transmission:F,transmissionMap:yt,thicknessMap:bt,gradientMap:Ct,opaque:P.transparent===!1&&P.blending===Sp,alphaMap:ht,alphaTest:jt,alphaHash:be,combine:P.combine,mapUv:Qe&&x(P.map.channel),aoMapUv:le&&x(P.aoMap.channel),lightMapUv:De&&x(P.lightMap.channel),bumpMapUv:Ee&&x(P.bumpMap.channel),normalMapUv:X&&x(P.normalMap.channel),displacementMapUv:te&&x(P.displacementMap.channel),emissiveMapUv:me&&x(P.emissiveMap.channel),metalnessMapUv:we&&x(P.metalnessMap.channel),roughnessMapUv:Ne&&x(P.roughnessMap.channel),anisotropyMapUv:oe&&x(P.anisotropyMap.channel),clearcoatMapUv:ge&&x(P.clearcoatMap.channel),clearcoatNormalMapUv:pe&&x(P.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:de&&x(P.clearcoatRoughnessMap.channel),iridescenceMapUv:ve&&x(P.iridescenceMap.channel),iridescenceThicknessMapUv:Se&&x(P.iridescenceThicknessMap.channel),sheenColorMapUv:Pe&&x(P.sheenColorMap.channel),sheenRoughnessMapUv:Be&&x(P.sheenRoughnessMap.channel),specularMapUv:je&&x(P.specularMap.channel),specularColorMapUv:Fe&&x(P.specularColorMap.channel),specularIntensityMapUv:xt&&x(P.specularIntensityMap.channel),transmissionMapUv:yt&&x(P.transmissionMap.channel),thicknessMapUv:bt&&x(P.thicknessMap.channel),alphaMapUv:ht&&x(P.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(X||Ue),vertexColors:P.vertexColors,vertexAlphas:P.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,vertexUv1s:ct,vertexUv2s:Ye,vertexUv3s:pt,pointsUvs:Z.isPoints===!0&&!!J.attributes.uv&&(Qe||ht),fog:!!j,useFog:P.fog===!0,fogExp2:j&&j.isFogExp2,flatShading:P.flatShading===!0,sizeAttenuation:P.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:Z.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:re,morphTextureStride:ue,numDirLights:N.directional.length,numPointLights:N.point.length,numSpotLights:N.spot.length,numSpotLightMaps:N.spotLightMap.length,numRectAreaLights:N.rectArea.length,numHemiLights:N.hemi.length,numDirLightShadows:N.directionalShadowMap.length,numPointLightShadows:N.pointShadowMap.length,numSpotLightShadows:N.spotShadowMap.length,numSpotLightShadowsWithMaps:N.numSpotLightShadowsWithMaps,numLightProbes:N.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:P.dithering,shadowMapEnabled:t.shadowMap.enabled&&B.length>0,shadowMapType:t.shadowMap.type,toneMapping:Vt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:Qe&&P.map.isVideoTexture===!0&&ar.getTransfer(P.map.colorSpace)===Er,premultipliedAlpha:P.premultipliedAlpha,doubleSided:P.side===ql,flipSided:P.side===xa,useDepthPacking:P.depthPacking>=0,depthPacking:P.depthPacking||0,index0AttributeName:P.index0AttributeName,extensionDerivatives:gt&&P.extensions.derivatives===!0,extensionFragDepth:gt&&P.extensions.fragDepth===!0,extensionDrawBuffers:gt&&P.extensions.drawBuffers===!0,extensionShaderTextureLOD:gt&&P.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:c||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:P.customProgramCacheKey()}}function v(P){const N=[];if(P.shaderID?N.push(P.shaderID):(N.push(P.customVertexShaderID),N.push(P.customFragmentShaderID)),P.defines!==void 0)for(const B in P.defines)N.push(B),N.push(P.defines[B]);return P.isRawShaderMaterial===!1&&(S(N,P),w(N,P),N.push(t.outputColorSpace)),N.push(P.customProgramCacheKey),N.join()}function S(P,N){P.push(N.precision),P.push(N.outputColorSpace),P.push(N.envMapMode),P.push(N.envMapCubeUVHeight),P.push(N.mapUv),P.push(N.alphaMapUv),P.push(N.lightMapUv),P.push(N.aoMapUv),P.push(N.bumpMapUv),P.push(N.normalMapUv),P.push(N.displacementMapUv),P.push(N.emissiveMapUv),P.push(N.metalnessMapUv),P.push(N.roughnessMapUv),P.push(N.anisotropyMapUv),P.push(N.clearcoatMapUv),P.push(N.clearcoatNormalMapUv),P.push(N.clearcoatRoughnessMapUv),P.push(N.iridescenceMapUv),P.push(N.iridescenceThicknessMapUv),P.push(N.sheenColorMapUv),P.push(N.sheenRoughnessMapUv),P.push(N.specularMapUv),P.push(N.specularColorMapUv),P.push(N.specularIntensityMapUv),P.push(N.transmissionMapUv),P.push(N.thicknessMapUv),P.push(N.combine),P.push(N.fogExp2),P.push(N.sizeAttenuation),P.push(N.morphTargetsCount),P.push(N.morphAttributeCount),P.push(N.numDirLights),P.push(N.numPointLights),P.push(N.numSpotLights),P.push(N.numSpotLightMaps),P.push(N.numHemiLights),P.push(N.numRectAreaLights),P.push(N.numDirLightShadows),P.push(N.numPointLightShadows),P.push(N.numSpotLightShadows),P.push(N.numSpotLightShadowsWithMaps),P.push(N.numLightProbes),P.push(N.shadowMapType),P.push(N.toneMapping),P.push(N.numClippingPlanes),P.push(N.numClipIntersection),P.push(N.depthPacking)}function w(P,N){s.disableAll(),N.isWebGL2&&s.enable(0),N.supportsVertexTextures&&s.enable(1),N.instancing&&s.enable(2),N.instancingColor&&s.enable(3),N.matcap&&s.enable(4),N.envMap&&s.enable(5),N.normalMapObjectSpace&&s.enable(6),N.normalMapTangentSpace&&s.enable(7),N.clearcoat&&s.enable(8),N.iridescence&&s.enable(9),N.alphaTest&&s.enable(10),N.vertexColors&&s.enable(11),N.vertexAlphas&&s.enable(12),N.vertexUv1s&&s.enable(13),N.vertexUv2s&&s.enable(14),N.vertexUv3s&&s.enable(15),N.vertexTangents&&s.enable(16),N.anisotropy&&s.enable(17),N.alphaHash&&s.enable(18),P.push(s.mask),s.disableAll(),N.fog&&s.enable(0),N.useFog&&s.enable(1),N.flatShading&&s.enable(2),N.logarithmicDepthBuffer&&s.enable(3),N.skinning&&s.enable(4),N.morphTargets&&s.enable(5),N.morphNormals&&s.enable(6),N.morphColors&&s.enable(7),N.premultipliedAlpha&&s.enable(8),N.shadowMapEnabled&&s.enable(9),N.useLegacyLights&&s.enable(10),N.doubleSided&&s.enable(11),N.flipSided&&s.enable(12),N.useDepthPacking&&s.enable(13),N.dithering&&s.enable(14),N.transmission&&s.enable(15),N.sheen&&s.enable(16),N.opaque&&s.enable(17),N.pointsUvs&&s.enable(18),N.decodeVideoTexture&&s.enable(19),P.push(s.mask)}function E(P){const N=y[P.type];let B;if(N){const G=jl[N];B=XW.clone(G.uniforms)}else B=P.uniforms;return B}function T(P,N){let B;for(let G=0,Z=u.length;G0?r.push(v):p.transparent===!0?i.push(v):n.push(v)}function l(f,d,p,y,x,_){const v=a(f,d,p,y,x,_);p.transmission>0?r.unshift(v):p.transparent===!0?i.unshift(v):n.unshift(v)}function u(f,d){n.length>1&&n.sort(f||zEe),r.length>1&&r.sort(d||e6),i.length>1&&i.sort(d||e6)}function c(){for(let f=e,d=t.length;f=o.length?(a=new t6,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function HEe(){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 ae,color:new Pt};break;case"SpotLight":n={position:new ae,direction:new ae,color:new Pt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ae,color:new Pt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ae,skyColor:new Pt,groundColor:new Pt};break;case"RectAreaLight":n={color:new Pt,position:new ae,halfWidth:new ae,halfHeight:new ae};break}return t[e.id]=n,n}}}function VEe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Je};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Je};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Je,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let WEe=0;function GEe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function jEe(t,e){const n=new HEe,r=VEe(),i={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++)i.probe.push(new ae);const o=new ae,a=new yn,s=new yn;function l(c,f){let d=0,p=0,y=0;for(let G=0;G<9;G++)i.probe[G].set(0,0,0);let x=0,_=0,v=0,S=0,w=0,E=0,T=0,A=0,D=0,I=0,P=0;c.sort(GEe);const N=f===!0?Math.PI:1;for(let G=0,Z=c.length;G0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=wt.LTC_FLOAT_1,i.rectAreaLTC2=wt.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=wt.LTC_HALF_1,i.rectAreaLTC2=wt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=p,i.ambient[2]=y;const B=i.hash;(B.directionalLength!==x||B.pointLength!==_||B.spotLength!==v||B.rectAreaLength!==S||B.hemiLength!==w||B.numDirectionalShadows!==E||B.numPointShadows!==T||B.numSpotShadows!==A||B.numSpotMaps!==D||B.numLightProbes!==P)&&(i.directional.length=x,i.spot.length=v,i.rectArea.length=S,i.point.length=_,i.hemi.length=w,i.directionalShadow.length=E,i.directionalShadowMap.length=E,i.pointShadow.length=T,i.pointShadowMap.length=T,i.spotShadow.length=A,i.spotShadowMap.length=A,i.directionalShadowMatrix.length=E,i.pointShadowMatrix.length=T,i.spotLightMatrix.length=A+D-I,i.spotLightMap.length=D,i.numSpotLightShadowsWithMaps=I,i.numLightProbes=P,B.directionalLength=x,B.pointLength=_,B.spotLength=v,B.rectAreaLength=S,B.hemiLength=w,B.numDirectionalShadows=E,B.numPointShadows=T,B.numSpotShadows=A,B.numSpotMaps=D,B.numLightProbes=P,i.version=WEe++)}function u(c,f){let d=0,p=0,y=0,x=0,_=0;const v=f.matrixWorldInverse;for(let S=0,w=c.length;S=s.length?(l=new n6(t,e),s.push(l)):l=s[a],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class h4 extends To{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=PW,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 p4 extends To{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 XEe=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,YEe=`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 KEe(t,e,n){let r=new gC;const i=new Je,o=new Je,a=new rr,s=new h4({depthPacking:NW}),l=new p4,u={},c=n.maxTextureSize,f={[rf]:xa,[xa]:rf,[ql]:ql},d=new tc({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Je},radius:{value:4}},vertexShader:XEe,fragmentShader:YEe}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const y=new Ln;y.setAttribute("position",new xr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new So(y,d),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fC;let v=this.type;this.render=function(T,A,D){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||T.length===0)return;const I=t.getRenderTarget(),P=t.getActiveCubeFace(),N=t.getActiveMipmapLevel(),B=t.state;B.setBlending(qc),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const G=v!==Hl&&this.type===Hl,Z=v===Hl&&this.type!==Hl;for(let j=0,J=T.length;jc||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/W.x),i.x=o.x*W.x,$.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/W.y),i.y=o.y*W.y,$.mapSize.y=o.y)),$.map===null||G===!0||Z===!0){const ne=this.type!==Hl?{minFilter:ci,magFilter:ci}:{};$.map!==null&&$.map.dispose(),$.map=new au(i.x,i.y,ne),$.map.texture.name=Y.name+".shadowMap",$.camera.updateProjectionMatrix()}t.setRenderTarget($.map),t.clear();const U=$.getViewportCount();for(let ne=0;ne0||A.map&&A.alphaTest>0){const B=P.uuid,G=A.uuid;let Z=u[B];Z===void 0&&(Z={},u[B]=Z);let j=Z[G];j===void 0&&(j=P.clone(),Z[G]=j),P=j}if(P.visible=A.visible,P.wireframe=A.wireframe,I===Hl?P.side=A.shadowSide!==null?A.shadowSide:A.side:P.side=A.shadowSide!==null?A.shadowSide:f[A.side],P.alphaMap=A.alphaMap,P.alphaTest=A.alphaTest,P.map=A.map,P.clipShadows=A.clipShadows,P.clippingPlanes=A.clippingPlanes,P.clipIntersection=A.clipIntersection,P.displacementMap=A.displacementMap,P.displacementScale=A.displacementScale,P.displacementBias=A.displacementBias,P.wireframeLinewidth=A.wireframeLinewidth,P.linewidth=A.linewidth,D.isPointLight===!0&&P.isMeshDistanceMaterial===!0){const B=t.properties.get(P);B.light=D}return P}function E(T,A,D,I,P){if(T.visible===!1)return;if(T.layers.test(A.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&P===Hl)&&(!T.frustumCulled||r.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,T.matrixWorld);const G=e.update(T),Z=T.material;if(Array.isArray(Z)){const j=G.groups;for(let J=0,Y=j.length;J=1):ne.indexOf("OpenGL ES")!==-1&&(U=parseFloat(/^OpenGL ES (\d)/.exec(ne)[1]),W=U>=2);let re=null,ue={};const ce=t.getParameter(t.SCISSOR_BOX),Ce=t.getParameter(t.VIEWPORT),Re=new rr().fromArray(ce),Ie=new rr().fromArray(Ce);function He(be,gt,ct,Ye){const pt=new Uint8Array(4),Vt=t.createTexture();t.bindTexture(be,Vt),t.texParameteri(be,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(be,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let xn=0;xn"u"?!1:/OculusBrowser/g.test(navigator.userAgent),y=new WeakMap;let x;const _=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(z,F){return v?new OffscreenCanvas(z,F):Lx("canvas")}function w(z,F,oe,ge){let pe=1;if((z.width>ge||z.height>ge)&&(pe=ge/Math.max(z.width,z.height)),pe<1||F===!0)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap){const de=F?m2:Math.floor,ve=de(pe*z.width),Se=de(pe*z.height);x===void 0&&(x=S(ve,Se));const Pe=oe?S(ve,Se):x;return Pe.width=ve,Pe.height=Se,Pe.getContext("2d").drawImage(z,0,0,ve,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+z.width+"x"+z.height+") to ("+ve+"x"+Se+")."),Pe}else return"data"in z&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+z.width+"x"+z.height+")."),z;return z}function E(z){return dP(z.width)&&dP(z.height)}function T(z){return s?!1:z.wrapS!==so||z.wrapT!==so||z.minFilter!==ci&&z.minFilter!==wi}function A(z,F){return z.generateMipmaps&&F&&z.minFilter!==ci&&z.minFilter!==wi}function D(z){t.generateMipmap(z)}function I(z,F,oe,ge,pe=!1){if(s===!1)return F;if(z!==null){if(t[z]!==void 0)return t[z];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let de=F;if(F===t.RED&&(oe===t.FLOAT&&(de=t.R32F),oe===t.HALF_FLOAT&&(de=t.R16F),oe===t.UNSIGNED_BYTE&&(de=t.R8)),F===t.RED_INTEGER&&(oe===t.UNSIGNED_BYTE&&(de=t.R8UI),oe===t.UNSIGNED_SHORT&&(de=t.R16UI),oe===t.UNSIGNED_INT&&(de=t.R32UI),oe===t.BYTE&&(de=t.R8I),oe===t.SHORT&&(de=t.R16I),oe===t.INT&&(de=t.R32I)),F===t.RG&&(oe===t.FLOAT&&(de=t.RG32F),oe===t.HALF_FLOAT&&(de=t.RG16F),oe===t.UNSIGNED_BYTE&&(de=t.RG8)),F===t.RGBA){const ve=pe?Rx:ar.getTransfer(ge);oe===t.FLOAT&&(de=t.RGBA32F),oe===t.HALF_FLOAT&&(de=t.RGBA16F),oe===t.UNSIGNED_BYTE&&(de=ve===Er?t.SRGB8_ALPHA8:t.RGBA8),oe===t.UNSIGNED_SHORT_4_4_4_4&&(de=t.RGBA4),oe===t.UNSIGNED_SHORT_5_5_5_1&&(de=t.RGB5_A1)}return(de===t.R16F||de===t.R32F||de===t.RG16F||de===t.RG32F||de===t.RGBA16F||de===t.RGBA32F)&&e.get("EXT_color_buffer_float"),de}function P(z,F,oe){return A(z,oe)===!0||z.isFramebufferTexture&&z.minFilter!==ci&&z.minFilter!==wi?Math.log2(Math.max(F.width,F.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?F.mipmaps.length:1}function N(z){return z===ci||z===h2||z===L1?t.NEAREST:t.LINEAR}function B(z){const F=z.target;F.removeEventListener("dispose",B),Z(F),F.isVideoTexture&&y.delete(F)}function G(z){const F=z.target;F.removeEventListener("dispose",G),J(F)}function Z(z){const F=r.get(z);if(F.__webglInit===void 0)return;const oe=z.source,ge=_.get(oe);if(ge){const pe=ge[F.__cacheKey];pe.usedTimes--,pe.usedTimes===0&&j(z),Object.keys(ge).length===0&&_.delete(oe)}r.remove(z)}function j(z){const F=r.get(z);t.deleteTexture(F.__webglTexture);const oe=z.source,ge=_.get(oe);delete ge[F.__cacheKey],a.memory.textures--}function J(z){const F=z.texture,oe=r.get(z),ge=r.get(F);if(ge.__webglTexture!==void 0&&(t.deleteTexture(ge.__webglTexture),a.memory.textures--),z.depthTexture&&z.depthTexture.dispose(),z.isWebGLCubeRenderTarget)for(let pe=0;pe<6;pe++){if(Array.isArray(oe.__webglFramebuffer[pe]))for(let de=0;de=l&&console.warn("THREE.WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+l),Y+=1,z}function U(z){const F=[];return F.push(z.wrapS),F.push(z.wrapT),F.push(z.wrapR||0),F.push(z.magFilter),F.push(z.minFilter),F.push(z.anisotropy),F.push(z.internalFormat),F.push(z.format),F.push(z.type),F.push(z.generateMipmaps),F.push(z.premultiplyAlpha),F.push(z.flipY),F.push(z.unpackAlignment),F.push(z.colorSpace),F.join()}function ne(z,F){const oe=r.get(z);if(z.isVideoTexture&&We(z),z.isRenderTargetTexture===!1&&z.version>0&&oe.__version!==z.version){const ge=z.image;if(ge===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ge.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Qe(oe,z,F);return}}n.bindTexture(t.TEXTURE_2D,oe.__webglTexture,t.TEXTURE0+F)}function re(z,F){const oe=r.get(z);if(z.version>0&&oe.__version!==z.version){Qe(oe,z,F);return}n.bindTexture(t.TEXTURE_2D_ARRAY,oe.__webglTexture,t.TEXTURE0+F)}function ue(z,F){const oe=r.get(z);if(z.version>0&&oe.__version!==z.version){Qe(oe,z,F);return}n.bindTexture(t.TEXTURE_3D,oe.__webglTexture,t.TEXTURE0+F)}function ce(z,F){const oe=r.get(z);if(z.version>0&&oe.__version!==z.version){ut(oe,z,F);return}n.bindTexture(t.TEXTURE_CUBE_MAP,oe.__webglTexture,t.TEXTURE0+F)}const Ce={[Mx]:t.REPEAT,[so]:t.CLAMP_TO_EDGE,[Cx]:t.MIRRORED_REPEAT},Re={[ci]:t.NEAREST,[h2]:t.NEAREST_MIPMAP_NEAREST,[L1]:t.NEAREST_MIPMAP_LINEAR,[wi]:t.LINEAR,[ZO]:t.LINEAR_MIPMAP_NEAREST,[Bd]:t.LINEAR_MIPMAP_LINEAR},Ie={[IW]:t.NEVER,[$W]:t.ALWAYS,[LW]:t.LESS,[kW]:t.LEQUAL,[FW]:t.EQUAL,[zW]:t.GEQUAL,[BW]:t.GREATER,[UW]:t.NOTEQUAL};function He(z,F,oe){if(oe?(t.texParameteri(z,t.TEXTURE_WRAP_S,Ce[F.wrapS]),t.texParameteri(z,t.TEXTURE_WRAP_T,Ce[F.wrapT]),(z===t.TEXTURE_3D||z===t.TEXTURE_2D_ARRAY)&&t.texParameteri(z,t.TEXTURE_WRAP_R,Ce[F.wrapR]),t.texParameteri(z,t.TEXTURE_MAG_FILTER,Re[F.magFilter]),t.texParameteri(z,t.TEXTURE_MIN_FILTER,Re[F.minFilter])):(t.texParameteri(z,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(z,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(z===t.TEXTURE_3D||z===t.TEXTURE_2D_ARRAY)&&t.texParameteri(z,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(F.wrapS!==so||F.wrapT!==so)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(z,t.TEXTURE_MAG_FILTER,N(F.magFilter)),t.texParameteri(z,t.TEXTURE_MIN_FILTER,N(F.minFilter)),F.minFilter!==ci&&F.minFilter!==wi&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),F.compareFunction&&(t.texParameteri(z,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(z,t.TEXTURE_COMPARE_FUNC,Ie[F.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ge=e.get("EXT_texture_filter_anisotropic");if(F.magFilter===ci||F.minFilter!==L1&&F.minFilter!==Bd||F.type===Zl&&e.has("OES_texture_float_linear")===!1||s===!1&&F.type===Up&&e.has("OES_texture_half_float_linear")===!1)return;(F.anisotropy>1||r.get(F).__currentAnisotropy)&&(t.texParameterf(z,ge.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(F.anisotropy,i.getMaxAnisotropy())),r.get(F).__currentAnisotropy=F.anisotropy)}}function tt(z,F){let oe=!1;z.__webglInit===void 0&&(z.__webglInit=!0,F.addEventListener("dispose",B));const ge=F.source;let pe=_.get(ge);pe===void 0&&(pe={},_.set(ge,pe));const de=U(F);if(de!==z.__cacheKey){pe[de]===void 0&&(pe[de]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,oe=!0),pe[de].usedTimes++;const ve=pe[z.__cacheKey];ve!==void 0&&(pe[z.__cacheKey].usedTimes--,ve.usedTimes===0&&j(F)),z.__cacheKey=de,z.__webglTexture=pe[de].texture}return oe}function Qe(z,F,oe){let ge=t.TEXTURE_2D;(F.isDataArrayTexture||F.isCompressedArrayTexture)&&(ge=t.TEXTURE_2D_ARRAY),F.isData3DTexture&&(ge=t.TEXTURE_3D);const pe=tt(z,F),de=F.source;n.bindTexture(ge,z.__webglTexture,t.TEXTURE0+oe);const ve=r.get(de);if(de.version!==ve.__version||pe===!0){n.activeTexture(t.TEXTURE0+oe);const Se=ar.getPrimaries(ar.workingColorSpace),Pe=F.colorSpace===Ss?null:ar.getPrimaries(F.colorSpace),Be=F.colorSpace===Ss||Se===Pe?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,F.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,F.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);const je=T(F)&&E(F.image)===!1;let Fe=w(F.image,je,!1,c);Fe=st(F,Fe);const xt=E(Fe)||s,yt=o.convert(F.format,F.colorSpace);let bt=o.convert(F.type),Ct=I(F.internalFormat,yt,bt,F.colorSpace,F.isVideoTexture);He(ge,F,xt);let ht;const jt=F.mipmaps,be=s&&F.isVideoTexture!==!0,gt=ve.__version===void 0||pe===!0,ct=P(F,Fe,xt);if(F.isDepthTexture)Ct=t.DEPTH_COMPONENT,s?F.type===Zl?Ct=t.DEPTH_COMPONENT32F:F.type===Wc?Ct=t.DEPTH_COMPONENT24:F.type===Md?Ct=t.DEPTH24_STENCIL8:Ct=t.DEPTH_COMPONENT16:F.type===Zl&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),F.format===Cd&&Ct===t.DEPTH_COMPONENT&&F.type!==dC&&F.type!==Wc&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),F.type=Wc,bt=o.convert(F.type)),F.format===zp&&Ct===t.DEPTH_COMPONENT&&(Ct=t.DEPTH_STENCIL,F.type!==Md&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),F.type=Md,bt=o.convert(F.type))),gt&&(be?n.texStorage2D(t.TEXTURE_2D,1,Ct,Fe.width,Fe.height):n.texImage2D(t.TEXTURE_2D,0,Ct,Fe.width,Fe.height,0,yt,bt,null));else if(F.isDataTexture)if(jt.length>0&&xt){be&>&&n.texStorage2D(t.TEXTURE_2D,ct,Ct,jt[0].width,jt[0].height);for(let Ye=0,pt=jt.length;Ye>=1,pt>>=1}}else if(jt.length>0&&xt){be&>&&n.texStorage2D(t.TEXTURE_2D,ct,Ct,jt[0].width,jt[0].height);for(let Ye=0,pt=jt.length;Ye0&>++,n.texStorage2D(t.TEXTURE_CUBE_MAP,gt,ht,Fe[0].width,Fe[0].height));for(let Ye=0;Ye<6;Ye++)if(je){jt?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Ye,0,0,0,Fe[Ye].width,Fe[Ye].height,bt,Ct,Fe[Ye].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Ye,0,ht,Fe[Ye].width,Fe[Ye].height,0,bt,Ct,Fe[Ye].data);for(let pt=0;pt>de),Fe=Math.max(1,F.height>>de);pe===t.TEXTURE_3D||pe===t.TEXTURE_2D_ARRAY?n.texImage3D(pe,de,Pe,je,Fe,F.depth,0,ve,Se,null):n.texImage2D(pe,de,Pe,je,Fe,0,ve,Se,null)}n.bindFramebuffer(t.FRAMEBUFFER,z),Ue(F)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,ge,pe,r.get(oe).__webglTexture,0,Ne(F)):(pe===t.TEXTURE_2D||pe>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&pe<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,ge,pe,r.get(oe).__webglTexture,de),n.bindFramebuffer(t.FRAMEBUFFER,null)}function le(z,F,oe){if(t.bindRenderbuffer(t.RENDERBUFFER,z),F.depthBuffer&&!F.stencilBuffer){let ge=s===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(oe||Ue(F)){const pe=F.depthTexture;pe&&pe.isDepthTexture&&(pe.type===Zl?ge=t.DEPTH_COMPONENT32F:pe.type===Wc&&(ge=t.DEPTH_COMPONENT24));const de=Ne(F);Ue(F)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,de,ge,F.width,F.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,de,ge,F.width,F.height)}else t.renderbufferStorage(t.RENDERBUFFER,ge,F.width,F.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,z)}else if(F.depthBuffer&&F.stencilBuffer){const ge=Ne(F);oe&&Ue(F)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,ge,t.DEPTH24_STENCIL8,F.width,F.height):Ue(F)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ge,t.DEPTH24_STENCIL8,F.width,F.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,F.width,F.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,z)}else{const ge=F.isWebGLMultipleRenderTargets===!0?F.texture:[F.texture];for(let pe=0;pe0){oe.__webglFramebuffer[Se]=[];for(let Pe=0;Pe0){oe.__webglFramebuffer=[];for(let Se=0;Se0&&Ue(z)===!1){const Se=de?F:[F];oe.__webglMultisampledFramebuffer=t.createFramebuffer(),oe.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,oe.__webglMultisampledFramebuffer);for(let Pe=0;Pe0)for(let Pe=0;Pe0)for(let Pe=0;Pe0&&Ue(z)===!1){const F=z.isWebGLMultipleRenderTargets?z.texture:[z.texture],oe=z.width,ge=z.height;let pe=t.COLOR_BUFFER_BIT;const de=[],ve=z.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Se=r.get(z),Pe=z.isWebGLMultipleRenderTargets===!0;if(Pe)for(let Be=0;Be0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&F.__useRenderToTexture!==!1}function We(z){const F=a.render.frame;y.get(z)!==F&&(y.set(z,F),z.update())}function st(z,F){const oe=z.colorSpace,ge=z.format,pe=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||z.format===p2||oe!==ec&&oe!==Ss&&(ar.getTransfer(oe)===Er?s===!1?e.has("EXT_sRGB")===!0&&ge===ga?(z.format=p2,z.minFilter=wi,z.generateMipmaps=!1):F=l4.sRGBToLinear(F):(ge!==ga||pe!==Ps)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",oe)),F}this.allocateTextureUnit=W,this.resetTextureUnits=$,this.setTexture2D=ne,this.setTexture2DArray=re,this.setTexture3D=ue,this.setTextureCube=ce,this.rebindTextures=X,this.setupRenderTarget=te,this.updateRenderTargetMipmap=me,this.updateMultisampleRenderTarget=we,this.setupDepthRenderbuffer=Ee,this.setupFrameBufferTexture=Xe,this.useMultisampledRTT=Ue}function nG(t,e,n){const r=n.isWebGL2;function i(o,a=Ss){let s;const l=ar.getTransfer(a);if(o===Ps)return t.UNSIGNED_BYTE;if(o===QO)return t.UNSIGNED_SHORT_4_4_4_4;if(o===e4)return t.UNSIGNED_SHORT_5_5_5_1;if(o===bW)return t.BYTE;if(o===_W)return t.SHORT;if(o===dC)return t.UNSIGNED_SHORT;if(o===JO)return t.INT;if(o===Wc)return t.UNSIGNED_INT;if(o===Zl)return t.FLOAT;if(o===Up)return r?t.HALF_FLOAT:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(o===wW)return t.ALPHA;if(o===ga)return t.RGBA;if(o===SW)return t.LUMINANCE;if(o===EW)return t.LUMINANCE_ALPHA;if(o===Cd)return t.DEPTH_COMPONENT;if(o===zp)return t.DEPTH_STENCIL;if(o===p2)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(o===t4)return t.RED;if(o===n4)return t.RED_INTEGER;if(o===MW)return t.RG;if(o===r4)return t.RG_INTEGER;if(o===i4)return t.RGBA_INTEGER;if(o===rE||o===iE||o===oE||o===aE)if(l===Er)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(o===rE)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===iE)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===oE)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===aE)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(o===rE)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===iE)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===oE)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===aE)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===UR||o===zR||o===$R||o===HR)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(o===UR)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===zR)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===$R)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===HR)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===CW)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===VR||o===WR)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(o===VR)return l===Er?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(o===WR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===GR||o===jR||o===qR||o===XR||o===YR||o===KR||o===ZR||o===JR||o===QR||o===eP||o===tP||o===nP||o===rP||o===iP)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(o===GR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===jR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===qR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===XR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===YR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===KR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===ZR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===JR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===QR)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===eP)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===tP)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===nP)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===rP)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===iP)return l===Er?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===sE||o===oP||o===aP)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(o===sE)return l===Er?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(o===oP)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(o===aP)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(o===AW||o===sP||o===lP||o===uP)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(o===sE)return s.COMPRESSED_RED_RGTC1_EXT;if(o===sP)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(o===lP)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(o===uP)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return o===Md?r?t.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class rG extends ao{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let dg=class extends Kn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const QEe={type:"move"};class f3{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new dg,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 dg,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ae,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ae),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new dg,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ae,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ae),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,a=null;const s=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){a=!0;for(const x of e.hand.values()){const _=n.getJointPose(x,r),v=this._getHandJoint(u,x);_!==null&&(v.matrix.fromArray(_.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=_.radius),v.visible=_!==null}const c=u.joints["index-finger-tip"],f=u.joints["thumb-tip"],d=c.position.distanceTo(f.position),p=.02,y=.005;u.inputState.pinching&&d>p+y?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&d<=p-y&&(u.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));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(QEe)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new dg;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class iG extends hi{constructor(e,n,r,i,o,a,s,l,u,c){if(c=c!==void 0?c:Cd,c!==Cd&&c!==zp)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&c===Cd&&(r=Wc),r===void 0&&c===zp&&(r=Md),super(null,i,o,a,s,l,c,r,u),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=s!==void 0?s:ci,this.minFilter=l!==void 0?l:ci,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class e2e extends pf{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=1,u=null,c=null,f=null,d=null,p=null,y=null;const x=n.getContextAttributes();let _=null,v=null;const S=[],w=[],E=new ao;E.layers.enable(1),E.viewport=new rr;const T=new ao;T.layers.enable(2),T.viewport=new rr;const A=[E,T],D=new rG;D.layers.enable(1),D.layers.enable(2);let I=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let ue=S[re];return ue===void 0&&(ue=new f3,S[re]=ue),ue.getTargetRaySpace()},this.getControllerGrip=function(re){let ue=S[re];return ue===void 0&&(ue=new f3,S[re]=ue),ue.getGripSpace()},this.getHand=function(re){let ue=S[re];return ue===void 0&&(ue=new f3,S[re]=ue),ue.getHandSpace()};function N(re){const ue=w.indexOf(re.inputSource);if(ue===-1)return;const ce=S[ue];ce!==void 0&&(ce.update(re.inputSource,re.frame,u||a),ce.dispatchEvent({type:re.type,data:re.inputSource}))}function B(){i.removeEventListener("select",N),i.removeEventListener("selectstart",N),i.removeEventListener("selectend",N),i.removeEventListener("squeeze",N),i.removeEventListener("squeezestart",N),i.removeEventListener("squeezeend",N),i.removeEventListener("end",B),i.removeEventListener("inputsourceschange",G);for(let re=0;re=0&&(w[Ce]=null,S[Ce].disconnect(ce))}for(let ue=0;ue=w.length){w.push(ce),Ce=Ie;break}else if(w[Ie]===null){w[Ie]=ce,Ce=Ie;break}if(Ce===-1)break}const Re=S[Ce];Re&&Re.connect(ce)}}const Z=new ae,j=new ae;function J(re,ue,ce){Z.setFromMatrixPosition(ue.matrixWorld),j.setFromMatrixPosition(ce.matrixWorld);const Ce=Z.distanceTo(j),Re=ue.projectionMatrix.elements,Ie=ce.projectionMatrix.elements,He=Re[14]/(Re[10]-1),tt=Re[14]/(Re[10]+1),Qe=(Re[9]+1)/Re[5],ut=(Re[9]-1)/Re[5],Xe=(Re[8]-1)/Re[0],le=(Ie[8]+1)/Ie[0],De=He*Xe,Ee=He*le,X=Ce/(-Xe+le),te=X*-Xe;ue.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(te),re.translateZ(X),re.matrixWorld.compose(re.position,re.quaternion,re.scale),re.matrixWorldInverse.copy(re.matrixWorld).invert();const me=He+X,we=tt+X,Ne=De-te,Ue=Ee+(Ce-te),We=Qe*tt/we*me,st=ut*tt/we*me;re.projectionMatrix.makePerspective(Ne,Ue,We,st,me,we),re.projectionMatrixInverse.copy(re.projectionMatrix).invert()}function Y(re,ue){ue===null?re.matrixWorld.copy(re.matrix):re.matrixWorld.multiplyMatrices(ue.matrixWorld,re.matrix),re.matrixWorldInverse.copy(re.matrixWorld).invert()}this.updateCamera=function(re){if(i===null)return;D.near=T.near=E.near=re.near,D.far=T.far=E.far=re.far,(I!==D.near||P!==D.far)&&(i.updateRenderState({depthNear:D.near,depthFar:D.far}),I=D.near,P=D.far);const ue=re.parent,ce=D.cameras;Y(D,ue);for(let Ce=0;Ce0&&(_.alphaTest.value=v.alphaTest);const S=e.get(v).envMap;if(S&&(_.envMap.value=S,_.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=v.reflectivity,_.ior.value=v.ior,_.refractionRatio.value=v.refractionRatio),v.lightMap){_.lightMap.value=v.lightMap;const w=t._useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=v.lightMapIntensity*w,n(v.lightMap,_.lightMapTransform)}v.aoMap&&(_.aoMap.value=v.aoMap,_.aoMapIntensity.value=v.aoMapIntensity,n(v.aoMap,_.aoMapTransform))}function a(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,v.map&&(_.map.value=v.map,n(v.map,_.mapTransform))}function s(_,v){_.dashSize.value=v.dashSize,_.totalSize.value=v.dashSize+v.gapSize,_.scale.value=v.scale}function l(_,v,S,w){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.size.value=v.size*S,_.scale.value=w*.5,v.map&&(_.map.value=v.map,n(v.map,_.uvTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,n(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function u(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.rotation.value=v.rotation,v.map&&(_.map.value=v.map,n(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,n(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function c(_,v){_.specular.value.copy(v.specular),_.shininess.value=Math.max(v.shininess,1e-4)}function f(_,v){v.gradientMap&&(_.gradientMap.value=v.gradientMap)}function d(_,v){_.metalness.value=v.metalness,v.metalnessMap&&(_.metalnessMap.value=v.metalnessMap,n(v.metalnessMap,_.metalnessMapTransform)),_.roughness.value=v.roughness,v.roughnessMap&&(_.roughnessMap.value=v.roughnessMap,n(v.roughnessMap,_.roughnessMapTransform)),e.get(v).envMap&&(_.envMapIntensity.value=v.envMapIntensity)}function p(_,v,S){_.ior.value=v.ior,v.sheen>0&&(_.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),_.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(_.sheenColorMap.value=v.sheenColorMap,n(v.sheenColorMap,_.sheenColorMapTransform)),v.sheenRoughnessMap&&(_.sheenRoughnessMap.value=v.sheenRoughnessMap,n(v.sheenRoughnessMap,_.sheenRoughnessMapTransform))),v.clearcoat>0&&(_.clearcoat.value=v.clearcoat,_.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(_.clearcoatMap.value=v.clearcoatMap,n(v.clearcoatMap,_.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,n(v.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(_.clearcoatNormalMap.value=v.clearcoatNormalMap,n(v.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===xa&&_.clearcoatNormalScale.value.negate())),v.iridescence>0&&(_.iridescence.value=v.iridescence,_.iridescenceIOR.value=v.iridescenceIOR,_.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(_.iridescenceMap.value=v.iridescenceMap,n(v.iridescenceMap,_.iridescenceMapTransform)),v.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=v.iridescenceThicknessMap,n(v.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),v.transmission>0&&(_.transmission.value=v.transmission,_.transmissionSamplerMap.value=S.texture,_.transmissionSamplerSize.value.set(S.width,S.height),v.transmissionMap&&(_.transmissionMap.value=v.transmissionMap,n(v.transmissionMap,_.transmissionMapTransform)),_.thickness.value=v.thickness,v.thicknessMap&&(_.thicknessMap.value=v.thicknessMap,n(v.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=v.attenuationDistance,_.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(_.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(_.anisotropyMap.value=v.anisotropyMap,n(v.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=v.specularIntensity,_.specularColor.value.copy(v.specularColor),v.specularColorMap&&(_.specularColorMap.value=v.specularColorMap,n(v.specularColorMap,_.specularColorMapTransform)),v.specularIntensityMap&&(_.specularIntensityMap.value=v.specularIntensityMap,n(v.specularIntensityMap,_.specularIntensityMapTransform))}function y(_,v){v.matcap&&(_.matcap.value=v.matcap)}function x(_,v){const S=e.get(v).light;_.referencePosition.value.setFromMatrixPosition(S.matrixWorld),_.nearDistance.value=S.shadow.camera.near,_.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function n2e(t,e,n,r){let i={},o={},a=[];const s=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(S,w){const E=w.program;r.uniformBlockBinding(S,E)}function u(S,w){let E=i[S.id];E===void 0&&(y(S),E=c(S),i[S.id]=E,S.addEventListener("dispose",_));const T=w.program;r.updateUBOMapping(S,T);const A=e.render.frame;o[S.id]!==A&&(d(S),o[S.id]=A)}function c(S){const w=f();S.__bindingPointIndex=w;const E=t.createBuffer(),T=S.__size,A=S.usage;return t.bindBuffer(t.UNIFORM_BUFFER,E),t.bufferData(t.UNIFORM_BUFFER,T,A),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,w,E),E}function f(){for(let S=0;S0){A=E%T;const G=T-A;A!==0&&G-N.boundary<0&&(E+=T-A,P.__offset=E)}E+=N.storage}return A=E%T,A>0&&(E+=T-A),S.__size=E,S.__cache={},this}function x(S){const w={boundary:0,storage:0};return typeof S=="number"?(w.boundary=4,w.storage=4):S.isVector2?(w.boundary=8,w.storage=8):S.isVector3||S.isColor?(w.boundary=16,w.storage=12):S.isVector4?(w.boundary=16,w.storage=16):S.isMatrix3?(w.boundary=48,w.storage=48):S.isMatrix4?(w.boundary=64,w.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),w}function _(S){const w=S.target;w.removeEventListener("dispose",_);const E=a.indexOf(w.__bindingPointIndex);a.splice(E,1),t.deleteBuffer(i[w.id]),delete i[w.id],delete o[w.id]}function v(){for(const S in i)t.deleteBuffer(i[S]);a=[],i={},o={}}return{bind:l,update:u,dispose:v}}class m4{constructor(e={}){const{canvas:n=WW(),context:r=null,depth:i=!0,stencil:o=!0,alpha:a=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let d;r!==null?d=r.getContextAttributes().alpha:d=a;const p=new Uint32Array(4),y=new Int32Array(4);let x=null,_=null;const v=[],S=[];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=zi,this._useLegacyLights=!1,this.toneMapping=ju,this.toneMappingExposure=1;const w=this;let E=!1,T=0,A=0,D=null,I=-1,P=null;const N=new rr,B=new rr;let G=null;const Z=new Pt(0);let j=0,J=n.width,Y=n.height,$=1,W=null,U=null;const ne=new rr(0,0,J,Y),re=new rr(0,0,J,Y);let ue=!1;const ce=new gC;let Ce=!1,Re=!1,Ie=null;const He=new yn,tt=new Je,Qe=new ae,ut={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Xe(){return D===null?$:1}let le=r;function De(K,_e){for(let Oe=0;Oe{function Et(){if(ke.forEach(function(Lt){we.get(Lt).currentProgram.isReady()&&ke.delete(Lt)}),ke.size===0){ze(K);return}setTimeout(Et,10)}Ee.get("KHR_parallel_shader_compile")!==null?Et():setTimeout(Et,10)})};let xn=null;function Zn(K){xn&&xn(K)}function Cr(){Sn.stop()}function sn(){Sn.start()}const Sn=new ZW;Sn.setAnimationLoop(Zn),typeof self<"u"&&Sn.setContext(self),this.setAnimationLoop=function(K){xn=K,ht.setAnimationLoop(K),K===null?Sn.stop():Sn.start()},ht.addEventListener("sessionstart",Cr),ht.addEventListener("sessionend",sn),this.render=function(K,_e){if(_e!==void 0&&_e.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;K.matrixWorldAutoUpdate===!0&&K.updateMatrixWorld(),_e.parent===null&&_e.matrixWorldAutoUpdate===!0&&_e.updateMatrixWorld(),ht.enabled===!0&&ht.isPresenting===!0&&(ht.cameraAutoUpdate===!0&&ht.updateCamera(_e),_e=ht.getCamera()),K.isScene===!0&&K.onBeforeRender(w,K,_e,D),_=de.get(K,S.length),_.init(),S.push(_),He.multiplyMatrices(_e.projectionMatrix,_e.matrixWorldInverse),ce.setFromProjectionMatrix(He),Re=this.localClippingEnabled,Ce=ve.init(this.clippingPlanes,Re),x=pe.get(K,v.length),x.init(),v.push(x),ur(K,_e,0,w.sortObjects),x.finish(),w.sortObjects===!0&&x.sort(W,U),this.info.render.frame++,Ce===!0&&ve.beginShadows();const Oe=_.state.shadowsArray;if(Se.render(Oe,K,_e),Ce===!0&&ve.endShadows(),this.info.autoReset===!0&&this.info.reset(),Pe.render(x,K),_.setupLights(w._useLegacyLights),_e.isArrayCamera){const ke=_e.cameras;for(let ze=0,Et=ke.length;ze0?_=S[S.length-1]:_=null,v.pop(),v.length>0?x=v[v.length-1]:x=null};function ur(K,_e,Oe,ke){if(K.visible===!1)return;if(K.layers.test(_e.layers)){if(K.isGroup)Oe=K.renderOrder;else if(K.isLOD)K.autoUpdate===!0&&K.update(_e);else if(K.isLight)_.pushLight(K),K.castShadow&&_.pushShadow(K);else if(K.isSprite){if(!K.frustumCulled||ce.intersectsSprite(K)){ke&&Qe.setFromMatrixPosition(K.matrixWorld).applyMatrix4(He);const Lt=F.update(K),Wt=K.material;Wt.visible&&x.push(K,Lt,Wt,Oe,Qe.z,null)}}else if((K.isMesh||K.isLine||K.isPoints)&&(!K.frustumCulled||ce.intersectsObject(K))){const Lt=F.update(K),Wt=K.material;if(ke&&(K.boundingSphere!==void 0?(K.boundingSphere===null&&K.computeBoundingSphere(),Qe.copy(K.boundingSphere.center)):(Lt.boundingSphere===null&&Lt.computeBoundingSphere(),Qe.copy(Lt.boundingSphere.center)),Qe.applyMatrix4(K.matrixWorld).applyMatrix4(He)),Array.isArray(Wt)){const vt=Lt.groups;for(let Ft=0,en=vt.length;Ft0&&Ea(ze,Et,_e,Oe),ke&&te.viewport(N.copy(ke)),ze.length>0&&Ka(ze,_e,Oe),Et.length>0&&Ka(Et,_e,Oe),Lt.length>0&&Ka(Lt,_e,Oe),te.buffers.depth.setTest(!0),te.buffers.depth.setMask(!0),te.buffers.color.setMask(!0),te.setPolygonOffset(!1)}function Ea(K,_e,Oe,ke){if((Oe.isScene===!0?Oe.overrideMaterial:null)!==null)return;const Et=X.isWebGL2;Ie===null&&(Ie=new au(1,1,{generateMipmaps:!0,type:Ee.has("EXT_color_buffer_half_float")?Up:Ps,minFilter:Bd,samples:Et?4:0})),w.getDrawingBufferSize(tt),Et?Ie.setSize(tt.x,tt.y):Ie.setSize(m2(tt.x),m2(tt.y));const Lt=w.getRenderTarget();w.setRenderTarget(Ie),w.getClearColor(Z),j=w.getClearAlpha(),j<1&&w.setClearColor(16777215,.5),w.clear();const Wt=w.toneMapping;w.toneMapping=ju,Ka(K,Oe,ke),Ne.updateMultisampleRenderTarget(Ie),Ne.updateRenderTargetMipmap(Ie);let vt=!1;for(let Ft=0,en=_e.length;Ft0),Zt=!!Oe.morphAttributes.position,Xn=!!Oe.morphAttributes.normal,Qr=!!Oe.morphAttributes.color;let cr=ju;ke.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(cr=w.toneMapping);const Si=Oe.morphAttributes.position||Oe.morphAttributes.normal||Oe.morphAttributes.color,tn=Si!==void 0?Si.length:0,It=we.get(ke),Ma=_.state.lights;if(Ce===!0&&(Re===!0||K!==P)){const Mi=K===P&&ke.id===I;ve.setState(ke,K,Mi)}let Nn=!1;ke.version===It.__version?(It.needsLights&&It.lightsStateVersion!==Ma.state.version||It.outputColorSpace!==Wt||ze.isInstancedMesh&&It.instancing===!1||!ze.isInstancedMesh&&It.instancing===!0||ze.isSkinnedMesh&&It.skinning===!1||!ze.isSkinnedMesh&&It.skinning===!0||ze.isInstancedMesh&&It.instancingColor===!0&&ze.instanceColor===null||ze.isInstancedMesh&&It.instancingColor===!1&&ze.instanceColor!==null||It.envMap!==vt||ke.fog===!0&&It.fog!==Et||It.numClippingPlanes!==void 0&&(It.numClippingPlanes!==ve.numPlanes||It.numIntersection!==ve.numIntersection)||It.vertexAlphas!==Ft||It.vertexTangents!==en||It.morphTargets!==Zt||It.morphNormals!==Xn||It.morphColors!==Qr||It.toneMapping!==cr||X.isWebGL2===!0&&It.morphTargetsCount!==tn)&&(Nn=!0):(Nn=!0,It.__version=ke.version);let Ar=It.currentProgram;Nn===!0&&(Ar=Zo(ke,_e,ze));let Za=!1,No=!1,Ei=!1;const $r=Ar.getUniforms(),Qo=It.uniforms;if(te.useProgram(Ar.program)&&(Za=!0,No=!0,Ei=!0),ke.id!==I&&(I=ke.id,No=!0),Za||P!==K){$r.setValue(le,"projectionMatrix",K.projectionMatrix),$r.setValue(le,"viewMatrix",K.matrixWorldInverse);const Mi=$r.map.cameraPosition;Mi!==void 0&&Mi.setValue(le,Qe.setFromMatrixPosition(K.matrixWorld)),X.logarithmicDepthBuffer&&$r.setValue(le,"logDepthBufFC",2/(Math.log(K.far+1)/Math.LN2)),(ke.isMeshPhongMaterial||ke.isMeshToonMaterial||ke.isMeshLambertMaterial||ke.isMeshBasicMaterial||ke.isMeshStandardMaterial||ke.isShaderMaterial)&&$r.setValue(le,"isOrthographic",K.isOrthographicCamera===!0),P!==K&&(P=K,No=!0,Ei=!0)}if(ze.isSkinnedMesh){$r.setOptional(le,ze,"bindMatrix"),$r.setOptional(le,ze,"bindMatrixInverse");const Mi=ze.skeleton;Mi&&(X.floatVertexTextures?(Mi.boneTexture===null&&Mi.computeBoneTexture(),$r.setValue(le,"boneTexture",Mi.boneTexture,Ne),$r.setValue(le,"boneTextureSize",Mi.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const sc=Oe.morphAttributes;if((sc.position!==void 0||sc.normal!==void 0||sc.color!==void 0&&X.isWebGL2===!0)&&Be.update(ze,Oe,Ar),(No||It.receiveShadow!==ze.receiveShadow)&&(It.receiveShadow=ze.receiveShadow,$r.setValue(le,"receiveShadow",ze.receiveShadow)),ke.isMeshGouraudMaterial&&ke.envMap!==null&&(Qo.envMap.value=vt,Qo.flipEnvMap.value=vt.isCubeTexture&&vt.isRenderTargetTexture===!1?-1:1),No&&($r.setValue(le,"toneMappingExposure",w.toneMappingExposure),It.needsLights&&Ge(Qo,Ei),Et&&ke.fog===!0&&ge.refreshFogUniforms(Qo,Et),ge.refreshMaterialUniforms(Qo,ke,$,Y,Ie),uE.upload(le,Po(It),Qo,Ne)),ke.isShaderMaterial&&ke.uniformsNeedUpdate===!0&&(uE.upload(le,Po(It),Qo,Ne),ke.uniformsNeedUpdate=!1),ke.isSpriteMaterial&&$r.setValue(le,"center",ze.center),$r.setValue(le,"modelViewMatrix",ze.modelViewMatrix),$r.setValue(le,"normalMatrix",ze.normalMatrix),$r.setValue(le,"modelMatrix",ze.matrixWorld),ke.isShaderMaterial||ke.isRawShaderMaterial){const Mi=ke.uniformsGroups;for(let lc=0,Oo=Mi.length;lc0&&Ne.useMultisampledRTT(K)===!1?ze=we.get(K).__webglMultisampledFramebuffer:Array.isArray(en)?ze=en[Oe]:ze=en,N.copy(K.viewport),B.copy(K.scissor),G=K.scissorTest}else N.copy(ne).multiplyScalar($).floor(),B.copy(re).multiplyScalar($).floor(),G=ue;if(te.bindFramebuffer(le.FRAMEBUFFER,ze)&&X.drawBuffers&&ke&&te.drawBuffers(K,ze),te.viewport(N),te.scissor(B),te.setScissorTest(G),Et){const vt=we.get(K.texture);le.framebufferTexture2D(le.FRAMEBUFFER,le.COLOR_ATTACHMENT0,le.TEXTURE_CUBE_MAP_POSITIVE_X+_e,vt.__webglTexture,Oe)}else if(Lt){const vt=we.get(K.texture),Ft=_e||0;le.framebufferTextureLayer(le.FRAMEBUFFER,le.COLOR_ATTACHMENT0,vt.__webglTexture,Oe||0,Ft)}I=-1},this.readRenderTargetPixels=function(K,_e,Oe,ke,ze,Et,Lt){if(!(K&&K.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Wt=we.get(K).__webglFramebuffer;if(K.isWebGLCubeRenderTarget&&Lt!==void 0&&(Wt=Wt[Lt]),Wt){te.bindFramebuffer(le.FRAMEBUFFER,Wt);try{const vt=K.texture,Ft=vt.format,en=vt.type;if(Ft!==ga&&xt.convert(Ft)!==le.getParameter(le.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Zt=en===Up&&(Ee.has("EXT_color_buffer_half_float")||X.isWebGL2&&Ee.has("EXT_color_buffer_float"));if(en!==Ps&&xt.convert(en)!==le.getParameter(le.IMPLEMENTATION_COLOR_READ_TYPE)&&!(en===Zl&&(X.isWebGL2||Ee.has("OES_texture_float")||Ee.has("WEBGL_color_buffer_float")))&&!Zt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}_e>=0&&_e<=K.width-ke&&Oe>=0&&Oe<=K.height-ze&&le.readPixels(_e,Oe,ke,ze,xt.convert(Ft),xt.convert(en),Et)}finally{const vt=D!==null?we.get(D).__webglFramebuffer:null;te.bindFramebuffer(le.FRAMEBUFFER,vt)}}},this.copyFramebufferToTexture=function(K,_e,Oe=0){const ke=Math.pow(2,-Oe),ze=Math.floor(_e.image.width*ke),Et=Math.floor(_e.image.height*ke);Ne.setTexture2D(_e,0),le.copyTexSubImage2D(le.TEXTURE_2D,Oe,0,0,K.x,K.y,ze,Et),te.unbindTexture()},this.copyTextureToTexture=function(K,_e,Oe,ke=0){const ze=_e.image.width,Et=_e.image.height,Lt=xt.convert(Oe.format),Wt=xt.convert(Oe.type);Ne.setTexture2D(Oe,0),le.pixelStorei(le.UNPACK_FLIP_Y_WEBGL,Oe.flipY),le.pixelStorei(le.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Oe.premultiplyAlpha),le.pixelStorei(le.UNPACK_ALIGNMENT,Oe.unpackAlignment),_e.isDataTexture?le.texSubImage2D(le.TEXTURE_2D,ke,K.x,K.y,ze,Et,Lt,Wt,_e.image.data):_e.isCompressedTexture?le.compressedTexSubImage2D(le.TEXTURE_2D,ke,K.x,K.y,_e.mipmaps[0].width,_e.mipmaps[0].height,Lt,_e.mipmaps[0].data):le.texSubImage2D(le.TEXTURE_2D,ke,K.x,K.y,Lt,Wt,_e.image),ke===0&&Oe.generateMipmaps&&le.generateMipmap(le.TEXTURE_2D),te.unbindTexture()},this.copyTextureToTexture3D=function(K,_e,Oe,ke,ze=0){if(w.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Et=K.max.x-K.min.x+1,Lt=K.max.y-K.min.y+1,Wt=K.max.z-K.min.z+1,vt=xt.convert(ke.format),Ft=xt.convert(ke.type);let en;if(ke.isData3DTexture)Ne.setTexture3D(ke,0),en=le.TEXTURE_3D;else if(ke.isDataArrayTexture)Ne.setTexture2DArray(ke,0),en=le.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}le.pixelStorei(le.UNPACK_FLIP_Y_WEBGL,ke.flipY),le.pixelStorei(le.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ke.premultiplyAlpha),le.pixelStorei(le.UNPACK_ALIGNMENT,ke.unpackAlignment);const Zt=le.getParameter(le.UNPACK_ROW_LENGTH),Xn=le.getParameter(le.UNPACK_IMAGE_HEIGHT),Qr=le.getParameter(le.UNPACK_SKIP_PIXELS),cr=le.getParameter(le.UNPACK_SKIP_ROWS),Si=le.getParameter(le.UNPACK_SKIP_IMAGES),tn=Oe.isCompressedTexture?Oe.mipmaps[0]:Oe.image;le.pixelStorei(le.UNPACK_ROW_LENGTH,tn.width),le.pixelStorei(le.UNPACK_IMAGE_HEIGHT,tn.height),le.pixelStorei(le.UNPACK_SKIP_PIXELS,K.min.x),le.pixelStorei(le.UNPACK_SKIP_ROWS,K.min.y),le.pixelStorei(le.UNPACK_SKIP_IMAGES,K.min.z),Oe.isDataTexture||Oe.isData3DTexture?le.texSubImage3D(en,ze,_e.x,_e.y,_e.z,Et,Lt,Wt,vt,Ft,tn.data):Oe.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),le.compressedTexSubImage3D(en,ze,_e.x,_e.y,_e.z,Et,Lt,Wt,vt,tn.data)):le.texSubImage3D(en,ze,_e.x,_e.y,_e.z,Et,Lt,Wt,vt,Ft,tn),le.pixelStorei(le.UNPACK_ROW_LENGTH,Zt),le.pixelStorei(le.UNPACK_IMAGE_HEIGHT,Xn),le.pixelStorei(le.UNPACK_SKIP_PIXELS,Qr),le.pixelStorei(le.UNPACK_SKIP_ROWS,cr),le.pixelStorei(le.UNPACK_SKIP_IMAGES,Si),ze===0&&ke.generateMipmaps&&le.generateMipmap(en),te.unbindTexture()},this.initTexture=function(K){K.isCubeTexture?Ne.setTextureCube(K,0):K.isData3DTexture?Ne.setTexture3D(K,0):K.isDataArrayTexture||K.isCompressedArrayTexture?Ne.setTexture2DArray(K,0):Ne.setTexture2D(K,0),te.unbindTexture()},this.resetState=function(){T=0,A=0,D=null,te.reset(),yt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Bu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===pC?"display-p3":"srgb",n.unpackColorSpace=ar.workingColorSpace===_b?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===zi?Ad:a4}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Ad?zi:ec}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class oG extends m4{}oG.prototype.isWebGL1Renderer=!0;class yC{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new Pt(e),this.density=n}clone(){return new yC(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class xC{constructor(e,n=1,r=1e3){this.isFog=!0,this.name="",this.color=new Pt(e),this.near=n,this.far=r}clone(){return new xC(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class g2 extends Kn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,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,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}}class bC{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=Ox,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ns()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;ie.far||n.push({distance:l,point:Uy.clone(),uv:Fa.getInterpolation(Uy,Yw,$y,Kw,r6,d3,i6,new Je),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 Zw(t,e,n,r,i,o){x0.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(zy.x=o*x0.x-i*x0.y,zy.y=i*x0.x+o*x0.y):zy.copy(x0),t.copy(e),t.x+=zy.x,t.y+=zy.y,t.applyMatrix4(aG)}const Jw=new ae,o6=new ae;class lG extends Kn{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){Jw.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Jw);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){Jw.setFromMatrixPosition(e.matrixWorld),o6.setFromMatrixPosition(this.matrixWorld);const r=Jw.distanceTo(o6)/e.zoom;n[0].object.visible=!0;let i,o;for(i=1,o=n.length;i=a)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(d);Ie.far||n.push({distance:I,point:f.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,a.start),S=Math.min(_.count,a.start+a.count);for(let w=v,E=S-1;wl)continue;d.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(d);Ae.far||n.push({distance:A,point:f.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;oi.far)return;o.push({distance:u,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,object:a})}}class a2e extends hi{constructor(e,n,r,i,o,a,s,l,u){super(e,n,r,i,o,a,s,l,u),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:wi,this.magFilter=o!==void 0?o:wi,this.generateMipmaps=!1;const c=this;function f(){c.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class s2e extends hi{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=ci,this.minFilter=ci,this.generateMipmaps=!1,this.needsUpdate=!0}}class wC extends hi{constructor(e,n,r,i,o,a,s,l,u,c,f,d){super(null,a,s,l,u,c,i,o,f,d),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class l2e extends wC{constructor(e,n,r,i,o,a){super(e,n,r,o,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=so}}class u2e extends wC{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,of),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class c2e extends hi{constructor(e,n,r,i,o,a,s,l,u){super(e,n,r,i,o,a,s,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class uu{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 a=1;a<=e;a++)r=this.getPoint(a/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 a;n?a=n:a=e*r[o-1];let s=0,l=o-1,u;for(;s<=l;)if(i=Math.floor(s+(l-s)/2),u=r[i]-a,u<0)s=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===a)return i/(o-1);const c=r[i],d=r[i+1]-c,p=(a-c)/d;return(i+p)/(o-1)}getTangent(e,n){let i=e-1e-4,o=e+1e-4;i<0&&(i=0),o>1&&(o=1);const a=this.getPoint(i),s=this.getPoint(o),l=n||(a.isVector2?new Je:new ae);return l.copy(s).sub(a).normalize(),l}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n){const r=new ae,i=[],o=[],a=[],s=new ae,l=new yn;for(let p=0;p<=e;p++){const y=p/e;i[p]=this.getTangentAt(y,new ae)}o[0]=new ae,a[0]=new ae;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),f=Math.abs(i[0].y),d=Math.abs(i[0].z);c<=u&&(u=c,r.set(1,0,0)),f<=u&&(u=f,r.set(0,1,0)),d<=u&&r.set(0,0,1),s.crossVectors(i[0],r).normalize(),o[0].crossVectors(i[0],s),a[0].crossVectors(i[0],o[0]);for(let p=1;p<=e;p++){if(o[p]=o[p-1].clone(),a[p]=a[p-1].clone(),s.crossVectors(i[p-1],i[p]),s.length()>Number.EPSILON){s.normalize();const y=Math.acos(fi(i[p-1].dot(i[p]),-1,1));o[p].applyMatrix4(l.makeRotationAxis(s,y))}a[p].crossVectors(i[p],o[p])}if(n===!0){let p=Math.acos(fi(o[0].dot(o[e]),-1,1));p/=e,i[0].dot(s.crossVectors(o[0],o[e]))>0&&(p=-p);for(let y=1;y<=e;y++)o[y].applyMatrix4(l.makeRotationAxis(i[y],p*y)),a[y].crossVectors(i[y],o[y])}return{tangents:i,normals:o,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class SC extends uu{constructor(e=0,n=0,r=1,i=1,o=0,a=Math.PI*2,s=!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=a,this.aClockwise=s,this.aRotation=l}getPoint(e,n){const r=n||new Je,i=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const a=Math.abs(o)i;)o-=i;o0?0:(Math.floor(Math.abs(s)/o)+1)*o:l===0&&s===o-1&&(s=o-2,l=1);let u,c;this.closed||s>0?u=i[(s-1)%o]:(iS.subVectors(i[0],i[1]).add(i[0]),u=iS);const f=i[s%o],d=i[(s+1)%o];if(this.closed||s+2i.length-2?i.length-1:a+1],f=i[a>i.length-3?i.length-1:a+2];return r.set(_6(s,l.x,u.x,c.x,f.x),_6(s,l.y,u.y,c.y,f.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n=r){const a=i[o]-r,s=this.curves[o],l=s.getLength(),u=l===0?0:1-a/l;return s.getPointAt(u,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=u.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Ab extends Ln{constructor(e=[new Je(0,-.5),new Je(.5,0),new Je(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=fi(i,0,Math.PI*2);const o=[],a=[],s=[],l=[],u=[],c=1/n,f=new ae,d=new Je,p=new ae,y=new ae,x=new ae;let _=0,v=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:_=e[S+1].x-e[S].x,v=e[S+1].y-e[S].y,p.x=v*1,p.y=-_,p.z=v*0,x.copy(p),p.normalize(),l.push(p.x,p.y,p.z);break;case e.length-1:l.push(x.x,x.y,x.z);break;default:_=e[S+1].x-e[S].x,v=e[S+1].y-e[S].y,p.x=v*1,p.y=-_,p.z=v*0,y.copy(p),p.x+=x.x,p.y+=x.y,p.z+=x.z,p.normalize(),l.push(p.x,p.y,p.z),x.copy(y)}for(let S=0;S<=n;S++){const w=r+S*c*i,E=Math.sin(w),T=Math.cos(w);for(let A=0;A<=e.length-1;A++){f.x=e[A].x*E,f.y=e[A].y,f.z=e[A].x*T,a.push(f.x,f.y,f.z),d.x=S/n,d.y=A/(e.length-1),s.push(d.x,d.y);const D=l[3*A+0]*E,I=l[3*A+1],P=l[3*A+0]*T;u.push(D,I,P)}}for(let S=0;S0&&w(!0),n>0&&w(!1)),this.setIndex(c),this.setAttribute("position",new Ut(f,3)),this.setAttribute("normal",new Ut(d,3)),this.setAttribute("uv",new Ut(p,2));function S(){const E=new ae,T=new ae;let A=0;const D=(n-e)/r;for(let I=0;I<=o;I++){const P=[],N=I/o,B=N*(n-e)+e;for(let G=0;G<=i;G++){const Z=G/i,j=Z*l+s,J=Math.sin(j),Y=Math.cos(j);T.x=B*J,T.y=-N*r+_,T.z=B*Y,f.push(T.x,T.y,T.z),E.set(J,D,Y).normalize(),d.push(E.x,E.y,E.z),p.push(Z,1-N),P.push(y++)}x.push(P)}for(let I=0;I.9&&D<.1&&(w<.2&&(a[S+0]+=1),E<.2&&(a[S+2]+=1),T<.2&&(a[S+4]+=1))}}function d(S){o.push(S.x,S.y,S.z)}function p(S,w){const E=S*3;w.x=e[E+0],w.y=e[E+1],w.z=e[E+2]}function y(){const S=new ae,w=new ae,E=new ae,T=new ae,A=new Je,D=new Je,I=new Je;for(let P=0,N=0;P80*n){s=u=t[0],l=c=t[1];for(let y=n;yu&&(u=f),d>c&&(c=d);p=Math.max(u-s,c-l),p=p!==0?32767/p:0}return kx(o,a,n,s,l,p,0),a}};function xG(t,e,n,r,i){let o,a;if(i===I2e(t,e,n,r)>0)for(o=e;o=e;o-=r)a=w6(o,t[o],t[o+1],a);return a&&TC(a,a.next)&&(Ux(a),a=a.next),a}function Hp(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(TC(n,n.next)||Yr(n.prev,n,n.next)===0)){if(Ux(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function kx(t,e,n,r,i,o,a){if(!t)return;!a&&o&&T2e(t,r,i,o);let s=t,l,u;for(;t.prev!==t.next;){if(l=t.prev,u=t.next,o?b2e(t,r,i,o):x2e(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),Ux(t),t=u.next,s=u.next;continue}if(t=u,t===s){a?a===1?(t=_2e(Hp(t),e,n),kx(t,e,n,r,i,o,2)):a===2&&w2e(t,e,n,r,i,o):kx(Hp(t),e,n,r,i,o,1);break}}}function x2e(t){const e=t.prev,n=t,r=t.next;if(Yr(e,n,r)>=0)return!1;const i=e.x,o=n.x,a=r.x,s=e.y,l=n.y,u=r.y,c=io?i>a?i:a:o>a?o:a,p=s>l?s>u?s:u:l>u?l:u;let y=r.next;for(;y!==e;){if(y.x>=c&&y.x<=d&&y.y>=f&&y.y<=p&&hg(i,s,o,l,a,u,y.x,y.y)&&Yr(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function b2e(t,e,n,r){const i=t.prev,o=t,a=t.next;if(Yr(i,o,a)>=0)return!1;const s=i.x,l=o.x,u=a.x,c=i.y,f=o.y,d=a.y,p=sl?s>u?s:u:l>u?l:u,_=c>f?c>d?c:d:f>d?f:d,v=gP(p,y,e,n,r),S=gP(x,_,e,n,r);let w=t.prevZ,E=t.nextZ;for(;w&&w.z>=v&&E&&E.z<=S;){if(w.x>=p&&w.x<=x&&w.y>=y&&w.y<=_&&w!==i&&w!==a&&hg(s,c,l,f,u,d,w.x,w.y)&&Yr(w.prev,w,w.next)>=0||(w=w.prevZ,E.x>=p&&E.x<=x&&E.y>=y&&E.y<=_&&E!==i&&E!==a&&hg(s,c,l,f,u,d,E.x,E.y)&&Yr(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;w&&w.z>=v;){if(w.x>=p&&w.x<=x&&w.y>=y&&w.y<=_&&w!==i&&w!==a&&hg(s,c,l,f,u,d,w.x,w.y)&&Yr(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;E&&E.z<=S;){if(E.x>=p&&E.x<=x&&E.y>=y&&E.y<=_&&E!==i&&E!==a&&hg(s,c,l,f,u,d,E.x,E.y)&&Yr(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function _2e(t,e,n){let r=t;do{const i=r.prev,o=r.next.next;!TC(i,o)&&bG(i,r,r.next,o)&&Bx(i,o)&&Bx(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),Ux(r),Ux(r.next),r=t=o),r=r.next}while(r!==t);return Hp(r)}function w2e(t,e,n,r,i,o){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&P2e(a,s)){let l=_G(a,s);a=Hp(a,a.next),l=Hp(l,l.next),kx(a,e,n,r,i,o,0),kx(l,e,n,r,i,o,0);return}s=s.next}a=a.next}while(a!==t)}function S2e(t,e,n,r){const i=[];let o,a,s,l,u;for(o=0,a=e.length;o=n.next.y&&n.next.y!==n.y){const d=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=o&&d>r&&(r=d,i=n.x=n.x&&n.x>=l&&o!==n.x&&hg(ai.x||n.x===i.x&&A2e(i,n)))&&(i=n,c=f)),n=n.next;while(n!==s);return i}function A2e(t,e){return Yr(t.prev,t,e.prev)<0&&Yr(e.next,t,t.next)<0}function T2e(t,e,n,r){let i=t;do i.z===0&&(i.z=gP(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,D2e(i)}function D2e(t){let e,n,r,i,o,a,s,l,u=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||l>0&&r;)s!==0&&(l===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1);return t}function gP(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 R2e(t){let e=t,n=t;do(e.x=(t-a)*(o-s)&&(t-a)*(r-s)>=(n-a)*(e-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function P2e(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!N2e(t,e)&&(Bx(t,e)&&Bx(e,t)&&O2e(t,e)&&(Yr(t.prev,t,e.prev)||Yr(t,e.prev,e))||TC(t,e)&&Yr(t.prev,t,t.next)>0&&Yr(e.prev,e,e.next)>0)}function Yr(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function TC(t,e){return t.x===e.x&&t.y===e.y}function bG(t,e,n,r){const i=uS(Yr(t,e,n)),o=uS(Yr(t,e,r)),a=uS(Yr(n,r,t)),s=uS(Yr(n,r,e));return!!(i!==o&&a!==s||i===0&&lS(t,n,e)||o===0&&lS(t,r,e)||a===0&&lS(n,t,r)||s===0&&lS(n,e,r))}function lS(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 uS(t){return t>0?1:t<0?-1:0}function N2e(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&&bG(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Bx(t,e){return Yr(t.prev,t,t.next)<0?Yr(t,e,t.next)>=0&&Yr(t,t.prev,e)>=0:Yr(t,e,t.prev)<0||Yr(t,t.next,e)<0}function O2e(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 _G(t,e){const n=new vP(t.i,t.x,t.y),r=new vP(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 w6(t,e,n,r){const i=new vP(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 Ux(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 vP(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 I2e(t,e,n,r){let i=0;for(let o=e,a=n-r;o2&&t[e-1].equals(t[0])&&t.pop()}function E6(t,e){for(let n=0;nNumber.EPSILON){const F=Math.sqrt(st),oe=Math.sqrt(Ue*Ue+We*We),ge=De.x-Ne/F,pe=De.y+we/F,de=Ee.x-We/oe,ve=Ee.y+Ue/oe,Se=((de-ge)*We-(ve-pe)*Ue)/(we*We-Ne*Ue);X=ge+we*Se-le.x,te=pe+Ne*Se-le.y;const Pe=X*X+te*te;if(Pe<=2)return new Je(X,te);me=Math.sqrt(Pe/2)}else{let F=!1;we>Number.EPSILON?Ue>Number.EPSILON&&(F=!0):we<-Number.EPSILON?Ue<-Number.EPSILON&&(F=!0):Math.sign(Ne)===Math.sign(We)&&(F=!0),F?(X=-Ne,te=we,me=Math.sqrt(st)):(X=we,te=Ne,me=Math.sqrt(st/2))}return new Je(X/me,te/me)}const U=[];for(let le=0,De=j.length,Ee=De-1,X=le+1;le=0;le--){const De=le/_,Ee=p*Math.cos(De*Math.PI/2),X=y*Math.sin(De*Math.PI/2)+x;for(let te=0,me=j.length;te=0;){const X=Ee;let te=Ee-1;te<0&&(te=le.length-1);for(let me=0,we=c+_*2;me0)&&p.push(w,E,A),(v!==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 sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class CG extends To{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Pt(16777215),this.specular=new Pt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jd,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=xb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class AG extends To{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Pt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jd,this.normalScale=new Je(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 TG extends To{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jd,this.normalScale=new Je(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 DG extends To{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jd,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=xb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class RG extends To{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Pt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jd,this.normalScale=new Je(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 PG extends wa{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 pp(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 NG(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function OG(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 yP(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,a=0;a!==r;++o){const s=n[o]*e;for(let l=0;l!==e;++l)i[a++]=t[s+l]}return i}function C4(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 a=o[r];if(a!==void 0)if(Array.isArray(a))do a=o[r],a!==void 0&&(e.push(o.time),n.push.apply(n,a)),o=t[i++];while(o!==void 0);else if(a.toArray!==void 0)do a=o[r],a!==void 0&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do a=o[r],a!==void 0&&(e.push(o.time),n.push(a)),o=t[i++];while(o!==void 0)}function B2e(t,e,n,r,i=30){const o=t.clone();o.name=e;const a=[];for(let l=0;l=r)){f.push(u.times[p]);for(let x=0;xo.tracks[l].times[0]&&(s=o.tracks[l].times[0]);for(let l=0;l=s.times[y]){const v=y*f+c,S=v+f-c;x=s.values.slice(v,S)}else{const v=s.createInterpolant(),S=c,w=f-c;v.evaluate(o),x=v.resultBuffer.slice(S,w)}l==="quaternion"&&new Wa().fromArray(x).normalize().conjugate().toArray(x);const _=u.times.length;for(let v=0;v<_;++v){const S=v*p+d;if(l==="quaternion")Wa.multiplyQuaternionsFlat(u.values,S,x,0,u.values,S);else{const w=p-d*2;for(let E=0;E=o)){const s=n[1];e=o)break t}a=r,r=0;break n}break e}for(;r>>1;en;)--a;if(++a,o!==0||a!==i){o>=a&&(a=Math.max(a,1),o=a-1);const s=this.getValueSize();this.times=r.slice(o,a),this.values=this.values.slice(o*s,a*s)}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 a=null;for(let s=0;s!==o;s++){const l=r[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,a),e=!1;break}a=l}if(i!==void 0&&NG(i))for(let s=0,l=i.length;s!==l;++s){const u=i[s];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===lE,o=e.length-1;let a=1;for(let s=1;s0){e[a]=e[o];for(let s=o*r,l=a*r,u=0;u!==r;++u)n[l+u]=n[s+u];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*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}}cu.prototype.TimeBufferType=Float32Array;cu.prototype.ValueBufferType=Float32Array;cu.prototype.DefaultInterpolation=Tx;class Zp extends cu{}Zp.prototype.ValueTypeName="bool";Zp.prototype.ValueBufferType=Array;Zp.prototype.DefaultInterpolation=Ax;Zp.prototype.InterpolantFactoryMethodLinear=void 0;Zp.prototype.InterpolantFactoryMethodSmooth=void 0;class T4 extends cu{}T4.prototype.ValueTypeName="color";class zx extends cu{}zx.prototype.ValueTypeName="number";class FG extends Rb{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=(r-n)/(i-n);let u=e*s;for(let c=u+s;u!==c;u+=4)Wa.slerpFlat(o,0,a,u-s,a,u,l);return o}}class yv extends cu{InterpolantFactoryMethodLinear(e){return new FG(this.times,this.values,this.getValueSize(),e)}}yv.prototype.ValueTypeName="quaternion";yv.prototype.DefaultInterpolation=Tx;yv.prototype.InterpolantFactoryMethodSmooth=void 0;class Jp extends cu{}Jp.prototype.ValueTypeName="string";Jp.prototype.ValueBufferType=Array;Jp.prototype.DefaultInterpolation=Ax;Jp.prototype.InterpolantFactoryMethodLinear=void 0;Jp.prototype.InterpolantFactoryMethodSmooth=void 0;class $x extends cu{}$x.prototype.ValueTypeName="vector";class Hx{constructor(e,n=-1,r,i=hC){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Ns(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let a=0,s=r.length;a!==s;++a)n.push(H2e(r[a]).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,a=r.length;o!==a;++o)n.push(cu.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,a=[];for(let s=0;s1){const f=c[1];let d=i[f];d||(i[f]=d=[]),d.push(u)}}const a=[];for(const s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],n,r));return a}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(f,d,p,y,x){if(p.length!==0){const _=[],v=[];C4(p,_,v,y),_.length!==0&&x.push(new f(d,_,v))}},i=[],o=e.name||"default",a=e.fps||30,s=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let f=0;f{n&&n(o),this.manager.itemEnd(e)},0),o;if(Pc[e]!==void 0){Pc[e].push({onLoad:n,onProgress:r,onError:i});return}Pc[e]=[],Pc[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const c=Pc[e],f=u.body.getReader(),d=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),p=d?parseInt(d):0,y=p!==0;let x=0;const _=new ReadableStream({start(v){S();function S(){f.read().then(({done:w,value:E})=>{if(w)v.close();else{x+=E.byteLength;const T=new ProgressEvent("progress",{lengthComputable:y,loaded:x,total:p});for(let A=0,D=c.length;A{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,s));case"json":return u.json();default:if(s===void 0)return u.text();{const f=/charset="?([^;"\s]*)"?/i.exec(s),d=f&&f[1]?f[1].toLowerCase():void 0,p=new TextDecoder(d);return u.arrayBuffer().then(y=>p.decode(y))}}}).then(u=>{Vp.add(e,u);const c=Pc[e];delete Pc[e];for(let f=0,d=c.length;f{const c=Pc[e];if(c===void 0)throw this.manager.itemError(e),u;delete Pc[e];for(let f=0,d=c.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class W2e extends qa{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new sf(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(s){try{n(o.parse(JSON.parse(s)))}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 a=e.uniforms[o];switch(i.uniforms[o]={},a.type){case"t":i.uniforms[o].value=r(a.value);break;case"c":i.uniforms[o].value=new Pt().setHex(a.value);break;case"v2":i.uniforms[o].value=new Je().fromArray(a.value);break;case"v3":i.uniforms[o].value=new ae().fromArray(a.value);break;case"v4":i.uniforms[o].value=new rr().fromArray(a.value);break;case"m3":i.uniforms[o].value=new In().fromArray(a.value);break;case"m4":i.uniforms[o].value=new yn().fromArray(a.value);break;default:i.uniforms[o].value=a.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 Je().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.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 Je().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}static createMaterialFromType(e){const n={ShadowMaterial:SG,SpriteMaterial:g4,RawShaderMaterial:EG,ShaderMaterial:tc,PointsMaterial:y4,MeshPhysicalMaterial:MG,MeshStandardMaterial:M4,MeshPhongMaterial:CG,MeshToonMaterial:AG,MeshNormalMaterial:TG,MeshLambertMaterial:DG,MeshDepthMaterial:h4,MeshDistanceMaterial:p4,MeshBasicMaterial:Qd,MeshMatcapMaterial:RG,LineDashedMaterial:PG,LineBasicMaterial:wa,Material:To};return new n[e]}}class xP{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let r=0,i=e.length;r0){const l=new D4(n);o=new Vx(l),o.setCrossOrigin(this.crossOrigin);for(let u=0,c=e.length;u0){i=new Vx(this.manager),i.setCrossOrigin(this.crossOrigin);for(let a=0,s=e.length;a"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,a=Vp.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader,fetch(e,s).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(l){Vp.add(e,l),n&&n(l),o.manager.itemEnd(e)}).catch(function(l){i&&i(l),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}let cS;class P4{static getContext(){return cS===void 0&&(cS=new(window.AudioContext||window.webkitAudioContext)),cS}static setContext(e){cS=e}}class tMe extends qa{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new sf(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){try{const u=l.slice(0);P4.getContext().decodeAudioData(u,function(f){n(f)},s)}catch(u){s(u)}},r,i);function s(l){i?i(l):console.error(l),o.manager.itemError(e)}}}const N6=new yn,O6=new yn,Wh=new yn;class nMe{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ao,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ao,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,Wh.copy(e.projectionMatrix);const i=n.eyeSep/2,o=i*n.near/n.focus,a=n.near*Math.tan(Ep*n.fov*.5)/n.zoom;let s,l;O6.elements[12]=-i,N6.elements[12]=i,s=-a*n.aspect+o,l=a*n.aspect+o,Wh.elements[0]=2*n.near/(l-s),Wh.elements[8]=(l+s)/(l-s),this.cameraL.projectionMatrix.copy(Wh),s=-a*n.aspect-o,l=a*n.aspect-o,Wh.elements[0]=2*n.near/(l-s),Wh.elements[8]=(l+s)/(l-s),this.cameraR.projectionMatrix.copy(Wh)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(O6),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(N6)}}class N4{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=I6(),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=I6();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function I6(){return(typeof performance>"u"?Date:performance).now()}const Gh=new ae,L6=new Wa,rMe=new ae,jh=new ae;class iMe extends Kn{constructor(){super(),this.type="AudioListener",this.context=P4.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new N4}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(Gh,L6,rMe),jh.set(0,0,-1).applyQuaternion(L6),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(Gh.x,i),n.positionY.linearRampToValueAtTime(Gh.y,i),n.positionZ.linearRampToValueAtTime(Gh.z,i),n.forwardX.linearRampToValueAtTime(jh.x,i),n.forwardY.linearRampToValueAtTime(jh.y,i),n.forwardZ.linearRampToValueAtTime(jh.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(Gh.x,Gh.y,Gh.z),n.setOrientation(jh.x,jh.y,jh.z,r.x,r.y,r.z)}}class XG extends Kn{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(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,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,u=n+n;l!==u;++l)if(r[l]!==r[l+n]){s.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,a=i;o!==a;++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 a=0;a!==o;++a)e[n+a]=e[r+a]}_slerp(e,n,r,i){Wa.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,o){const a=this._workIndex*o;Wa.multiplyQuaternionsFlat(e,a,e,n,e,r),Wa.slerpFlat(e,n,e,n,e,a,i)}_lerp(e,n,r,i,o){const a=1-i;for(let s=0;s!==o;++s){const l=n+s;e[l]=e[l]*a+e[r+s]*i}}_lerpAdditive(e,n,r,i,o){for(let a=0;a!==o;++a){const s=n+a;e[s]=e[s]+e[r+a]*i}}}const O4="\\[\\]\\.:\\/",lMe=new RegExp("["+O4+"]","g"),I4="[^"+O4+"]",uMe="[^"+O4.replace("\\.","")+"]",cMe=/((?:WC+[\/:])*)/.source.replace("WC",I4),fMe=/(WCOD+)?/.source.replace("WCOD",uMe),dMe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",I4),hMe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",I4),pMe=new RegExp("^"+cMe+fMe+dMe+hMe+"$"),mMe=["material","materials","bones","map"];class gMe{constructor(e,n,r){const i=r||jn.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 jn{constructor(e,n,r){this.path=n,this.parsedPath=r||jn.parseTrackName(n),this.node=jn.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 jn.Composite(e,n,r):new jn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lMe,"")}static parseTrackName(e){const n=pMe.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);mMe.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 a=0;a=o){const f=o++,d=e[f];n[d.uuid]=c,e[c]=d,n[u]=f,e[f]=l;for(let p=0,y=i;p!==y;++p){const x=r[p],_=x[f],v=x[c];x[c]=_,x[f]=v}}}this.nCachedObjects_=o}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let o=this.nCachedObjects_,a=e.length;for(let s=0,l=arguments.length;s!==l;++s){const u=arguments[s],c=u.uuid,f=n[c];if(f!==void 0)if(delete n[c],f0&&(n[p.uuid]=f),e[f]=p,e.pop();for(let y=0,x=i;y!==x;++y){const _=r[y];_[f]=_[d],_.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 a=this._paths,s=this._parsedPaths,l=this._objects,u=l.length,c=this.nCachedObjects_,f=new Array(u);i=o.length,r[e]=i,a.push(e),s.push(n),o.push(f);for(let d=c,p=l.length;d!==p;++d){const y=l[d];f[d]=new jn(y,e,n)}return f}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length-1,l=a[s],u=e[s];n[u]=r,a[r]=l,a.pop(),o[r]=o[s],o.pop(),i[r]=i[s],i.pop()}}}class KG{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const o=n.tracks,a=o.length,s=new Array(a),l={endingStart:fp,endingEnd:fp};for(let u=0;u!==a;++u){const c=o[u].createInterpolant(null);s[u]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=DW,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,a=o/i,s=i/o;e.warp(1,a,n),this.warp(s,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,a=this.timeScale;let s=this._timeScaleInterpolant;s===null&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);const l=s.parameterPositions,u=s.sampleValues;return l[0]=o,l[1]=o+r,u[0]=e/a,u[1]=n/a,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,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 a=this._updateTime(n),s=this._updateWeight(e);if(s>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case o4:for(let c=0,f=l.length;c!==f;++c)l[c].evaluate(a),u[c].accumulateAdditive(s);break;case hC:default:for(let c=0,f=l.length;c!==f;++c)l[c].evaluate(a),u[c].accumulate(i,s)}}}_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 a=r===RW;if(e===0)return o===-1?i:a&&(o&1)===1?n-i:i;if(r===TW){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,a)):this._setEndings(this.repetitions===0,!0,a)),i>=n||i<0){const s=Math.floor(i/n);i-=n*s,o+=Math.abs(s);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 u=e<0;this._setEndings(u,!u,a)}else this._setEndings(!1,!1,a);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:s})}}else this.time=i;if(a&&(o&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=dp,i.endingEnd=dp):(e?i.endingStart=this.zeroSlopeAtStart?dp:fp:i.endingStart=Dx,n?i.endingEnd=this.zeroSlopeAtEnd?dp:fp:i.endingEnd=Dx)}_scheduleFading(e,n,r){const i=this._mixer,o=i.time;let a=this._weightInterpolant;a===null&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);const s=a.parameterPositions,l=a.sampleValues;return s[0]=o,l[0]=n,s[1]=o+e,l[1]=r,this}}const yMe=new Float32Array(1);class xMe extends pf{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,a=e._propertyBindings,s=e._interpolants,l=r.uuid,u=this._bindingsByRootAndName;let c=u[l];c===void 0&&(c={},u[l]=c);for(let f=0;f!==o;++f){const d=i[f],p=d.name;let y=c[p];if(y!==void 0)++y.referenceCount,a[f]=y;else{if(y=a[f],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,l,p));continue}const x=n&&n._propertyBindings[f].binding.parsedPath;y=new YG(jn.create(r,p,x),d.ValueTypeName,d.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,l,p),a[f]=y}s[f].resultBuffer=y.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),a=this._accuIndex^=1;for(let u=0;u!==r;++u)n[u]._update(i,e,o,a);const s=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)s[u].apply(a);return this}setTime(e){this.time=0;for(let n=0;nthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,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.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,B6).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 U6=new ae,fS=new ae;class AMe{constructor(e=new ae,n=new ae){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){U6.subVectors(e,this.start),fS.subVectors(this.end,this.start);const r=fS.dot(fS);let o=fS.dot(U6)/r;return n&&(o=fi(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 z6=new ae;class TMe extends Kn{constructor(e,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new Ln,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 a=0,s=1,l=32;a1)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{G6.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(G6,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 $Me extends ic{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 Ln;i.setAttribute("position",new Ut(n,3)),i.setAttribute("color",new Ut(r,3));const o=new wa({vertexColors:!0,toneMapped:!1});super(i,o),this.type="AxesHelper"}setColors(e,n,r){const i=new Pt,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 HMe{constructor(){this.type="ShapePath",this.color=new Pt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new Fx,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,a){return this.currentPath.bezierCurveTo(e,n,r,i,o,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(v){const S=[];for(let w=0,E=v.length;wNumber.EPSILON){if(N<0&&(D=S[A],P=-P,I=S[T],N=-N),v.yI.y)continue;if(v.y===D.y){if(v.x===D.x)return!0}else{const B=N*(v.x-D.x)-P*(v.y-D.y);if(B===0)return!0;if(B<0)continue;E=!E}}else{if(v.y!==D.y)continue;if(I.x<=v.x&&v.x<=D.x||D.x<=v.x&&v.x<=I.x)return!0}}return E}const i=qu.isClockWise,o=this.subPaths;if(o.length===0)return[];let a,s,l;const u=[];if(o.length===1)return s=o[0],l=new Cp,l.curves=s.curves,u.push(l),u;let c=!i(o[0].getPoints());c=e?!c:c;const f=[],d=[];let p=[],y=0,x;d[y]=void 0,p[y]=[];for(let v=0,S=o.length;v1){let v=!1,S=0;for(let w=0,E=d.length;w0&&v===!1&&(p=f)}let _;for(let v=0,S=d.length;v{const f=typeof u=="function"?u(e):u;if(f!==e){const d=e;e=c?f:Object.assign({},e,f),n.forEach(p=>p(e,d))}},i=()=>e,o=(u,c=i,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=c(e);function p(){const y=c(e);if(!f(d,y)){const x=d;u(d=y,x)}}return n.add(p),()=>n.delete(p)},l={setState:r,getState:i,subscribe:(u,c,f)=>c||f?o(u,c,f):(n.add(u),()=>n.delete(u)),destroy:()=>n.clear()};return e=t(r,i,l),l}const GMe=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),j6=GMe?V.useEffect:V.useLayoutEffect;function jMe(t){const e=typeof t=="function"?WMe(t):t,n=(r=e.getState,i=Object.is)=>{const[,o]=V.useReducer(_=>_+1,0),a=e.getState(),s=V.useRef(a),l=V.useRef(r),u=V.useRef(i),c=V.useRef(!1),f=V.useRef();f.current===void 0&&(f.current=r(a));let d,p=!1;(s.current!==a||l.current!==r||u.current!==i||c.current)&&(d=r(a),p=!i(f.current,d)),j6(()=>{p&&(f.current=d),s.current=a,l.current=r,u.current=i,c.current=!1});const y=V.useRef(a);j6(()=>{const _=()=>{try{const S=e.getState(),w=l.current(S);u.current(f.current,w)||(s.current=S,f.current=w,o())}catch{c.current=!0,o()}},v=e.subscribe(_);return e.getState()!==y.current&&_(),v},[]);const x=p?d:f.current;return V.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 ej={exports:{}},tj={exports:{}},nj={};/** + * @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(W,U){var ne=W.length;W.push(U);e:for(;0>>1,ue=W[re];if(0>>1;rei(Re,ne))Iei(He,Re)?(W[re]=He,W[Ie]=ne,re=Ie):(W[re]=Re,W[Ce]=ne,re=Ce);else if(Iei(He,ne))W[re]=He,W[Ie]=ne,re=Ie;else break e}}return U}function i(W,U){var ne=W.sortIndex-U.sortIndex;return ne!==0?ne:W.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,d=3,p=!1,y=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(W){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=W)r(u),U.sortIndex=U.expirationTime,e(l,U);else break;U=n(u)}}function E(W){if(x=!1,w(W),!y)if(n(l)!==null)y=!0,Y(T);else{var U=n(u);U!==null&&$(E,U.startTime-W)}}function T(W,U){y=!1,x&&(x=!1,v(I),I=-1),p=!0;var ne=d;try{for(w(U),f=n(l);f!==null&&(!(f.expirationTime>U)||W&&!B());){var re=f.callback;if(typeof re=="function"){f.callback=null,d=f.priorityLevel;var ue=re(f.expirationTime<=U);U=t.unstable_now(),typeof ue=="function"?f.callback=ue:f===n(l)&&r(l),w(U)}else r(l);f=n(l)}if(f!==null)var ce=!0;else{var Ce=n(u);Ce!==null&&$(E,Ce.startTime-U),ce=!1}return ce}finally{f=null,d=ne,p=!1}}var A=!1,D=null,I=-1,P=5,N=-1;function B(){return!(t.unstable_now()-NW||125re?(W.sortIndex=ne,e(u,W),n(l)===null&&W===n(u)&&(x?(v(I),I=-1):x=!0,$(E,ne-re))):(W.sortIndex=ue,e(l,W),y||p||(y=!0,Y(T))),W},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(W){var U=d;return function(){var ne=d;d=U;try{return W.apply(this,arguments)}finally{d=ne}}}})(nj);tj.exports=nj;var _P=tj.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 qMe=function(e){var n={},r=V,i=_P,o=Object.assign;function a(m){for(var g="https://reactjs.org/docs/error-decoder.html?invariant="+m,M=1;MMe||O[fe]!==H[Me]){var qe=` +`+O[fe].replace(" at new "," at ");return m.displayName&&qe.includes("")&&(qe=qe.replace("",m.displayName)),qe}while(1<=fe&&0<=Me);break}}}finally{en=!1,Error.prepareStackTrace=M}return(m=m?m.displayName||m.name:"")?Ft(m):""}var Xn=Object.prototype.hasOwnProperty,Qr=[],cr=-1;function Si(m){return{current:m}}function tn(m){0>cr||(m.current=Qr[cr],Qr[cr]=null,cr--)}function It(m,g){cr++,Qr[cr]=m.current,m.current=g}var Ma={},Nn=Si(Ma),Ar=Si(!1),Za=Ma;function No(m,g){var M=m.type.contextTypes;if(!M)return Ma;var R=m.stateNode;if(R&&R.__reactInternalMemoizedUnmaskedChildContext===g)return R.__reactInternalMemoizedMaskedChildContext;var O={},H;for(H in M)O[H]=g[H];return R&&(m=m.stateNode,m.__reactInternalMemoizedUnmaskedChildContext=g,m.__reactInternalMemoizedMaskedChildContext=O),O}function Ei(m){return m=m.childContextTypes,m!=null}function $r(){tn(Ar),tn(Nn)}function Qo(m,g,M){if(Nn.current!==Ma)throw Error(a(168));It(Nn,g),It(Ar,M)}function sc(m,g,M){var R=m.stateNode;if(g=g.childContextTypes,typeof R.getChildContext!="function")return M;R=R.getChildContext();for(var O in R)if(!(O in g))throw Error(a(108,I(m)||"Unknown",O));return o({},M,R)}function Mi(m){return m=(m=m.stateNode)&&m.__reactInternalMemoizedMergedChildContext||Ma,Za=Nn.current,It(Nn,m),It(Ar,Ar.current),!0}function lc(m,g,M){var R=m.stateNode;if(!R)throw Error(a(169));M?(m=sc(m,g,Za),R.__reactInternalMemoizedMergedChildContext=m,tn(Ar),tn(Nn),It(Nn,m)):tn(Ar),It(Ar,M)}var Oo=Math.clz32?Math.clz32:jb,yf=Math.log,pA=Math.LN2;function jb(m){return m>>>=0,m===0?32:31-(yf(m)/pA|0)|0}var xf=64,bf=4194304;function zs(m){switch(m&-m){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 m&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return m&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return m}}function oh(m,g){var M=m.pendingLanes;if(M===0)return 0;var R=0,O=m.suspendedLanes,H=m.pingedLanes,fe=M&268435455;if(fe!==0){var Me=fe&~O;Me!==0?R=zs(Me):(H&=fe,H!==0&&(R=zs(H)))}else fe=M&~O,fe!==0?R=zs(fe):H!==0&&(R=zs(H));if(R===0)return 0;if(g!==0&&g!==R&&!(g&O)&&(O=R&-R,H=g&-g,O>=H||O===16&&(H&4194240)!==0))return g;if(R&4&&(R|=M&16),g=m.entangledLanes,g!==0)for(m=m.entanglements,g&=R;0M;M++)g.push(m);return g}function _f(m,g,M){m.pendingLanes|=g,g!==536870912&&(m.suspendedLanes=0,m.pingedLanes=0),m=m.eventTimes,g=31-Oo(g),m[g]=M}function Xb(m,g){var M=m.pendingLanes&~g;m.pendingLanes=g,m.suspendedLanes=0,m.pingedLanes=0,m.expiredLanes&=g,m.mutableReadLanes&=g,m.entangledLanes&=g,g=m.entanglements;var R=m.eventTimes;for(m=m.expirationTimes;0>=fe,O-=fe,Ml=1<<32-Oo(g)+O|M<Cn?(ri=gn,gn=null):ri=gn.sibling;var Bn=Gt(Le,gn,Ve[Cn],Tt);if(Bn===null){gn===null&&(gn=ri);break}m&&gn&&Bn.alternate===null&&g(Le,gn),Ae=H(Bn,Ae,Cn),Mn===null?Bt=Bn:Mn.sibling=Bn,Mn=Bn,gn=ri}if(Cn===Ve.length)return M(Le,gn),gr&&Cl(Le,Cn),Bt;if(gn===null){for(;CnCn?(ri=gn,gn=null):ri=gn.sibling;var Js=Gt(Le,gn,Bn.value,Tt);if(Js===null){gn===null&&(gn=ri);break}m&&gn&&Js.alternate===null&&g(Le,gn),Ae=H(Js,Ae,Cn),Mn===null?Bt=Js:Mn.sibling=Js,Mn=Js,gn=ri}if(Bn.done)return M(Le,gn),gr&&Cl(Le,Cn),Bt;if(gn===null){for(;!Bn.done;Cn++,Bn=Ve.next())Bn=dn(Le,Bn.value,Tt),Bn!==null&&(Ae=H(Bn,Ae,Cn),Mn===null?Bt=Bn:Mn.sibling=Bn,Mn=Bn);return gr&&Cl(Le,Cn),Bt}for(gn=R(Le,gn);!Bn.done;Cn++,Bn=Ve.next())Bn=tr(gn,Le,Cn,Bn.value,Tt),Bn!==null&&(m&&Bn.alternate!==null&&gn.delete(Bn.key===null?Cn:Bn.key),Ae=H(Bn,Ae,Cn),Mn===null?Bt=Bn:Mn.sibling=Bn,Mn=Bn);return m&&gn.forEach(function(Hm){return g(Le,Hm)}),gr&&Cl(Le,Cn),Bt}function aa(Le,Ae,Ve,Tt){if(typeof Ve=="object"&&Ve!==null&&Ve.type===c&&Ve.key===null&&(Ve=Ve.props.children),typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case l:e:{for(var Bt=Ve.key,Mn=Ae;Mn!==null;){if(Mn.key===Bt){if(Bt=Ve.type,Bt===c){if(Mn.tag===7){M(Le,Mn.sibling),Ae=O(Mn,Ve.props.children),Ae.return=Le,Le=Ae;break e}}else if(Mn.elementType===Bt||typeof Bt=="object"&&Bt!==null&&Bt.$$typeof===w&&hh(Bt)===Mn.type){M(Le,Mn.sibling),Ae=O(Mn,Ve.props),Ae.ref=Tf(Le,Mn,Ve),Ae.return=Le,Le=Ae;break e}M(Le,Mn);break}else g(Le,Mn);Mn=Mn.sibling}Ve.type===c?(Ae=Au(Ve.props.children,Le.mode,Tt,Ve.key),Ae.return=Le,Le=Ae):(Tt=zm(Ve.type,Ve.key,Ve.props,null,Le.mode,Tt),Tt.ref=Tf(Le,Ae,Ve),Tt.return=Le,Le=Tt)}return fe(Le);case u:e:{for(Mn=Ve.key;Ae!==null;){if(Ae.key===Mn)if(Ae.tag===4&&Ae.stateNode.containerInfo===Ve.containerInfo&&Ae.stateNode.implementation===Ve.implementation){M(Le,Ae.sibling),Ae=O(Ae,Ve.children||[]),Ae.return=Le,Le=Ae;break e}else{M(Le,Ae);break}else g(Le,Ae);Ae=Ae.sibling}Ae=Da(Ve,Le.mode,Tt),Ae.return=Le,Le=Ae}return fe(Le);case w:return Mn=Ve._init,aa(Le,Ae,Mn(Ve._payload),Tt)}if(J(Ve))return kt(Le,Ae,Ve,Tt);if(A(Ve))return eo(Le,Ae,Ve,Tt);is(Le,Ve)}return typeof Ve=="string"&&Ve!==""||typeof Ve=="number"?(Ve=""+Ve,Ae!==null&&Ae.tag===6?(M(Le,Ae.sibling),Ae=O(Ae,Ve),Ae.return=Le,Le=Ae):(M(Le,Ae),Ae=Qi(Ve,Le.mode,Tt),Ae.return=Le,Le=Ae),fe(Le)):M(Le,Ae)}return aa}var Df=i_(!0),o_=i_(!1),Ws={},Or=Si(Ws),Rf=Si(Ws),Pf=Si(Ws);function Gs(m){if(m===Ws)throw Error(a(174));return m}function $v(m,g){It(Pf,g),It(Rf,m),It(Or,Ws),m=$(g),tn(Or),It(Or,m)}function Nf(){tn(Or),tn(Rf),tn(Pf)}function a_(m){var g=Gs(Pf.current),M=Gs(Or.current);g=W(M,m.type,g),M!==g&&(It(Rf,m),It(Or,g))}function pu(m){Rf.current===m&&(tn(Or),tn(Rf))}var xe=Si(0);function Ke(m){for(var g=m;g!==null;){if(g.tag===13){var M=g.memoizedState;if(M!==null&&(M=M.dehydrated,M===null||Sa(M)||Ea(M)))return g}else if(g.tag===19&&g.memoizedProps.revealOrder!==void 0){if(g.flags&128)return g}else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===m)break;for(;g.sibling===null;){if(g.return===null||g.return===m)return null;g=g.return}g.sibling.return=g.return,g=g.sibling}return null}var $e=[];function Rt(){for(var m=0;m<$e.length;m++){var g=$e[m];ut?g._workInProgressVersionPrimary=null:g._workInProgressVersionSecondary=null}$e.length=0}var ln=s.ReactCurrentDispatcher,vn=s.ReactCurrentBatchConfig,wr=0,nn=null,Ai=null,Ti=null,vo=!1,mu=!1,ph=0,Of=0;function mi(){throw Error(a(321))}function If(m,g){if(g===null)return!1;for(var M=0;MM?M:4,m(!0);var R=vn.transition;vn.transition={};try{m(!1),g()}finally{Vn=M,vn.transition=R}}function c_(){return ea().memoizedState}function gi(m,g,M){var R=Ks(m);M={lane:R,action:M,hasEagerState:!1,eagerState:null,next:null},f_(m)?d_(g,M):(qv(m,g,M),M=Ki(),m=Aa(m,R,M),m!==null&&h_(m,g,R))}function qi(m,g,M){var R=Ks(m),O={lane:R,action:M,hasEagerState:!1,eagerState:null,next:null};if(f_(m))d_(g,O);else{qv(m,g,O);var H=m.alternate;if(m.lanes===0&&(H===null||H.lanes===0)&&(H=g.lastRenderedReducer,H!==null))try{var fe=g.lastRenderedState,Me=H(fe,M);if(O.hasEagerState=!0,O.eagerState=Me,Hs(Me,fe))return}catch{}finally{}M=Ki(),m=Aa(m,R,M),m!==null&&h_(m,g,R)}}function f_(m){var g=m.alternate;return m===nn||g!==null&&g===nn}function d_(m,g){mu=vo=!0;var M=m.pending;M===null?g.next=g:(g.next=M.next,M.next=g),m.pending=g}function qv(m,g,M){ti!==null&&m.mode&1&&!(En&2)?(m=g.interleaved,m===null?(M.next=M,Vs===null?Vs=[g]:Vs.push(g)):(M.next=m.next,m.next=M),g.interleaved=M):(m=g.pending,m===null?M.next=M:(M.next=m.next,m.next=M),g.pending=M)}function h_(m,g,M){if(M&4194240){var R=g.lanes;R&=m.pendingLanes,M|=R,g.lanes=M,Pv(m,M)}}var Ff={readContext:_r,useCallback:mi,useContext:mi,useEffect:mi,useImperativeHandle:mi,useInsertionEffect:mi,useLayoutEffect:mi,useMemo:mi,useReducer:mi,useRef:mi,useState:mi,useDebugValue:mi,useDeferredValue:mi,useTransition:mi,useMutableSource:mi,useSyncExternalStore:mi,useId:mi,unstable_isNewReconciler:!1},wh={readContext:_r,useCallback:function(m,g){return js().memoizedState=[m,g===void 0?null:g],m},useContext:_r,useEffect:Lf,useImperativeHandle:function(m,g,M){return M=M!=null?M.concat([m]):null,vu(4194308,4,xh.bind(null,g,m),M)},useLayoutEffect:function(m,g){return vu(4194308,4,m,g)},useInsertionEffect:function(m,g){return vu(4,2,m,g)},useMemo:function(m,g){var M=js();return g=g===void 0?null:g,m=m(),M.memoizedState=[m,g],m},useReducer:function(m,g,M){var R=js();return g=M!==void 0?M(g):g,R.memoizedState=R.baseState=g,m={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:m,lastRenderedState:g},R.queue=m,m=m.dispatch=gi.bind(null,nn,m),[R.memoizedState,m]},useRef:function(m){var g=js();return m={current:m},g.memoizedState=m},useState:Sm,useDebugValue:_h,useDeferredValue:function(m){var g=Sm(m),M=g[0],R=g[1];return Lf(function(){var O=vn.transition;vn.transition={};try{R(m)}finally{vn.transition=O}},[m]),M},useTransition:function(){var m=Sm(!1),g=m[0];return m=wA.bind(null,m[1]),js().memoizedState=m,[g,m]},useMutableSource:function(){},useSyncExternalStore:function(m,g,M){var R=nn,O=js();if(gr){if(M===void 0)throw Error(a(407));M=M()}else{if(M=g(),ti===null)throw Error(a(349));wr&30||gh(R,g,M)}O.memoizedState=M;var H={value:M,getSnapshot:g};return O.queue=H,Lf(vh.bind(null,R,H,m),[m]),R.flags|=2048,gu(9,Vv.bind(null,R,H,M,g),void 0,null),M},useId:function(){var m=js(),g=ti.identifierPrefix;if(gr){var M=ns,R=Ml;M=(R&~(1<<32-Oo(R)-1)).toString(32)+M,g=":"+g+"R"+M,M=ph++,0Dh&&(g.flags|=128,R=!0,Xi(O,!1),g.lanes=4194304)}else{if(!R)if(m=Ke(H),m!==null){if(g.flags|=128,R=!0,m=m.updateQueue,m!==null&&(g.updateQueue=m,g.flags|=4),Xi(O,!0),O.tail===null&&O.tailMode==="hidden"&&!H.alternate&&!gr)return Yt(g),null}else 2*Ci()-O.renderingStartTime>Dh&&M!==1073741824&&(g.flags|=128,R=!0,Xi(O,!1),g.lanes=4194304);O.isBackwards?(H.sibling=g.child,g.child=H):(m=O.last,m!==null?m.sibling=H:g.child=H,O.last=H)}return O.tail!==null?(g=O.tail,O.rendering=g,O.tail=g.sibling,O.renderingStartTime=Ci(),g.sibling=null,m=xe.current,It(xe,R?m&1|2:m&1),g):(Yt(g),null);case 22:case 23:return cy(),R=g.memoizedState!==null,m!==null&&m.memoizedState!==null!==R&&(g.flags|=8192),R&&g.mode&1?ia&1073741824&&(Yt(g),Xe&&g.subtreeFlags&6&&(g.flags|=8192)):Yt(g),null;case 24:return null;case 25:return null}throw Error(a(156,g.tag))}var EA=s.ReactCurrentOwner,ta=!1;function Hr(m,g,M,R){g.child=m===null?o_(g,null,M,R):Df(g,m.child,M,R)}function y_(m,g,M,R,O){M=M.render;var H=g.ref;return uc(g,O),R=Gn(m,g,M,R,H,O),M=Hv(),m!==null&&!ta?(g.updateQueue=m.updateQueue,g.flags&=-2053,m.lanes&=~O,vi(m,g,O)):(gr&&M&&bm(g),g.flags|=1,Hr(m,g,R,O),g.child)}function x_(m,g,M,R,O){if(m===null){var H=M.type;return typeof H=="function"&&!gy(H)&&H.defaultProps===void 0&&M.compare===null&&M.defaultProps===void 0?(g.tag=15,g.type=H,b_(m,g,H,R,O)):(m=zm(M.type,null,R,g,g.mode,O),m.ref=g.ref,m.return=g,g.child=m)}if(H=m.child,!(m.lanes&O)){var fe=H.memoizedProps;if(M=M.compare,M=M!==null?M:ei,M(fe,R)&&m.ref===g.ref)return vi(m,g,O)}return g.flags|=1,m=Pl(H,R),m.ref=g.ref,m.return=g,g.child=m}function b_(m,g,M,R,O){if(m!==null&&ei(m.memoizedProps,R)&&m.ref===g.ref)if(ta=!1,(m.lanes&O)!==0)m.flags&131072&&(ta=!0);else return g.lanes=m.lanes,vi(m,g,O);return os(m,g,M,R,O)}function __(m,g,M){var R=g.pendingProps,O=R.children,H=m!==null?m.memoizedState:null;if(R.mode==="hidden")if(!(g.mode&1))g.memoizedState={baseLanes:0,cachePool:null},It(Hf,ia),ia|=M;else if(M&1073741824)g.memoizedState={baseLanes:0,cachePool:null},R=H!==null?H.baseLanes:M,It(Hf,ia),ia|=R;else return m=H!==null?H.baseLanes|M:M,g.lanes=g.childLanes=1073741824,g.memoizedState={baseLanes:m,cachePool:null},g.updateQueue=null,It(Hf,ia),ia|=m,null;else H!==null?(R=H.baseLanes|M,g.memoizedState=null):R=M,It(Hf,ia),ia|=R;return Hr(m,g,O,M),g.child}function w_(m,g){var M=g.ref;(m===null&&M!==null||m!==null&&m.ref!==M)&&(g.flags|=512,g.flags|=2097152)}function os(m,g,M,R,O){var H=Ei(M)?Za:Nn.current;return H=No(g,H),uc(g,O),M=Gn(m,g,M,R,H,O),R=Hv(),m!==null&&!ta?(g.updateQueue=m.updateQueue,g.flags&=-2053,m.lanes&=~O,vi(m,g,O)):(gr&&R&&bm(g),g.flags|=1,Hr(m,g,M,O),g.child)}function S_(m,g,M,R,O){if(Ei(M)){var H=!0;Mi(g)}else H=!1;if(uc(g,O),g.stateNode===null)m!==null&&(m.alternate=null,g.alternate=null,g.flags|=2),e_(g,M,R),Ef(g,M,R,O),R=!0;else if(m===null){var fe=g.stateNode,Me=g.memoizedProps;fe.props=Me;var qe=fe.context,ft=M.contextType;typeof ft=="object"&&ft!==null?ft=_r(ft):(ft=Ei(M)?Za:Nn.current,ft=No(g,ft));var Nt=M.getDerivedStateFromProps,dn=typeof Nt=="function"||typeof fe.getSnapshotBeforeUpdate=="function";dn||typeof fe.UNSAFE_componentWillReceiveProps!="function"&&typeof fe.componentWillReceiveProps!="function"||(Me!==R||qe!==ft)&&Bv(g,fe,R,ft),pi=!1;var Gt=g.memoizedState;fe.state=Gt,es(g,R,fe,O),qe=g.memoizedState,Me!==R||Gt!==qe||Ar.current||pi?(typeof Nt=="function"&&(lh(g,M,Nt,R),qe=g.memoizedState),(Me=pi||Qb(g,M,Me,R,Gt,qe,ft))?(dn||typeof fe.UNSAFE_componentWillMount!="function"&&typeof fe.componentWillMount!="function"||(typeof fe.componentWillMount=="function"&&fe.componentWillMount(),typeof fe.UNSAFE_componentWillMount=="function"&&fe.UNSAFE_componentWillMount()),typeof fe.componentDidMount=="function"&&(g.flags|=4194308)):(typeof fe.componentDidMount=="function"&&(g.flags|=4194308),g.memoizedProps=R,g.memoizedState=qe),fe.props=R,fe.state=qe,fe.context=ft,R=Me):(typeof fe.componentDidMount=="function"&&(g.flags|=4194308),R=!1)}else{fe=g.stateNode,kv(m,g),Me=g.memoizedProps,ft=g.type===g.elementType?Me:Oi(g.type,Me),fe.props=ft,dn=g.pendingProps,Gt=fe.context,qe=M.contextType,typeof qe=="object"&&qe!==null?qe=_r(qe):(qe=Ei(M)?Za:Nn.current,qe=No(g,qe));var tr=M.getDerivedStateFromProps;(Nt=typeof tr=="function"||typeof fe.getSnapshotBeforeUpdate=="function")||typeof fe.UNSAFE_componentWillReceiveProps!="function"&&typeof fe.componentWillReceiveProps!="function"||(Me!==dn||Gt!==qe)&&Bv(g,fe,R,qe),pi=!1,Gt=g.memoizedState,fe.state=Gt,es(g,R,fe,O);var kt=g.memoizedState;Me!==dn||Gt!==kt||Ar.current||pi?(typeof tr=="function"&&(lh(g,M,tr,R),kt=g.memoizedState),(ft=pi||Qb(g,M,ft,R,Gt,kt,qe)||!1)?(Nt||typeof fe.UNSAFE_componentWillUpdate!="function"&&typeof fe.componentWillUpdate!="function"||(typeof fe.componentWillUpdate=="function"&&fe.componentWillUpdate(R,kt,qe),typeof fe.UNSAFE_componentWillUpdate=="function"&&fe.UNSAFE_componentWillUpdate(R,kt,qe)),typeof fe.componentDidUpdate=="function"&&(g.flags|=4),typeof fe.getSnapshotBeforeUpdate=="function"&&(g.flags|=1024)):(typeof fe.componentDidUpdate!="function"||Me===m.memoizedProps&&Gt===m.memoizedState||(g.flags|=4),typeof fe.getSnapshotBeforeUpdate!="function"||Me===m.memoizedProps&&Gt===m.memoizedState||(g.flags|=1024),g.memoizedProps=R,g.memoizedState=kt),fe.props=R,fe.state=kt,fe.context=qe,R=ft):(typeof fe.componentDidUpdate!="function"||Me===m.memoizedProps&&Gt===m.memoizedState||(g.flags|=4),typeof fe.getSnapshotBeforeUpdate!="function"||Me===m.memoizedProps&&Gt===m.memoizedState||(g.flags|=1024),R=!1)}return Yv(m,g,M,R,H,O)}function Yv(m,g,M,R,O,H){w_(m,g);var fe=(g.flags&128)!==0;if(!R&&!fe)return O&&lc(g,M,!1),vi(m,g,H);R=g.stateNode,EA.current=g;var Me=fe&&typeof M.getDerivedStateFromError!="function"?null:R.render();return g.flags|=1,m!==null&&fe?(g.child=Df(g,m.child,null,H),g.child=Df(g,null,Me,H)):Hr(m,g,Me,H),g.memoizedState=R.state,O&&lc(g,M,!0),g.child}function E_(m){var g=m.stateNode;g.pendingContext?Qo(m,g.pendingContext,g.pendingContext!==g.context):g.context&&Qo(m,g.context,!1),$v(m,g.containerInfo)}function M_(m,g,M,R,O){return Af(),dh(O),g.flags|=256,Hr(m,g,M,R),g.child}var Mm={dehydrated:null,treeContext:null,retryLane:0};function Ca(m){return{baseLanes:m,cachePool:null}}function C_(m,g,M){var R=g.pendingProps,O=xe.current,H=!1,fe=(g.flags&128)!==0,Me;if((Me=fe)||(Me=m!==null&&m.memoizedState===null?!1:(O&2)!==0),Me?(H=!0,g.flags&=-129):(m===null||m.memoizedState!==null)&&(O|=1),It(xe,O&1),m===null)return zv(g),m=g.memoizedState,m!==null&&(m=m.dehydrated,m!==null)?(g.mode&1?Ea(m)?g.lanes=8:g.lanes=1073741824:g.lanes=1,null):(O=R.children,m=R.fallback,H?(R=g.mode,H=g.child,O={mode:"hidden",children:O},!(R&1)&&H!==null?(H.childLanes=0,H.pendingProps=O):H=Ih(O,R,0,null),m=Au(m,R,M,null),H.return=g,m.return=g,H.sibling=m,g.child=H,g.child.memoizedState=Ca(M),g.memoizedState=Mm,m):Kv(g,O));if(O=m.memoizedState,O!==null){if(Me=O.dehydrated,Me!==null){if(fe)return g.flags&256?(g.flags&=-257,Cm(m,g,M,Error(a(422)))):g.memoizedState!==null?(g.child=m.child,g.flags|=128,null):(H=R.fallback,O=g.mode,R=Ih({mode:"visible",children:R.children},O,0,null),H=Au(H,O,M,null),H.flags|=2,R.return=g,H.return=g,R.sibling=H,g.child=R,g.mode&1&&Df(g,m.child,null,M),g.child.memoizedState=Ca(M),g.memoizedState=Mm,H);if(!(g.mode&1))g=Cm(m,g,M,null);else if(Ea(Me))g=Cm(m,g,M,Error(a(419)));else if(R=(M&m.childLanes)!==0,ta||R){if(R=ti,R!==null){switch(M&-M){case 4:H=2;break;case 16:H=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:H=32;break;case 536870912:H=268435456;break;default:H=0}R=H&(R.suspendedLanes|M)?0:H,R!==0&&R!==O.retryLane&&(O.retryLane=R,Aa(m,R,-1))}km(),g=Cm(m,g,M,Error(a(421)))}else Sa(Me)?(g.flags|=128,g.child=m.child,g=Cu.bind(null,m),Ka(Me,g),g=null):(M=O.treeContext,De&&(Li=Jo(Me),go=g,gr=!0,rs=null,Cf=!1,M!==null&&(Io[Lo++]=Ml,Io[Lo++]=ns,Io[Lo++]=hu,Ml=M.id,ns=M.overflow,hu=g)),g=Kv(g,g.pendingProps.children),g.flags|=4096);return g}return H?(R=T_(m,g,R.children,R.fallback,M),H=g.child,O=m.child.memoizedState,H.memoizedState=O===null?Ca(M):{baseLanes:O.baseLanes|M,cachePool:null},H.childLanes=m.childLanes&~M,g.memoizedState=Mm,R):(M=A_(m,g,R.children,M),g.memoizedState=null,M)}return H?(R=T_(m,g,R.children,R.fallback,M),H=g.child,O=m.child.memoizedState,H.memoizedState=O===null?Ca(M):{baseLanes:O.baseLanes|M,cachePool:null},H.childLanes=m.childLanes&~M,g.memoizedState=Mm,R):(M=A_(m,g,R.children,M),g.memoizedState=null,M)}function Kv(m,g){return g=Ih({mode:"visible",children:g},m.mode,0,null),g.return=m,m.child=g}function A_(m,g,M,R){var O=m.child;return m=O.sibling,M=Pl(O,{mode:"visible",children:M}),!(g.mode&1)&&(M.lanes=R),M.return=g,M.sibling=null,m!==null&&(R=g.deletions,R===null?(g.deletions=[m],g.flags|=16):R.push(m)),g.child=M}function T_(m,g,M,R,O){var H=g.mode;m=m.child;var fe=m.sibling,Me={mode:"hidden",children:M};return!(H&1)&&g.child!==m?(M=g.child,M.childLanes=0,M.pendingProps=Me,g.deletions=null):(M=Pl(m,Me),M.subtreeFlags=m.subtreeFlags&14680064),fe!==null?R=Pl(fe,R):(R=Au(R,H,O,null),R.flags|=2),R.return=g,M.return=g,M.sibling=R,g.child=M,R}function Cm(m,g,M,R){return R!==null&&dh(R),Df(g,m.child,null,M),m=Kv(g,g.pendingProps.children),m.flags|=2,g.memoizedState=null,m}function yu(m,g,M){m.lanes|=g;var R=m.alternate;R!==null&&(R.lanes|=g),vm(m.return,g,M)}function Zv(m,g,M,R,O){var H=m.memoizedState;H===null?m.memoizedState={isBackwards:g,rendering:null,renderingStartTime:0,last:R,tail:M,tailMode:O}:(H.isBackwards=g,H.rendering=null,H.renderingStartTime=0,H.last=R,H.tail=M,H.tailMode=O)}function D_(m,g,M){var R=g.pendingProps,O=R.revealOrder,H=R.tail;if(Hr(m,g,R.children,M),R=xe.current,R&2)R=R&1|2,g.flags|=128;else{if(m!==null&&m.flags&128)e:for(m=g.child;m!==null;){if(m.tag===13)m.memoizedState!==null&&yu(m,M,g);else if(m.tag===19)yu(m,M,g);else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===g)break e;for(;m.sibling===null;){if(m.return===null||m.return===g)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}R&=1}if(It(xe,R),!(g.mode&1))g.memoizedState=null;else switch(O){case"forwards":for(M=g.child,O=null;M!==null;)m=M.alternate,m!==null&&Ke(m)===null&&(O=M),M=M.sibling;M=O,M===null?(O=g.child,g.child=null):(O=M.sibling,M.sibling=null),Zv(g,!1,O,M,H);break;case"backwards":for(M=null,O=g.child,g.child=null;O!==null;){if(m=O.alternate,m!==null&&Ke(m)===null){g.child=O;break}m=O.sibling,O.sibling=M,M=O,O=m}Zv(g,!0,M,null,H);break;case"together":Zv(g,!1,null,null,void 0);break;default:g.memoizedState=null}return g.child}function vi(m,g,M){if(m!==null&&(g.dependencies=m.dependencies),Wf|=g.lanes,!(M&g.childLanes))return null;if(m!==null&&g.child!==m.child)throw Error(a(153));if(g.child!==null){for(m=g.child,M=Pl(m,m.pendingProps),g.child=M,M.return=g;m.sibling!==null;)m=m.sibling,M=M.sibling=Pl(m,m.pendingProps),M.return=g;M.sibling=null}return g.child}function MA(m,g,M){switch(g.tag){case 3:E_(g),Af();break;case 5:a_(g);break;case 1:Ei(g.type)&&Mi(g);break;case 4:$v(g,g.stateNode.containerInfo);break;case 10:Lv(g,g.type._context,g.memoizedProps.value);break;case 13:var R=g.memoizedState;if(R!==null)return R.dehydrated!==null?(It(xe,xe.current&1),g.flags|=128,null):M&g.child.childLanes?C_(m,g,M):(It(xe,xe.current&1),m=vi(m,g,M),m!==null?m.sibling:null);It(xe,xe.current&1);break;case 19:if(R=(M&g.childLanes)!==0,m.flags&128){if(R)return D_(m,g,M);g.flags|=128}var O=g.memoizedState;if(O!==null&&(O.rendering=null,O.tail=null,O.lastEffect=null),It(xe,xe.current),R)break;return null;case 22:case 23:return g.lanes=0,__(m,g,M)}return vi(m,g,M)}function CA(m,g){switch(mo(g),g.tag){case 1:return Ei(g.type)&&$r(),m=g.flags,m&65536?(g.flags=m&-65537|128,g):null;case 3:return Nf(),tn(Ar),tn(Nn),Rt(),m=g.flags,m&65536&&!(m&128)?(g.flags=m&-65537|128,g):null;case 5:return pu(g),null;case 13:if(tn(xe),m=g.memoizedState,m!==null&&m.dehydrated!==null){if(g.alternate===null)throw Error(a(340));Af()}return m=g.flags,m&65536?(g.flags=m&-65537|128,g):null;case 19:return tn(xe),null;case 4:return Nf(),null;case 10:return gm(g.type._context),null;case 22:case 23:return cy(),null;case 24:return null;default:return null}}var Am=!1,mc=!1,AA=typeof WeakSet=="function"?WeakSet:Set,St=null;function Mh(m,g){var M=m.ref;if(M!==null)if(typeof M=="function")try{M(null)}catch(R){Ji(m,g,R)}else M.current=null}function Jv(m,g,M){try{M()}catch(R){Ji(m,g,R)}}var R_=!1;function Qv(m,g){for(U(m.containerInfo),St=g;St!==null;)if(m=St,g=m.child,(m.subtreeFlags&1028)!==0&&g!==null)g.return=m,St=g;else for(;St!==null;){m=St;try{var M=m.alternate;if(m.flags&1024)switch(m.tag){case 0:case 11:case 15:break;case 1:if(M!==null){var R=M.memoizedProps,O=M.memoizedState,H=m.stateNode,fe=H.getSnapshotBeforeUpdate(m.elementType===m.type?R:Oi(m.type,R),O);H.__reactInternalSnapshotBeforeUpdate=fe}break;case 3:Xe&>(m.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(Me){Ji(m,m.return,Me)}if(g=m.sibling,g!==null){g.return=m.return,St=g;break}St=m.return}return M=R_,R_=!1,M}function as(m,g,M){var R=g.updateQueue;if(R=R!==null?R.lastEffect:null,R!==null){var O=R=R.next;do{if((O.tag&m)===m){var H=O.destroy;O.destroy=void 0,H!==void 0&&Jv(g,M,H)}O=O.next}while(O!==R)}}function xu(m,g){if(g=g.updateQueue,g=g!==null?g.lastEffect:null,g!==null){var M=g=g.next;do{if((M.tag&m)===m){var R=M.create;M.destroy=R()}M=M.next}while(M!==g)}}function ey(m){var g=m.ref;if(g!==null){var M=m.stateNode;switch(m.tag){case 5:m=Y(M);break;default:m=M}typeof g=="function"?g(m):g.current=m}}function ty(m,g,M){if($s&&typeof $s.onCommitFiberUnmount=="function")try{$s.onCommitFiberUnmount(dm,g)}catch{}switch(g.tag){case 0:case 11:case 14:case 15:if(m=g.updateQueue,m!==null&&(m=m.lastEffect,m!==null)){var R=m=m.next;do{var O=R,H=O.destroy;O=O.tag,H!==void 0&&(O&2||O&4)&&Jv(g,M,H),R=R.next}while(R!==m)}break;case 1:if(Mh(g,M),m=g.stateNode,typeof m.componentWillUnmount=="function")try{m.props=g.memoizedProps,m.state=g.memoizedState,m.componentWillUnmount()}catch(fe){Ji(g,M,fe)}break;case 5:Mh(g,M);break;case 4:Xe?ry(m,g,M):le&&le&&(g=g.stateNode.containerInfo,M=Ye(g),xn(g,M))}}function P_(m,g,M){for(var R=g;;)if(ty(m,R,M),R.child===null||Xe&&R.tag===4){if(R===g)break;for(;R.sibling===null;){if(R.return===null||R.return===g)return;R=R.return}R.sibling.return=R.return,R=R.sibling}else R.child.return=R,R=R.child}function Ys(m){var g=m.alternate;g!==null&&(m.alternate=null,Ys(g)),m.child=null,m.deletions=null,m.sibling=null,m.tag===5&&(g=m.stateNode,g!==null&&me(g)),m.stateNode=null,m.return=null,m.dependencies=null,m.memoizedProps=null,m.memoizedState=null,m.pendingProps=null,m.stateNode=null,m.updateQueue=null}function Tm(m){return m.tag===5||m.tag===3||m.tag===4}function bu(m){e:for(;;){for(;m.sibling===null;){if(m.return===null||Tm(m.return))return null;m=m.return}for(m.sibling.return=m.return,m=m.sibling;m.tag!==5&&m.tag!==6&&m.tag!==18;){if(m.flags&2||m.child===null||m.tag===4)continue e;m.child.return=m,m=m.child}if(!(m.flags&2))return m.stateNode}}function na(m){if(Xe){e:{for(var g=m.return;g!==null;){if(Tm(g))break e;g=g.return}throw Error(a(160))}var M=g;switch(M.tag){case 5:g=M.stateNode,M.flags&32&&(bt(g),M.flags&=-33),M=bu(m),Dm(m,M,g);break;case 3:case 4:g=M.stateNode.containerInfo,M=bu(m),ny(m,M,g);break;default:throw Error(a(161))}}}function ny(m,g,M){var R=m.tag;if(R===5||R===6)m=m.stateNode,g?Fe(M,m,g):ve(M,m);else if(R!==4&&(m=m.child,m!==null))for(ny(m,g,M),m=m.sibling;m!==null;)ny(m,g,M),m=m.sibling}function Dm(m,g,M){var R=m.tag;if(R===5||R===6)m=m.stateNode,g?je(M,m,g):de(M,m);else if(R!==4&&(m=m.child,m!==null))for(Dm(m,g,M),m=m.sibling;m!==null;)Dm(m,g,M),m=m.sibling}function ry(m,g,M){for(var R=g,O=!1,H,fe;;){if(!O){O=R.return;e:for(;;){if(O===null)throw Error(a(160));switch(H=O.stateNode,O.tag){case 5:fe=!1;break e;case 3:H=H.containerInfo,fe=!0;break e;case 4:H=H.containerInfo,fe=!0;break e}O=O.return}O=!0}if(R.tag===5||R.tag===6)P_(m,R,M),fe?yt(H,R.stateNode):xt(H,R.stateNode);else if(R.tag===18)fe?ze(H,R.stateNode):ke(H,R.stateNode);else if(R.tag===4){if(R.child!==null){H=R.stateNode.containerInfo,fe=!0,R.child.return=R,R=R.child;continue}}else if(ty(m,R,M),R.child!==null){R.child.return=R,R=R.child;continue}if(R===g)break;for(;R.sibling===null;){if(R.return===null||R.return===g)return;R=R.return,R.tag===4&&(O=!1)}R.sibling.return=R.return,R=R.sibling}}function gc(m,g){if(Xe){switch(g.tag){case 0:case 11:case 14:case 15:as(3,g,g.return),xu(3,g),as(5,g,g.return);return;case 1:return;case 5:var M=g.stateNode;if(M!=null){var R=g.memoizedProps;m=m!==null?m.memoizedProps:R;var O=g.type,H=g.updateQueue;g.updateQueue=null,H!==null&&Be(M,H,O,m,R,g)}return;case 6:if(g.stateNode===null)throw Error(a(162));M=g.memoizedProps,Se(g.stateNode,m!==null?m.memoizedProps:M,M);return;case 3:De&&m!==null&&m.memoizedState.isDehydrated&&_e(g.stateNode.containerInfo);return;case 12:return;case 13:ss(g);return;case 19:ss(g);return;case 17:return}throw Error(a(163))}switch(g.tag){case 0:case 11:case 14:case 15:as(3,g,g.return),xu(3,g),as(5,g,g.return);return;case 12:return;case 13:ss(g);return;case 19:ss(g);return;case 3:De&&m!==null&&m.memoizedState.isDehydrated&&_e(g.stateNode.containerInfo);break;case 22:case 23:return}e:if(le){switch(g.tag){case 1:case 5:case 6:break e;case 3:case 4:g=g.stateNode,xn(g.containerInfo,g.pendingChildren);break e}throw Error(a(163))}}function ss(m){var g=m.updateQueue;if(g!==null){m.updateQueue=null;var M=m.stateNode;M===null&&(M=m.stateNode=new AA),g.forEach(function(R){var O=U_.bind(null,m,R);M.has(R)||(M.add(R),R.then(O,O))})}}function N_(m,g){for(St=g;St!==null;){g=St;var M=g.deletions;if(M!==null)for(var R=0;R";case Ah:return":has("+(Th(m)||"")+")";case ra:return'[role="'+m.value+'"]';case vc:return'"'+m.value+'"';case zf:return'[data-testname="'+m.value+'"]';default:throw Error(a(365))}}function I_(m,g){var M=[];m=[m,0];for(var R=0;RO&&(O=fe),R&=~H}if(R=O,R=Ci()-R,R=(120>R?120:480>R?480:1080>R?1080:1920>R?1920:3e3>R?3e3:4320>R?4320:1960*DA(R/1960))-R,10m?16:m,Rl===null)var R=!1;else{if(m=Rl,Rl=null,Ph=0,En&6)throw Error(a(331));var O=En;for(En|=4,St=m.current;St!==null;){var H=St,fe=H.child;if(St.flags&16){var Me=H.deletions;if(Me!==null){for(var qe=0;qeCi()-ly?Zs(m,0):sy|=M),Xt(m,g)}function B_(m,g){g===0&&(m.mode&1?(g=bf,bf<<=1,!(bf&130023424)&&(bf=4194304)):g=1);var M=Ki();m=qf(m,g),m!==null&&(_f(m,g,M),Xt(m,M))}function Cu(m){var g=m.memoizedState,M=0;g!==null&&(M=g.retryLane),B_(m,M)}function U_(m,g){var M=0;switch(m.tag){case 13:var R=m.stateNode,O=m.memoizedState;O!==null&&(M=O.retryLane);break;case 19:R=m.stateNode;break;default:throw Error(a(314))}R!==null&&R.delete(g),B_(m,M)}var my;my=function(m,g,M){if(m!==null)if(m.memoizedProps!==g.pendingProps||Ar.current)ta=!0;else{if(!(m.lanes&M)&&!(g.flags&128))return ta=!1,MA(m,g,M);ta=!!(m.flags&131072)}else ta=!1,gr&&g.flags&1048576&&t_(g,ch,g.index);switch(g.lanes=0,g.tag){case 2:var R=g.type;m!==null&&(m.alternate=null,g.alternate=null,g.flags|=2),m=g.pendingProps;var O=No(g,Nn.current);uc(g,M),O=Gn(null,g,R,m,O,M);var H=Hv();return g.flags|=1,typeof O=="object"&&O!==null&&typeof O.render=="function"&&O.$$typeof===void 0?(g.tag=1,g.memoizedState=null,g.updateQueue=null,Ei(R)?(H=!0,Mi(g)):H=!1,g.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,Fv(g),O.updater=xm,g.stateNode=O,O._reactInternals=g,Ef(g,R,m,M),g=Yv(null,g,R,!0,H,M)):(g.tag=0,gr&&H&&bm(g),Hr(null,g,O,M),g=g.child),g;case 16:R=g.elementType;e:{switch(m!==null&&(m.alternate=null,g.alternate=null,g.flags|=2),m=g.pendingProps,O=R._init,R=O(R._payload),g.type=R,O=g.tag=z_(R),m=Oi(R,m),O){case 0:g=os(null,g,R,m,M);break e;case 1:g=S_(null,g,R,m,M);break e;case 11:g=y_(null,g,R,m,M);break e;case 14:g=x_(null,g,R,Oi(R.type,m),M);break e}throw Error(a(306,R,""))}return g;case 0:return R=g.type,O=g.pendingProps,O=g.elementType===R?O:Oi(R,O),os(m,g,R,O,M);case 1:return R=g.type,O=g.pendingProps,O=g.elementType===R?O:Oi(R,O),S_(m,g,R,O,M);case 3:e:{if(E_(g),m===null)throw Error(a(387));R=g.pendingProps,H=g.memoizedState,O=H.element,kv(m,g),es(g,R,null,M);var fe=g.memoizedState;if(R=fe.element,De&&H.isDehydrated)if(H={element:R,isDehydrated:!1,cache:fe.cache,transitions:fe.transitions},g.updateQueue.baseState=H,g.memoizedState=H,g.flags&256){O=Error(a(423)),g=M_(m,g,R,M,O);break e}else if(R!==O){O=Error(a(424)),g=M_(m,g,R,M,O);break e}else for(De&&(Li=Po(g.stateNode.containerInfo),go=g,gr=!0,rs=null,Cf=!1),M=o_(g,null,R,M),g.child=M;M;)M.flags=M.flags&-3|4096,M=M.sibling;else{if(Af(),R===O){g=vi(m,g,M);break e}Hr(m,g,R,M)}g=g.child}return g;case 5:return a_(g),m===null&&zv(g),R=g.type,O=g.pendingProps,H=m!==null?m.memoizedProps:null,fe=O.children,Re(R,O)?fe=null:H!==null&&Re(R,H)&&(g.flags|=32),w_(m,g),Hr(m,g,fe,M),g.child;case 6:return m===null&&zv(g),null;case 13:return C_(m,g,M);case 4:return $v(g,g.stateNode.containerInfo),R=g.pendingProps,m===null?g.child=Df(g,null,R,M):Hr(m,g,R,M),g.child;case 11:return R=g.type,O=g.pendingProps,O=g.elementType===R?O:Oi(R,O),y_(m,g,R,O,M);case 7:return Hr(m,g,g.pendingProps,M),g.child;case 8:return Hr(m,g,g.pendingProps.children,M),g.child;case 12:return Hr(m,g,g.pendingProps.children,M),g.child;case 10:e:{if(R=g.type._context,O=g.pendingProps,H=g.memoizedProps,fe=O.value,Lv(g,R,fe),H!==null)if(Hs(H.value,fe)){if(H.children===O.children&&!Ar.current){g=vi(m,g,M);break e}}else for(H=g.child,H!==null&&(H.return=g);H!==null;){var Me=H.dependencies;if(Me!==null){fe=H.child;for(var qe=Me.firstContext;qe!==null;){if(qe.context===R){if(H.tag===1){qe=ji(-1,M&-M),qe.tag=2;var ft=H.updateQueue;if(ft!==null){ft=ft.shared;var Nt=ft.pending;Nt===null?qe.next=qe:(qe.next=Nt.next,Nt.next=qe),ft.pending=qe}}H.lanes|=M,qe=H.alternate,qe!==null&&(qe.lanes|=M),vm(H.return,M,g),Me.lanes|=M;break}qe=qe.next}}else if(H.tag===10)fe=H.type===g.type?null:H.child;else if(H.tag===18){if(fe=H.return,fe===null)throw Error(a(341));fe.lanes|=M,Me=fe.alternate,Me!==null&&(Me.lanes|=M),vm(fe,M,g),fe=H.sibling}else fe=H.child;if(fe!==null)fe.return=H;else for(fe=H;fe!==null;){if(fe===g){fe=null;break}if(H=fe.sibling,H!==null){H.return=fe.return,fe=H;break}fe=fe.return}H=fe}Hr(m,g,O.children,M),g=g.child}return g;case 9:return O=g.type,R=g.pendingProps.children,uc(g,M),O=_r(O),R=R(O),g.flags|=1,Hr(m,g,R,M),g.child;case 14:return R=g.type,O=Oi(R,g.pendingProps),O=Oi(R.type,O),x_(m,g,R,O,M);case 15:return b_(m,g,g.type,g.pendingProps,M);case 17:return R=g.type,O=g.pendingProps,O=g.elementType===R?O:Oi(R,O),m!==null&&(m.alternate=null,g.alternate=null,g.flags|=2),g.tag=1,Ei(R)?(m=!0,Mi(g)):m=!1,uc(g,M),e_(g,R,O),Ef(g,R,O,M),Yv(null,g,R,!0,m,M);case 19:return D_(m,g,M);case 22:return __(m,g,M)}throw Error(a(156,g.tag))};function Um(m,g){return fm(m,g)}function RA(m,g,M,R){this.tag=m,this.key=M,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=g,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 Ta(m,g,M,R){return new RA(m,g,M,R)}function gy(m){return m=m.prototype,!(!m||!m.isReactComponent)}function z_(m){if(typeof m=="function")return gy(m)?1:0;if(m!=null){if(m=m.$$typeof,m===x)return 11;if(m===S)return 14}return 2}function Pl(m,g){var M=m.alternate;return M===null?(M=Ta(m.tag,g,m.key,m.mode),M.elementType=m.elementType,M.type=m.type,M.stateNode=m.stateNode,M.alternate=m,m.alternate=M):(M.pendingProps=g,M.type=m.type,M.flags=0,M.subtreeFlags=0,M.deletions=null),M.flags=m.flags&14680064,M.childLanes=m.childLanes,M.lanes=m.lanes,M.child=m.child,M.memoizedProps=m.memoizedProps,M.memoizedState=m.memoizedState,M.updateQueue=m.updateQueue,g=m.dependencies,M.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext},M.sibling=m.sibling,M.index=m.index,M.ref=m.ref,M}function zm(m,g,M,R,O,H){var fe=2;if(R=m,typeof m=="function")gy(m)&&(fe=1);else if(typeof m=="string")fe=5;else e:switch(m){case c:return Au(M.children,O,H,g);case f:fe=8,O|=8;break;case d:return m=Ta(12,M,g,O|2),m.elementType=d,m.lanes=H,m;case _:return m=Ta(13,M,g,O),m.elementType=_,m.lanes=H,m;case v:return m=Ta(19,M,g,O),m.elementType=v,m.lanes=H,m;case E:return Ih(M,O,H,g);default:if(typeof m=="object"&&m!==null)switch(m.$$typeof){case p:fe=10;break e;case y:fe=9;break e;case x:fe=11;break e;case S:fe=14;break e;case w:fe=16,R=null;break e}throw Error(a(130,m==null?m:typeof m,""))}return g=Ta(fe,M,g,O),g.elementType=m,g.type=R,g.lanes=H,g}function Au(m,g,M,R){return m=Ta(7,m,R,g),m.lanes=M,m}function Ih(m,g,M,R){return m=Ta(22,m,R,g),m.elementType=E,m.lanes=M,m.stateNode={},m}function Qi(m,g,M){return m=Ta(6,m,null,g),m.lanes=M,m}function Da(m,g,M){return g=Ta(4,m.children!==null?m.children:[],m.key,g),g.lanes=M,g.stateNode={containerInfo:m.containerInfo,pendingChildren:null,implementation:m.implementation},g}function PA(m,g,M,R,O){this.tag=g,this.containerInfo=m,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Qe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cm(0),this.expirationTimes=cm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cm(0),this.identifierPrefix=R,this.onRecoverableError=O,De&&(this.mutableSourceEagerHydrationData=null)}function $_(m,g,M,R,O,H,fe,Me,qe){return m=new PA(m,g,M,Me,qe),g===1?(g=1,H===!0&&(g|=8)):g=0,H=Ta(3,null,null,g),m.current=H,H.stateNode=m,H.memoizedState={element:R,isDehydrated:M,cache:null,transitions:null},Fv(H),m}function Lh(m){if(!m)return Ma;m=m._reactInternals;e:{if(P(m)!==m||m.tag!==1)throw Error(a(170));var g=m;do{switch(g.tag){case 3:g=g.stateNode.context;break e;case 1:if(Ei(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break e}}g=g.return}while(g!==null);throw Error(a(171))}if(m.tag===1){var M=m.type;if(Ei(M))return sc(m,M,g)}return g}function bc(m){var g=m._reactInternals;if(g===void 0)throw typeof m.render=="function"?Error(a(188)):(m=Object.keys(m).join(","),Error(a(268,m)));return m=G(g),m===null?null:m.stateNode}function vy(m,g){if(m=m.memoizedState,m!==null&&m.dehydrated!==null){var M=m.retryLane;m.retryLane=M!==0&&M=ft&&H>=dn&&O<=Nt&&fe<=Gt){m.splice(g,1);break}else if(R!==ft||M.width!==qe.width||Gtfe){if(!(H!==dn||M.height!==qe.height||NtO)){ft>R&&(qe.width+=ft-R,qe.x=R),NtH&&(qe.height+=dn-H,qe.y=H),GtM&&(M=fe)),fe ")+` + +No matching component was found for: + `)+m.join(" > ")}return null},n.getPublicRootInstance=function(m){if(m=m.current,!m.child)return null;switch(m.child.tag){case 5:return Y(m.child.stateNode);default:return m.child.stateNode}},n.injectIntoDevTools=function(m){if(m={bundleType:m.bundleType,version:m.version,rendererPackageName:m.rendererPackageName,rendererConfig:m.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:NA,findFiberByHostInstance:m.findFiberByHostInstance||H_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")m=!1;else{var g=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(g.isDisabled||!g.supportsFiber)m=!0;else{try{dm=g.inject(m),$s=g}catch{}m=!!g.checkDCE}}return m},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(m,g,M,R){if(!Ue)throw Error(a(363));m=oy(m,g);var O=pe(m,M,R).disconnect;return{disconnect:function(){O()}}},n.registerMutableSourceForHydration=function(m,g){var M=g._getVersion;M=M(g._source),m.mutableSourceEagerHydrationData==null?m.mutableSourceEagerHydrationData=[g,M]:m.mutableSourceEagerHydrationData.push(g,M)},n.runWithPriority=function(m,g){var M=Vn;try{return Vn=m,g()}finally{Vn=M}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(m,g,M,R){var O=g.current,H=Ki(),fe=Ks(O);return M=Lh(M),g.context===null?g.context=M:g.pendingContext=M,g=ji(H,fe),g.payload={element:m},R=R===void 0?null:R,R!==null&&(g.callback=R),Qa(O,g),m=Aa(O,fe,H),m!==null&&Sf(m,O,fe),fe},n};ej.exports=qMe;var XMe=ej.exports;const YMe=su(XMe),F4={},rj=t=>void Object.assign(F4,t);function KMe(t,e){function n(c,{args:f=[],attach:d,...p},y){let x=`${c[0].toUpperCase()}${c.slice(1)}`,_;if(c==="primitive"){if(p.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const v=p.object;_=R0(v,{type:c,root:y,attach:d,primitive:!0})}else{const v=F4[x];if(!v)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!");_=R0(new v(...f),{type:c,root:y,attach:d,memoizedProps:{args:f}})}return _.__r3f.attach===void 0&&(_ instanceof Ln?_.__r3f.attach="geometry":_ instanceof To&&(_.__r3f.attach="material")),x!=="inject"&&C3(_,p),_}function r(c,f){let d=!1;if(f){var p,y;(p=f.__r3f)!=null&&p.attach?M3(c,f,f.__r3f.attach):f.isObject3D&&c.isObject3D&&(c.add(f),d=!0),d||(y=c.__r3f)==null||y.objects.push(f),f.__r3f||R0(f,{}),f.__r3f.parent=c,SP(f),P0(f)}}function i(c,f,d){let p=!1;if(f){var y,x;if((y=f.__r3f)!=null&&y.attach)M3(c,f,f.__r3f.attach);else if(f.isObject3D&&c.isObject3D){f.parent=c,f.dispatchEvent({type:"added"});const _=c.children.filter(S=>S!==f),v=_.indexOf(d);c.children=[..._.slice(0,v),f,..._.slice(v)],p=!0}p||(x=c.__r3f)==null||x.objects.push(f),f.__r3f||R0(f,{}),f.__r3f.parent=c,SP(f),P0(f)}}function o(c,f,d=!1){c&&[...c].forEach(p=>a(f,p,d))}function a(c,f,d){if(f){var p,y,x;if(f.__r3f&&(f.__r3f.parent=null),(p=c.__r3f)!=null&&p.objects&&(c.__r3f.objects=c.__r3f.objects.filter(E=>E!==f)),(y=f.__r3f)!=null&&y.attach)Z6(c,f,f.__r3f.attach);else if(f.isObject3D&&c.isObject3D){var _;c.remove(f),(_=f.__r3f)!=null&&_.root&&iCe(f.__r3f.root,f)}const S=(x=f.__r3f)==null?void 0:x.primitive,w=d===void 0?f.dispose!==null&&!S:d;if(!S){var v;o((v=f.__r3f)==null?void 0:v.objects,f,w),o(f.children,f,w)}delete f.__r3f,w&&f.dispose&&f.type!=="Scene"&&_P.unstable_scheduleCallback(_P.unstable_IdlePriority,()=>{try{f.dispose()}catch{}}),P0(c)}}function s(c,f,d,p){var y;const x=(y=c.__r3f)==null?void 0:y.parent;if(!x)return;const _=n(f,d,c.__r3f.root);if(c.children){for(const v of c.children)v.__r3f&&r(_,v);c.children=c.children.filter(v=>!v.__r3f)}c.__r3f.objects.forEach(v=>r(_,v)),c.__r3f.objects=[],c.__r3f.autoRemovedBeforeAppend||a(x,c),_.parent&&(_.__r3f.autoRemovedBeforeAppend=!0),r(x,_),_.raycast&&_.__r3f.eventCount&&_.__r3f.root.getState().internal.interaction.push(_),[p,p.alternate].forEach(v=>{v!==null&&(v.stateNode=_,v.ref&&(typeof v.ref=="function"?v.ref(_):v.ref.current=_))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:YMe({createInstance:n,removeChild:a,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(c,f)=>{if(!f)return;const d=c.getState().scene;d.__r3f&&(d.__r3f.root=c,r(d,f))},removeChildFromContainer:(c,f)=>{f&&a(c.getState().scene,f)},insertInContainerBefore:(c,f,d)=>{if(!f||!d)return;const p=c.getState().scene;p.__r3f&&i(p,f,d)},getRootHostContext:()=>null,getChildHostContext:c=>c,finalizeInitialChildren(c){var f;return!!((f=c==null?void 0:c.__r3f)!=null?f:{}).handlers},prepareUpdate(c,f,d,p){var y;if(((y=c==null?void 0:c.__r3f)!=null?y:{}).primitive&&p.object&&p.object!==c)return[!0];{const{args:_=[],children:v,...S}=p,{args:w=[],children:E,...T}=d;if(!Array.isArray(_))throw new Error("R3F: the args prop must be an array!");if(_.some((D,I)=>D!==w[I]))return[!0];const A=cj(c,S,T,!0);return A.changes.length?[!1,A]:null}},commitUpdate(c,[f,d],p,y,x,_){f?s(c,p,x,_):C3(c,d)},commitMount(c,f,d,p){var y;const x=(y=c.__r3f)!=null?y:{};c.raycast&&x.handlers&&x.eventCount&&c.__r3f.root.getState().internal.interaction.push(c)},getPublicInstance:c=>c,prepareForCommit:()=>null,preparePortalMount:c=>R0(c.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(c){var f;const{attach:d,parent:p}=(f=c.__r3f)!=null?f:{};d&&p&&Z6(p,c,d),c.isObject3D&&(c.visible=!1),P0(c)},unhideInstance(c,f){var d;const{attach:p,parent:y}=(d=c.__r3f)!=null?d:{};p&&y&&M3(y,c,p),(c.isObject3D&&f.visible==null||f.visible)&&(c.visible=!0),P0(c)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():pg.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Lr.fun(performance.now)?performance.now:Lr.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Lr.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Lr.fun(clearTimeout)?clearTimeout:void 0}),applyProps:C3}}var q6,X6;const E3=t=>"colorSpace"in t||"outputColorSpace"in t,ij=()=>{var t;return(t=F4.ColorManagement)!=null?t:null},oj=t=>t&&t.isOrthographicCamera,ZMe=t=>t&&t.hasOwnProperty("current"),Pb=typeof window<"u"&&((q6=window.document)!=null&&q6.createElement||((X6=window.navigator)==null?void 0:X6.product)==="ReactNative")?V.useLayoutEffect:V.useEffect;function aj(t){const e=V.useRef(t);return Pb(()=>void(e.current=t),[t]),e}function JMe({set:t}){return Pb(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class sj extends V.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}sj.getDerivedStateFromError=()=>({error:!0});const lj="__default",Y6=new Map,QMe=t=>t&&!!t.memoized&&!!t.changes;function uj(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 Gy=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()},Lr={obj:t=>t===Object(t)&&!Lr.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(Lr.str(t)||Lr.num(t))return t===e;const o=Lr.obj(t);if(o&&r==="reference")return t===e;const a=Lr.arr(t);if(a&&n==="reference")return t===e;if((a||o)&&t===e)return!0;let s;for(s in t)if(!(s in e))return!1;if(o&&n==="shallow"&&r==="shallow"){for(s in i?e:t)if(!Lr.equ(t[s],e[s],{strict:i,objects:"reference"}))return!1}else for(s in i?e:t)if(t[s]!==e[s])return!1;if(Lr.und(s)){if(a&&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 eCe(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function R0(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function wP(t,e){let n=t;if(e.includes("-")){const r=e.split("-"),i=r.pop();return n=r.reduce((o,a)=>o[a],t),{target:n,key:i}}else return{target:n,key:e}}const K6=/-\d+$/;function M3(t,e,n){if(Lr.str(n)){if(K6.test(n)){const o=n.replace(K6,""),{target:a,key:s}=wP(t,o);Array.isArray(a[s])||(a[s]=[])}const{target:r,key:i}=wP(t,n);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=n(t,e)}function Z6(t,e,n){var r,i;if(Lr.str(n)){const{target:o,key:a}=wP(t,n),s=e.__r3f.previousAttach;s===void 0?delete o[a]:o[a]=s}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(t,e);(i=e.__r3f)==null||delete i.previousAttach}function cj(t,{children:e,key:n,ref:r,...i},{children:o,key:a,ref:s,...l}={},u=!1){var c;const f=(c=t==null?void 0:t.__r3f)!=null?c:{},d=Object.entries(i),p=[];if(u){const x=Object.keys(l);for(let _=0;_{var v;if((v=t.__r3f)!=null&&v.primitive&&x==="object"||Lr.equ(_,l[x]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(x))return p.push([x,_,!0,[]]);let S=[];x.includes("-")&&(S=x.split("-")),p.push([x,_,!1,S]);for(const w in i){const E=i[w];w.startsWith(`${x}-`)&&p.push([w,E,!1,w.split("-")])}});const y={...i};return f.memoizedProps&&f.memoizedProps.args&&(y.args=f.memoizedProps.args),f.memoizedProps&&f.memoizedProps.attach&&(y.attach=f.memoizedProps.attach),{memoized:y,changes:p}}const tCe=typeof process<"u"&&!1;function C3(t,e){var n,r,i;const o=(n=t.__r3f)!=null?n:{},a=o.root,s=(r=a==null||a.getState==null?void 0:a.getState())!=null?r:{},{memoized:l,changes:u}=QMe(e)?e:cj(t,e),c=o.eventCount;t.__r3f&&(t.__r3f.memoizedProps=l);for(let d=0;dw[E],t),!(S&&S.set))){const[w,...E]=_.reverse();v=E.reverse().reduce((T,A)=>T[A],t),p=w}if(y===lj+"remove")if(v.constructor){let w=Y6.get(v.constructor);w||(w=new v.constructor,Y6.set(v.constructor,w)),y=w[p]}else y=0;if(x)y?o.handlers[p]=y:delete o.handlers[p],o.eventCount=Object.keys(o.handlers).length;else if(S&&S.set&&(S.copy||S instanceof Mp)){if(Array.isArray(y))S.fromArray?S.fromArray(y):S.set(...y);else if(S.copy&&y&&y.constructor&&(tCe?S.constructor.name===y.constructor.name:S.constructor===y.constructor))S.copy(y);else if(y!==void 0){const w=S instanceof Pt;!w&&S.setScalar?S.setScalar(y):S instanceof Mp&&y instanceof Mp?S.mask=y.mask:S.set(y),!ij()&&!s.linear&&w&&S.convertSRGBToLinear()}}else if(v[p]=y,v[p]instanceof hi&&v[p].format===ga&&v[p].type===Ps){const w=v[p];E3(w)&&E3(s.gl)?w.colorSpace=s.gl.outputColorSpace:w.encoding=s.gl.outputEncoding}P0(t)}if(o.parent&&s.internal&&t.raycast&&c!==o.eventCount){const d=s.internal.interaction.indexOf(t);d>-1&&s.internal.interaction.splice(d,1),o.eventCount&&s.internal.interaction.push(t)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(i=t.__r3f)!=null&&i.parent&&SP(t),t}function P0(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 SP(t){t.onUpdate==null||t.onUpdate(t)}function nCe(t,e){t.manual||(oj(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 vS(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function rCe(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return pg.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return pg.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return pg.ContinuousEventPriority;default:return pg.DefaultEventPriority}}function fj(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function iCe(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)=>{fj(n.capturedMap,e,r,i)})}function oCe(t){function e(l){const{internal:u}=t.getState(),c=l.offsetX-u.initialClick[0],f=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(c*c+f*f))}function n(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(c=>{var f;return(f=u.__r3f)==null?void 0:f.handlers["onPointer"+c]}))}function r(l,u){const c=t.getState(),f=new Set,d=[],p=u?u(c.internal.interaction):c.internal.interaction;for(let v=0;v{const w=Gy(v.object),E=Gy(S.object);return!w||!E?v.distance-S.distance:E.events.priority-w.events.priority||v.distance-S.distance}).filter(v=>{const S=vS(v);return f.has(S)?!1:(f.add(S),!0)});c.events.filter&&(x=c.events.filter(x,c));for(const v of x){let S=v.object;for(;S;){var _;(_=S.__r3f)!=null&&_.eventCount&&d.push({...v,eventObject:S}),S=S.parent}}if("pointerId"in l&&c.internal.capturedMap.has(l.pointerId))for(let v of c.internal.capturedMap.get(l.pointerId).values())f.has(vS(v.intersection))||d.push(v.intersection);return d}function i(l,u,c,f){const d=t.getState();if(l.length){const p={stopped:!1};for(const y of l){const x=Gy(y.object)||d,{raycaster:_,pointer:v,camera:S,internal:w}=x,E=new ae(v.x,v.y,0).unproject(S),T=N=>{var B,G;return(B=(G=w.capturedMap.get(N))==null?void 0:G.has(y.eventObject))!=null?B:!1},A=N=>{const B={intersection:y,target:u.target};w.capturedMap.has(N)?w.capturedMap.get(N).set(y.eventObject,B):w.capturedMap.set(N,new Map([[y.eventObject,B]])),u.target.setPointerCapture(N)},D=N=>{const B=w.capturedMap.get(N);B&&fj(w.capturedMap,y.eventObject,B,N)};let I={};for(let N in u){let B=u[N];typeof B!="function"&&(I[N]=B)}let P={...y,...I,pointer:v,intersections:l,stopped:p.stopped,delta:c,unprojectedPoint:E,ray:_.ray,camera:S,stopPropagation(){const N="pointerId"in u&&w.capturedMap.get(u.pointerId);if((!N||N.has(y.eventObject))&&(P.stopped=p.stopped=!0,w.hovered.size&&Array.from(w.hovered.values()).find(B=>B.eventObject===y.eventObject))){const B=l.slice(0,l.indexOf(y));o([...B,y])}},target:{hasPointerCapture:T,setPointerCapture:A,releasePointerCapture:D},currentTarget:{hasPointerCapture:T,setPointerCapture:A,releasePointerCapture:D},nativeEvent:u};if(f(P),p.stopped===!0)break}}return l}function o(l){const{internal:u}=t.getState();for(const c of u.hovered.values())if(!l.length||!l.find(f=>f.object===c.object&&f.index===c.index&&f.instanceId===c.instanceId)){const d=c.eventObject.__r3f,p=d==null?void 0:d.handlers;if(u.hovered.delete(vS(c)),d!=null&&d.eventCount){const y={...c,intersections:l};p.onPointerOut==null||p.onPointerOut(y),p.onPointerLeave==null||p.onPointerLeave(y)}}}function a(l,u){for(let c=0;co([]);case"onLostPointerCapture":return u=>{const{internal:c}=t.getState();"pointerId"in u&&c.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{c.capturedMap.has(u.pointerId)&&(c.capturedMap.delete(u.pointerId),o([]))})}}return function(c){const{onPointerMissed:f,internal:d}=t.getState();d.lastEvent.current=c;const p=l==="onPointerMove",y=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=r(c,p?n:void 0),v=y?e(c):0;l==="onPointerDown"&&(d.initialClick=[c.offsetX,c.offsetY],d.initialHits=_.map(w=>w.eventObject)),y&&!_.length&&v<=2&&(a(c,d.interaction),f&&f(c)),p&&o(_);function S(w){const E=w.eventObject,T=E.__r3f,A=T==null?void 0:T.handlers;if(T!=null&&T.eventCount)if(p){if(A.onPointerOver||A.onPointerEnter||A.onPointerOut||A.onPointerLeave){const D=vS(w),I=d.hovered.get(D);I?I.stopped&&w.stopPropagation():(d.hovered.set(D,w),A.onPointerOver==null||A.onPointerOver(w),A.onPointerEnter==null||A.onPointerEnter(w))}A.onPointerMove==null||A.onPointerMove(w)}else{const D=A[l];D?(!y||d.initialHits.includes(E))&&(a(c,d.interaction.filter(I=>!d.initialHits.includes(I))),D(w)):y&&d.initialHits.includes(E)&&a(c,d.interaction.filter(I=>!d.initialHits.includes(I)))}}i(_,c,v,S)}}return{handlePointer:s}}const dj=t=>!!(t!=null&&t.render),hj=V.createContext(null),aCe=(t,e)=>{const n=jMe((s,l)=>{const u=new ae,c=new ae,f=new ae;function d(v=l().camera,S=c,w=l().size){const{width:E,height:T,top:A,left:D}=w,I=E/T;S instanceof ae?f.copy(S):f.set(...S);const P=v.getWorldPosition(u).distanceTo(f);if(oj(v))return{width:E/v.zoom,height:T/v.zoom,top:A,left:D,factor:1,distance:P,aspect:I};{const N=v.fov*Math.PI/180,B=2*Math.tan(N/2)*P,G=B*(E/T);return{width:G,height:B,top:A,left:D,factor:E/G,distance:P,aspect:I}}}let p;const y=v=>s(S=>({performance:{...S.performance,current:v}})),x=new Je;return{set:s,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(v=1)=>t(l(),v),advance:(v,S)=>e(v,S,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new N4,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const v=l();p&&clearTimeout(p),v.performance.current!==v.performance.min&&y(v.performance.min),p=setTimeout(()=>y(l().performance.max),v.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:d},setEvents:v=>s(S=>({...S,events:{...S.events,...v}})),setSize:(v,S,w,E,T)=>{const A=l().camera,D={width:v,height:S,top:E||0,left:T||0,updateStyle:w};s(I=>({size:D,viewport:{...I.viewport,...d(A,c,D)}}))},setDpr:v=>s(S=>{const w=uj(v);return{viewport:{...S.viewport,dpr:w,initialDpr:S.viewport.initialDpr||w}}}),setFrameloop:(v="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,v!=="never"&&(S.start(),S.elapsedTime=0),s(()=>({frameloop:v}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:V.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(v,S,w)=>{const E=l().internal;return E.priority=E.priority+(S>0?1:0),E.subscribers.push({ref:v,priority:S,store:w}),E.subscribers=E.subscribers.sort((T,A)=>T.priority-A.priority),()=>{const T=l().internal;T!=null&&T.subscribers&&(T.priority=T.priority-(S>0?1:0),T.subscribers=T.subscribers.filter(A=>A.ref!==v))}}}}}),r=n.getState();let i=r.size,o=r.viewport.dpr,a=r.camera;return n.subscribe(()=>{const{camera:s,size:l,viewport:u,gl:c,set:f}=n.getState();if(l.width!==i.width||l.height!==i.height||u.dpr!==o){var d;i=l,o=u.dpr,nCe(s,l),c.setPixelRatio(u.dpr);const p=(d=l.updateStyle)!=null?d:typeof HTMLCanvasElement<"u"&&c.domElement instanceof HTMLCanvasElement;c.setSize(l.width,l.height,p)}s!==a&&(a=s,f(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(s)}})))}),n.subscribe(s=>t(s)),n};let yS,sCe=new Set,lCe=new Set,uCe=new Set;function A3(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function jy(t,e){switch(t){case"before":return A3(sCe,e);case"after":return A3(lCe,e);case"tail":return A3(uCe,e)}}let T3,D3;function R3(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),T3=e.internal.subscribers,yS=0;yS0)&&!((u=i.gl.xr)!=null&&u.isPresenting)&&(n+=R3(l,i))}if(jy("after",l),n===0)return jy("tail",l),e=!1,cancelAnimationFrame(r)}function a(l,u=1){var c;if(!l)return t.forEach(f=>a(f.store.getState()),u);(c=l.gl.xr)!=null&&c.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+u),e||(e=!0,requestAnimationFrame(o)))}function s(l,u=!0,c,f){if(u&&jy("before",l),c)R3(l,c,f);else for(const d of t.values())R3(l,d.store.getState());u&&jy("after",l)}return{loop:o,invalidate:a,advance:s}}function pj(){const t=V.useContext(hj);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function Co(t=n=>n,e){return pj()(t,e)}function k4(t,e=0){const n=pj(),r=n.getState().internal.subscribe,i=aj(t);return Pb(()=>r(i,e,n),[e,r,n]),null}const ev=new Map,{invalidate:J6,advance:Q6}=cCe(ev),{reconciler:y2,applyProps:_0}=KMe(ev,rCe),w0={objects:"shallow",strict:!1},fCe=(t,e)=>{const n=typeof t=="function"?t(e):t;return dj(n)?n:new m4({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function dCe(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:o,left:a,updateStyle:s=n}=e;return{width:r,height:i,top:o,left:a,updateStyle:s}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:r,height:i,top:o,left:a}=t.parentElement.getBoundingClientRect();return{width:r,height:i,top:o,left:a,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 hCe(t){const e=ev.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||aCe(J6,Q6),a=n||y2.createContainer(o,pg.ConcurrentRoot,null,!1,null,"",i,null);e||ev.set(t,{fiber:a,store:o});let s,l=!1,u;return{configure(c={}){let{gl:f,size:d,scene:p,events:y,onCreated:x,shadows:_=!1,linear:v=!1,flat:S=!1,legacy:w=!1,orthographic:E=!1,frameloop:T="always",dpr:A=[1,2],performance:D,raycaster:I,camera:P,onPointerMissed:N}=c,B=o.getState(),G=B.gl;B.gl||B.set({gl:G=fCe(f,t)});let Z=B.raycaster;Z||B.set({raycaster:Z=new ZG});const{params:j,...J}=I||{};if(Lr.equ(J,Z,w0)||_0(Z,{...J}),Lr.equ(j,Z.params,w0)||_0(Z,{params:{...Z.params,...j}}),!B.camera||B.camera===u&&!Lr.equ(u,P,w0)){u=P;const ue=P instanceof Sb,ce=ue?P:E?new Cb(0,0,0,0,.1,1e3):new ao(75,0,.1,1e3);ue||(ce.position.z=5,P&&_0(ce,P),!B.camera&&!(P!=null&&P.rotation)&&ce.lookAt(0,0,0)),B.set({camera:ce}),Z.camera=ce}if(!B.scene){let ue;p instanceof g2?ue=p:(ue=new g2,p&&_0(ue,p)),B.set({scene:R0(ue)})}if(!B.xr){var Y;const ue=(Re,Ie)=>{const He=o.getState();He.frameloop!=="never"&&Q6(Re,!0,He,Ie)},ce=()=>{const Re=o.getState();Re.gl.xr.enabled=Re.gl.xr.isPresenting,Re.gl.xr.setAnimationLoop(Re.gl.xr.isPresenting?ue:null),Re.gl.xr.isPresenting||J6(Re)},Ce={connect(){const Re=o.getState().gl;Re.xr.addEventListener("sessionstart",ce),Re.xr.addEventListener("sessionend",ce)},disconnect(){const Re=o.getState().gl;Re.xr.removeEventListener("sessionstart",ce),Re.xr.removeEventListener("sessionend",ce)}};typeof((Y=G.xr)==null?void 0:Y.addEventListener)=="function"&&Ce.connect(),B.set({xr:Ce})}if(G.shadowMap){const ue=G.shadowMap.enabled,ce=G.shadowMap.type;if(G.shadowMap.enabled=!!_,Lr.boo(_))G.shadowMap.type=I1;else if(Lr.str(_)){var $;const Ce={basic:VV,percentage:fC,soft:I1,variance:Hl};G.shadowMap.type=($=Ce[_])!=null?$:I1}else Lr.obj(_)&&Object.assign(G.shadowMap,_);(ue!==G.shadowMap.enabled||ce!==G.shadowMap.type)&&(G.shadowMap.needsUpdate=!0)}const W=ij();W&&("enabled"in W?W.enabled=!w:"legacyMode"in W&&(W.legacyMode=w)),_0(G,{outputEncoding:v?3e3:3001,toneMapping:S?ju:KO}),B.legacy!==w&&B.set(()=>({legacy:w})),B.linear!==v&&B.set(()=>({linear:v})),B.flat!==S&&B.set(()=>({flat:S})),f&&!Lr.fun(f)&&!dj(f)&&!Lr.equ(f,G,w0)&&_0(G,f),y&&!B.events.handlers&&B.set({events:y(o)});const re=dCe(t,d);return Lr.equ(re,B.size,w0)||B.setSize(re.width,re.height,re.updateStyle,re.top,re.left),A&&B.viewport.dpr!==uj(A)&&B.setDpr(A),B.frameloop!==T&&B.setFrameloop(T),B.onPointerMissed||B.set({onPointerMissed:N}),D&&!Lr.equ(D,B.performance,w0)&&B.set(ue=>({performance:{...ue.performance,...D}})),s=x,l=!0,this},render(c){return l||this.configure(),y2.updateContainer(V.createElement(pCe,{store:o,children:c,onCreated:s,rootElement:t}),a,null,()=>{}),o},unmount(){mj(t)}}}function pCe({store:t,children:e,onCreated:n,rootElement:r}){return Pb(()=>{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)},[]),V.createElement(hj.Provider,{value:t},e)}function mj(t,e){const n=ev.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),y2.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var o,a,s,l;i.events.disconnect==null||i.events.disconnect(),(o=i.gl)==null||(a=o.renderLists)==null||a.dispose==null||a.dispose(),(s=i.gl)==null||s.forceContextLoss==null||s.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),eCe(i),ev.delete(t),e&&e(t)}catch{}},500)})}}y2.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:V.version});function EP(t,e,n){var r,i,o,a,s;e==null&&(e=100);function l(){var c=Date.now()-a;c=0?r=setTimeout(l,e-c):(r=null,n||(s=t.apply(o,i),o=i=null))}var u=function(){o=this,i=arguments,a=Date.now();var c=n&&!r;return r||(r=setTimeout(l,e)),c&&(s=t.apply(o,i),o=i=null),s};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(s=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},u}EP.debounce=EP;var mCe=EP;const eB=su(mCe);function gCe(t){let{debounce:e,scroll:n,polyfill:r,offsetSize:i}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const o=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!o)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[a,s]=V.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=V.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a}),u=e?typeof e=="number"?e:e.scroll:null,c=e?typeof e=="number"?e:e.resize:null,f=V.useRef(!1);V.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[d,p,y]=V.useMemo(()=>{const S=()=>{if(!l.current.element)return;const{left:w,top:E,width:T,height:A,bottom:D,right:I,x:P,y:N}=l.current.element.getBoundingClientRect(),B={left:w,top:E,width:T,height:A,bottom:D,right:I,x:P,y:N};l.current.element instanceof HTMLElement&&i&&(B.height=l.current.element.offsetHeight,B.width=l.current.element.offsetWidth),Object.freeze(B),f.current&&!bCe(l.current.lastBounds,B)&&s(l.current.lastBounds=B)};return[S,c?eB(S,c):S,u?eB(S,u):S]},[s,i,u,c]);function x(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",y,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function _(){l.current.element&&(l.current.resizeObserver=new o(y),l.current.resizeObserver.observe(l.current.element),n&&l.current.scrollContainers&&l.current.scrollContainers.forEach(S=>S.addEventListener("scroll",y,{capture:!0,passive:!0})))}const v=S=>{!S||S===l.current.element||(x(),l.current.element=S,l.current.scrollContainers=gj(S),_())};return yCe(y,!!n),vCe(p),V.useEffect(()=>{x(),_()},[n,y,p]),V.useEffect(()=>x,[]),[v,a,d]}function vCe(t){V.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function yCe(t,e){V.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function gj(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,...gj(t.parentElement)]}const xCe=["x","y","top","bottom","left","right","width","height"],bCe=(t,e)=>xCe.every(n=>t[n]===e[n]);var _Ce=Object.defineProperty,wCe=Object.defineProperties,SCe=Object.getOwnPropertyDescriptors,tB=Object.getOwnPropertySymbols,ECe=Object.prototype.hasOwnProperty,MCe=Object.prototype.propertyIsEnumerable,nB=(t,e,n)=>e in t?_Ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,rB=(t,e)=>{for(var n in e||(e={}))ECe.call(e,n)&&nB(t,n,e[n]);if(tB)for(var n of tB(e))MCe.call(e,n)&&nB(t,n,e[n]);return t},CCe=(t,e)=>wCe(t,SCe(e));function vj(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=e?t.return:t.child;for(;r;){const i=vj(r,e,n);if(i)return i;r=e?null:r.sibling}}function yj(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const B4=yj(V.createContext(null));class xj extends V.Component{render(){return V.createElement(B4.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:iB,ReactCurrentDispatcher:oB}=V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function ACe(){const t=V.useContext(B4);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=V.useId();return V.useMemo(()=>{for(const r of[iB==null?void 0:iB.current,t,t==null?void 0:t.alternate]){if(!r)continue;const i=vj(r,!1,o=>{let a=o.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(i)return i}},[t,e])}function TCe(){var t,e;const n=ACe(),[r]=V.useState(()=>new Map);r.clear();let i=n;for(;i;){const o=(t=i.type)==null?void 0:t._context;o&&o!==B4&&!r.has(o)&&r.set(o,(e=oB==null?void 0:oB.current)==null?void 0:e.readContext(yj(o))),i=i.return}return r}function DCe(){const t=TCe();return V.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>V.createElement(e,null,V.createElement(n.Provider,CCe(rB({},r),{value:t.get(n)}))),e=>V.createElement(xj,rB({},e))),[t])}const P3={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 RCe(t){const{handlePointer:e}=oCe(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(P3).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(a=>({events:{...a.events,connected:n}})),Object.entries((r=o.handlers)!=null?r:[]).forEach(([a,s])=>{const[l,u]=P3[a];n.addEventListener(l,s,{passive:u})})},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([o,a])=>{if(r&&r.connected instanceof HTMLElement){const[s]=P3[o];r.connected.removeEventListener(s,a)}}),n(o=>({events:{...o.events,connected:void 0}}))}}}}const PCe=V.forwardRef(function({children:e,fallback:n,resize:r,style:i,gl:o,events:a=RCe,eventSource:s,eventPrefix:l,shadows:u,linear:c,flat:f,legacy:d,orthographic:p,frameloop:y,dpr:x,performance:_,raycaster:v,camera:S,scene:w,onPointerMissed:E,onCreated:T,...A},D){V.useMemo(()=>rj(VMe),[]);const I=DCe(),[P,N]=gCe({scroll:!0,debounce:{scroll:50,resize:0},...r}),B=V.useRef(null),G=V.useRef(null);V.useImperativeHandle(D,()=>B.current);const Z=aj(E),[j,J]=V.useState(!1),[Y,$]=V.useState(!1);if(j)throw j;if(Y)throw Y;const W=V.useRef(null);Pb(()=>{const ne=B.current;N.width>0&&N.height>0&&ne&&(W.current||(W.current=hCe(ne)),W.current.configure({gl:o,events:a,shadows:u,linear:c,flat:f,legacy:d,orthographic:p,frameloop:y,dpr:x,performance:_,raycaster:v,camera:S,scene:w,size:N,onPointerMissed:(...re)=>Z.current==null?void 0:Z.current(...re),onCreated:re=>{re.events.connect==null||re.events.connect(s?ZMe(s)?s.current:s:G.current),l&&re.setEvents({compute:(ue,ce)=>{const Ce=ue[l+"X"],Re=ue[l+"Y"];ce.pointer.set(Ce/ce.size.width*2-1,-(Re/ce.size.height)*2+1),ce.raycaster.setFromCamera(ce.pointer,ce.camera)}}),T==null||T(re)}}),W.current.render(V.createElement(I,null,V.createElement(sj,{set:$},V.createElement(V.Suspense,{fallback:V.createElement(JMe,{set:J})},e)))))}),V.useEffect(()=>{const ne=B.current;if(ne)return()=>mj(ne)},[]);const U=s?"none":"auto";return V.createElement("div",ee({ref:G,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:U,...i}},A),V.createElement("div",{ref:P,style:{width:"100%",height:"100%"}},V.createElement("canvas",{ref:B,style:{display:"block"}},n)))}),NCe=V.forwardRef(function(e,n){return V.createElement(xj,null,V.createElement(PCe,ee({},e,{ref:n})))});function cE(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function OCe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function bj(t){let e,n,r;t.length!==2?(e=cE,n=(s,l)=>cE(t(s),l),r=(s,l)=>t(s)-l):(e=t===cE||t===OCe?t:ICe,n=t,r=t);function i(s,l,u=0,c=s.length){if(u>>1;n(s[f],l)<0?u=f+1:c=f}while(u>>1;n(s[f],l)<=0?u=f+1:c=f}while(uu&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function ICe(){return 0}function LCe(t){return t===null?NaN:+t}const FCe=bj(cE),kCe=FCe.right;bj(LCe).center;const BCe=kCe,UCe=Math.sqrt(50),zCe=Math.sqrt(10),$Ce=Math.sqrt(2);function x2(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=UCe?10:o>=zCe?5:o>=$Ce?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(t*u),l=Math.round(e*u),s/ue&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(t/u),l=Math.round(e/u),s*ue&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let u=0;u>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?xS(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?xS(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=VCe.exec(t))?new uo(e[1],e[2],e[3],1):(e=WCe.exec(t))?new uo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=GCe.exec(t))?xS(e[1],e[2],e[3],e[4]):(e=jCe.exec(t))?xS(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=qCe.exec(t))?dB(e[1],e[2]/100,e[3]/100,1):(e=XCe.exec(t))?dB(e[1],e[2]/100,e[3]/100,e[4]):aB.hasOwnProperty(t)?uB(aB[t]):t==="transparent"?new uo(NaN,NaN,NaN,0):null}function uB(t){return new uo(t>>16&255,t>>8&255,t&255,1)}function xS(t,e,n,r){return r<=0&&(t=e=n=NaN),new uo(t,e,n,r)}function U4(t){return t instanceof nh||(t=Gx(t)),t?(t=t.rgb(),new uo(t.r,t.g,t.b,t.opacity)):new uo}function Ud(t,e,n,r){return arguments.length===1?U4(t):new uo(t,e,n,r??1)}function uo(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}xv(uo,Ud,Nb(nh,{brighter(t){return t=t==null?tv:Math.pow(tv,t),new uo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Wp:Math.pow(Wp,t),new uo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new uo(Ap(this.r),Ap(this.g),Ap(this.b),b2(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:cB,formatHex:cB,formatHex8:ZCe,formatRgb:fB,toString:fB}));function cB(){return`#${mp(this.r)}${mp(this.g)}${mp(this.b)}`}function ZCe(){return`#${mp(this.r)}${mp(this.g)}${mp(this.b)}${mp((isNaN(this.opacity)?1:this.opacity)*255)}`}function fB(){const t=b2(this.opacity);return`${t===1?"rgb(":"rgba("}${Ap(this.r)}, ${Ap(this.g)}, ${Ap(this.b)}${t===1?")":`, ${t})`}`}function b2(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ap(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mp(t){return t=Ap(t),(t<16?"0":"")+t.toString(16)}function dB(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Xl(t,e,n,r)}function wj(t){if(t instanceof Xl)return new Xl(t.h,t.s,t.l,t.opacity);if(t instanceof nh||(t=Gx(t)),!t)return new Xl;if(t instanceof Xl)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),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n0&&l<1?0:a,new Xl(a,s,l,t.opacity)}function _2(t,e,n,r){return arguments.length===1?wj(t):new Xl(t,e,n,r??1)}function Xl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}xv(Xl,_2,Nb(nh,{brighter(t){return t=t==null?tv:Math.pow(tv,t),new Xl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Wp:Math.pow(Wp,t),new Xl(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 uo(N3(t>=240?t-240:t+120,i,r),N3(t,i,r),N3(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Xl(hB(this.h),bS(this.s),bS(this.l),b2(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=b2(this.opacity);return`${t===1?"hsl(":"hsla("}${hB(this.h)}, ${bS(this.s)*100}%, ${bS(this.l)*100}%${t===1?")":`, ${t})`}`}}));function hB(t){return t=(t||0)%360,t<0?t+360:t}function bS(t){return Math.max(0,Math.min(1,t||0))}function N3(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 Sj=Math.PI/180,Ej=180/Math.PI,w2=18,Mj=.96422,Cj=1,Aj=.82521,Tj=4/29,Dg=6/29,Dj=3*Dg*Dg,JCe=Dg*Dg*Dg;function Rj(t){if(t instanceof Yu)return new Yu(t.l,t.a,t.b,t.opacity);if(t instanceof Gc)return Pj(t);t instanceof uo||(t=U4(t));var e=F3(t.r),n=F3(t.g),r=F3(t.b),i=O3((.2225045*e+.7168786*n+.0606169*r)/Cj),o,a;return e===n&&n===r?o=a=i:(o=O3((.4360747*e+.3850649*n+.1430804*r)/Mj),a=O3((.0139322*e+.0971045*n+.7141733*r)/Aj)),new Yu(116*i-16,500*(o-i),200*(i-a),t.opacity)}function AP(t,e,n,r){return arguments.length===1?Rj(t):new Yu(t,e,n,r??1)}function Yu(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}xv(Yu,AP,Nb(nh,{brighter(t){return new Yu(this.l+w2*(t??1),this.a,this.b,this.opacity)},darker(t){return new Yu(this.l-w2*(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=Mj*I3(e),t=Cj*I3(t),n=Aj*I3(n),new uo(L3(3.1338561*e-1.6168667*t-.4906146*n),L3(-.9787684*e+1.9161415*t+.033454*n),L3(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function O3(t){return t>JCe?Math.pow(t,1/3):t/Dj+Tj}function I3(t){return t>Dg?t*t*t:Dj*(t-Tj)}function L3(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function F3(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function QCe(t){if(t instanceof Gc)return new Gc(t.h,t.c,t.l,t.opacity);if(t instanceof Yu||(t=Rj(t)),t.a===0&&t.b===0)return new Gc(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r()=>t;function Oj(t,e){return function(n){return t+n*e}}function rAe(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 H4(t,e){var n=e-t;return n?Oj(t,n>180||n<-180?n-360*Math.round(n/360):n):zC(isNaN(t)?e:t)}function iAe(t){return(t=+t)==1?co:function(e,n){return n-e?rAe(e,n,t):zC(isNaN(e)?n:e)}}function co(t,e){var n=e-t;return n?Oj(t,n):zC(isNaN(t)?e:t)}const DP=function t(e){var n=iAe(e);function r(i,o){var a=n((i=Ud(i)).r,(o=Ud(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=co(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=t,r}(1);function oAe(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;an&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:nv(r,i)})),n=k3.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function EAe(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?MAe:EAe,l=u=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=s(t.map(r),e,n)))(r(a(d)))}return f.invert=function(d){return a(i((u||(u=s(e,t.map(r),nv)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,wAe),c()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),c()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=W4,c()},f.clamp=function(d){return arguments.length?(a=d?!0:Uu,c()):a!==Uu},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,p){return r=d,i=p,c()}}function CAe(){return VC()(Uu,Uu)}function AAe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function S2(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 rv(t){return t=S2(Math.abs(t)),t?t[1]:NaN}function TAe(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function DAe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var RAe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function qx(t){if(!(e=RAe.exec(t)))throw new Error("invalid format: "+t);var e;return new G4({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]})}qx.prototype=G4.prototype;function G4(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+""}G4.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 PAe(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 kj;function NAe(t,e){var n=S2(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(kj=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+S2(t,Math.max(0,e+o-1))[0]}function yB(t,e){var n=S2(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 xB={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:AAe,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)=>yB(t*100,e),r:yB,s:NAe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function bB(t){return t}var _B=Array.prototype.map,wB=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function OAe(t){var e=t.grouping===void 0||t.thousands===void 0?bB:TAe(_B.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?bB:DAe(_B.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(f){f=qx(f);var d=f.fill,p=f.align,y=f.sign,x=f.symbol,_=f.zero,v=f.width,S=f.comma,w=f.precision,E=f.trim,T=f.type;T==="n"?(S=!0,T="g"):xB[T]||(w===void 0&&(w=12),E=!0,T="g"),(_||d==="0"&&p==="=")&&(_=!0,d="0",p="=");var A=x==="$"?n:x==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",D=x==="$"?r:/[%p]/.test(T)?a:"",I=xB[T],P=/[defgprs%]/.test(T);w=w===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function N(B){var G=A,Z=D,j,J,Y;if(T==="c")Z=I(B)+Z,B="";else{B=+B;var $=B<0||1/B<0;if(B=isNaN(B)?l:I(Math.abs(B),w),E&&(B=PAe(B)),$&&+B==0&&y!=="+"&&($=!1),G=($?y==="("?y:s:y==="-"||y==="("?"":y)+G,Z=(T==="s"?wB[8+kj/3]:"")+Z+($&&y==="("?")":""),P){for(j=-1,J=B.length;++jY||Y>57){Z=(Y===46?i+B.slice(j+1):B.slice(j))+Z,B=B.slice(0,j);break}}}S&&!_&&(B=e(B,1/0));var W=G.length+B.length+Z.length,U=W>1)+G+B+Z+U.slice(W);break;default:B=U+G+B+Z;break}return o(B)}return N.toString=function(){return f+""},N}function c(f,d){var p=u((f=qx(f),f.type="f",f)),y=Math.max(-8,Math.min(8,Math.floor(rv(d)/3)))*3,x=Math.pow(10,-y),_=wB[8+y/3];return function(v){return p(x*v)+_}}return{format:u,formatPrefix:c}}var _S,oc,Bj;IAe({thousands:",",grouping:[3],currency:["$",""]});function IAe(t){return _S=OAe(t),oc=_S.format,Bj=_S.formatPrefix,_S}function LAe(t){return Math.max(0,-rv(Math.abs(t)))}function FAe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(rv(e)/3)))*3-rv(Math.abs(t)))}function kAe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,rv(e)-rv(t))+1}function BAe(t,e,n,r){var i=_j(t,e,n),o;switch(r=qx(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=FAe(i,a))&&(r.precision=o),Bj(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=kAe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=LAe(i))&&(r.precision=o-(r.type==="%")*2);break}}return oc(r)}function j4(t){var e=t.domain;return t.ticks=function(n){var r=e();return MP(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return BAe(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,a=r[i],s=r[o],l,u,c=10;for(s0;){if(u=CP(a,s,n),u===l)return r[i]=a,r[o]=s,e(r);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;l=u}return t},t}function Uj(){var t=CAe();return t.copy=function(){return HC(t,Uj())},BC.apply(t,arguments),j4(t)}function UAe(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return oMath.pow(t,e)}function WAe(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 MB(t){return(e,n)=>-t(-e,n)}function GAe(t){const e=t(SB,EB),n=e.domain;let r=10,i,o;function a(){return i=WAe(r),o=VAe(r),n()[0]<0?(i=MB(i),o=MB(o),t(zAe,$Ae)):t(SB,EB),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let u=l[0],c=l[l.length-1];const f=c0){for(;d<=p;++d)for(y=1;yc)break;v.push(x)}}else for(;d<=p;++d)for(y=r-1;y>=1;--y)if(x=d>0?y/o(-d):y*o(d),!(xc)break;v.push(x)}v.length*2<_&&(v=MP(u,c,_))}else v=MP(d,p,Math.min(p-d,_)).map(o);return f?v.reverse():v},e.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=qx(l)).precision==null&&(l.trim=!0),l=oc(l)),s===1/0)return l;const u=Math.max(1,r*s/e.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*rn(UAe(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function zj(){const t=GAe(VC()).domain([1,10]);return t.copy=()=>HC(t,zj()).base(t.base()),BC.apply(t,arguments),t}function CB(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function AB(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function jAe(t){var e=1,n=t(CB(e),AB(e));return n.constant=function(r){return arguments.length?t(CB(e=+r),AB(e)):e},j4(n)}function $j(){var t=jAe(VC());return t.copy=function(){return HC(t,$j()).constant(t.constant())},BC.apply(t,arguments)}function TB(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function qAe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function XAe(t){return t<0?-t*t:t*t}function YAe(t){var e=t(Uu,Uu),n=1;function r(){return n===1?t(Uu,Uu):n===.5?t(qAe,XAe):t(TB(n),TB(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},j4(e)}function q4(){var t=YAe(VC());return t.copy=function(){return HC(t,q4()).exponent(t.exponent())},BC.apply(t,arguments),t}function KAe(){return q4.apply(null,arguments).exponent(.5)}const B3=new Date,U3=new Date;function Do(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 a=i(o),s=i.ceil(o);return o-a(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let u;do l.push(u=new Date(+o)),e(o,s),t(o);while(uDo(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(B3.setTime(+o),U3.setTime(+a),t(B3),t(U3),Math.floor(n(B3,U3))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const Xx=1e3,zd=Xx*60,Yx=zd*60,Kx=Yx*24,Hj=Kx*7,X4=Do(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Xx)},(t,e)=>(e-t)/Xx,t=>t.getUTCSeconds());X4.range;const Vj=Do(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Xx)},(t,e)=>{t.setTime(+t+e*zd)},(t,e)=>(e-t)/zd,t=>t.getMinutes());Vj.range;const Wj=Do(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*zd)},(t,e)=>(e-t)/zd,t=>t.getUTCMinutes());Wj.range;const Gj=Do(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Xx-t.getMinutes()*zd)},(t,e)=>{t.setTime(+t+e*Yx)},(t,e)=>(e-t)/Yx,t=>t.getHours());Gj.range;const jj=Do(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Yx)},(t,e)=>(e-t)/Yx,t=>t.getUTCHours());jj.range;const qj=Do(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*zd)/Kx,t=>t.getDate()-1);qj.range;const Xj=Do(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Kx,t=>t.getUTCDate()-1);Xj.range;const ZAe=Do(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Kx,t=>Math.floor(t/Kx));ZAe.range;function em(t){return Do(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())*zd)/Hj)}const Yj=em(0),JAe=em(1),QAe=em(2),eTe=em(3),tTe=em(4),nTe=em(5),rTe=em(6);Yj.range;JAe.range;QAe.range;eTe.range;tTe.range;nTe.range;rTe.range;function tm(t){return Do(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)/Hj)}const Kj=tm(0),iTe=tm(1),oTe=tm(2),aTe=tm(3),sTe=tm(4),lTe=tm(5),uTe=tm(6);Kj.range;iTe.range;oTe.range;aTe.range;sTe.range;lTe.range;uTe.range;const Zj=Do(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());Zj.range;const Jj=Do(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());Jj.range;const Y4=Do(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());Y4.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Do(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)});Y4.range;const K4=Do(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());K4.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Do(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)});K4.range;function cTe(t,e){e.domain&&("nice"in t||"quantiles"in t||"padding"in t,t.domain(e.domain))}function fTe(t,e){e.range&&("padding"in t,t.range(e.range))}function dTe(t,e){"align"in t&&"align"in e&&typeof e.align<"u"&&t.align(e.align)}function hTe(t,e){"base"in t&&"base"in e&&typeof e.base<"u"&&t.base(e.base)}function pTe(t,e){"clamp"in t&&"clamp"in e&&typeof e.clamp<"u"&&t.clamp(e.clamp)}function mTe(t,e){"constant"in t&&"constant"in e&&typeof e.constant<"u"&&t.constant(e.constant)}function gTe(t,e){"exponent"in t&&"exponent"in e&&typeof e.exponent<"u"&&t.exponent(e.exponent)}var DB={lab:vAe,hcl:yAe,"hcl-long":xAe,hsl:mAe,"hsl-long":gAe,cubehelix:bAe,"cubehelix-long":$C,rgb:DP};function vTe(t){switch(t){case"lab":case"hcl":case"hcl-long":case"hsl":case"hsl-long":case"cubehelix":case"cubehelix-long":case"rgb":return DB[t]}var e=t.type,n=t.gamma,r=DB[e];return typeof n>"u"?r:r.gamma(n)}function yTe(t,e){if("interpolate"in e&&"interpolate"in t&&typeof e.interpolate<"u"){var n=vTe(e.interpolate);t.interpolate(n)}}var xTe=new Date(Date.UTC(2020,1,2,3,4,5)),bTe="%Y-%m-%d %H:%M";function _Te(t){var e=t.tickFormat(1,bTe)(xTe);return e==="2020-02-02 03:04"}var RB={day:qj,hour:Gj,minute:Vj,month:Zj,second:X4,week:Yj,year:Y4},PB={day:Xj,hour:jj,minute:Wj,month:Jj,second:X4,week:Kj,year:K4};function wTe(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=_Te(r);if(typeof n=="string")r.nice(i?PB[n]:RB[n]);else{var o=n.interval,a=n.step,s=(i?PB[o]:RB[o]).every(a);s!=null&&r.nice(s)}}}}function STe(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 ETe(t,e){if(e.reverse){var n=t.range().slice().reverse();"padding"in t,t.range(n)}}function MTe(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(W4))}function CTe(t,e){"unknown"in t&&"unknown"in e&&typeof e.unknown<"u"&&t.unknown(e.unknown)}function ATe(t,e){if("zero"in e&&e.zero===!0){var n=t.domain(),r=n[0],i=n[1],o=i0,a=[],s=[],l=0,u=0,c,f;for(c=0;c0&&a.push("var "+s.join(",")),c=r-1;c>=0;--c)l=t[c],a.push(["for(i",c,"=0;i",c,"0&&a.push(["index[",u,"]-=s",u].join("")),a.push(["++index[",l,"]"].join(""))),a.push("}")}return a.join(` +`)}function jTe(t,e,n,r){for(var i=e.length,o=n.arrayArgs.length,a=n.blockSize,s=n.indexArgs.length>0,l=[],u=0;u0;){"].join("")),l.push(["if(j",u,"<",a,"){"].join("")),l.push(["s",e[u],"=j",u].join("")),l.push(["j",u,"=0"].join("")),l.push(["}else{s",e[u],"=",a].join("")),l.push(["j",u,"-=",a,"}"].join("")),s&&l.push(["index[",e[u],"]=j",u].join(""));for(var u=0;u0&&(n=n&&e[r]===e[r-1])}return n?e[0]:e.join("")}function YTe(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 _=new Array(n),o=0;o0&&y.push("var "+x.join(","));for(var o=0;o3&&y.push(z3(t.pre,t,i));var E=z3(t.body,t,i),T=qTe(c);T3&&y.push(z3(t.post,t,i)),t.debug&&console.log("-----Generated cwise routine for ",e,`: +`+y.join(` +`)+` +----------`);var A=[t.funcName||"unnamed","_cwise_loop_",r[0].join("s"),"m",T,XTe(i)].join(""),D=new Function(["function ",A,"(",p.join(","),"){",y.join(` +`),"} return ",A].join(""));return D()}var KTe=YTe,ZTe=KTe;function JTe(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=[],a=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],s=[],l=[],u=0;u0&&(s.push("array"+t.arrayArgs[0]+".shape.length===array"+c+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),l.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+c+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+s.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 u=0;u0)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,e3e(e)}var r3e=n3e;(function(t){var e=r3e,n={body:"",args:[],thisVars:[],localVars:[]};function r(d){if(!d)return n;for(var p=0;p>",rrshift:">>>"};(function(){for(var d in a){var p=a[d];t[d]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+p+"c"},funcName:d}),t[d+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+p+"=b"},rvalue:!0,funcName:d+"eq"}),t[d+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+p+"s"},funcName:d+"s"}),t[d+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+p+"=s"},rvalue:!0,funcName:d+"seq"})}})();var s={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var d in s){var p=s[d];t[d]=o({args:["array","array"],body:{args:["a","b"],body:"a="+p+"b"},funcName:d}),t[d+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+p+"a"},rvalue:!0,count:2,funcName:d+"eq"})}})();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var d in l){var p=l[d];t[d]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+p+"c"},funcName:d}),t[d+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+p+"s"},funcName:d+"s"}),t[d+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+p+"b"},rvalue:!0,count:2,funcName:d+"eq"}),t[d+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+p+"s"},rvalue:!0,count:2,funcName:d+"seq"})}})();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var d=0;dthis_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"})})(zTe);var eq={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],i=0;i=0)&&(n[i]=t[i]);return n}function Ib(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.transform,a=t.className,s=t.children,l=t.innerRef,u=o3e(t,i3e);return se.createElement("g",NP({ref:l,className:rc("visx-group",a),transform:o||"translate("+i+", "+n+")"},u),s)}Ib.propTypes={top:at.number,left:at.number,transform:at.string,className:at.string,children:at.node,innerRef:at.oneOfType([at.string,at.func,at.object])};var a3e=["from","to","fill","className","innerRef"];function OP(){return OP=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function nq(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,a=o===void 0?"transparent":o,s=t.className,l=t.innerRef,u=s3e(t,a3e),c=n.x===i.x||n.y===i.y;return se.createElement("line",OP({ref:l,className:rc("visx-line",s),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:a,shapeRendering:c?"crispEdges":"auto"},u))}var l3e=rq;function rq(t,e,n){t instanceof RegExp&&(t=NB(t,n)),e instanceof RegExp&&(e=NB(e,n));var r=iq(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 NB(t,e){var n=e.match(t);return n?n[0]:null}rq.range=iq;function iq(t,e,n){var r,i,o,a,s,l=n.indexOf(t),u=n.indexOf(e,l+1),c=l;if(l>=0&&u>0){for(r=[],o=n.length;c>=0&&!s;)c==l?(r.push(c),l=n.indexOf(t,c+1)):r.length==1?s=[r.pop(),u]:(i=r.pop(),i=0?l:u;r.length&&(s=[o,a])}return s}var u3e=oq;function oq(t,e,n){t instanceof RegExp&&(t=OB(t,n)),e instanceof RegExp&&(e=OB(e,n));var r=aq(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 OB(t,e){var n=e.match(t);return n?n[0]:null}oq.range=aq;function aq(t,e,n){var r,i,o,a,s,l=n.indexOf(t),u=n.indexOf(e,l+1),c=l;if(l>=0&&u>0){if(t===e)return[l,u];for(r=[],o=n.length;c>=0&&!s;)c==l?(r.push(c),l=n.indexOf(t,c+1)):r.length==1?s=[r.pop(),u]:(i=r.pop(),i=0?l:u;r.length&&(s=[o,a])}return s}var c3e=u3e,f3e=sq;function sq(t,e,n){var r=t;return d3e(t,e).reduce(function(i,o){return i.replace(o.functionIdentifier+"("+o.matches.body+")",h3e(o.matches.body,o.functionIdentifier,n,r,e))},t)}function d3e(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],a=i.index,s=c3e("(",")",t.substring(a));if(!s||s.start!==i[0].length-1)throw new SyntaxError(o+"(): missing closing ')' in the value '"+t+"'");n.push({matches:s,functionIdentifier:o}),t=s.post}while(r.test(t));return n}function h3e(t,e,n,r,i){return n(sq(t,i,n),e,r)}var da=function(t){this.value=t};da.math={isDegree:!0,acos:function(t){return da.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,e){return t+e},asin:function(t){return da.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return da.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;ipa.length-2?pa.length-1:t.length-a;i>0;i--)if(pa[i]!==void 0)for(o=0;o0&&ur)a.push(e);else{for(;r>=i&&!u||u&&i"u"?e[e.length-1].value.push(o[s]):e[e.length-1].value=o[s].value(e[e.length-1].value);else if(o[s].type===7)typeof e[e.length-1].type>"u"?e[e.length-1].value.push(o[s]):e[e.length-1].value=o[s].value(e[e.length-1].value);else if(o[s].type===8){for(var l=[],u=0;u"u"?(r.value=r.concat(n),r.value.push(o[s]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[s]),e.push(n)):e.push({type:1,value:o[s].value(r.value,n.value)})):o[s].type===2||o[s].type===9?(n=e.pop(),r=e.pop(),typeof r.type>"u"?(r=r.concat(n),r.push(o[s]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[s]),e.push(n)):e.push({type:1,value:o[s].value(r.value,n.value)})):o[s].type===12?(n=e.pop(),typeof n.type<"u"&&(n=[n]),r=e.pop(),i=e.pop(),e.push({type:1,value:o[s].value(i.value,r.value,new z1(n))})):o[s].type===13&&(a?e.push({value:t[o[s].value],type:3}):e.push([o[s]]));if(e.length>1)throw new z1.Exception("Uncaught Syntax error");return e[0].value>1e15?"Infinity":parseFloat(e[0].value.toFixed(15))};z1.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 w3e=z1,uq=w3e;uq.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 S3e=uq,E3e=l3e,M3e=f3e,C3e=S3e,A3e=100,T3e=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,$3,D3e=R3e;function R3e(t,e){$3=0,e=Math.pow(10,e===void 0?5:e),t=t.replace(/\n+/g," ");function n(i,o,a){if($3++>A3e)throw $3=0,new Error("Call stack overflow for "+a);if(i==="")throw new Error(o+"(): '"+a+"' must contain a non-whitespace string");i=r(i,a);var s=P3e(i);if(s.length>1||i.indexOf("var(")>-1)return o+"("+i+")";var l=s[0]||"";l==="%"&&(i=i.replace(/\b[0-9\.]+%/g,function(f){return parseFloat(f.slice(0,-1))*.01}));var u=i.replace(new RegExp(l,"gi"),""),c;try{c=C3e.eval(u)}catch{return o+"("+i+")"}return l==="%"&&(c*=100),(o.length||l==="%")&&(c=Math.round(c*e)/e),c+=l,c}function r(i,o){i=i.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var a="",s=i,l;l=T3e.exec(s);){l[0].index>0&&(a+=s.substring(0,l[0].index));var u=E3e("(",")",s.substring([0].index));if(u.body==="")throw new Error("'"+i+"' must contain a non-whitespace string");var c=n(u.body,"",o);a+=u.pre+c,s=u.post}return a+s}return M3e(t,/((?:\-[a-z]+\-)?calc)\(/,n)}function P3e(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 H3=su(D3e);var N3e=typeof Fc=="object"&&Fc&&Fc.Object===Object&&Fc,cq=N3e,O3e=cq,I3e=typeof self=="object"&&self&&self.Object===Object&&self,L3e=O3e||I3e||Function("return this")(),ac=L3e,F3e=ac,k3e=F3e.Symbol,Lb=k3e,IB=Lb,fq=Object.prototype,B3e=fq.hasOwnProperty,U3e=fq.toString,Yy=IB?IB.toStringTag:void 0;function z3e(t){var e=B3e.call(t,Yy),n=t[Yy];try{t[Yy]=void 0;var r=!0}catch{}var i=U3e.call(t);return r&&(e?t[Yy]=n:delete t[Yy]),i}var $3e=z3e,H3e=Object.prototype,V3e=H3e.toString;function W3e(t){return V3e.call(t)}var G3e=W3e,LB=Lb,j3e=$3e,q3e=G3e,X3e="[object Null]",Y3e="[object Undefined]",FB=LB?LB.toStringTag:void 0;function K3e(t){return t==null?t===void 0?Y3e:X3e:FB&&FB in Object(t)?j3e(t):q3e(t)}var nm=K3e;function Z3e(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var bv=Z3e,J3e=nm,Q3e=bv,eDe="[object AsyncFunction]",tDe="[object Function]",nDe="[object GeneratorFunction]",rDe="[object Proxy]";function iDe(t){if(!Q3e(t))return!1;var e=J3e(t);return e==tDe||e==nDe||e==eDe||e==rDe}var dq=iDe,oDe=ac,aDe=oDe["__core-js_shared__"],sDe=aDe,V3=sDe,kB=function(){var t=/[^.]+$/.exec(V3&&V3.keys&&V3.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function lDe(t){return!!kB&&kB in t}var uDe=lDe,cDe=Function.prototype,fDe=cDe.toString;function dDe(t){if(t!=null){try{return fDe.call(t)}catch{}try{return t+""}catch{}}return""}var hq=dDe,hDe=dq,pDe=uDe,mDe=bv,gDe=hq,vDe=/[\\^$.*+?()[\]{}|]/g,yDe=/^\[object .+?Constructor\]$/,xDe=Function.prototype,bDe=Object.prototype,_De=xDe.toString,wDe=bDe.hasOwnProperty,SDe=RegExp("^"+_De.call(wDe).replace(vDe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function EDe(t){if(!mDe(t)||pDe(t))return!1;var e=hDe(t)?SDe:yDe;return e.test(gDe(t))}var MDe=EDe;function CDe(t,e){return t==null?void 0:t[e]}var ADe=CDe,TDe=MDe,DDe=ADe;function RDe(t,e){var n=DDe(t,e);return TDe(n)?n:void 0}var rm=RDe,PDe=rm,NDe=PDe(Object,"create"),WC=NDe,BB=WC;function ODe(){this.__data__=BB?BB(null):{},this.size=0}var IDe=ODe;function LDe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var FDe=LDe,kDe=WC,BDe="__lodash_hash_undefined__",UDe=Object.prototype,zDe=UDe.hasOwnProperty;function $De(t){var e=this.__data__;if(kDe){var n=e[t];return n===BDe?void 0:n}return zDe.call(e,t)?e[t]:void 0}var HDe=$De,VDe=WC,WDe=Object.prototype,GDe=WDe.hasOwnProperty;function jDe(t){var e=this.__data__;return VDe?e[t]!==void 0:GDe.call(e,t)}var qDe=jDe,XDe=WC,YDe="__lodash_hash_undefined__";function KDe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=XDe&&e===void 0?YDe:e,this}var ZDe=KDe,JDe=IDe,QDe=FDe,eRe=HDe,tRe=qDe,nRe=ZDe;function _v(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var xRe=yRe,bRe=GC;function _Re(t,e){var n=this.__data__,r=bRe(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var wRe=_Re,SRe=oRe,ERe=hRe,MRe=gRe,CRe=xRe,ARe=wRe;function wv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e=0)&&(n[i]=t[i]);return n}function W3(t){return typeof t=="number"}function HB(t){return typeof t=="number"&&Number.isFinite(t)||typeof t=="string"}function sPe(t){var e=t.verticalAnchor,n=e===void 0?"end":e,r=t.scaleToFit,i=r===void 0?!1:r,o=t.angle,a=t.width,s=t.lineHeight,l=s===void 0?"1em":s,u=t.capHeight,c=u===void 0?"0.71em":u,f=t.children,d=t.style,p=aPe(t,oPe),y=p.x,x=y===void 0?0:y,_=p.y,v=_===void 0?0:_,S=!HB(x)||!HB(v),w=V.useMemo(function(){var P=f==null?[]:f.toString().split(/(?:(?!\u00A0+)\s+)/);return{wordsWithWidth:P.map(function(N){return{word:N,wordWidth:$B(N,d)||0}}),spaceWidth:$B(" ",d)||0}},[f,d]),E=w.wordsWithWidth,T=w.spaceWidth,A=V.useMemo(function(){return S?[]:a||i?E.reduce(function(P,N){var B=N.word,G=N.wordWidth,Z=P[P.length-1];if(Z&&(a==null||i||(Z.width||0)+G+T0){var N=A[0].width||1,B=i==="shrink-only"?Math.min(a/N,1):a/N,G=B,Z=x-B*x,j=v-G*v;P.push("matrix("+B+", 0, 0, "+G+", "+Z+", "+j+")")}return o&&P.push("rotate("+o+", "+x+", "+v+")"),P.length>0?P.join(" "):""},[S,x,v,a,i,A,o]);return{wordsByLines:A,startDy:D,transform:I}}var lPe=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function FP(){return FP=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var cPe={overflow:"visible"};function gq(t){var e=t.dx,n=e===void 0?0:e,r=t.dy,i=r===void 0?0:r,o=t.textAnchor,a=o===void 0?"start":o,s=t.innerRef,l=t.innerTextRef;t.verticalAnchor,t.angle;var u=t.lineHeight,c=u===void 0?"1em":u;t.scaleToFit,t.capHeight,t.width;var f=uPe(t,lPe),d=f.x,p=d===void 0?0:d,y=f.fontSize,x=sPe(t),_=x.wordsByLines,v=x.startDy,S=x.transform;return se.createElement("svg",{ref:s,x:n,y:i,fontSize:y,style:cPe},_.length>0?se.createElement("text",FP({ref:l,transform:S},f,{textAnchor:a}),_.map(function(w,E){return se.createElement("tspan",{key:E,x:p,dy:E===0?v:c},w.words.join(" "))})):null)}var fPe={top:"top",left:"left",right:"right",bottom:"bottom"};const Es=fPe;function dPe(t){var e=t.labelOffset,n=t.labelProps,r=t.orientation,i=t.range,o=t.tickLabelFontSize,a=t.tickLength,s=r===Es.left||r===Es.top?-1:1,l,u,c;if(r===Es.top||r===Es.bottom){var f=r===Es.bottom&&typeof n.fontSize=="number"?n.fontSize:0;l=(Number(i[0])+Number(i[i.length-1]))/2,u=s*(a+e+o+f)}else l=s*((Number(i[0])+Number(i[i.length-1]))/2),u=-(a+e),c="rotate("+s*90+")";return{x:l,y:u,transform:c}}function $1(){return $1=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function vq(t){var e=t.children,n=e===void 0?pPe:e,r=t.axisClassName,i=t.hideAxisLine,o=i===void 0?!1:i,a=t.hideTicks,s=a===void 0?!1:a,l=t.hideZero,u=l===void 0?!1:l,c=t.left,f=c===void 0?0:c,d=t.numTicks,p=d===void 0?10:d,y=t.orientation,x=y===void 0?Es.bottom:y,_=t.rangePadding,v=_===void 0?0:_,S=t.scale,w=t.tickFormat,E=t.tickLength,T=E===void 0?8:E,A=t.tickValues,D=t.top,I=D===void 0?0:D,P=xPe(t,yPe),N=w??gPe(S),B=x===Es.left,G=x===Es.top,Z=G||x===Es.bottom,j=mPe(S),J=B||G?-1:1,Y=S.range(),$=vPe(v),W=ES({x:Number(Y[0])+.5-$.start,y:0},Z),U=ES({x:Number(Y[Y.length-1])+.5+$.end,y:0},Z),ne=(A??Q4(S,p)).filter(function(ue){return!u||ue!==0&&ue!=="0"}).map(function(ue,ce){return{value:ue,index:ce}}),re=ne.map(function(ue){var ce=ue.value,Ce=ue.index,Re=J4(j(ce));return{value:ce,index:Ce,from:ES({x:Re,y:0},Z),to:ES({x:Re,y:T*J},Z),formattedValue:N(ce,Ce,ne)}});return se.createElement(Ib,{className:rc("visx-axis",r),top:I,left:f},n(BP({},P,{axisFromPoint:W,axisToPoint:U,hideAxisLine:o,hideTicks:s,hideZero:u,horizontal:Z,numTicks:p,orientation:x,rangePadding:v,scale:S,tickFormat:N,tickLength:T,tickPosition:j,tickSign:J,ticks:re})))}var bPe=["axisClassName","labelOffset","tickLength","tickLabelProps"];function M2(){return M2=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var wPe={dx:"-0.25em",dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"end"};function SPe(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?36:n,i=t.tickLength,o=i===void 0?8:i,a=t.tickLabelProps,s=_Pe(t,bPe),l=typeof a=="function"?a:M2({},wPe,a);return se.createElement(vq,M2({axisClassName:rc("visx-axis-left",e),labelOffset:r,orientation:Es.left,tickLabelProps:l,tickLength:o},s))}var EPe=["axisClassName","labelOffset","tickLength","tickLabelProps"];function C2(){return C2=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var CPe={dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"middle"};function APe(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?8:n,i=t.tickLength,o=i===void 0?8:i,a=t.tickLabelProps,s=MPe(t,EPe),l=typeof a=="function"?a:C2({},CPe,a);return se.createElement(vq,C2({axisClassName:rc("visx-axis-bottom",e),labelOffset:r,orientation:Es.bottom,tickLabelProps:l,tickLength:o},s))}var yq=NPe,TPe=xq(V),DPe=xq(tq),RPe=["from","to","fill","className","innerRef"];function xq(t){return t&&t.__esModule?t:{default:t}}function UP(){return UP=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function NPe(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,a=o===void 0?"transparent":o,s=t.className,l=t.innerRef,u=PPe(t,RPe),c=n.x===i.x||n.y===i.y;return TPe.default.createElement("line",UP({ref:l,className:(0,DPe.default)("visx-line",s),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:a,shapeRendering:c?"crispEdges":"auto"},u))}function bq(t){return"bandwidth"in t?t.bandwidth():0}var OPe=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function zP(){return zP=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function _q(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,a=t.width,s=t.stroke,l=s===void 0?"#eaf0f6":s,u=t.strokeWidth,c=u===void 0?1:u,f=t.strokeDasharray,d=t.className,p=t.children,y=t.numTicks,x=y===void 0?10:y,_=t.lineStyle,v=t.offset,S=t.tickValues,w=IPe(t,OPe),E=S??Q4(o,x),T=(v??0)+bq(o)/2,A=E.map(function(D,I){var P,N=((P=J4(o(D)))!=null?P:0)+T;return{index:I,from:new Zx({x:0,y:N}),to:new Zx({x:a,y:N})}});return se.createElement(Ib,{className:rc("visx-rows",d),top:n,left:i},p?p({lines:A}):A.map(function(D){var I=D.from,P=D.to,N=D.index;return se.createElement(yq,zP({key:"row-line-"+N,from:I,to:P,stroke:l,strokeWidth:c,strokeDasharray:f,style:_},w))}))}_q.propTypes={tickValues:at.array,width:at.number.isRequired};var LPe=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function $P(){return $P=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function wq(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,a=t.height,s=t.stroke,l=s===void 0?"#eaf0f6":s,u=t.strokeWidth,c=u===void 0?1:u,f=t.strokeDasharray,d=t.className,p=t.numTicks,y=p===void 0?10:p,x=t.lineStyle,_=t.offset,v=t.tickValues,S=t.children,w=FPe(t,LPe),E=v??Q4(o,y),T=(_??0)+bq(o)/2,A=E.map(function(D,I){var P,N=((P=J4(o(D)))!=null?P:0)+T;return{index:I,from:new Zx({x:N,y:0}),to:new Zx({x:N,y:a})}});return se.createElement(Ib,{className:rc("visx-columns",d),top:n,left:i},S?S({lines:A}):A.map(function(D){var I=D.from,P=D.to,N=D.index;return se.createElement(yq,$P({key:"column-line-"+N,from:I,to:P,stroke:l,strokeWidth:c,strokeDasharray:f,style:x},w))}))}wq.propTypes={tickValues:at.array,height:at.number.isRequired};function er(t){for(var e=t.length/6|0,n=new Array(e),r=0;raAe(t[t.length-1]);var kPe=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(er);const BPe=br(kPe);var UPe=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(er);const zPe=br(UPe);var $Pe=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(er);const HPe=br($Pe);var VPe=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(er);const WPe=br(VPe);var GPe=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(er);const jPe=br(GPe);var qPe=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(er);const XPe=br(qPe);var YPe=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(er);const KPe=br(YPe);var ZPe=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(er);const JPe=br(ZPe);var QPe=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(er);const eNe=br(QPe);var tNe=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(er);const nNe=br(tNe);var rNe=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(er);const iNe=br(rNe);var oNe=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(er);const aNe=br(oNe);var sNe=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(er);const lNe=br(sNe);var uNe=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(er);const cNe=br(uNe);var fNe=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(er);const dNe=br(fNe);var hNe=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(er);const pNe=br(hNe);var mNe=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(er);const gNe=br(mNe);var vNe=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(er);const yNe=br(vNe);var xNe=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(er);const bNe=br(xNe);var _Ne=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(er);const wNe=br(_Ne);var SNe=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(er);const ENe=br(SNe);var MNe=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(er);const CNe=br(MNe);var ANe=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(er);const TNe=br(ANe);var DNe=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(er);const RNe=br(DNe);var PNe=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(er);const NNe=br(PNe);var ONe=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(er);const INe=br(ONe);var LNe=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(er);const FNe=br(LNe);function kNe(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 BNe=$C(nc(300,.5,0),nc(-240,.5,1));var UNe=$C(nc(-100,.75,.35),nc(80,1.5,.8)),zNe=$C(nc(260,.75,.35),nc(80,1.5,.8)),MS=nc();function $Ne(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return MS.h=360*t-100,MS.s=1.5-1.5*e,MS.l=.8-.9*e,MS+""}var CS=Ud(),HNe=Math.PI/3,VNe=Math.PI*2/3;function WNe(t){var e;return t=(.5-t)*Math.PI,CS.r=255*(e=Math.sin(t))*e,CS.g=255*(e=Math.sin(t+HNe))*e,CS.b=255*(e=Math.sin(t+VNe))*e,CS+""}function GNe(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 XC(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const jNe=XC(er("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var qNe=XC(er("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),XNe=XC(er("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),YNe=XC(er("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),Sq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},WB=se.createContext&&se.createContext(Sq),Rd=globalThis&&globalThis.__assign||function(){return Rd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0},t.prototype.connect_=function(){!HP||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),sOe?(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(){!HP||!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=aOe.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}(),Cq=function(t,e){for(var n=0,r=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof iv(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new gOe(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 iv(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 vOe(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}(),Tq=typeof WeakMap<"u"?new WeakMap:new Mq,Dq=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=lOe.getInstance(),r=new yOe(e,n,this);Tq.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){Dq.prototype[t]=function(){var e;return(e=Tq.get(this))[t].apply(e,arguments)}});var xOe=function(){return typeof A2.ResizeObserver<"u"?A2.ResizeObserver:Dq}(),bOe=["client","offset","scroll","bounds","margin"];function jB(t){var e=[];return bOe.forEach(function(n){t[n]&&e.push(n)}),e}function qB(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 _Oe(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||window}function wOe(t){return function(e){var n,r;return r=n=function(i){bO(o,i);function o(){for(var s,l=arguments.length,u=new Array(l),c=0;c0?e=t-1:this._settings.wrap?e=this._members.length-1:e=t,this.focusNodeAtIndex(e),e};zr.prototype.moveFocusToFirst=function(){this.focusNodeAtIndex(0)};zr.prototype.moveFocusToLast=function(){this.focusNodeAtIndex(this._members.length-1)};zr.prototype._handleUnboundKey=function(t){if(this._settings.stringSearch){if(this._searchString!==""&&(t.key===" "||t.keyCode===32))return t.preventDefault(),-1;if(!NOe(t.keyCode)||t.ctrlKey||t.metaKey||t.altKey)return-1;t.preventDefault(),this._addToSearchString(String.fromCharCode(t.keyCode)),this._runStringSearch()}};zr.prototype._clearSearchString=function(){this._searchString=""};zr.prototype._addToSearchString=function(t){this._searchString+=t.toLowerCase()};zr.prototype._startSearchStringRefreshTimer=function(){var t=this;this._clearSearchStringRefreshTimer(),this._stringSearchTimer=setTimeout(function(){t._clearSearchString()},this._settings.stringSearchDelay)};zr.prototype._clearSearchStringRefreshTimer=function(){clearTimeout(this._stringSearchTimer)};zr.prototype._runStringSearch=function(){this._startSearchStringRefreshTimer(),this.moveFocusByString(this._searchString)};zr.prototype.moveFocusByString=function(t){for(var e,n=0,r=this._members.length;n=65&&t<=90}function Oq(t){!t||!t.focus||(t.focus(),t.tagName.toLowerCase()==="input"&&t.select())}var OOe=function(e){return new zr(e)},IOe=OOe,XB=Nq,LOe={wrap:!0,stringSearch:!0},FOe={init:function(e){this.updateOptions(e),this.handleBlur=kOe.bind(this),this.handleSelection=BOe.bind(this),this.handleMenuKey=UOe.bind(this),this.focusGroup=IOe(LOe),this.button=null,this.menu=null,this.isOpen=!1},updateOptions:function(e){var n=this.options;this.options=e||this.options||{},typeof this.options.closeOnSelection>"u"&&(this.options.closeOnSelection=!0),typeof this.options.closeOnBlur>"u"&&(this.options.closeOnBlur=!0),this.options.id&&XB.registerManager(this.options.id,this),n&&n.id&&n.id!==this.options.id&&XB.unregisterManager(this.options.id,this)},focusItem:function(e){this.focusGroup.focusNodeAtIndex(e)},addItem:function(e){this.focusGroup.addMember(e)},clearItems:function(){this.focusGroup.clearMembers()},handleButtonNonArrowKey:function(e){this.focusGroup._handleUnboundKey(e)},destroy:function(){this.button=null,this.menu=null,this.focusGroup.deactivate(),clearTimeout(this.blurTimer),clearTimeout(this.moveFocusTimer)},update:function(){this.menu.setState({isOpen:this.isOpen}),this.button.setState({menuOpen:this.isOpen}),this.options.onMenuToggle&&this.options.onMenuToggle({isOpen:this.isOpen})},openMenu:function(e){if(!this.isOpen&&(e=e||{},e.focusMenu===void 0&&(e.focusMenu=!0),this.isOpen=!0,this.update(),this.focusGroup.activate(),e.focusMenu)){var n=this;this.moveFocusTimer=setTimeout(function(){n.focusItem(0)},0)}},closeMenu:function(e){this.isOpen&&(e=e||{},this.isOpen=!1,this.update(),e.focusButton&&this.button.ref.current.focus())},toggleMenu:function(e,n){e=e||{},n=n||{},this.isOpen?this.closeMenu(e):this.openMenu(n)}};function kOe(){var t=this;t.blurTimer=setTimeout(function(){if(t.button){var e=t.button.ref.current;if(e){var n=e.ownerDocument.activeElement;if(!(e&&n===e)){var r=t.menu.ref.current;if(r===n){t.focusItem(0);return}r&&r.contains(n)||t.isOpen&&t.closeMenu({focusButton:!1})}}}},0)}function BOe(t,e){this.options.closeOnSelection&&this.closeMenu({focusButton:!0}),this.options.onSelection&&this.options.onSelection(t,e)}function UOe(t){if(this.isOpen)switch(t.key){case"Escape":t.preventDefault(),this.closeMenu({focusButton:!0});break;case"Home":t.preventDefault(),this.focusGroup.moveFocusToFirst();break;case"End":t.preventDefault(),this.focusGroup.moveFocusToLast();break}}var zOe=function(t){var e=Object.create(FOe);return e.init(t),e},$Oe=V,HOe=$Oe.createContext(),ZC=HOe,AS=lv,JC={refType:AS.oneOfType([AS.func,AS.shape({current:AS.elementType})])},QC=function(t,e,n){n=n||{};for(var r in e)e.hasOwnProperty(r)&&(n[r]||(t[r]=e[r]))};function VOe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function WOe(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function GOe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var H1=V,E0=lv,jOe=zOe,qOe=ZC,XOe=JC,YOe=XOe.refType,VP=QC,D2={children:E0.node.isRequired,forwardedRef:YOe,onMenuToggle:E0.func,onSelection:E0.func,closeOnSelection:E0.bool,closeOnBlur:E0.bool,tag:E0.string},YB=function(e){return{onMenuToggle:e.onMenuToggle,onSelection:e.onSelection,closeOnSelection:e.closeOnSelection,closeOnBlur:e.closeOnBlur,id:e.id}},iI=function(t){GOe(e,t);function e(n){VOe(this,e);var r=WOe(this,t.call(this,n));return r.manager=jOe(YB(n)),r}return e.prototype.componentDidUpdate=function(){this.manager.updateOptions(YB(this.props))},e.prototype.render=function(){var r={};return VP(r,this.props,D2),H1.createElement(qOe.Provider,{value:this.manager},H1.createElement(this.props.tag,r,this.props.children))},e}(H1.Component);iI.propTypes=D2;iI.defaultProps={tag:"div"};var KOe=H1.forwardRef(function(t,e){var n={forwardedRef:e};return VP(n,t,{children:D2.children,forwardedRef:D2.forwardedRef}),VP(n,{forwardedRef:e}),H1.createElement(iI,n,t.children)});function ZOe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function KB(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function JOe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Rg=V,TS=lv,QOe=ZC,e4e=JC,t4e=e4e.refType,fE=QC,V1={ambManager:TS.object.isRequired,children:TS.node.isRequired,disabled:TS.bool,forwardedRef:t4e,tag:TS.string},n4e=function(){return["button","fieldset","input","optgroup","option","select","textarea"]},oI=function(t){JOe(e,t);function e(){var n,r,i;ZOe(this,e);for(var o=arguments.length,a=Array(o),s=0;s=0&&delete a.disabled,i.options.closeOnBlur&&(o.onBlur=i.handleBlur),fE(o,r,a),fE(o,{ref:this.setRef}),Rg.createElement(r.tag,o,r.children)},e}(Rg.Component);oI.propTypes=V1;oI.defaultProps={tag:"span"};var r4e=Rg.forwardRef(function(t,e){return Rg.createElement(QOe.Consumer,null,function(n){var r={ambManager:n,forwardedRef:e};return fE(r,t,{ambManager:V1.ambManager,children:V1.children,forwardedRef:V1.forwardedRef}),Rg.createElement(oI,r,t.children)})}),i4e=function(e,n,r){var i=0,o=0,a=!1,s=!1,l=!1;e.addEventListener("click",u,r),e.addEventListener("touchstart",c,r);function u(_){l||n(_)}function c(_){l=!0,!a&&(a=!0,e.addEventListener("touchmove",f,r),e.addEventListener("touchend",d,r),e.addEventListener("touchcancel",p,r),s=!1,i=_.touches[0].clientX,o=_.touches[0].clientY)}function f(_){s||Math.abs(_.touches[0].clientX-i)<=10&&Math.abs(_.touches[0].clientY-o)<=10||(s=!0)}function d(_){a=!1,y(),s||n(_)}function p(){a=!1,s=!1,i=0,o=0}function y(){e.removeEventListener("touchmove",f,r),e.removeEventListener("touchend",d,r),e.removeEventListener("touchcancel",p,r)}function x(){e.removeEventListener("click",u,r),e.removeEventListener("touchstart",c,r),y()}return{remove:x}};function o4e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ZB(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function a4e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Pg=V,Ky=lv,s4e=i4e,l4e=ZC,u4e=JC,c4e=u4e.refType,WP=QC,W1={ambManager:Ky.object.isRequired,children:Ky.oneOfType([Ky.func,Ky.node]).isRequired,forwardedRef:c4e,tag:Ky.string},aI=function(t){a4e(e,t);function e(){var n,r,i;o4e(this,e);for(var o=arguments.length,a=Array(o),s=0;s{let e;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(e):l;if(!Object.is(c,e)){const f=e;e=u??typeof c!="object"?c:Object.assign({},e,c),n.forEach(d=>d(e,f))}},i=()=>e,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return e=t(r,i,s),s},y4e=t=>t?eU(t):eU,{useSyncExternalStoreWithSelector:x4e}=UV;function b4e(t,e=t.getState,n){const r=x4e(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return V.useDebugValue(r),r}const tU=t=>{const e=typeof t=="function"?y4e(t):t,n=(r,i)=>b4e(e,r,i);return Object.assign(n,e),n},_4e=t=>t?tU(t):tU;var w4e=Object.defineProperty,S4e=(t,e,n)=>e in t?w4e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,DS=(t,e,n)=>(S4e(t,typeof e!="symbol"?e+"":e,n),n);const lI=V.createContext({}),E4e=V.createContext(void 0),M4e="_wrapper_1t5kp_1",C4e="_grid_1t5kp_6",A4e="_innerContainer_1t5kp_15",T4e="_colHeaders_1t5kp_19",D4e="_rowHeaders_1t5kp_23",R4e="_indexCell_1t5kp_28",P4e="_topLeftCell_1t5kp_49 _indexCell_1t5kp_28",N4e="_stickyGrid_1t5kp_53",O4e="_cell_1t5kp_72",ap={wrapper:M4e,grid:C4e,innerContainer:A4e,colHeaders:T4e,rowHeaders:D4e,indexCell:R4e,topLeftCell:P4e,stickyGrid:N4e,cell:O4e};function I4e(t){const{rowIndex:e,columnIndex:n,style:r}=t,{rowHeaderCellsWidth:i,cellSize:o,cellFormatter:a}=V.useContext(lI);return k.jsx("div",{className:ap.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:a(e,n)})}V.memo(I4e);function nU(t){const{indexMin:e,indexMax:n,width:r,transform:i,headers:o}=t,{cellSize:a}=V.useContext(lI);return k.jsx(k.Fragment,{children:Yo.range(e,n+1).map(s=>k.jsx("div",{className:ap.indexCell,style:{width:r||a.width,height:a.height,transform:i},"data-bg":s%2===1?"":void 0,children:s>=0&&o?o[s]:s},s.toString()))})}const L4e=V.forwardRef((t,e)=>{const{children:n,style:r}=t,{rowCount:i,columnCount:o,cellSize:a,sticky:s,rowHeaderCellsWidth:l,columnHeaders:u}=V.useContext(lI),c=V.useContext(E4e),{overscanColumnStartIndex:f=0,overscanColumnStopIndex:d=0,overscanRowStartIndex:p=0,overscanRowStopIndex:y=0}=c||{};return k.jsxs("div",{ref:e,className:ap.stickyGrid,style:{...r,width:r.width+l,height:r.height+a.height},role:"table","aria-rowcount":i,"aria-colcount":o,"data-sticky":s||void 0,children:[k.jsxs("div",{className:ap.colHeaders,children:[k.jsx("div",{className:ap.topLeftCell,style:{width:l,height:a.height},"data-bg":!0,"aria-hidden":"true"}),k.jsx(nU,{indexMin:f,indexMax:d,transform:`translateX(${a.width*f}px)`,headers:u})]}),k.jsxs("div",{className:ap.innerContainer,children:[k.jsx("div",{className:ap.rowHeaders,"aria-hidden":"true",children:k.jsx(nU,{indexMin:p,indexMax:y,transform:`translateY(${a.height*p}px)`,width:l})}),n]})]})});L4e.displayName="StickyGrid";var Ev=(t=>(t.Group="group",t.Dataset="dataset",t.Datatype="datatype",t.Unresolved="unresolved",t))(Ev||{}),ma=(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.Unknown="Unknown",t))(ma||{}),eA=(t=>(t.LE="little-endian",t.BE="big-endian",t))(eA||{}),Pn=(t=>(t.Linear="linear",t.Log="log",t.SymLog="symlog",t.Sqrt="sqrt",t.Gamma="gamma",t))(Pn||{});Pn.Linear,Pn.Log,Pn.SymLog;Pn.Linear,Pn.Log,Pn.SymLog,Pn.Sqrt;const rU=oc(".3~e"),j3=oc(".5~e");oc(".5~g");oc(".3~g");U4e(".12~g");const uI=3,F4e=/0\.([0-9]+)$/u,k4e=oc(`.${uI}~g`),B4e=oc(`.${uI}~e`);function q3(t){const e=k4e(t),n=F4e.exec(e);return n&&n[1].length>uI?B4e(t):e}function U4e(t,e=!1){const n=oc(t);return r=>{const[i,o]=r;if(o===0&&!e)return`${n(i)}`;if(i===0&&!e)return`${n(o)} i`;const a=Math.sign(o)>=0?" + ":" − ";return`${n(i)}${a}${n(Math.abs(o))} i`}}function z4e(t,e){return`${t==="/"?"":t}/${e}`}function $4e(t){const[e,n]=t.shape;return{rows:e,cols:n}}ma.Unsigned,ma.Integer,ma.Float,ma.String,ma.Bool,ma.Complex;function H4e(t){return t!==void 0}function V4e(t){return t!==null}function dE(t,e="Expected some value"){if(!H4e(t))throw new TypeError(e)}function X3(t,e="Expected value to not be null"){if(!V4e(t))throw new TypeError(e)}function W4e(t){return t.kind===Ev.Group}function G4e(t){return"children"in t}function j4e(t){return(...e)=>V.useMemo(()=>t(...e),e)}const nd=Yo.range(-20,21),hE=Yo.range(0,100,5),q4e=Yo.range(-1,1.25,.25),X4e=Yo.range(10,40,10),Y4e=Yo.range(1,4),K4e=Yo.range(9335,9338),Jx=nd.map(t=>t**2),pE=hE.map(t=>Jx.map(e=>e-t)),Lq=q4e.map(t=>pE.map(e=>e.map(n=>n*t))),Z4e=X4e.map(t=>Lq.map(e=>e.map(n=>n.map(r=>Math.sin(r/t))))),RS=[0,1,2,3],GP=[[[255,0,0],[0,255,0],[0,0,255]],[[0,255,255],[255,0,255],[255,255,0]],[[0,0,0],[128,128,128],[255,255,255]]],PS=GP.flat(1/0),cI=Yo.range(1,11).map(t=>[t*Math.cos(t*3.14/10),t*Math.sin(t*3.14/10)]),Fq=["Hydrogen","Lithum","Carbon","Sodium","Argon"].map((t,e)=>[t,e,Jx[e],e%2===0,cI[e]]),Y3=[!0,!1,!1,!0,!0,!0,!1,!0,!1,!1],J4e=[Fq,["Vanadium","Niobium","Tantalum","Silicon","Germanium"].map((t,e)=>[t,e*10,Jx[e],e%2===1,cI[e]])],Q4e={null:null,raw:{int:42},scalar_int:0,scalar_int_42:42,scalar_str:"foo",scalar_bool:!0,scalar_cplx:[1,5],oneD:Jx,oneD_cplx:cI,oneD_linear:nd,oneD_errors:Jx.map(t=>Math.abs(t)/10),oneD_str:["foo","bar"],oneD_bool:Y3,twoD:pE,twoD_errors:hE.map(t=>nd.map(e=>Math.abs(e-t))),twoD_cplx:[[[0,-5],[-2.1,-2]],[[5,0],[-3,.1]]],twoD_bool:Y3.map(t=>Y3.map(e=>t?e:!e)),threeD:Lq,threeD_bool:[[[!0,!1,!0,!1],[!0,!0,!0,!0],[!1,!1,!1,!1]],[[!0,!1,!1,!1],[!0,!0,!0,!0],[!1,!1,!0,!1]]],threeD_cplx:[[[[2,0],[1.41,1.41],[1,1.73],[0,2]],[[4,0],[2.82,2.82],[2,3.46],[0,4]],[[1,0],[.71,.71],[.5,.87],[0,1]]],[[[-1,0],[.87,-.5],[.92,-.38],[1,0]],[[-4,0],[3.46,-2],[3.7,-1.53],[4,0]],[[-8,0],[6.93,-4],[7.39,-3.06],[8,0]]]],threeD_rgb:GP,fourD_rgb:Yo.range(0,10).map(t=>GP.map(e=>e.map(n=>n.map(r=>Math.min(r+t*20,255))))),fourD:Z4e,uint8:Uint8Array.from(RS),int16:Int16Array.from(RS),float32:Float32Array.from(RS),float64:Float64Array.from(RS),int8_rgb:Int8Array.from(PS.map(t=>t-128)),uint8_rgb:Uint8Array.from(PS),int32_rgb:Uint32Array.from(PS),float32_rgb:Float32Array.from(PS.map(t=>t/255)),X:nd,X_desc:[...nd].reverse(),X_log:nd.map((t,e)=>(e+1)*.1),X_rgb:Y4e,Y:hE,Y_desc:[...hE].reverse(),Y_rgb:K4e,title_twoD:"NeXus 2D",secondary:pE.map(t=>t.map(e=>e*2)),tertiary:pE.map(t=>t.map(e=>e/2)),position:[-1,1,3],scatter_data:nd.map(t=>Math.cos(t*3.14/40)),Y_scatter:nd.map((t,e)=>(e%10+e%5)/123456),oneD_compound:Fq,twoD_compound:J4e},Ht={class:ma.Integer,endianness:eA.LE,size:32};ma.Unsigned,eA.LE;const Lc={class:ma.Float,endianness:eA.LE,size:64},zc={class:ma.String,charSet:"ASCII"},K3={class:ma.Compound,fields:{int:Ht}},d1={class:ma.Bool},np={class:ma.Complex,realType:Lc,imagType:Lc},iU={class:ma.Compound,fields:{string:zc,int:Ht,float:Lc,bool:d1,complex:np}};function fI(t,e,n,r){return{name:t,type:e,shape:n,value:r}}function kq(t,e,n){return fI(t,e,[],n)}function ki(t,e){return kq(t,zc,e)}function oU(t,e){return kq(t,Ht,e)}function jP(t,e){return{...t,attributes:[...t.attributes,...e]}}function M0(t){return jP(t,[ki("CLASS","IMAGE"),ki("IMAGE_VERSION","1.2")])}function Bq(t,e){t.children.forEach(n=>{n.path=z4e(e,n.path.slice(1)),W4e(n)&&G4e(n)&&Bq(n,e)})}function ms(t,e=[],n={}){const{attributes:r=[],link:i,isRoot:o=!1}=n,a=o?"/":`/${t}`,s={name:t,path:a,kind:Ev.Group,children:e,attributes:r,link:i};return Bq(s,a),s}function Kt(t,e,n,r={}){const{attributes:i=[],valueId:o=t,link:a}=r;return{name:t,path:`/${t}`,kind:Ev.Dataset,attributes:i,shape:n,type:e,value:Q4e[o],link:a}}function rl(t,e,n={}){return Kt(t,e,[],n)}function eIe(t,e,n={}){const{attributes:r=[],link:i}=n;return{name:t,path:`/${t}`,kind:Ev.Datatype,attributes:r,type:e,link:i}}function Z3(t,e,n,r){return{name:t,path:`/${t}`,kind:Ev.Unresolved,attributes:[],link:{class:e,file:r,path:n}}}function tIe(t){return fI("axes",zc,[t.length],t)}function nIe(t){return fI("auxiliary_signals",zc,[t.length],t)}function rIe(t){const{signalScaleType:e,axisScaleTypes:n}=t;return ki("SILX_style",JSON.stringify({signal_scale_type:e,axes_scale_type:n}))}function il(t,e,n={}){const{defaultPath:r,children:i,...o}=n;return ms(t,i,{...o,attributes:[...o.attributes??[],ki("NX_class",e),...r?[ki("default",r)]:[]]})}function xo(t,e){const{signal:n,title:r,errors:i,silxStyle:o,axes:a={},axesAttr:s,auxiliary:l={},auxAttr:u,attributes:c=[],children:f=[],...d}=e;return il(t,"NXdata",{...d,attributes:[ki("signal",n.name),...s?[tIe(s)]:[],...o?[rIe(o)]:[],...u?[nIe(u)]:[],...c],children:[n,...r?[r]:[],...i?[i]:[],...Object.values(a),...Object.values(l),...f]})}function ro(t,e,n,r={}){const{interpretation:i,longName:o,units:a,...s}=r;return Kt(t,e,n,{...s,attributes:[...s.attributes??[],...i?[ki("interpretation",i)]:[],...o?[ki("long_name",o)]:[],...a?[ki("units",a)]:[]]})}const iIe="source.h5";il(iIe,"NXroot",{isRoot:!0,defaultPath:"nexus_entry",children:[ms("entities",[ms("empty_group"),Kt("empty_dataset",Ht,null),eIe("datatype",K3),rl("raw",K3),rl("raw_large",K3),rl("scalar_int",Ht),rl("scalar_str",zc),rl("scalar_bool",d1),rl("scalar_cplx",np),Z3("unresolved_hard_link","Hard"),Z3("unresolved_soft_link","Soft","/foo"),Z3("unresolved_external_link","External","entry_000/dataset","my_file.h5")]),ms("nD_datasets",[Kt("oneD_linear",Ht,[41]),Kt("oneD",Ht,[41]),Kt("oneD_cplx",np,[10]),Kt("oneD_compound",iU,[5]),Kt("oneD_bool",d1,[10]),Kt("twoD",Ht,[20,41]),Kt("twoD_cplx",np,[2,2]),Kt("twoD_compound",iU,[2,5]),Kt("twoD_bool",d1,[10,10]),Kt("threeD",Ht,[9,20,41]),Kt("threeD_bool",d1,[2,3,4]),Kt("threeD_cplx",np,[2,3,4]),M0(Kt("threeD_rgb",Ht,[3,3,3])),Kt("fourD",Ht,[3,9,20,41])]),ms("typed_arrays",[Kt("uint8",Ht,[2,2]),Kt("int16",Ht,[2,2]),Kt("float32",Ht,[2,2]),Kt("float64",Ht,[2,2]),M0(Kt("int8_rgb",Ht,[3,3,3])),M0(Kt("uint8_rgb",Ht,[3,3,3])),M0(Kt("int32_rgb",Ht,[3,3,3])),M0(Kt("float32_rgb",Ht,[3,3,3]))]),il("nexus_entry","NXentry",{defaultPath:"nx_process/nx_data",children:[il("nx_process","NXprocess",{children:[xo("nx_data",{signal:Kt("twoD",Ht,[20,41]),silxStyle:{signalScaleType:Pn.SymLog},title:rl("title",zc,{valueId:"title_twoD"})}),il("absolute_default_path","NXentry",{defaultPath:"/nexus_entry/nx_process/nx_data"})]}),xo("spectrum",{signal:ro("twoD_spectrum",Ht,[20,41],{valueId:"twoD",interpretation:"spectrum",units:"arb. units"}),errors:Kt("errors",Lc,[20,41],{valueId:"twoD_errors"}),axes:{X:ro("X",Ht,[41],{units:"nm"})},axesAttr:[".","X"]}),xo("image",{signal:ro("fourD_image",Ht,[3,9,20,41],{valueId:"fourD",longName:"Interference fringes",interpretation:"image"}),axes:{X:ro("X",Ht,[41],{units:"nm"}),Y:ro("Y",Ht,[20],{units:"deg",longName:"Angle (degrees)"})},axesAttr:[".",".","Y","X"],silxStyle:{signalScaleType:Pn.Log}}),xo("log_spectrum",{signal:Kt("oneD",Ht,[41]),errors:Kt("oneD_errors",Ht,[41]),axes:{X_log:Kt("X_log",Lc,[41])},axesAttr:["X_log"],silxStyle:{signalScaleType:Pn.Log,axisScaleTypes:[Pn.Log]}}),xo("spectrum_with_aux",{signal:ro("twoD_spectrum",Ht,[20,41],{valueId:"twoD",interpretation:"spectrum",units:"arb. units"}),errors:Kt("errors",Lc,[20,41],{valueId:"twoD_errors"}),axes:{X:ro("X",Ht,[41],{units:"nm"})},axesAttr:[".","X"],auxiliary:{secondary:Kt("secondary",Ht,[20,41]),tertiary:Kt("tertiary",Ht,[20,41])},auxAttr:["secondary","tertiary"],children:[Kt("secondary_errors",Lc,[20,41],{valueId:"twoD_errors"})]}),xo("complex",{signal:Kt("twoD_complex",np,[2,2],{valueId:"twoD_cplx"}),axes:{position:Kt("position",Ht,[3])},axesAttr:[".","position"]}),xo("complex_spectrum",{signal:ro("twoD_complex",np,[2,2],{valueId:"twoD_cplx",interpretation:"spectrum"})}),xo("rgb-image",{signal:M0(ro("fourD_rgb",Ht,[10,3,3,3],{longName:"RGB CMY DGW",interpretation:"rgb-image"})),axes:{X_rgb:Kt("X_rgb",Lc,[3]),Y_rgb:Kt("Y_rgb",Lc,[3])},axesAttr:[".","Y_rgb","X_rgb"]}),xo("descending-axes",{signal:Kt("twoD",Ht,[20,41]),axes:{X:ro("X",Ht,[41],{valueId:"X_desc"}),Y:ro("Y",Ht,[20],{valueId:"Y_desc"})},axesAttr:["Y","X"]}),xo("scatter",{signal:Kt("scatter_data",Ht,[41]),axes:{X:ro("X",Ht,[41],{valueId:"X"}),Y:ro("Y",Ht,[41],{valueId:"Y_scatter"})},axesAttr:["X","Y"]}),il("old-style","NXdata",{children:[Kt("twoD",Ht,[20,41],{attributes:[oU("signal",1),ki("axes","Y:X")]}),ro("X",Ht,[41],{units:"nm"}),ro("Y",Ht,[20],{units:"deg",longName:"Angle (degrees)"})]})]}),il("nexus_no_default","NXprocess",{defaultPath:void 0,children:[il("ignore_me","NXentry"),xo("spectrum",{signal:Kt("oneD",Ht,[41])})]}),ms("nexus_malformed",[ms("default_not_found",[],{attributes:[ki("default","/test")]}),ms("no_signal",[],{attributes:[ki("NX_class","NXdata")]}),ms("signal_not_found",[],{attributes:[ki("NX_class","NXdata"),ki("signal","unknown")]}),il("signal_not_dataset","NXdata",{children:[ms("some_group")],attributes:[ki("signal","some_group")]}),il("signal_old-style_not_dataset","NXdata",{children:[ms("some_group",[],{attributes:[oU("signal",1)]})]}),il("signal_not_array","NXdata",{children:[rl("some_scalar",Ht)],attributes:[ki("signal","some_scalar")]}),il("signal_not_numeric","NXdata",{children:[Kt("oneD_str",zc,[2])],attributes:[ki("signal","oneD_str")]}),xo("interpretation_unknown",{signal:ro("fourD",Ht,[3,9,20,41],{interpretation:"unknown"})}),xo("rgb-image_incompatible",{signal:ro("oneD",Ht,[41],{interpretation:"rgb-image"})}),jP(xo("silx_style_unknown",{signal:Kt("oneD",Ht,[41]),axes:{X:Kt("X",Ht,[41])},axesAttr:["X"]}),[ki("SILX_style",JSON.stringify({unknown:Pn.Log,signal_scale_type:"invalid",axes_scale_type:["invalid"]}))]),jP(xo("silx_style_malformed",{signal:Kt("oneD",Ht,[41])}),[ki("SILX_style","{")])]),ms("resilience",[rl("error_value",Ht),rl("slow_value",Ht,{valueId:"scalar_int_42"}),Kt("slow_slicing",Ht,[9,20,41],{valueId:"threeD"}),ms("slow_metadata"),xo("slow_nx_spectrum",{signal:ro("slow_twoD",Ht,[20,41],{valueId:"twoD",interpretation:"spectrum"}),errors:Kt("slow_twoD_errors",Ht,[20,41],{valueId:"twoD_errors"}),axes:{slow_X:Kt("slow_X",Ht,[41],{valueId:"X"})},axesAttr:[".","slow_X"],auxiliary:{slow_secondary:Kt("slow_secondary",Ht,[20,41],{valueId:"secondary"})},auxAttr:["slow_secondary"],title:rl("title",zc,{valueId:"title_twoD"})}),xo("slow_nx_image",{signal:Kt("slow_threeD",Ht,[9,20,41],{valueId:"threeD"}),axes:{slow_X:Kt("slow_X",Ht,[41],{valueId:"X"}),slow_Y:Kt("slow_Y",Ht,[20],{valueId:"Y"})},axesAttr:[".","slow_Y","slow_X"],title:rl("title",zc,{valueId:"title_twoD"})})])]});const oIe=new ae(0,0,0);class mg extends Sl{get size(){const{x:e,y:n}=this.getSize(new ae);return{width:e,height:n}}get center(){return this.getCenter(new ae)}static empty(e=oIe){return new mg(e.clone(),e.clone())}static fromPoints(...e){return new mg().setFromPoints(e)}static fromSize({width:e,height:n}){return mg.empty().expandBySize(e,n)}clampPoint(e){return super.clampPoint(e,new ae)}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 ae(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,a=mg.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(a)}toRect(){return[this.min,this.max]}}const $d=mg;function aU(t,e){const n=e-t;return r=>n!==0?(r-t)/n:.5}function Uq(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=nv,a;const s=function(D){const I=Yo.isNumber(D)?D:D.valueOf();return Number.isNaN(I)?a:o(...n)(aU(...e)(l(I))**r)};function l(D){if(!i)return D;const[I,P]=e;return Math.max(I,Math.min(P,D))}function u(D){return D?(e=D,A):[...e]}function c(D){return D?(n=D,A):[...n]}function f(D){return D?(n=D,o=W4,A):[...n]}function d(D){return D?(i=D,A):i}function p(){return a}function y(D){return D?(o=D,A):o}function x(D){return D?(r=D,A):r}function _(D){return l(nv(...e)(aU(...n)(D)**(1/r)))}function v(){return ITe({domain:e,range:n,exponent:r,clamp:i})}function S(D){return e=v().nice(D).domain(),A}function w(D){return v().ticks(D)}function E(D,I){return v().tickFormat(D,I)}function T(){return Uq().domain(e).range(n).exponent(r).clamp(i).interpolate(o)}const A=Object.assign(s,{domain:u,range:c,rangeRound:f,clamp:d,interpolate:y,invert:_,unknown:p,exponent:x,nice:S,ticks:w,tickFormat:E,copy:T});return A}const aIe=[.1,1],sIe={left:80,right:24,top:16,bottom:34},lIe=28,sU=24;Pn.Linear+"",-1/0,Pn.Log+"",Number.MIN_VALUE,Pn.SymLog+"",-1/0,Pn.Sqrt+"",Pn.Gamma+"",-1/0;const uIe=Z4({domain:[300,900],range:[3,10],clamp:!0,round:!0}),cIe=Z4({domain:[300,500],range:[.8,1.4]});function zq(t,e){if(Array.isArray(t)){const[,n]=t;return Uq({...e,exponent:n})}switch(t){case Pn.Linear:return Z4(e);case Pn.Log:return NTe(e);case Pn.SymLog:return FTe(e);case Pn.Sqrt:return BTe(e)}throw new Error("Unknown scale type")}function fIe(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 dIe(t,e=[-Number.MAX_VALUE/2,Number.MAX_VALUE/2]){const[n,r]=e;return Yo.clamp(t,n,r)}function lU(t,e){const{scaleType:n,visDomain:r,flip:i,nice:o=!1}=t;return zq(n??Pn.Linear,{domain:r,range:[-e/2,e/2],reverse:i,nice:o})}function hIe(t,e){const n=Math.min(...t),r=Math.max(...t),i=Math.ceil(n),o=Math.floor(r),a=o-i+1,s=Math.min(a,e);if(s===0)return[];const l=Math.max(_j(i,o,s),1),u=Math.ceil(n/l),c=Math.floor(r/l)-u+1;return Array.from({length:c},(f,d)=>(u+d)*l)}function pIe(t,e,n){if(n!==Pn.Log)return q3;const[r,i]=t[0]>0?t:[-t[1],-[t[0]]],o=cIe(e);return i/r<10**o?q3:a=>{const s=Math.log10(Math.abs(a.valueOf()));return s===Math.floor(s)?q3(a):""}}function $q(t,e,n){if(t==="auto")return;if(t==="equal")return $q(1,e,n);const[r,i]=e,[o,a]=n;return Math.abs(i-r)/Math.abs(a-o)/t}function mIe(t={}){const{left:e,right:n,top:r,bottom:i}=sIe;return{left:e+(t.left?sU:0),right:n,top:r+(t.top?lIe:0),bottom:i+(t.bottom?sU:0)}}const gIe=` + varying vec2 coords; + + void main() { + coords = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } +`;function vIe(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{value:n}]))}const Hq=V.createContext({});function po(){return V.useContext(Hq)}function yIe(t){const{visRatio:e,abscissaConfig:n,ordinateConfig:r,svgOverlay:i,floatingToolbar:o,children:a}=t,{width:s,height:l}=Co(G=>G.size),u={width:s,height:l},c=s/l,f=fIe(u,e),d=V.useMemo(()=>$d.empty().expandByPoint(new ae(s,l)),[s,l]),p=lU(n,f.width),y=lU(r,f.height),x=V.useCallback(G=>new ae(p(G.x),y(G.y)),[p,y]),_=V.useCallback(G=>new ae(p.invert(G.x),y.invert(G.y)),[p,y]),v=V.useMemo(()=>new yn().makeScale(s/2,-l/2,1).setPosition(s/2,l/2,0),[s,l]),S=V.useMemo(()=>v.clone().invert(),[v]),w=V.useCallback((G,Z)=>Z.clone().project(G).applyMatrix4(v),[v]),E=V.useCallback((G,Z)=>Z.clone().applyMatrix4(S).unproject(G),[S]),T=V.useCallback((G,Z)=>w(G,x(Z)),[x,w]),A=V.useCallback((G,Z)=>_(E(G,Z)),[E,_]),D=V.useCallback((G,Z=G.position)=>{const{scale:j}=G;return $d.empty(Z).expandBySize(s*j.x,l*j.y)},[s,l]),I=V.useCallback(G=>{const[Z,j]=D(G).toRect().map(_);return{xVisibleDomain:[Z.x,j.x],yVisibleDomain:[Z.y,j.y]}},[D,_]),P=Co(G=>{var Z;return(Z=G.gl.domElement.parentElement)==null?void 0:Z.parentElement});dE(P),X3(P);const N=P.parentElement;X3(N);const B=N.parentElement;return X3(B),k.jsx(Hq.Provider,{value:{canvasSize:u,canvasRatio:c,canvasBox:d,visRatio:e,visSize:f,abscissaConfig:n,ordinateConfig:r,abscissaScale:p,ordinateScale:y,dataToWorld:x,dataToHtml:T,worldToHtml:w,worldToData:_,htmlToWorld:E,htmlToData:A,getFovBox:D,getVisibleDomains:I,visCanvas:B,canvasArea:N,r3fRoot:P,svgOverlay:i,floatingToolbar:o},children:a})}var tA=(t=>(t[t.Left=0]="Left",t[t.Middle=1]="Middle",t))(tA||{});class xIe{constructor(e,n){DS(this,"buttons"),DS(this,"modifierKeys"),DS(this,"isWheel"),DS(this,"isEnabled"),this.id=e;const{button:r=tA.Left,modifierKey:i=[],disabled:o=!1}=n;r==="Wheel"?(this.buttons=[],this.isWheel=!0):(this.buttons=Yo.castArray(r),this.isWheel=!1),this.modifierKeys=Yo.castArray(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 Vq=V.createContext({});function bIe(){return V.useContext(Vq)}function _Ie(t){const{children:e}=t,[n]=V.useState(new Map),r=V.useCallback((a,s)=>{n.has(a)?console.warn(`An interaction with ID "${a}" is already registered.`):n.set(a,new xIe(a,s))},[n]),i=V.useCallback(a=>{n.delete(a)},[n]),o=V.useCallback((a,s)=>{const l=[...n.values()];if(!n.has(a))throw new Error(`Interaction ${a} is not registered`);const u=l.filter(c=>c.matches(s));return u.length===0?!1:u.length===1?u[0].id===a:u.reduce((c,f)=>f.modifierKeys.length>c.modifierKeys.length?f:c).id===a},[n]);return k.jsx(Vq.Provider,{value:{registerInteraction:r,unregisterInteraction:i,shouldInteract:o},children:e})}const uU=.95,cU=new ae(1,1,1),wIe=["Alt","Control","Shift"];function Fb(){const{visSize:t,getFovBox:e}=po(),n=Co(i=>i.camera),r=Co(i=>i.invalidate);return V.useCallback(i=>{const{position:o}=n,a=$d.fromSize(t),s=e(n,i).keepWithin(a);o.copy(s.center.setZ(o.z)),n.updateMatrixWorld(),r()},[n,t,e,r])}function Wq(){const{canvasSize:t}=po(),e=Co(r=>r.camera),n=Fb();return V.useCallback(({world:r})=>{const{width:i,height:o}=t,a=$d.fromPoints(...r),{width:s,height:l}=a.size;e.scale.set(Math.max(s,1)/i,Math.max(l,1)/o,1),n(a.center)},[e,t,n])}function dI(){const{canvasArea:t}=po();wp(t,"wheel",e=>e.preventDefault(),{passive:!1})}function hI(t){const e=Co(r=>r.camera),n=Fb();return function(r){const{sourceEvent:i,worldPt:o}=r,{x:a,y:s}=t(i);if(!a&&!s)return;const l=new ae(a?uU:1,s?uU:1,1);i.deltaY<0?e.scale.multiply(l).min(cU):e.scale.divide(l).min(cU);const u=e.position.clone().sub(o);i.deltaY<0?u.multiply(l):u.divide(l),n(o.clone().add(u))}}function Xc(t,e,n={}){const r=_s(e),i=Co(u=>u.camera),{htmlToWorld:o,worldToData:a,canvasArea:s}=po();function l(u){const{offsetX:c,offsetY:f}=u,d=new ae(c,f),p=o(i,d),y=a(p);r.current({htmlPt:d,worldPt:p,dataPt:y,sourceEvent:u})}wp(s,t,l,n)}function kb(t,e){const{shouldInteract:n,registerInteraction:r,unregisterInteraction:i}=bIe();return V.useEffect(()=>(r(t,e),()=>i(t)),[t,r,i,e]),V.useCallback(o=>n(t,o),[t,n])}function Gq(t=[]){const{canvasArea:e}=po(),n=Yo.castArray(t),[r]=V.useState(new Map),[i,o]=exe(!1);function a(){const s=n.every(l=>r.get(l));i!==s&&o(s)}return wp(window,"keyup",s=>{const{key:l}=s;r.set(l,!1),a()}),wp(window,"keydown",s=>{const{key:l}=s;r.set(l,!0),a()}),wp(e,"pointerdown",s=>{wIe.forEach(l=>{r.set(l,s.getModifierState(l))}),a()}),i}function SIe(t){const{id:e="Pan",button:n=tA.Left,modifierKey:r,disabled:i}=t,o=kb(e,{button:n,modifierKey:r,disabled:i}),a=Co(p=>p.camera),s=Fb(),l=V.useRef(),u=Gq(r);function c(p){const{worldPt:y,sourceEvent:x}=p,{target:_,pointerId:v}=x;o(x)&&(_.setPointerCapture(v),l.current=y.clone())}function f(p){if(!l.current||!u)return;const{worldPt:y}=p,x=l.current.clone().sub(y);s(a.position.clone().add(x))}function d(p){const{sourceEvent:y}=p,{target:x,pointerId:_}=y;x.releasePointerCapture(_),l.current=void 0}return Xc("pointerdown",c),Xc("pointermove",f),Xc("pointerup",d),null}function jq(t){const{id:e="Selection",modifierKey:n,disabled:r,transform:i=ne=>ne,validate:o=()=>!0,onSelectionStart:a,onSelectionChange:s,onSelectionEnd:l,onValidSelection:u,children:c}=t,f=_s(i),d=_s(o),p=_s(a),y=_s(s),x=_s(l),_=_s(u),v=Co(ne=>ne.camera),S=po(),{canvasBox:w,htmlToWorld:E,worldToData:T}=S,[A,D]=Q1e(),I=V.useRef(),P=V.useRef(!1),N=Gq(n),B=kb(e,{button:tA.Left,modifierKey:n,disabled:r});function G(ne){const{sourceEvent:re}=ne;if(!B(re))return;const{target:ue,pointerId:ce}=re;ue.setPointerCapture(ce),I.current=ne}function Z(ne){if(!I.current)return;const{htmlPt:re}=I.current,ue=[re,w.clampPoint(ne.htmlPt)],ce=ue.map(Re=>E(v,Re)),Ce=ce.map(T);D({html:ue,world:ce,data:Ce})}function j(ne){if(!I.current)return;const{sourceEvent:re}=ne,{target:ue,pointerId:ce}=re;ue.releasePointerCapture(ce),I.current=void 0,P.current=B(re),D(void 0)}Xc("pointerdown",G),Xc("pointermove",Z),Xc("pointerup",j);function J(){I.current=void 0,D(void 0)}rxe("Escape",J,[],{event:"keydown"}),wp(window,"contextmenu",ne=>{I.current&&(ne.preventDefault(),J())});const Y=V.useMemo(()=>A&&f.current(A,v,S),[A,f,v,S]),$=V.useMemo(()=>!!Y&&d.current(Y),[Y,d]),W=yk(Y),U=yk($);return V.useEffect(()=>{var ne,re,ue,ce;if(Y){dE(A),W||(ne=p.current)==null||ne.call(p),(re=y.current)==null||re.call(y,N?Y:void 0,A,$);return}W&&(dE(U),(ue=x.current)==null||ue.call(x,P.current?W:void 0,U),U&&P.current&&((ce=_.current)==null||ce.call(_,W)),P.current=!1)},[Y,W,A,$,U,N,p,y,x,_]),!Y||!N?null:(dE(A),k.jsx(k.Fragment,{children:c(Y,A,$)}))}const EIe="_selection_1p9dp_1",qP={selection:EIe};function pI(t){const{overflowCanvas:e=!1,children:n}=t,{r3fRoot:r,canvasArea:i}=po(),o=e?i:r,[a]=V.useState(()=>{const l=document.createElement("div");return l.setAttribute("hidden",""),l}),[s]=V.useState(()=>u$(a));return V.useLayoutEffect(()=>{s.render(qd.createPortal(n,o))},[n,o,s]),V.useLayoutEffect(()=>(r.append(a),()=>{s.unmount(),a.remove()}),[r,s,a]),null}function mI(t){const{children:e}=t,{svgOverlay:n}=po();return n?k.jsx(pI,{children:qd.createPortal(e,n)}):null}function R2(t){const{coords:e,strokePosition:n,...r}=t,{stroke:i,strokeWidth:o=1}=r,a=i&&n?o*(n==="outside"?1:-1):0,{min:s,max:l}=$d.fromPoints(...e).expandBySize(a,a);return k.jsx("path",{d:`M ${s.x},${s.y} H ${l.x} V ${l.y} H ${s.x} z`,...r})}const MIe=20;function CIe(t){const{minZoom:e=MIe,...n}=t,{canvasSize:r,canvasRatio:i,canvasBox:o,visRatio:a,visSize:s,htmlToWorld:l,worldToData:u}=po(),c=Wq(),f=Co(y=>y.camera),d=a!==void 0;function p(y){if(!d)return y;const{scale:x}=f,_=$d.empty(new ae(r.width/2,r.height/2)).expandBySize(s.width/x.x,s.height/x.y),v=$d.fromPoints(...y.html).expandToRatio(i).keepWithin(o).keepWithin(_).toRect(),S=v.map(E=>l(f,E)),w=S.map(u);return{html:v,world:S,data:w}}return k.jsx(jq,{id:"SelectToZoom",transform:p,validate:({html:y})=>y[0].manhattanDistanceTo(y[1])>=e,onValidSelection:c,...n,children:({html:y},{html:x},_)=>k.jsxs(mI,{children:[k.jsx(R2,{className:qP.selection,coords:x,fill:"white",fillOpacity:!d&&_?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:d||!_?4:void 0}),d&&k.jsx(R2,{className:qP.selection,coords:y,fill:"white",fillOpacity:_?.25:0,stroke:"black",strokePosition:"inside"})]})})}function AIe(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=po(),i=kb("XAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=a=>({x:i(a),y:!1});return dI(),Xc("wheel",hI(o)),null}function TIe(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=po(),i=kb("YAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=a=>({x:!1,y:i(a)});return dI(),Xc("wheel",hI(o)),null}function DIe(t){const{modifierKey:e,disabled:n}=t,r=kb("Zoom",{button:"Wheel",modifierKey:e,disabled:n}),i=o=>{const a=r(o);return{x:a,y:a}};return dI(),Xc("wheel",hI(i)),null}function RIe(t){const{axis:e,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,children:o,...a}=t;function s(l,u,c){const{canvasSize:f,htmlToWorld:d,worldToData:p}=c,{width:y,height:x}=f,[_,v]=l.html,S=e==="x"?[new ae(_.x,0),new ae(v.x,x)]:[new ae(0,_.y),new ae(y,v.y)],w=S.map(T=>d(u,T)),E=w.map(p);return{html:S,world:w,data:E}}return k.jsx(jq,{transform:s,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,...a,children:o})}const PIe=20;function fU(t){const{axis:e,modifierKey:n,disabled:r,minZoom:i=PIe}=t,{visRatio:o}=po(),a=Wq();return k.jsx(RIe,{axis:e,id:`${e.toUpperCase()}SelectToZoom`,modifierKey:n,disabled:o!==void 0||r,validate:({html:s})=>$d.fromPoints(...s).hasMinSize(i),onValidSelection:a,children:({html:s},l,u)=>k.jsx(mI,{children:k.jsx(R2,{className:qP.selection,coords:s,fill:"white",fillOpacity:u?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:u?void 0:4})})})}function NIe(t){const{...e}=t;return k.jsxs(k.Fragment,{children:[e.pan!==!1&&k.jsx(SIe,{...e.pan}),e.zoom!==!1&&k.jsx(DIe,{...e.zoom}),e.xAxisZoom!==!1&&k.jsx(AIe,{modifierKey:"Alt",...e.xAxisZoom}),e.yAxisZoom!==!1&&k.jsx(TIe,{modifierKey:"Shift",...e.yAxisZoom}),e.selectToZoom!==!1&&k.jsx(CIe,{modifierKey:"Control",...e.selectToZoom}),e.xSelectToZoom!==!1&&k.jsx(fU,{axis:"x",modifierKey:["Control","Alt"],...e.xSelectToZoom}),e.ySelectToZoom!==!1&&k.jsx(fU,{axis:"y",modifierKey:["Control","Shift"],...e.ySelectToZoom})]})}function gI(t,e,n=(r,i)=>Object.is(r,i)){const r=Co(s=>s.camera),i=Z1e(),o=V.useRef(),a=_s(t);return V.useMemo(()=>{o.current=a.current(r)},e),k4(()=>{const s=a.current(r);n(o.current,s)||(o.current=s,i())}),o.current}function OIe(t){const{children:e}=t,{floatingToolbar:n}=po();return n?k.jsx(pI,{children:qd.createPortal(e,n)}):null}const IIe="_btn_rzs1v_1 _btn_rnveq_39 btnClean",LIe="_btnLike_rzs1v_11 _btnLike_rnveq_55",dU={btn:IIe,btnLike:LIe};function FIe(){const t=Co(i=>i.camera),e=Co(i=>i.invalidate),n=gI(({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 k.jsx(OIe,{children:k.jsx("button",{className:dU.btn,type:"button",hidden:!n,onClick:()=>r(),children:k.jsx("span",{className:dU.btnLike,children:"Reset zoom"})})})}function kIe(t){const{children:e,size:n,...r}=t,{visSize:i}=po(),{width:o,height:a}=n??i;return k.jsxs("mesh",{...r,children:[k.jsx("planeGeometry",{args:[o,a]}),e]})}const BIe="_axis_1fn7e_1",UIe="_grid_1fn7e_2",zIe="_tick_1fn7e_22",$Ie="_label_1fn7e_34",P2={axis:BIe,grid:UIe,tick:zIe,label:$Ie};function HIe(t){const{formattedValue:e,...n}=t;return k.jsx("text",{...n,dy:"0.3125em",children:e})}const VIe={labelClassName:P2.label,labelProps:{},tickClassName:P2.tick,tickComponent:HIe},WIe={abscissa:[APe,wq],ordinate:[SPe,_q]};function hU(t){const{type:e,config:n,domain:r,canvasSize:i,offset:o,flipAxis:a,showAxis:s}=t,{width:l,height:u}=i,c=e==="abscissa",f=c?l:u,{scaleType:d=Pn.Linear,isIndexAxis:p,showGrid:y,label:x,nice:_=!1}=n,v=zq(d,{domain:r,range:a?[f,0]:[0,f],nice:_}),[S,w]=WIe[e],E=uIe(f),T=p?{tickValues:hIe(r,E)}:{numTicks:E};return k.jsxs(k.Fragment,{children:[s&&k.jsx("svg",{className:P2.axis,"data-type":e,style:c?{width:l,height:o}:{width:o,height:u},children:k.jsx(S,{scale:v,tickFormat:pIe(r,f,d),label:x,labelOffset:o-(c?32:36),hideAxisLine:y,...T,...VIe})}),y&&k.jsx("svg",{className:P2.grid,...i,children:k.jsx(w,{scale:v,...i,...T})})]})}function GIe(t){const{axisOffsets:e,showAxes:n}=t,{canvasSize:r,visCanvas:i,abscissaConfig:o,ordinateConfig:a,getVisibleDomains:s}=po(),l=gI(s,[s]);return k.jsx(pI,{children:qd.createPortal(k.jsxs(k.Fragment,{children:[k.jsx(hU,{type:"abscissa",config:o,domain:l.xVisibleDomain,canvasSize:r,offset:e.bottom,showAxis:n}),k.jsx(hU,{type:"ordinate",config:a,domain:l.yVisibleDomain,canvasSize:r,offset:e.left,showAxis:n,flipAxis:!0})]}),i)})}function jIe(t){const{className:e,orthographic:n,children:r}=t;return k.jsxs(NCe,{className:e,orthographic:n,flat:!0,frameloop:"demand",dpr:[1,3],resize:{debounce:{scroll:20,resize:200},scroll:!1},gl:{preserveDrawingBuffer:!0},children:[k.jsx("ambientLight",{}),r]})}function qIe(){const{visRatio:t}=po(),e=Co(r=>r.camera),n=Fb();return V.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 XIe(t){const{value:e}=t,n=Co(i=>i.raycaster),r=Co(i=>i.camera);return V.useEffect(()=>{const i=n.params.Points,o=i?i.threshold:1;return i&&(i.threshold=e),()=>{i&&(i.threshold=o)}},[n,e]),k4(()=>{const i=(r.scale.x+r.scale.y)/2;n.params.Points&&(n.params.Points.threshold=e*i/2)}),null}function YIe(){const{dataToWorld:t,worldToData:e}=po(),n=V.useRef(),r=Co(o=>o.camera),i=Fb();return k4(()=>{n.current=e(r.position)}),V.useEffect(()=>{n.current&&i(t(n.current))},[n,i,t,r]),null}const KIe="_visCanvas_lddco_1",ZIe="_title_lddco_28",JIe="_canvasArea_lddco_40",QIe="_r3fRoot_lddco_42",e5e="_svgOverlay_lddco_42",t5e="_floatingToolbar_lddco_42",C0={visCanvas:KIe,title:ZIe,canvasArea:JIe,r3fRoot:QIe,svgOverlay:e5e,floatingToolbar:t5e},n5e={left:0,right:0,top:0,bottom:0};function r5e(t){const{title:e,aspect:n="auto",abscissaConfig:r,ordinateConfig:i,raycasterThreshold:o,showAxes:a=!0,children:s}=t,l=$q(n,r.visDomain,i.visDomain),u=a?mIe({left:!!i.label,bottom:!!r.label,top:!!e}):n5e,[c,f]=V.useState(null),[d,p]=V.useState(null);return k.jsxs("div",{className:C0.visCanvas,style:{gridTemplateColumns:`${u.left}px minmax(0, 1fr) ${u.right}px`,gridTemplateRows:`${u.top}px minmax(0, 1fr) ${u.bottom}px`},children:[a&&e&&k.jsx("p",{className:C0.title,children:e}),k.jsxs("div",{className:C0.canvasArea,children:[k.jsx(jIe,{className:C0.r3fRoot,orthographic:!0,children:k.jsxs(yIe,{visRatio:l,abscissaConfig:r,ordinateConfig:i,svgOverlay:c,floatingToolbar:d,children:[k.jsx(GIe,{axisOffsets:u,showAxes:a}),k.jsx(_Ie,{children:s}),k.jsx(YIe,{}),k.jsx(qIe,{}),o!==void 0&&k.jsx(XIe,{value:o})]})}),k.jsx("svg",{ref:f,className:C0.svgOverlay,overflow:"hidden"})]}),k.jsx("div",{ref:p,className:C0.floatingToolbar})]})}var h1=(t=>(t.Circle="Circle",t.Cross="Cross",t.Square="Square",t.Cap="Cap",t))(h1||{});h1.Cross+"",h1.Cap+"",h1.Circle+"",h1.Square+"";class i5e extends af{}rj({Line_:i5e});var gg=(t=>(t.MinGreater="min-greater",t.InvalidMinWithScale="invalid-min-with-scale",t.InvalidMaxWithScale="invalid-max-with-scale",t.CustomMaxFallback="custom-max-fallback",t))(gg||{});function o5e(t){return _2(t*360,1,.5).formatRgb()}function A0(t){return e=>t(1-e)}const a5e={Blues:A0(CNe),Greens:A0(TNe),Greys:A0(RNe),Oranges:A0(FNe),Purples:A0(NNe),Reds:A0(INe),Turbo:GNe,Viridis:jNe,Inferno:XNe,Magma:qNe,Plasma:YNe,Cividis:kNe,Warm:UNe,Cool:zNe,Cubehelix:BNe,BuGn:nNe,BuPu:iNe,GnBu:aNe,OrRd:lNe,PuBuGn:cNe,PuBu:dNe,PuRd:pNe,RdPu:gNe,YlGnBu:yNe,YlGn:bNe,YlOrBr:wNe,YlOrRd:ENe,Rainbow:$Ne,Sinebow:WNe,HSL:o5e,BrBG:BPe,PRGn:zPe,PiYG:HPe,PuOr:WPe,RdBu:jPe,RdGy:XPe,RdYlBu:KPe,RdYlGn:JPe,Spectral:eNe},pU=1/20;Yo.range(0,1+pU,pU);const s5e={[Pn.Linear]:t=>t,[Pn.Log]:Math.log10,[Pn.SymLog]:t=>Math.sign(t)*Math.log10(1+Math.abs(t)),[Pn.Sqrt]:Math.sqrt,[Pn.Gamma]:t=>t},l5e={float32:Zl,uint16:Up,uint8:Ps,uint8_clamped:Ps};function u5e(t,e){const n=a5e[t];return e?r=>n(1-r):n}function c5e(t,e=Pn.Linear){const n=s5e[e];return[n(t[0]),n(t[1])]}function f5e(t,e=ci){if(!t)return;const{rows:n,cols:r}=$4e(t),i=new Td(t.data,r,n,t4,l5e[t.dtype],bb,so,so,e);return i.needsUpdate=!0,i}const J3=j4e(f5e),d5e=Ud(255,255,255,0),Q3=256,h5e={[Pn.Log]:"log(value) * oneOverLog10",[Pn.SymLog]:"sign(value) * log(1. + abs(value)) * oneOverLog10",[Pn.Sqrt]:"sqrt(value)"},p5e={[Pn.Log]:"value > 0.",[Pn.Sqrt]:"value >= 0."};function m5e(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o=!1,magFilter:a,alphaValues:s,alphaDomain:l=aIe,badColor:u=d5e,mask:c}=t,f=J3(e,a),d=J3(s),p=J3(c),y=V.useMemo(()=>{const E=u5e(i,o),T=Array.from({length:Q3}).flatMap((D,I)=>{const{r:P,g:N,b:B}=Ud(E(I/(Q3-1)));return[P,N,B,255]}),A=new Td(Uint8Array.from(T),Q3,1,ga,Ps);return A.needsUpdate=!0,A},[i,o]),[x,_]=Array.isArray(r)?r:[r,1],v=c5e(n,x),S=typeof u=="string"?Ud(u):u,w={uniforms:vIe({data:f,mask:p,colorMap:y,min:v[0],oneOverRange:1/(v[1]-v[0]),gammaExponent:_,normRevertFactor:e.dtype==="uint8"?255:1,alpha:d,withAlpha:s?1:0,alphaMin:l[0],oneOverAlphaRange:1/(l[1]-l[0]),badColor:new rr(S.r/255,S.g/255,S.b/255,S.opacity)}),vertexShader:gIe,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 ${p5e[x]||"true"}; + } + + float scale(float value) { + return ${h5e[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 k.jsx("shaderMaterial",{args:[w],side:ql})}const g5e=V.memo(m5e);function v5e(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:a,alphaValues:s,alphaDomain:l,badColor:u,mask:c,...f}=t;return k.jsx(kIe,{...f,children:k.jsx(g5e,{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:a,alphaValues:s,alphaDomain:l,badColor:u,mask:c})})}const y5e="_toolbar_rnveq_1",x5e="_controls_rnveq_13",b5e="_controlWrapper_rnveq_20",_5e="_control_rnveq_13",w5e="_sep_rnveq_34",S5e="_btn_rnveq_39 btnClean",E5e="_btnLike_rnveq_55",M5e="_icon_rnveq_80",C5e="_label_rnveq_97",A5e="_popup_rnveq_133",T5e="_popupInner_rnveq_140",NS={toolbar:y5e,controls:x5e,controlWrapper:b5e,control:_5e,sep:w5e,btn:S5e,btnLike:E5e,icon:M5e,label:C5e,popup:A5e,popupInner:T5e};function D5e(t){const{label:e,icon:n,iconOnly:r,small:i,raised:o,disabled:a,onClick:s,...l}=t;return k.jsx("button",{className:NS.btn,type:"button",title:r?e:void 0,"aria-label":r?e:void 0,disabled:a,"data-small":i||void 0,"data-raised":o||void 0,onClick:()=>s(),...l,children:k.jsxs("span",{className:NS.btnLike,children:[n&&k.jsx(n,{className:NS.icon}),!r&&k.jsx("span",{className:NS.label,children:e})]})})}function mU(t){const{value:e,onToggle:n,...r}=t;return k.jsx(D5e,{...r,"aria-pressed":e,onClick:()=>n()})}V.createContext(void 0);const R5e="_boundEditor_fj0px_1",P5e="_label_fj0px_8",N5e="_value_fj0px_16",O5e="_actionBtn_fj0px_64 _actionBtn_3jqdy_30 btnClean",Jy={boundEditor:R5e,label:P5e,value:N5e,actionBtn:O5e},qq=V.forwardRef((t,e)=>{const{bound:n,value:r,isEditing:i,hasError:o,onEditToggle:a,onChange:s}=t,l=`${n}-bound`,u=V.useRef(null),[c,f]=V.useState("");function d(){a(!1),f(j3(r))}return V.useImperativeHandle(e,()=>({cancel:d})),V.useEffect(()=>{f(j3(r))},[r,f]),V.useEffect(()=>{var p,y;i||(p=u.current)==null||p.blur(),i&&n==="min"&&((y=u.current)==null||y.focus())},[i,n]),k.jsxs("form",{className:Jy.boundEditor,"data-error":o||void 0,"data-editing":i,onSubmit:p=>{p.preventDefault();const y=Number.parseFloat(c.replace("−","-")),x=Number.isNaN(y)?r:dIe(y);f(j3(x)),s(x),a(!1)},children:[k.jsx("label",{id:`${l}-label`,className:Jy.label,htmlFor:l,children:n}),k.jsx("input",{id:l,ref:u,className:Jy.value,type:"text",name:"bound",value:c,title:i?void 0:r.toString(),"aria-labelledby":`${l}-label`,onChange:p=>f(p.target.value),onFocus:()=>{i||a(!0)}}),k.jsx("button",{className:Jy.actionBtn,type:"submit",disabled:!i,"aria-label":`Apply ${n}`,children:k.jsx(QNe,{})}),k.jsx("button",{className:Jy.actionBtn,type:"button",disabled:!i,"aria-label":`Cancel ${n}`,onClick:()=>d(),children:k.jsx(tOe,{})})]})});qq.displayName="BoundEditor";const gU=qq,I5e="_root_3jqdy_1",L5e="_dataRange_3jqdy_9",F5e="_autoscale_3jqdy_20",k5e="_actionBtn_3jqdy_30 btnClean",B5e="_error_3jqdy_51",U5e="_errorMessage_3jqdy_59",z5e="_swapBtn_3jqdy_73 _actionBtn_3jqdy_30 btnClean",Og={root:I5e,dataRange:L5e,autoscale:F5e,actionBtn:k5e,error:B5e,errorMessage:U5e,swapBtn:z5e},$5e={[gg.MinGreater]:{message:"Min greater than max",fallback:"data range"},[gg.InvalidMinWithScale]:{message:"Custom min invalid with this scale",fallback:"data min"},[gg.InvalidMaxWithScale]:{message:"Custom max invalid with this scale",fallback:"data max"},[gg.CustomMaxFallback]:{message:"Custom min invalid with this scale",fallback:"custom max"}};function eD(t){const{error:e,showSwapBtn:n=!1,onSwap:r}=t,{message:i,fallback:o}=$5e[e];return k.jsxs("p",{className:Og.error,children:[k.jsxs("span",{className:Og.errorMessage,children:[i,k.jsx("br",{}),k.jsx(eOe,{})," falling back to ",k.jsx("strong",{children:o})]}),n&&r&&k.jsx("button",{className:Og.swapBtn,type:"button","aria-label":"Swap min and max",onClick:()=>r(),children:k.jsx(SOe,{})})]})}const H5e=V.forwardRef((t,e)=>{const{sliderDomain:n,dataDomain:r,errors:i}=t,{isAutoMin:o,isAutoMax:a,isEditingMin:s,isEditingMax:l}=t,{onAutoMinToggle:u,onAutoMaxToggle:c,onEditMin:f,onEditMax:d,onChangeMin:p,onChangeMax:y,onSwap:x}=t,{minGreater:_,minError:v,maxError:S}=i,w=V.useRef(null),E=V.useRef(null);return V.useImperativeHandle(e,()=>({cancelEditing:()=>{var T,A;(T=w.current)==null||T.cancel(),(A=E.current)==null||A.cancel()}})),k.jsxs("div",{className:Og.root,children:[_&&k.jsx(eD,{error:gg.MinGreater,showSwapBtn:!o&&!a,onSwap:x}),k.jsx(gU,{ref:w,bound:"min",value:n[0],isEditing:s,hasError:_||!!v,onEditToggle:f,onChange:p}),v&&k.jsx(eD,{error:v}),k.jsx(gU,{ref:E,bound:"max",value:n[1],isEditing:l,hasError:_||!!S,onEditToggle:d,onChange:y}),S&&k.jsx(eD,{error:S}),k.jsxs("p",{className:Og.dataRange,children:["Data range"," ",k.jsxs("span",{children:["["," ",k.jsx("abbr",{title:r[0].toString(),children:rU(r[0])})," ",","," ",k.jsx("abbr",{title:r[1].toString(),children:rU(r[1])})," ","]"]})]}),k.jsxs("p",{className:Og.autoscale,children:["Autoscale"," ",k.jsx(mU,{label:"Min",raised:!0,value:o,onToggle:u}),k.jsx(mU,{label:"Max",raised:!0,value:a,onToggle:c})]})]})});H5e.displayName="DomainControls";const V5e="_thumb_doizn_1",W5e="_thumbBtnLike_doizn_11",G5e="_icon_doizn_47",OS={thumb:V5e,thumbBtnLike:W5e,icon:G5e},j5e=V.forwardRef((t,e)=>{const{bound:n,isAuto:r,hasError:i,disabled:o,AutoIcon:a,...s}=t;return k.jsx("div",{ref:e,...s,className:OS.thumb,"aria-label":`Change ${n} limit`,"aria-disabled":o||void 0,tabIndex:o?-1:s.tabIndex,"data-auto":r,"data-error":i||void 0,children:k.jsxs("div",{className:OS.thumbBtnLike,children:[r&&k.jsx(a,{className:OS.icon}),!r&&i&&k.jsx(JNe,{className:OS.icon,strokeWidth:"3"})]})})});j5e.displayName="Thumb";function q5e(t){return k.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:k.jsx("path",{d:"M18 17v-2H6v2zm4-4v-2H2v2zm-8 8v-2h-4v2zm4-12V7H6v2zm-8-4h4V3h-4z",stroke:"none"})})}function X5e(t){return k.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:k.jsx("polyline",{points:"2 12 6 12 9 21 15 3 19 3"})})}Pn.Linear+"",Pn.Log+"",Pn.SymLog+"",Pn.Sqrt+"",Pn.Gamma+"";function Y5e(t){const{points:e,children:n}=t,{dataToHtml:r}=po(),i=gI(o=>e.map(a=>r(o,a)),[e,r]);return k.jsx(k.Fragment,{children:n(...i)})}function tD(t){const{coords:e,...n}=t,[r,i]=e;return k.jsx("line",{x1:r.x,y1:r.y,x2:i.x,y2:i.y,...n})}_4e(t=>({val:void 0,setTooltipValue:(e,n,r)=>t(()=>({val:{x:e,y:n,v:r}}))}));function K5e(t){const{api:e,layer:n,x:r,y:i,magFilter:o,onPointerMove:a,...s}=t,l=e.get(n,new Je(r,i)),[u,c]=l.shape,f=a&&Yo.throttle(d=>{a(d,l)},50,{trailing:!1});return k.jsx("group",{position:[r+c/2,i+u/2,0],children:k.jsx(v5e,{values:l,...s,magFilter:o,size:{width:c,height:u},onPointerMove:f})})}V.memo(K5e);new Sl(new ae(-1,-1,-1),new ae(1,1,1));class Vo{constructor(e,n){Il(this,"min");Il(this,"max");if(this.min=e,this.max=n,e>n){const r=n;this.max=e,this.min=r}}containsValue(e){return e>=this.min&&e<=this.max}containsRange(e){return e.min>=this.min&&e.max<=this.max}toString(){return`(min:${this.min}, max:${this.max})`}intersect(e){return e===null||e.min>this.max||this.min>e.max?null:new Vo(Math.max(e.min,this.min),Math.min(e.max,this.max))}equals(e){return this.min===e.min&&this.max===e.max}apply(e){return new Vo(e(this.min),e(this.max))}inPlaceApply(e){return this.min=e(this.min),this.max=e(this.max),this}static createWithFunc(e,n,r){return new Vo(r(e),r(n))}}var Yc=(t=>(t.milimeter="mm",t.pixel="pixel",t.reciprocal="reciprocal",t))(Yc||{});const Xq=hv(t=>({detector:!0,detectorColour:{r:144,g:19,b:254,a:.4},beamstop:!0,beamstopColor:{r:0,g:0,b:0,a:1},cameraTube:!0,cameraTubeColor:{r:80,g:227,b:194,a:.4},visibleRange:!0,visibleColor:{r:208,g:2,b:27,a:1},requestedRange:!0,requestedRangeColor:{r:65,g:117,b:5,a:1},clearance:!0,clearanceColor:{r:0,g:0,b:0,a:.2},inaccessibleRange:!1,inaccessibleRangeColor:{r:245,g:166,b:35,a:1},plotAxes:"mm",update:e=>{t({...e})}})),Z5e=(t,e)=>{let n=500;e===Yc.milimeter&&(n=100);const r=t.upperBound.x>t.upperBound.y?t.upperBound.x:t.upperBound.y;return{xAxis:new Vo(Math.round(-n),Math.round(r+n)),yAxis:new Vo(Math.round(-n),Math.round(r+n))}},rd=t=>`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`,vU=(t,e,n)=>{let r=n,i=n;n===Yc.pixel&&(r="xpixel",i="ypixel");const o=new ae(t.x.to(r).toNumber(),t.y.to(i).toNumber());return{centre:o,endPointX:new ae(o.x+ru(e,2).to(r).toNumber(),o.y),endPointY:new ae(o.x,o.y+ru(e,2).to(i).toNumber())}},J5e=(t,e,n,r)=>{let i=r,o=r;r===Yc.pixel&&(i="xpixel",o="ypixel");const a=new ae(t.x.to(i).toNumber(),t.y.to(o).toNumber());return{centre:a,endPointX:new ae(a.x+ru(e,2).to(i).toNumber()+un(n,"xpixel").to(i).toNumber(),a.y),endPointY:new ae(a.x,a.y+ru(e,2).to(o).toNumber()+un(n,"ypixel").to(o).toNumber())}},Q5e=(t,e,n)=>{let r=n,i=n;return n===Yc.pixel&&(r="xpixel",i="ypixel"),{lowerBound:t,upperBound:new ae(un(e.width,"xpixel").to(r).toNumber(),un(e.height,"ypixel").to(i).toNumber())}},yU=(t,e,n)=>{let r=n,i=n;return n===Yc.pixel&&(r="xpixel",i="ypixel"),{start:new ae(t.x.to(r).toNumber(),t.y.to(i).toNumber()),end:new ae(e.x.to(r).toNumber(),e.y.to(i).toNumber())}};class eLe{constructor(e,n,r){Il(this,"detProps");Il(this,"kmod");Il(this,"qScale");Il(this,"mki");this.detProps=e,e.beamVector.normalize(),this.qScale=r,this.mki=e.beamVector.clone().negate(),this.kmod=this.qScale/n;const i=this.detProps.beamVector.clone();i.multiplyScalar(this.kmod),this.mki=i.negate()}convertToQ(e){const n=e.length();return n>0?(e.multiplyScalar(this.kmod/n),e.add(this.mki)):e.add(this.mki),e}qFromPixelPosition(e){const n=new ae;return n.set(-e.x,-e.y,0),n.add(this.detProps.origin),this.convertToQ(n)}setDiffractionCrystalEnviroment(e){this.kmod=this.qScale/e;const n=this.detProps.beamVector.clone();n.multiplyScalar(this.kmod),this.mki=n.negate()}}class Yq{constructor(e,n){Il(this,"direction");Il(this,"initial_point");if(e.length()==0)throw TypeError("The direction vector of a ray cannot be the zero vector.");this.direction=e,this.initial_point=n}getPoint(e){const n=new Je(this.direction.x,this.direction.y);return n.multiplyScalar(e),n.add(this.initial_point),n}getPointAtDistance(e){return this.getPoint(e/this.direction.length())}getParameterRange(e,n){let r=Math.min(e,n);const i=Math.max(e,n);return r<0&&(r=0),new Vo(r,i)}getCircleIntersectionParameterRange(e,n){const r=this.initial_point.clone().add(n.multiplyScalar(-1)),i=this.direction.dot(this.direction),o=2*r.dot(this.direction),a=r.dot(r)-Math.pow(e,2),s=Math.pow(o,2)-4*i*a;if(s<0)return null;let l,u;if(i==0){if(o==0)return a==0?new Vo(0,Number.POSITIVE_INFINITY):null;l=-a/o,u=-a/o}else l=.5*(-o-Math.sqrt(s))/i,u=.5*(-o+Math.sqrt(s))/i;return this.getParameterRange(l,u)}getRectangleIntersectionParameterRange(e,n,r){let i;const o=e.x+n,a=e.x,s=e.y,l=e.y-r;if(this.direction.x===0){if(!new Vo(a,o).containsValue(this.initial_point.x))return null;i=new Vo(0,Number.POSITIVE_INFINITY)}else i=new Vo((a-this.initial_point.x)/this.direction.x,(o-this.initial_point.x)/this.direction.x);return this.direction.y==0?new Vo(l,s).containsValue(this.initial_point.y)?this.getParameterRange(i.min,i.max):null:(i=i.intersect(new Vo((l-this.initial_point.y)/this.direction.y,(s-this.initial_point.y)/this.direction.y)),i==null?null:this.getParameterRange(i.min,i.max))}}function tLe(t,e,n,r){const i={ptMin:new Je(0,0),ptMax:new Je(0,0),visibleQRange:null,fullQRange:null},o=un(r.cameraLength??NaN,"m"),a=Cw(un(e.clearance??NaN,"xpixel"),ru(e.diameter,2)),s=Cw(un(e.clearance??NaN,"ypixel"),ru(e.diameter,2)),l=un(e.centre.x??NaN,"xpixel"),u=un(e.centre.y??NaN,"ypixel"),c=un(t.resolution.height,"ypixel"),f=un(t.resolution.width,"xpixel"),d=un(n.centre.x??NaN,"xpixel"),p=un(n.centre.y??NaN,"ypixel"),y=Cw(Fd(a,dk(r.angle)),l),x=Cw(Fd(s,hk(r.angle)),u);if(typeof y=="number"||!("units"in y)||typeof x=="number"||!("units"in x))return i;const _=new Je(y.toSI().toNumber(),x.toSI().toNumber()),v=new Yq(new Je(dk(r.angle),hk(r.angle)),_);let S=v.getRectangleIntersectionParameterRange(new Je(0,c.toSI().toNumber()),f.toSI().toNumber(),c.toSI().toNumber());if(S!=null&&n!=null&&n.diameter.toSI().toNumber()!=0&&(S=S.intersect(v.getCircleIntersectionParameterRange(ru(n.diameter,2).toSI().toNumber(),new Je(d.toSI().toNumber(),p.toSI().toNumber())))),S===null)return i;const w=v.getPoint(S.min),E=v.getPoint(S.max),T={...t,origin:new ae(l.toSI().toNumber(),u.toSI().toNumber(),o.toSI().toNumber()),beamVector:new ae(0,0,1)},A=new eLe(T,r.wavelength.toSI().toNumber(),2*Math.PI),D=A.qFromPixelPosition(w),I=A.qFromPixelPosition(E);T.origin.z=r.minCameraLength.toSI().toNumber(),A.setDiffractionCrystalEnviroment(r.minWavelength.toSI().toNumber());const P=A.qFromPixelPosition(E);T.origin.z=r.maxCameraLength.toSI().toNumber(),A.setDiffractionCrystalEnviroment(r.maxWavelength.toSI().toNumber());const N=A.qFromPixelPosition(w);return{ptMin:w,ptMax:E,visibleQRange:new Vo(D.length(),I.length()),fullQRange:new Vo(P.length(),N.length())}}var ul={},Bb={},nLe=Array.isArray,fu=nLe;function rLe(t){return t!=null&&typeof t=="object"}var mf=rLe,iLe=nm,oLe=fu,aLe=mf,sLe="[object String]";function lLe(t){return typeof t=="string"||!oLe(t)&&aLe(t)&&iLe(t)==sLe}var uLe=lLe;function cLe(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var fLe=cLe,dLe=fLe,hLe=dLe(),pLe=hLe;function mLe(t,e){for(var n=-1,r=Array(t);++n-1&&t%1==0&&t-1&&t%1==0&&t<=PLe}var yI=NLe,OLe=nm,ILe=yI,LLe=mf,FLe="[object Arguments]",kLe="[object Array]",BLe="[object Boolean]",ULe="[object Date]",zLe="[object Error]",$Le="[object Function]",HLe="[object Map]",VLe="[object Number]",WLe="[object Object]",GLe="[object RegExp]",jLe="[object Set]",qLe="[object String]",XLe="[object WeakMap]",YLe="[object ArrayBuffer]",KLe="[object DataView]",ZLe="[object Float32Array]",JLe="[object Float64Array]",QLe="[object Int8Array]",eFe="[object Int16Array]",tFe="[object Int32Array]",nFe="[object Uint8Array]",rFe="[object Uint8ClampedArray]",iFe="[object Uint16Array]",oFe="[object Uint32Array]",Dr={};Dr[ZLe]=Dr[JLe]=Dr[QLe]=Dr[eFe]=Dr[tFe]=Dr[nFe]=Dr[rFe]=Dr[iFe]=Dr[oFe]=!0;Dr[FLe]=Dr[kLe]=Dr[YLe]=Dr[BLe]=Dr[KLe]=Dr[ULe]=Dr[zLe]=Dr[$Le]=Dr[HLe]=Dr[VLe]=Dr[WLe]=Dr[GLe]=Dr[jLe]=Dr[qLe]=Dr[XLe]=!1;function aFe(t){return LLe(t)&&ILe(t.length)&&!!Dr[OLe(t)]}var sFe=aFe;function lFe(t){return function(e){return t(e)}}var xI=lFe,O2={exports:{}};O2.exports;(function(t,e){var n=cq,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(O2,O2.exports);var bI=O2.exports,uFe=sFe,cFe=xI,bU=bI,_U=bU&&bU.isTypedArray,fFe=_U?cFe(_U):uFe,Qq=fFe,dFe=gLe,hFe=Zq,pFe=fu,mFe=vI,gFe=Jq,vFe=Qq,yFe=Object.prototype,xFe=yFe.hasOwnProperty;function bFe(t,e){var n=pFe(t),r=!n&&hFe(t),i=!n&&!r&&mFe(t),o=!n&&!r&&!i&&vFe(t),a=n||r||i||o,s=a?dFe(t.length,String):[],l=s.length;for(var u in t)(e||xFe.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||gFe(u,l)))&&s.push(u);return s}var eX=bFe,_Fe=Object.prototype;function wFe(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||_Fe;return t===n}var _I=wFe;function SFe(t,e){return function(n){return t(e(n))}}var tX=SFe,EFe=tX,MFe=EFe(Object.keys,Object),CFe=MFe,AFe=_I,TFe=CFe,DFe=Object.prototype,RFe=DFe.hasOwnProperty;function PFe(t){if(!AFe(t))return TFe(t);var e=[];for(var n in Object(t))RFe.call(t,n)&&n!="constructor"&&e.push(n);return e}var NFe=PFe,OFe=dq,IFe=yI;function LFe(t){return t!=null&&IFe(t.length)&&!OFe(t)}var nA=LFe,FFe=eX,kFe=NFe,BFe=nA;function UFe(t){return BFe(t)?FFe(t):kFe(t)}var Ub=UFe,zFe=pLe,$Fe=Ub;function HFe(t,e){return t&&zFe(t,e,$Fe)}var nX=HFe;function VFe(t){return t}var rX=VFe,WFe=rX;function GFe(t){return typeof t=="function"?t:WFe}var jFe=GFe,qFe=nX,XFe=jFe;function YFe(t,e){return t&&qFe(t,XFe(e))}var wI=YFe,KFe=tX,ZFe=KFe(Object.getPrototypeOf,Object),SI=ZFe,JFe=nm,QFe=SI,e8e=mf,t8e="[object Object]",n8e=Function.prototype,r8e=Object.prototype,iX=n8e.toString,i8e=r8e.hasOwnProperty,o8e=iX.call(Object);function a8e(t){if(!e8e(t)||JFe(t)!=t8e)return!1;var e=QFe(t);if(e===null)return!0;var n=i8e.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&iX.call(n)==o8e}var s8e=a8e;function l8e(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++ns))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var f=-1,d=!0,p=n&q8e?new V8e:void 0;for(o.set(t,e),o.set(e,t);++f0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,LUe.default)(e,function(r){Array.isArray(r)?t(r).map(function(i){return n.push(i)}):(0,OUe.default)(r)?(0,PUe.default)(r,function(i,o){i===!0&&n.push(o),n.push(o+"-"+i)}):(0,DUe.default)(r)&&n.push(r)}),n};Bb.default=FUe;var zb={};function kUe(t,e){for(var n=-1,r=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=e.default&&(0,r$e.default)(e.default)||{};return n.map(function(i){var o=e[i];return o&&(0,t$e.default)(o,function(a,s){r[s]||(r[s]={}),r[s]=i$e({},r[s],o[s])}),i}),r};zb.default=o$e;var $b={};Object.defineProperty($b,"__esModule",{value:!0});$b.autoprefix=void 0;var a$e=wI,JU=l$e(a$e),s$e=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){m$e(i,r);function i(){var o,a,s,l;p$e(this,i);for(var u=arguments.length,c=Array(u),f=0;f1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){_$e(i,r);function i(){var o,a,s,l;b$e(this,i);for(var u=arguments.length,c=Array(u),f=0;f1&&arguments[1]!==void 0?arguments[1]:!0;r[a]=s};return e===0&&i("first-child"),e===n-1&&i("last-child"),(e===0||e%2===0)&&i("even"),Math.abs(e%2)===1&&i("odd"),i("nth-child",e),r};RI.default=S$e;Object.defineProperty(ul,"__esModule",{value:!0});ul.ReactCSS=ul.loop=ul.handleActive=PI=ul.handleHover=ul.hover=void 0;var E$e=Bb,M$e=Av(E$e),C$e=zb,A$e=Av(C$e),T$e=$b,D$e=Av(T$e),R$e=Hb,AX=Av(R$e),P$e=Vb,N$e=Av(P$e),O$e=RI,I$e=Av(O$e);function Av(t){return t&&t.__esModule?t:{default:t}}ul.hover=AX.default;var PI=ul.handleHover=AX.default;ul.handleActive=N$e.default;ul.loop=I$e.default;var L$e=ul.ReactCSS=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;is?d=1:d=Math.round(f*100/s)/100,n.a!==d)return{h:n.h,s:n.s,l:n.l,a:d,source:"rgb"}}else{var p=void 0;if(c<0?p=0:c>a?p=1:p=Math.round(c*100/a)/100,i!==p)return{h:n.h,s:n.s,l:n.l,a:p,source:"rgb"}}return null},aD={},k$e=function(e,n,r,i){if(typeof document>"u"&&!i)return null;var o=i?new i:document.createElement("canvas");o.width=r*2,o.height=r*2;var a=o.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,o.width,o.height),a.fillStyle=n,a.fillRect(0,0,r,r),a.translate(r,r),a.fillRect(0,0,r,r),o.toDataURL()):null},B$e=function(e,n,r,i){var o=e+"-"+n+"-"+r+(i?"-server":"");if(aD[o])return aD[o];var a=k$e(e,n,r,i);return aD[o]=a,a},tz=Object.assign||function(t){for(var e=1;e-1},J$e=function(e){return Number(String(e).replace(/%/g,""))},Q$e=1,Hn=function(t){q$e(e,t);function e(n){G$e(this,e);var r=j$e(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(i){r.setUpdatedValue(i.target.value,i)},r.handleKeyDown=function(i){var o=J$e(i.target.value);if(!isNaN(o)&&Z$e(i.keyCode)){var a=r.getArrowOffset(),s=i.keyCode===TX?o+a:o-a;r.setUpdatedValue(s,i)}},r.handleDrag=function(i){if(r.props.dragLabel){var o=Math.round(r.props.value+i.movementX);o>=0&&o<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(o),i)}},r.handleMouseDown=function(i){r.props.dragLabel&&(i.preventDefault(),r.handleDrag(i),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},r.inputId="rc-editable-input-"+Q$e++,r}return V$e(e,[{key:"componentDidUpdate",value:function(r,i){this.props.value!==this.state.value&&(r.value!==this.props.value||i.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return W$e({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||X$e}},{key:"setUpdatedValue",value:function(r,i){var o=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(o,i),this.setState({value:r})}},{key:"render",value:function(){var r=this,i=mn({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return se.createElement("div",{style:i.wrap},se.createElement("input",{id:this.inputId,style:i.input,ref:function(a){return r.input=a},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?se.createElement("label",{htmlFor:this.inputId,style:i.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(V.PureComponent||V.Component),eHe=function(e,n,r,i){var o=i.clientWidth,a=i.clientHeight,s=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,u=s-(i.getBoundingClientRect().left+window.pageXOffset),c=l-(i.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var f=void 0;if(c<0)f=359;else if(c>a)f=0;else{var d=-(c*100/a)+100;f=360*d/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var p=void 0;if(u<0)p=0;else if(u>o)p=359;else{var y=u*100/o;p=360*y/100}if(r.h!==p)return{h:p,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},tHe=function(){function t(e,n){for(var r=0;r-1}function cHe(t,e){var n=this.__data__,r=sA(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function gf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=RVe}function Rv(t){return t!=null&&FI(t.length)&&!OI(t)}function PVe(t){return Vd(t)&&Rv(t)}function NVe(){return!1}var FX=typeof As=="object"&&As&&!As.nodeType&&As,fz=FX&&typeof Ts=="object"&&Ts&&!Ts.nodeType&&Ts,OVe=fz&&fz.exports===FX,dz=OVe?du.Buffer:void 0,IVe=dz?dz.isBuffer:void 0,LVe=IVe||NVe;const U2=LVe;var FVe="[object Object]",kVe=Function.prototype,BVe=Object.prototype,kX=kVe.toString,UVe=BVe.hasOwnProperty,zVe=kX.call(Object);function $Ve(t){if(!Vd(t)||im(t)!=FVe)return!1;var e=IX(t);if(e===null)return!0;var n=UVe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&kX.call(n)==zVe}var HVe="[object Arguments]",VVe="[object Array]",WVe="[object Boolean]",GVe="[object Date]",jVe="[object Error]",qVe="[object Function]",XVe="[object Map]",YVe="[object Number]",KVe="[object Object]",ZVe="[object RegExp]",JVe="[object Set]",QVe="[object String]",eWe="[object WeakMap]",tWe="[object ArrayBuffer]",nWe="[object DataView]",rWe="[object Float32Array]",iWe="[object Float64Array]",oWe="[object Int8Array]",aWe="[object Int16Array]",sWe="[object Int32Array]",lWe="[object Uint8Array]",uWe="[object Uint8ClampedArray]",cWe="[object Uint16Array]",fWe="[object Uint32Array]",Rr={};Rr[rWe]=Rr[iWe]=Rr[oWe]=Rr[aWe]=Rr[sWe]=Rr[lWe]=Rr[uWe]=Rr[cWe]=Rr[fWe]=!0;Rr[HVe]=Rr[VVe]=Rr[tWe]=Rr[WVe]=Rr[nWe]=Rr[GVe]=Rr[jVe]=Rr[qVe]=Rr[XVe]=Rr[YVe]=Rr[KVe]=Rr[ZVe]=Rr[JVe]=Rr[QVe]=Rr[eWe]=!1;function dWe(t){return Vd(t)&&FI(t.length)&&!!Rr[im(t)]}function hWe(t){return function(e){return t(e)}}var BX=typeof As=="object"&&As&&!As.nodeType&&As,j1=BX&&typeof Ts=="object"&&Ts&&!Ts.nodeType&&Ts,pWe=j1&&j1.exports===BX,lD=pWe&&DX.process,mWe=function(){try{var t=j1&&j1.require&&j1.require("util").types;return t||lD&&lD.binding&&lD.binding("util")}catch{}}();const hz=mWe;var pz=hz&&hz.isTypedArray,gWe=pz?hWe(pz):dWe;const kI=gWe;function eN(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var vWe=Object.prototype,yWe=vWe.hasOwnProperty;function xWe(t,e,n){var r=t[e];(!(yWe.call(t,e)&&Wb(r,n))||n===void 0&&!(e in t))&&II(t,e,n)}function bWe(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o-1&&t%1==0&&t0){if(++e>=kWe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var $We=zWe(FWe);const HWe=$We;function VWe(t,e){return HWe(OWe(t,e,uA),t+"")}function WWe(t,e,n){if(!_l(n))return!1;var r=typeof e;return(r=="number"?Rv(n)&&BI(e,n.length):r=="string"&&e in n)?Wb(n[e],t):!1}function GWe(t){return VWe(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&WWe(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r=e||D<0||f&&I>=o}function v(){var A=uD();if(_(A))return S(A);s=setTimeout(v,x(A))}function S(A){return s=void 0,d&&r?p(A):(r=i=void 0,a)}function w(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function E(){return s===void 0?a:S(uD())}function T(){var A=uD(),D=_(A);if(r=arguments,i=this,l=A,D){if(s===void 0)return y(l);if(f)return clearTimeout(s),s=setTimeout(v,e),p(l)}return s===void 0&&(s=setTimeout(v,e)),a}return T.cancel=w,T.flush=E,T}var aGe="Expected a function";function sGe(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(aGe);return _l(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),HX(t,e,{leading:r,maxWait:e,trailing:i})}var lGe=function(e,n,r){var i=r.getBoundingClientRect(),o=i.width,a=i.height,s=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,u=s-(r.getBoundingClientRect().left+window.pageXOffset),c=l-(r.getBoundingClientRect().top+window.pageYOffset);u<0?u=0:u>o&&(u=o),c<0?c=0:c>a&&(c=a);var f=u/o,d=1-c/a;return{h:n.h,s:f,v:d,a:n.a,source:"hsv"}},uGe=function(){function t(e,n){for(var r=0;r=0,o=!n&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return $t(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(IGe,arguments)},brighten:function(){return this._applyModification(LGe,arguments)},darken:function(){return this._applyModification(FGe,arguments)},desaturate:function(){return this._applyModification(PGe,arguments)},saturate:function(){return this._applyModification(NGe,arguments)},greyscale:function(){return this._applyModification(OGe,arguments)},spin:function(){return this._applyModification(kGe,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(zGe,arguments)},complement:function(){return this._applyCombination(BGe,arguments)},monochromatic:function(){return this._applyCombination($Ge,arguments)},splitcomplement:function(){return this._applyCombination(UGe,arguments)},triad:function(){return this._applyCombination(wz,[3])},tetrad:function(){return this._applyCombination(wz,[4])}};$t.fromRatio=function(t,e){if(z2(t)=="object"){var n={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?n[r]=t[r]:n[r]=p1(t[r]));t=n}return $t(t,e)};function CGe(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof t=="string"&&(t=jGe(t)),z2(t)=="object"&&(Nc(t.r)&&Nc(t.g)&&Nc(t.b)?(e=AGe(t.r,t.g,t.b),a=!0,s=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Nc(t.h)&&Nc(t.s)&&Nc(t.v)?(r=p1(t.s),i=p1(t.v),e=DGe(t.h,r,i),a=!0,s="hsv"):Nc(t.h)&&Nc(t.s)&&Nc(t.l)&&(r=p1(t.s),o=p1(t.l),e=TGe(t.h,r,o),a=!0,s="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=WX(n),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function AGe(t,e,n){return{r:kr(t,255)*255,g:kr(e,255)*255,b:kr(n,255)*255}}function yz(t,e,n){t=kr(t,255),e=kr(e,255),n=kr(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o,a,s=(r+i)/2;if(r==i)o=a=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case t:o=(e-n)/l+(e1&&(f-=1),f<1/6?u+(c-u)*6*f:f<1/2?c:f<2/3?u+(c-u)*(2/3-f)*6:u}if(e===0)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=a(l,s,t+1/3),i=a(l,s,t),o=a(l,s,t-1/3)}return{r:r*255,g:i*255,b:o*255}}function xz(t,e,n){t=kr(t,255),e=kr(e,255),n=kr(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o,a,s=r,l=r-i;if(a=r===0?0:l/r,r==i)o=0;else{switch(r){case t:o=(e-n)/l+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push($t(r));return o}function $Ge(t,e){e=e||6;for(var n=$t(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push($t({h:r,s:i,v:o})),o=(o+s)%1;return a}$t.mix=function(t,e,n){n=n===0?0:n||50;var r=$t(t).toRgb(),i=$t(e).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return $t(a)};$t.readability=function(t,e){var n=$t(t),r=$t(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};$t.isReadable=function(t,e,n){var r=$t.readability(t,e),i,o;switch(o=!1,i=qGe(n),i.level+i.size){case"AAsmall":case"AAAlarge":o=r>=4.5;break;case"AAlarge":o=r>=3;break;case"AAAsmall":o=r>=7;break}return o};$t.mostReadable=function(t,e,n){var r=null,i=0,o,a,s,l;n=n||{},a=n.includeFallbackColors,s=n.level,l=n.size;for(var u=0;ui&&(i=o,r=$t(e[u]));return $t.isReadable(t,r,{level:s,size:l})||!a?r:(n.includeFallbackColors=!1,$t.mostReadable(t,["#fff","#000"],n))};var tN=$t.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},HGe=$t.hexNames=VGe(tN);function VGe(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function WX(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function kr(t,e){WGe(t)&&(t="100%");var n=GGe(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function dA(t){return Math.min(1,Math.max(0,t))}function gs(t){return parseInt(t,16)}function WGe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function GGe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Jl(t){return t.length==1?"0"+t:""+t}function p1(t){return t<=1&&(t=t*100+"%"),t}function GX(t){return Math.round(parseFloat(t)*255).toString(16)}function Sz(t){return gs(t)/255}var zl=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Nc(t){return!!zl.CSS_UNIT.exec(t)}function jGe(t){t=t.replace(EGe,"").replace(MGe,"").toLowerCase();var e=!1;if(tN[t])t=tN[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=zl.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=zl.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=zl.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=zl.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=zl.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=zl.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=zl.hex8.exec(t))?{r:gs(n[1]),g:gs(n[2]),b:gs(n[3]),a:Sz(n[4]),format:e?"name":"hex8"}:(n=zl.hex6.exec(t))?{r:gs(n[1]),g:gs(n[2]),b:gs(n[3]),format:e?"name":"hex"}:(n=zl.hex4.exec(t))?{r:gs(n[1]+""+n[1]),g:gs(n[2]+""+n[2]),b:gs(n[3]+""+n[3]),a:Sz(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=zl.hex3.exec(t))?{r:gs(n[1]+""+n[1]),g:gs(n[2]+""+n[2]),b:gs(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function qGe(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}var Ez=function(e){var n=["r","g","b","a","h","s","l","v"],r=0,i=0;return SGe(n,function(o){if(e[o]&&(r+=1,isNaN(e[o])||(i+=1),o==="s"||o==="l")){var a=/^\d+%$/;a.test(e[o])&&(i+=1)}}),r===i?e:!1},m1=function(e,n){var r=e.hex?$t(e.hex):$t(e),i=r.toHsl(),o=r.toHsv(),a=r.toRgb(),s=r.toHex();i.s===0&&(i.h=n||0,o.h=n||0);var l=s==="000000"&&a.a===0;return{hsl:i,hex:l?"transparent":"#"+s,rgb:a,hsv:o,oldHue:e.h||n||i.h,source:e.source}},ih=function(e){if(e==="transparent")return!0;var n=String(e).charAt(0)==="#"?1:0;return e.length!==4+n&&e.length<7+n&&$t(e).isValid()},zI=function(e){if(!e)return"#fff";var n=m1(e);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},cD=function(e,n){var r=e.replace("°","");return $t(n+" ("+r+")")._ok},e1=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){tje(i,r);function i(){var o,a,s,l;eje(this,i);for(var u=arguments.length,c=Array(u),f=0;fs))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var f=-1,d=!0,p=n&hje?new $2:void 0;for(o.set(t,e),o.set(e,t);++f=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var FS=24,Lqe=tY.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,i=r===void 0?FS:r,o=t.height,a=o===void 0?FS:o,s=t.style,l=s===void 0?{}:s,u=Iqe(t,["fill","width","height","style"]);return Vz.default.createElement("svg",Hz({viewBox:"0 0 "+FS+" "+FS,style:Hz({fill:n,width:i,height:a},l)},u),Vz.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},Fqe=function(){function t(e,n){for(var r=0;r1&&(i.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(i.a*100)/100,source:"rgb"},o)):(i.h||i.s||i.l)&&(typeof i.s=="string"&&i.s.includes("%")&&(i.s=i.s.replace("%","")),typeof i.l=="string"&&i.l.includes("%")&&(i.l=i.l.replace("%","")),i.s==1?i.s=.01:i.l==1&&(i.l=.01),r.props.onChange({h:i.h||r.props.hsl.h,s:Number($z(i.s)?r.props.hsl.s:i.s),l:Number($z(i.l)?r.props.hsl.l:i.l),source:"hsl"},o))},r.showHighlight=function(i){i.currentTarget.style.background="#eee"},r.hideHighlight=function(i){i.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return Fqe(e,[{key:"render",value:function(){var r=this,i=mn({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),o=void 0;return this.state.view==="hex"?o=se.createElement("div",{style:i.fields,className:"flexbox-fix"},se.createElement("div",{style:i.field},se.createElement(Hn,{style:{input:i.input,label:i.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?o=se.createElement("div",{style:i.fields,className:"flexbox-fix"},se.createElement("div",{style:i.field},se.createElement(Hn,{style:{input:i.input,label:i.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),se.createElement("div",{style:i.field},se.createElement(Hn,{style:{input:i.input,label:i.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),se.createElement("div",{style:i.field},se.createElement(Hn,{style:{input:i.input,label:i.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),se.createElement("div",{style:i.alpha},se.createElement(Hn,{style:{input:i.input,label:i.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(o=se.createElement("div",{style:i.fields,className:"flexbox-fix"},se.createElement("div",{style:i.field},se.createElement(Hn,{style:{input:i.input,label:i.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),se.createElement("div",{style:i.field},se.createElement(Hn,{style:{input:i.input,label:i.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),se.createElement("div",{style:i.field},se.createElement(Hn,{style:{input:i.input,label:i.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),se.createElement("div",{style:i.alpha},se.createElement(Hn,{style:{input:i.input,label:i.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),se.createElement("div",{style:i.wrap,className:"flexbox-fix"},o,se.createElement("div",{style:i.toggle},se.createElement("div",{style:i.icon,onClick:this.toggleViews,ref:function(s){return r.icon=s}},se.createElement(Lqe,{style:i.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.hsl.a!==1&&i.view==="hex"?{view:"rgb"}:null}}]),e}(se.Component);nY.defaultProps={view:"hex"};var Wz=function(){var e=mn({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return se.createElement("div",{style:e.picker})},zqe=function(){var e=mn({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return se.createElement("div",{style:e.picker})},jI=function(e){var n=e.width,r=e.onChange,i=e.disableAlpha,o=e.rgb,a=e.hsl,s=e.hsv,l=e.hex,u=e.renderers,c=e.styles,f=c===void 0?{}:c,d=e.className,p=d===void 0?"":d,y=e.defaultView,x=mn(Xa({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+o.r+", "+o.g+", "+o.b+", "+o.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},f),{disableAlpha:i});return se.createElement("div",{style:x.picker,className:"chrome-picker "+p},se.createElement("div",{style:x.saturation},se.createElement(fA,{style:x.Saturation,hsl:a,hsv:s,pointer:zqe,onChange:r})),se.createElement("div",{style:x.body},se.createElement("div",{style:x.controls,className:"flexbox-fix"},se.createElement("div",{style:x.color},se.createElement("div",{style:x.swatch},se.createElement("div",{style:x.active}),se.createElement(Tv,{renderers:u}))),se.createElement("div",{style:x.toggles},se.createElement("div",{style:x.hue},se.createElement(Dv,{style:x.Hue,hsl:a,pointer:Wz,onChange:r})),se.createElement("div",{style:x.alpha},se.createElement(NI,{style:x.Alpha,rgb:o,hsl:a,pointer:Wz,renderers:u,onChange:r})))),se.createElement(nY,{rgb:o,hsl:a,hex:l,view:y,onChange:r,disableAlpha:i})))};jI.propTypes={width:at.oneOfType([at.string,at.number]),disableAlpha:at.bool,styles:at.object,defaultView:at.oneOf(["hex","rgb","hsl"])};jI.defaultProps={width:225,disableAlpha:!1,styles:{}};Ya(jI);var $qe=function(e){var n=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=e.active,s=mn({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:zI(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:a,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return se.createElement(sm,{style:s.color,color:n,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+n}},se.createElement("div",{style:s.dot}))},Hqe=function(e){var n=e.hex,r=e.rgb,i=e.onChange,o=mn({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),a=function(l,u){l.r||l.g||l.b?i({r:l.r||r.r,g:l.g||r.g,b:l.b||r.b,source:"rgb"},u):i({hex:l.hex,source:"hex"},u)};return se.createElement("div",{style:o.fields,className:"flexbox-fix"},se.createElement("div",{style:o.active}),se.createElement(Hn,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"hex",value:n,onChange:a}),se.createElement(Hn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:r.r,onChange:a}),se.createElement(Hn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:r.g,onChange:a}),se.createElement(Hn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:r.b,onChange:a}))},qI=function(e){var n=e.onChange,r=e.onSwatchHover,i=e.colors,o=e.hex,a=e.rgb,s=e.styles,l=s===void 0?{}:s,u=e.className,c=u===void 0?"":u,f=mn(Xa({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},l)),d=function(y,x){y.hex?ih(y.hex)&&n({hex:y.hex,source:"hex"},x):n(y,x)};return se.createElement(Gb,{style:f.Compact,styles:l},se.createElement("div",{style:f.compact,className:"compact-picker "+c},se.createElement("div",null,lm(i,function(p){return se.createElement($qe,{key:p,color:p,active:p.toLowerCase()===o,onClick:d,onSwatchHover:r})}),se.createElement("div",{style:f.clear})),se.createElement(Hqe,{hex:o,rgb:a,onChange:d})))};qI.propTypes={colors:at.arrayOf(at.string),styles:at.object};qI.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};Ya(qI);var Vqe=function(e){var n=e.hover,r=e.color,i=e.onClick,o=e.onSwatchHover,a={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=mn({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:a}},{hover:n});return se.createElement("div",{style:s.swatch},se.createElement(sm,{color:r,onClick:i,onHover:o,focusStyle:a}))};const Wqe=PI(Vqe);var XI=function(e){var n=e.width,r=e.colors,i=e.onChange,o=e.onSwatchHover,a=e.triangle,s=e.styles,l=s===void 0?{}:s,u=e.className,c=u===void 0?"":u,f=mn(Xa({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},l),{"hide-triangle":a==="hide","top-left-triangle":a==="top-left","top-right-triangle":a==="top-right","bottom-left-triangle":a==="bottom-left","bottom-right-triangle":a==="bottom-right"}),d=function(y,x){return i({hex:y,source:"hex"},x)};return se.createElement("div",{style:f.card,className:"github-picker "+c},se.createElement("div",{style:f.triangleShadow}),se.createElement("div",{style:f.triangle}),lm(r,function(p){return se.createElement(Wqe,{color:p,key:p,onClick:d,onSwatchHover:o})}))};XI.propTypes={width:at.oneOfType([at.string,at.number]),colors:at.arrayOf(at.string),triangle:at.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:at.object};XI.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Ya(XI);var Gqe=function(e){var n=e.direction,r=mn({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return se.createElement("div",{style:r.picker})},jqe=Object.assign||function(t){for(var e=1;e.5});return se.createElement("div",{style:r.picker})},Kqe=function(){var e=mn({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return se.createElement("div",{style:e.pointer},se.createElement("div",{style:e.left},se.createElement("div",{style:e.leftInside})),se.createElement("div",{style:e.right},se.createElement("div",{style:e.rightInside})))},Gz=function(e){var n=e.onClick,r=e.label,i=e.children,o=e.active,a=mn({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:o});return se.createElement("div",{style:a.button,onClick:n},r||i)},Zqe=function(e){var n=e.rgb,r=e.currentColor,i=mn({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return se.createElement("div",null,se.createElement("div",{style:i.label},"new"),se.createElement("div",{style:i.swatches},se.createElement("div",{style:i.new}),se.createElement("div",{style:i.current})),se.createElement("div",{style:i.label},"current"))},Jqe=function(){function t(e,n){for(var r=0;r100&&(c.a=100),c.a/=100,n({h:i.h,s:i.s,l:i.l,a:c.a,source:"rgb"},f))};return se.createElement("div",{style:s.fields,className:"flexbox-fix"},se.createElement("div",{style:s.double},se.createElement(Hn,{style:{input:s.input,label:s.label},label:"hex",value:o.replace("#",""),onChange:l})),se.createElement("div",{style:s.single},se.createElement(Hn,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),se.createElement("div",{style:s.single},se.createElement(Hn,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),se.createElement("div",{style:s.single},se.createElement(Hn,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),se.createElement("div",{style:s.alpha},se.createElement(Hn,{style:{input:s.input,label:s.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},rXe=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var kS=24,fXe=iY.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,i=r===void 0?kS:r,o=t.height,a=o===void 0?kS:o,s=t.style,l=s===void 0?{}:s,u=cXe(t,["fill","width","height","style"]);return qz.default.createElement("svg",jz({viewBox:"0 0 "+kS+" "+kS,style:jz({fill:n,width:i,height:a},l)},u),qz.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},dXe=function(e){var n=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=e.first,s=e.last,l=e.active,u=mn({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:zI(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:a,last:s,active:l,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return se.createElement(sm,{color:n,style:u.color,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+n}},se.createElement("div",{style:u.check},se.createElement(fXe,null)))},hXe=function(e){var n=e.onClick,r=e.onSwatchHover,i=e.group,o=e.active,a=mn({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return se.createElement("div",{style:a.group},lm(i,function(s,l){return se.createElement(dXe,{key:s,color:s,active:s.toLowerCase()===o,first:l===0,last:l===i.length-1,onClick:n,onSwatchHover:r})}))},QI=function(e){var n=e.width,r=e.height,i=e.onChange,o=e.onSwatchHover,a=e.colors,s=e.hex,l=e.styles,u=l===void 0?{}:l,c=e.className,f=c===void 0?"":c,d=mn(Xa({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},u)),p=function(x,_){return i({hex:x,source:"hex"},_)};return se.createElement("div",{style:d.picker,className:"swatches-picker "+f},se.createElement(Gb,null,se.createElement("div",{style:d.overflow},se.createElement("div",{style:d.body},lm(a,function(y){return se.createElement(hXe,{key:y.toString(),group:y,active:s,onClick:p,onSwatchHover:o})}),se.createElement("div",{style:d.clear})))))};QI.propTypes={width:at.oneOfType([at.string,at.number]),height:at.oneOfType([at.string,at.number]),colors:at.arrayOf(at.arrayOf(at.string)),styles:at.object};QI.defaultProps={width:320,height:240,colors:[[N0[900],N0[700],N0[500],N0[300],N0[100]],[O0[900],O0[700],O0[500],O0[300],O0[100]],[I0[900],I0[700],I0[500],I0[300],I0[100]],[L0[900],L0[700],L0[500],L0[300],L0[100]],[F0[900],F0[700],F0[500],F0[300],F0[100]],[k0[900],k0[700],k0[500],k0[300],k0[100]],[B0[900],B0[700],B0[500],B0[300],B0[100]],[U0[900],U0[700],U0[500],U0[300],U0[100]],[z0[900],z0[700],z0[500],z0[300],z0[100]],["#194D33",g1[700],g1[500],g1[300],g1[100]],[$0[900],$0[700],$0[500],$0[300],$0[100]],[H0[900],H0[700],H0[500],H0[300],H0[100]],[V0[900],V0[700],V0[500],V0[300],V0[100]],[W0[900],W0[700],W0[500],W0[300],W0[100]],[G0[900],G0[700],G0[500],G0[300],G0[100]],[j0[900],j0[700],j0[500],j0[300],j0[100]],[q0[900],q0[700],q0[500],q0[300],q0[100]],[X0[900],X0[700],X0[500],X0[300],X0[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Ya(QI);var e5=function(e){var n=e.onChange,r=e.onSwatchHover,i=e.hex,o=e.colors,a=e.width,s=e.triangle,l=e.styles,u=l===void 0?{}:l,c=e.className,f=c===void 0?"":c,d=mn(Xa({default:{card:{width:a,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},u),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),p=function(x,_){ih(x)&&n({hex:x,source:"hex"},_)};return se.createElement("div",{style:d.card,className:"twitter-picker "+f},se.createElement("div",{style:d.triangleShadow}),se.createElement("div",{style:d.triangle}),se.createElement("div",{style:d.body},lm(o,function(y,x){return se.createElement(sm,{key:x,color:y,hex:y,style:d.swatch,onClick:p,onHover:r,focusStyle:{boxShadow:"0 0 4px "+y}})}),se.createElement("div",{style:d.hash},"#"),se.createElement(Hn,{label:null,style:{input:d.input},value:i.replace("#",""),onChange:p}),se.createElement("div",{style:d.clear})))};e5.propTypes={width:at.oneOfType([at.string,at.number]),triangle:at.oneOf(["hide","top-left","top-right"]),colors:at.arrayOf(at.string),styles:at.object};e5.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Ya(e5);var t5=function(e){var n=mn({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(e.hsl.s*100)+"%, "+Math.round(e.hsl.l*100)+"%)"}}});return se.createElement("div",{style:n.picker})};t5.propTypes={hsl:at.shape({h:at.number,s:at.number,l:at.number,a:at.number})};t5.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var n5=function(e){var n=mn({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return se.createElement("div",{style:n.picker})};n5.propTypes={hsl:at.shape({h:at.number,s:at.number,l:at.number,a:at.number})};n5.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var pXe=function(e){var n=e.onChange,r=e.rgb,i=e.hsl,o=e.hex,a=e.hsv,s=function(p,y){if(p.hex)ih(p.hex)&&n({hex:p.hex,source:"hex"},y);else if(p.rgb){var x=p.rgb.split(",");cD(p.rgb,"rgb")&&n({r:x[0],g:x[1],b:x[2],a:1,source:"rgb"},y)}else if(p.hsv){var _=p.hsv.split(",");cD(p.hsv,"hsv")&&(_[2]=_[2].replace("%",""),_[1]=_[1].replace("%",""),_[0]=_[0].replace("°",""),_[1]==1?_[1]=.01:_[2]==1&&(_[2]=.01),n({h:Number(_[0]),s:Number(_[1]),v:Number(_[2]),source:"hsv"},y))}else if(p.hsl){var v=p.hsl.split(",");cD(p.hsl,"hsl")&&(v[2]=v[2].replace("%",""),v[1]=v[1].replace("%",""),v[0]=v[0].replace("°",""),f[1]==1?f[1]=.01:f[2]==1&&(f[2]=.01),n({h:Number(v[0]),s:Number(v[1]),v:Number(v[2]),source:"hsl"},y))}},l=mn({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),u=r.r+", "+r.g+", "+r.b,c=Math.round(i.h)+"°, "+Math.round(i.s*100)+"%, "+Math.round(i.l*100)+"%",f=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.v*100)+"%";return se.createElement("div",{style:l.wrap,className:"flexbox-fix"},se.createElement("div",{style:l.fields},se.createElement("div",{style:l.double},se.createElement(Hn,{style:{input:l.input,label:l.label},label:"hex",value:o,onChange:s})),se.createElement("div",{style:l.column},se.createElement("div",{style:l.single},se.createElement(Hn,{style:{input:l.input2,label:l.label2},label:"rgb",value:u,onChange:s})),se.createElement("div",{style:l.single},se.createElement(Hn,{style:{input:l.input2,label:l.label2},label:"hsv",value:f,onChange:s})),se.createElement("div",{style:l.single},se.createElement(Hn,{style:{input:l.input2,label:l.label2},label:"hsl",value:c,onChange:s})))))},r5=function(e){var n=e.width,r=e.onChange,i=e.rgb,o=e.hsl,a=e.hsv,s=e.hex,l=e.header,u=e.styles,c=u===void 0?{}:u,f=e.className,d=f===void 0?"":f,p=mn(Xa({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+i.r+", "+i.g+", "+i.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},c));return se.createElement("div",{style:p.picker,className:"google-picker "+d},se.createElement("div",{style:p.head},l),se.createElement("div",{style:p.swatch}),se.createElement("div",{style:p.saturation},se.createElement(fA,{hsl:o,hsv:a,pointer:t5,onChange:r})),se.createElement("div",{style:p.body},se.createElement("div",{style:p.controls,className:"flexbox-fix"},se.createElement("div",{style:p.hue},se.createElement(Dv,{style:p.Hue,hsl:o,radius:"4px",pointer:n5,onChange:r}))),se.createElement(pXe,{rgb:i,hsl:o,hex:s,hsv:a,onChange:r})))};r5.propTypes={width:at.oneOfType([at.string,at.number]),styles:at.object,header:at.string};r5.defaultProps={width:652,styles:{},header:"Color picker"};Ya(r5);var i5={},oY={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})(oY);var aY=oY.exports,dD={};const mXe=HQ(Joe);var Xz;function sY(){return Xz||(Xz=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=mXe}(dD)),dD}var gXe=aY;Object.defineProperty(i5,"__esModule",{value:!0});var lY=i5.default=void 0,vXe=gXe(sY()),yXe=k,xXe=(0,vXe.default)((0,yXe.jsx)("path",{d:"M3 3h18v18H3z"}),"Square");lY=i5.default=xXe;function Yh(t){const[e,n]=se.useState(null),r=a=>{n(a.currentTarget)},i=()=>{n(null)},o=!!e;return k.jsxs("div",{children:[k.jsx(WM,{style:{color:rd(t.color)},onClick:r,children:k.jsx(lY,{})}),k.jsx(AH,{open:o,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:k.jsx(oXe,{color:t.color,onChangeComplete:t.onChangeComplete})})]})}function bXe(){const t=Xq();return k.jsx(KM,{sx:{height:1,width:1},children:k.jsx(ZM,{children:k.jsxs(Wn,{spacing:1,children:[k.jsx(An,{variant:"h6",children:" Legend"}),k.jsx(bp,{}),k.jsxs(xH,{children:[k.jsx(vs,{control:k.jsx(Uh,{checked:t.detector,onChange:(e,n)=>t.update({detector:n})}),label:k.jsxs(Wn,{direction:"row",children:[k.jsx(Yh,{color:t.detectorColour,onChangeComplete:e=>t.update({detectorColour:e.rgb})}),k.jsx(An,{children:"Detector:"})]})}),k.jsx(vs,{control:k.jsx(Uh,{checked:t.cameraTube,onChange:(e,n)=>t.update({cameraTube:n})}),label:k.jsxs(Wn,{direction:"row",children:[k.jsx(Yh,{color:t.cameraTubeColor,onChangeComplete:e=>t.update({cameraTubeColor:e.rgb})}),k.jsx(An,{children:"Camera Tube:"})]})}),k.jsx(vs,{control:k.jsx(Uh,{checked:t.beamstop,onChange:(e,n)=>{t.update({beamstop:n})}}),label:k.jsxs(Wn,{direction:"row",children:[k.jsx(Yh,{color:t.beamstopColor,onChangeComplete:e=>t.update({beamstopColor:e.rgb})}),k.jsx(An,{children:"Beamstop"})]})}),k.jsx(vs,{control:k.jsx(Uh,{checked:t.clearance,onChange:(e,n)=>{t.update({clearance:n})}}),label:k.jsxs(Wn,{direction:"row",children:[k.jsx(Yh,{color:t.clearanceColor,onChangeComplete:e=>t.update({clearanceColor:e.rgb})}),k.jsx(An,{children:"Clearance"})]})}),k.jsx(vs,{control:k.jsx(Uh,{checked:t.visibleRange,onChange:(e,n)=>t.update({visibleRange:n})}),label:k.jsxs(Wn,{direction:"row",children:[k.jsx(Yh,{color:t.visibleColor,onChangeComplete:e=>t.update({visibleColor:e.rgb})}),k.jsx(An,{children:"Visible Range"})]})}),k.jsx(vs,{control:k.jsx(Uh,{checked:t.requestedRange,onChange:(e,n)=>t.update({requestedRange:n})}),label:k.jsxs(Wn,{direction:"row",children:[k.jsx(Yh,{color:t.requestedRangeColor,onChangeComplete:e=>t.update({requestedRangeColor:e.rgb})}),k.jsx(An,{children:"Requested Range"})]})}),k.jsx(vs,{control:k.jsx(Uh,{checked:t.inaccessibleRange,onChange:(e,n)=>t.update({inaccessibleRange:n})}),label:k.jsxs(Wn,{direction:"row",children:[k.jsx(Yh,{color:t.inaccessibleRangeColor,onChangeComplete:e=>t.update({inaccessibleRangeColor:e.rgb})}),k.jsx(An,{children:"inaccessible Range"})]})})]}),k.jsxs(pl,{children:[k.jsx(IO,{id:"demo-radio-buttons-group-label",children:"Axes:"}),k.jsxs(IH,{"aria-labelledby":"demo-radio-buttons-group-label",value:t.plotAxes,name:"radio-buttons-group",onChange:e=>t.update({plotAxes:e.target.value}),children:[k.jsx(vs,{value:Yc.milimeter,control:k.jsx(Mg,{}),label:"Axes in mm"}),k.jsx(vs,{value:Yc.pixel,control:k.jsx(Mg,{}),label:"Axes in pixels"}),k.jsx(vs,{value:Yc.reciprocal,control:k.jsx(Mg,{}),label:"Axes in q(nm^-1)"})]})]})]})})})}var Ia=(t=>(t.q="q",t.s="s",t.d="d",t))(Ia||{});const gp=hv(t=>({requested:"q",qUnits:l2.nanmometres,sUnits:ll.nanmometres,dUnits:ll.nanmometres,requestedMin:null,requestedMax:null,updateRequested:e=>{t({requested:e})},updateRequestedRange:e=>{t({...e})},updateQUnits:e=>t({qUnits:e}),updateSUnits:e=>t({sUnits:e}),updateDUnits:e=>t({dUnits:e})}));function _Xe(t){return k.jsx("svg",{style:{display:"grid",height:"40%",width:"90%",border:"solid black"},children:k.jsx("text",{x:"40%",y:"50%",children:t.message})})}function wXe(t){console.log(t.requestedRange.min.formatUnits());const e=t.visibleRange.max.toNumber()-t.visibleRange.min.toNumber(),n=t.requestedRange.max.toNumber()/e*100,r=t.requestedRange.min.toNumber()/e*100,i=t.visibleRange.containsRange(t.requestedRange)?"green":"red";return k.jsxs("svg",{style:{display:"grid",height:"40%",width:"90%",border:"solid black"},children:[k.jsx("rect",{y:"0",x:"0",width:"100%",height:"50%",fill:i}),k.jsx("line",{x1:`${r}%`,y1:0,x2:`${r}%`,y2:"50%",style:{stroke:"black",strokeWidth:2}}),k.jsx("line",{x1:`${n}%`,y1:0,x2:`${n}%`,y2:"60%",style:{stroke:"black",strokeWidth:2}}),k.jsxs("text",{y:"60%",x:`${r}%`,children:[" ","Requested min"]}),k.jsx("text",{y:"80%",x:`${n}%`,children:"Requested max"})]})}const H2=t=>ru(1,t),V2=t=>ru(2*Math.PI,t);function SXe(t){const e=gp(),n=gp(f=>f.updateQUnits),r=gp(f=>f.updateSUnits),i=gp(f=>f.updateDUnits),o=f=>{n(f.target.value)},a=f=>{r(f.target.value)},s=f=>{i(f.target.value)},l=t.qRange.to(e.qUnits),u=t.qRange.apply(H2).to(e.sUnits),c=t.qRange.apply(V2).to(e.dUnits);return k.jsx(tf,{flexGrow:1,children:k.jsx(Epe,{component:Xp,children:k.jsxs(rpe,{sx:{minWidth:50},"aria-label":"simple table",size:"small",children:[k.jsx(Ppe,{children:k.jsxs(Ew,{children:[k.jsx(Uo,{children:"Values"}),k.jsx(Uo,{align:"right",children:"Min"}),k.jsx(Uo,{align:"right",children:"Max"}),k.jsx(Uo,{align:"right",children:"Units"})]})}),k.jsxs(fpe,{children:[k.jsxs(Ew,{children:[k.jsx(Uo,{component:"th",scope:"row",children:Ia.q}),k.jsx(Uo,{align:"right",children:l.min.toNumber().toFixed(4)}),k.jsx(Uo,{align:"right",children:l.max.toNumber().toFixed(4)}),k.jsx(Uo,{align:"right",children:k.jsxs(pl,{children:[k.jsx(Wu,{children:"q"}),k.jsxs(Gu,{size:"small",label:"units",value:e.qUnits,onChange:o,children:[k.jsx(oo,{value:l2.nanmometres,children:"1 / nm"}),k.jsx(oo,{value:l2.angstroms,children:"1 / Å"})]})]})})]},"q"),k.jsxs(Ew,{children:[k.jsx(Uo,{component:"th",scope:"row",children:Ia.s}),k.jsx(Uo,{align:"right",children:u.min.toNumber().toFixed(4)}),k.jsx(Uo,{align:"right",children:u.max.toNumber().toFixed(4)}),k.jsx(Uo,{align:"right",children:k.jsxs(pl,{children:[k.jsx(Wu,{children:"s"}),k.jsxs(Gu,{size:"small",label:"units",value:e.sUnits,onChange:a,children:[k.jsx(oo,{value:ll.nanmometres,children:ll.nanmometres}),k.jsx(oo,{value:ll.angstroms,children:"Å"})]})]})})]},"s"),k.jsxs(Ew,{children:[k.jsx(Uo,{component:"th",scope:"row",children:Ia.d}),k.jsx(Uo,{align:"right",children:c.min.toNumber().toFixed(4)}),k.jsx(Uo,{align:"right",children:c.max.toNumber().toFixed(4)}),k.jsx(Uo,{align:"right",children:k.jsxs(pl,{children:[k.jsx(Wu,{children:"d"}),k.jsxs(Gu,{size:"small",label:"units",value:e.dUnits,onChange:s,children:[k.jsx(oo,{value:ll.nanmometres,children:ll.nanmometres}),k.jsx(oo,{value:ll.angstroms,children:"Å"})]})]})})]},"d")]})]})})})}class Ql{constructor(e,n){Il(this,"min");Il(this,"max");if(this.min=e,this.max=n,nE(e,n)){const r=n.clone();this.max=e,this.min=r}}to(e){return new Ql(this.min.to(e),this.max.to(e))}containsValue(e){return $T(e,this.min)&&$T(e,this.max)}containsRange(e){return console.log(`${e.min.formatUnits()} ${this.min.formatUnits()}`),console.log(`${e.min.formatUnits()} ${this.min.formatUnits()}`),f1e(this.min,e.min)&&$T(this.max,e.max)}toString(){return`(min:${this.min.toString()}, max:${this.max.toString()})`}intersect(e){return nE(e.min,this.max)||nE(this.min,e.max)?null:new Ql(c1e(e.min,this.min),a1e(e.max,this.max))}equals(e){return DR(this.min,e.min)&&DR(this.max,e.max)}apply(e){return new Ql(e(this.min),e(this.max))}inPlaceApply(e){return this.min=e(this.min),this.max=e(this.max),this}static fromNumericRange(e,n){return new Ql(un((e==null?void 0:e.min)??NaN,n),un((e==null?void 0:e.max)??NaN,n))}}function EXe(t){const e=gp(),n=gp(l=>l.requestedMax&&l.requestedMin?new Vo(l.requestedMin,l.requestedMax):null);let r=null,i=null,o=null;const a=l=>{e.updateRequestedRange({requestedMax:ug(l.target.value)})},s=l=>{e.updateRequestedRange({requestedMin:ug(l.target.value)})};if(t.visableQRange&&t.fullQrange&&n)switch(e.requested){case Ia.d:r=t.visableQRange.apply(V2).to("nm"),i=t.fullQrange.apply(V2).to("nm"),o=Ql.fromNumericRange(n,e.dUnits).to("nm");break;case Ia.s:r=t.visableQRange.apply(H2).to("nm"),i=t.fullQrange.apply(H2).to("nm"),o=Ql.fromNumericRange(n,e.sUnits).to("nm");break;default:r=t.visableQRange.to("nm^-1"),i=t.fullQrange.to("nm^-1"),o=Ql.fromNumericRange(n,e.qUnits).to("nm^-1")}return k.jsx(tf,{sx:{flexGrow:1},children:k.jsx(KM,{sx:{height:1},children:k.jsx(ZM,{children:k.jsxs(Wn,{spacing:1,children:[k.jsx(An,{variant:"h6",children:" Results"}),k.jsx(bp,{}),k.jsxs(Wn,{direction:"row",spacing:3,children:[k.jsx(SXe,{qRange:t.visableQRange}),k.jsx(bp,{orientation:"vertical"}),k.jsxs(Wn,{flexGrow:2,children:[k.jsx(Wn,{spacing:1,children:k.jsxs(Wn,{direction:"row",spacing:1,children:[k.jsxs(Wn,{spacing:1,children:[k.jsxs(An,{children:["Requested min ",e.requested," value:"," "]}),k.jsxs(An,{children:["Requested max ",e.requested," value:"," "]})]}),k.jsxs(Wn,{spacing:1,children:[k.jsx(Cs,{type:"number",size:"small",value:e.requestedMin,onChange:s}),k.jsx(Cs,{type:"number",size:"small",value:e.requestedMax,onChange:a})]}),k.jsxs(pl,{children:[k.jsx(IO,{children:"Requested Quantiy"}),k.jsxs(IH,{row:!0,value:e.requested,onChange:l=>e.updateRequested(l.target.value),children:[k.jsx(vs,{value:Ia.q,control:k.jsx(Mg,{}),label:Ia.q}),k.jsx(vs,{value:Ia.s,control:k.jsx(Mg,{}),label:Ia.s}),k.jsx(vs,{value:Ia.d,control:k.jsx(Mg,{}),label:Ia.d})]})]})]})}),(()=>r&&i&&o&&i.containsRange(r)?k.jsx(wXe,{visibleRange:r,fullRange:i,requestedRange:o}):k.jsx(_Xe,{message:"No solution"}))()]})]})]})})})})}const MXe=(t,e,n)=>{if(t<0||e<0||n<0)return null;const r=n*t/(4*Math.PI);return Math.abs(r)>=Math.sqrt(2)/2?null:Math.tan(2*Math.asin(r))*e},Yz=(t,e,n,r,i)=>{const a=new Yq(new Je(Math.cos(e.toSI().toNumber()),Math.sin(e.toSI().toNumber())),new Je(i.x.toSI().toNumber(),i.y.toSI().toNumber())).getPointAtDistance(MXe(t.toSI().toNumber(),n.toSI().toNumber(),r.toSI().toNumber())??0);return{x:un(a.x,"m"),y:un(a.y,"m")}};function hD(t){const{coords:e,...n}=t,[r,i,o]=e,a=i.distanceTo(r),s=o.distanceTo(r);return k.jsx("ellipse",{cx:r.x,cy:r.y,rx:a,ry:s,...n})}function CXe(){const t=Xq(),e=u2(D=>({angle:D.angle,cameraLength:D.cameraLength,minWavelength:D.minWavelength,maxWavelength:D.maxWavelength,minCameraLength:D.minCameraLength,maxCameraLength:D.maxCameraLength,cameraLengthStep:D.cameraLengthStep,wavelength:D.wavelength})),n=_x(D=>({resolution:D.resolution,pixelSize:D.pixelSize})),r=XO(D=>({centre:D.centre,diameter:D.diameter,clearance:D.clearance})),i=YO(D=>({centre:D.centre,diameter:D.diameter}));lg.UNITS.xpixel&&delete lg.UNITS.xpixel,lg.UNITS.ypixel&&delete lg.UNITS.ypixel,pk("xpixel",n.pixelSize.width.toString()),pk("ypixel",n.pixelSize.height.toString());const{ptMin:o,ptMax:a,visibleQRange:s,fullQRange:l}=tLe(n,r,i,e),u=Ql.fromNumericRange(s,"m^-1").to("nm^-1"),c=Ql.fromNumericRange(l,"m^-1").to("nm^-1"),f={x:un(o.x,"m"),y:un(o.y,"m")},d={x:un(a.x,"m"),y:un(a.y,"m")},p={x:un(r.centre.x??NaN,"xpixel"),y:un(r.centre.y??NaN,"ypixel")},y={x:un(i.centre.x??NaN,"xpixel"),y:un(i.centre.y??NaN,"ypixel")},x=vU(p,r.diameter,t.plotAxes),_=vU(y,i.diameter,t.plotAxes),v=J5e(p,r.diameter,r.clearance??0,t.plotAxes),S=Q5e(new ae(0,0),n.resolution,t.plotAxes),w=yU(f,d,t.plotAxes),E=gp(D=>{if(!D.requestedMax||!D.requestedMin)return null;const I=P=>{let N;switch(D.requested){case Ia.d:N=V2(un(P,D.dUnits));break;case Ia.s:N=H2(un(P,D.sUnits));break;default:N=un(P,D.qUnits)}return N};return new Ql(I(D.requestedMin),I(D.requestedMax))});let T={start:new ae(0,0),end:new ae(0,0)};if(E&&e.cameraLength){const D=Yz(E.max,e.angle,un(e.cameraLength,"m"),e.wavelength,p),I=Yz(E.min,e.angle,un(e.cameraLength,"m"),e.wavelength,p);T=yU(I,D,t.plotAxes)}const A=Z5e(S,t.plotAxes);return k.jsx(tf,{children:k.jsxs(Wn,{direction:"column",spacing:1,children:[k.jsxs(Wn,{direction:"row",spacing:1,children:[k.jsx(KM,{children:k.jsx(ZM,{children:k.jsx("div",{style:{display:"grid",height:"60vh",width:"65vh",border:"solid black"},children:k.jsxs(r5e,{abscissaConfig:{visDomain:[A.xAxis.min,A.xAxis.max],showGrid:!0},ordinateConfig:{visDomain:[A.yAxis.max,A.yAxis.min],showGrid:!0},children:[k.jsx(NIe,{}),k.jsx(FIe,{}),k.jsx(Y5e,{points:[x.centre,x.endPointX,x.endPointY,v.centre,v.endPointX,v.endPointY,_.centre,_.endPointX,_.endPointY,S.lowerBound,S.upperBound,w.start,w.end,T.start,T.end],children:(D,I,P,N,B,G,Z,j,J,Y,$,W,U,ne,re)=>k.jsxs(mI,{children:[t.cameraTube&&k.jsx(hD,{coords:[Z,j,J],fill:rd(t.cameraTubeColor),id:"camera tube"}),t.detector&&k.jsx(R2,{coords:[Y,$],fill:rd(t.detectorColour),id:"detector"}),t.inaccessibleRange&&k.jsx(tD,{coords:[D,W],stroke:rd(t.inaccessibleRangeColor),strokeWidth:3,id:"inaccessible"}),t.clearance&&k.jsx(hD,{coords:[N,B,G],fill:rd(t.clearanceColor),id:"clearance"}),t.visibleRange&&k.jsx(tD,{coords:[W,U],stroke:rd(t.visibleColor),strokeWidth:3,id:"visible"}),t.requestedRange&&k.jsx(tD,{coords:[ne,re],stroke:rd(t.requestedRangeColor),strokeWidth:3,id:"requested"}),t.beamstop&&k.jsx(hD,{coords:[D,I,P],fill:rd(t.beamstopColor),id:"beamstop"})]})})]})})})}),k.jsx(tf,{flexGrow:1,children:k.jsx(bXe,{})})]}),k.jsx(EXe,{visableQRange:u,fullQrange:c})]})})}var o5={},AXe=aY;Object.defineProperty(o5,"__esModule",{value:!0});var uY=o5.default=void 0,TXe=AXe(sY()),DXe=k,RXe=(0,TXe.default)((0,DXe.jsx)("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");uY=o5.default=RXe;function PXe(){return k.jsxs(tf,{children:[k.jsx(SH,{children:k.jsx(Mde,{children:k.jsx(Wn,{direction:"row",children:k.jsx(An,{flexGrow:3,children:"Nothing to see here (0_0)"})})})}),k.jsx(bp,{})]})}function NXe(){const[t,e]=V.useState({menuOpen:!1}),n=u=>()=>{e({menuOpen:u})},r=u2(u=>u.preset),i=XO(u=>u.updateBeamstop),o=YO(u=>u.updateCameraTube),a=u2(u=>u.update),s=_x(u=>u.updateDetector),l=u=>{const{beamstop:c,cameraTube:f,detector:d,...p}=bx[u];s(d),i(c),o(f),a(p),a({preset:u})};return k.jsx(tf,{sx:{flexGrow:2},children:k.jsx(Kae,{position:"static",children:k.jsxs(kpe,{children:[k.jsxs(V.Fragment,{children:[k.jsx(WM,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:n(!0),children:k.jsx(uY,{})}),k.jsx(lfe,{anchor:"left",open:t.menuOpen,onClose:n(!1),children:k.jsx(tf,{sx:{width:250},role:"presentation",onClick:n(!1),children:k.jsx(PXe,{})})})]}),k.jsx(An,{variant:"h6",component:"div",sx:{flexGrow:1},children:"Dedi Web"}),k.jsx(cH,{size:"small",disablePortal:!0,id:"combo-box-demo",options:Object.keys(bx),value:r,sx:{width:300,color:"white"},renderInput:u=>k.jsx(Cs,{...u,label:"choose beamline preset",sx:{color:"white"}}),onChange:(u,c)=>{c&&l(c)}})]})})})}function OXe(){return k.jsxs(tf,{children:[k.jsx(NXe,{}),k.jsxs(Wn,{direction:"row",spacing:1,margin:1,children:[k.jsx(tf,{children:k.jsx(H1e,{})}),k.jsx(Wn,{direction:"column",spacing:1,flexGrow:1,children:k.jsx(CXe,{})})]})]})}mD.createRoot(document.getElementById("root")).render(k.jsx(se.StrictMode,{children:k.jsx(OXe,{})}))});export default IXe(); diff --git a/index.html b/index.html index b891f13..2d723a4 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ dedi-web - +