/*! For license information please see main.ec3c5280.js.LICENSE.txt */
(()=>{var e={1273:e=>{"use strict";e.exports=function(e,t){if(null===e||"undefined"===typeof e)throw new TypeError("expected first argument to be an object.");if("undefined"===typeof t||"undefined"===typeof Symbol)return e;if("function"!==typeof Object.getOwnPropertySymbols)return e;for(var n=Object.prototype.propertyIsEnumerable,r=Object(e),i=arguments.length,a=0;++a<i;)for(var o=Object(arguments[a]),s=Object.getOwnPropertySymbols(o),l=0;l<s.length;l++){var c=s[l];n.call(o,c)&&(r[c]=o[c])}return r}},8628:(e,t)=>{"use strict";t.A=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",i=(e.type||"").toLowerCase(),a=i.replace(/\/.*$/,"");return n.some((function(e){var t=e.trim().toLowerCase();return"."===t.charAt(0)?r.toLowerCase().endsWith(t):t.endsWith("/*")?a===t.replace(/\/.*$/,""):i===t}))}return!0}},4695:e=>{function t(e,t,n){var r,i,a,o,s;function l(){var c=Date.now()-o;c<t&&c>=0?r=setTimeout(l,t-c):(r=null,n||(s=e.apply(a,i),a=i=null))}null==t&&(t=100);var c=function(){a=this,i=arguments,o=Date.now();var c=n&&!r;return r||(r=setTimeout(l,t)),c&&(s=e.apply(a,i),a=i=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=e.apply(a,i),a=i=null,clearTimeout(r),r=null)},c}t.debounce=t,e.exports=t},2087:(e,t)=>{"use strict";var n=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;t.validate=function(e){if(!e)return!1;if(e.length>254)return!1;if(!n.test(e))return!1;var t=e.split("@");return!(t[0].length>64)&&!t[1].split(".").some((function(e){return e.length>63}))}},6533:(e,t,n)=>{"use strict";var r=n(9752);function i(e,t){for(var n in t)a(t,n)&&(e[n]=t[n])}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e){r(e)||(e={});for(var t=arguments.length,n=1;n<t;n++){var a=arguments[n];r(a)&&i(e,a)}return e}},9752:e=>{"use strict";e.exports=function(e){return"undefined"!==typeof e&&null!==e&&("object"===typeof e||"function"===typeof e)}},5113:e=>{"use strict";e.exports=function(e,t,n){for(var r in e)if(!1===t.call(n,e[r],r,e))break}},7480:e=>{function t(e){return e?Array.isArray(e)?e.join("."):e:""}e.exports=function(e,n,r,i,a){if(null===(o=e)||"object"!==typeof o&&"function"!==typeof o||!n)return e;var o;if(n=t(n),r&&(n+="."+t(r)),i&&(n+="."+t(i)),a&&(n+="."+t(a)),n in e)return e[n];for(var s=n.split("."),l=s.length,c=-1;e&&++c<l;){for(var u=s[c];"\\"===u[u.length-1];)u=u.slice(0,-1)+"."+s[++c];e=e[u]}return e}},9959:(e,t,n)=>{"use strict";var r=n(6927);e.exports=function(e){return r(e)||"function"===typeof e||Array.isArray(e)}},6927:(e,t,n)=>{"use strict";var r=n(6899);function i(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,n;return!1!==i(e)&&("function"===typeof(t=e.constructor)&&(!1!==i(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))}},6899:e=>{"use strict";e.exports=function(e){return null!=e&&"object"===typeof e&&!1===Array.isArray(e)}},7248:(e,t,n)=>{"use strict";var r=n(9959),i=n(3654),a=n(7480),o=n(692);e.exports=function(e,t,n){if(!r(e))throw new TypeError("expected an object");if("string"!==typeof t||null==n)return i.apply(null,arguments);if("string"===typeof n)return o(e,t,n),e;var s=a(e,t);return r(n)&&r(s)&&(n=i({},s,n)),o(e,t,n),e}},3654:(e,t,n)=>{"use strict";var r=n(9959),i=n(5113);function a(e,t){for(var n=arguments.length,r=0;++r<n;){var a=arguments[r];s(a)&&i(a,o,e)}return e}function o(e,t){if(function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e}(t)){var n=this[t];s(e)&&s(n)?a(n,e):this[t]=e}}function s(e){return r(e)&&!Array.isArray(e)}e.exports=a},1497:(e,t,n)=>{"use strict";var r=n(3218);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=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 s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},5173:(e,t,n)=>{e.exports=n(1497)()},3218:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2730:(e,t,n)=>{"use strict";var r=n(5043),i=n(7067);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,s={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(s[e]=t,e=0;e<t.length;e++)o.add(t[e])}var u=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},f={};function m(e,t,n,r,i,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,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(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function b(e,t,n,r){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!d.call(f,e)||!d.call(p,e)&&(h.test(e)?f[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"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(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var x=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),C=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),I=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var D=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var L=Symbol.iterator;function k(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=L&&e[L]||e["@@iterator"])?e:null}var O,N=Object.assign;function F(e){if(void 0===O)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);O=t&&t[1]||""}return"\n"+O+e}var U=!1;function z(e,t){if(!e||U)return"";U=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"===typeof c.stack){for(var i=c.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,0>--s||i[o]!==a[s]){var l="\n"+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=o&&0<=s);break}}}finally{U=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?F(e):""}function H(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=z(e.type,!1);case 11:return e=z(e.type.render,!1);case 1:return e=z(e.type,!0);default:return""}}function G(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case w:return"Fragment";case S:return"Portal";case A:return"Profiler";case E:return"StrictMode";case R:return"Suspense";case P:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case M:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case B:return null!==(t=e.displayName||null)?t:G(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return G(e(t))}catch(n){}}return null}function j(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return G(t);case 8:return t===E?"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("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function V(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function W(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function X(e){e._valueTracker||(e._valueTracker=function(e){var t=W(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function J(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=W(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function $(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function K(e,t){var n=t.checked;return N({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Y(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=V(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function q(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function Q(e,t){q(e,t);var n=V(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,V(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Z(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&$(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+V(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return N({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(te(n)){if(1<n.length)throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:V(n)}}function ae(e,t){var n=V(t.value),r=V(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,ue=function(e){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function de(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var he={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},pe=["Webkit","ms","Moz","O"];function fe(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||he.hasOwnProperty(e)&&he[e]?(""+t).trim():t+"px"}function me(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=fe(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(he).forEach((function(e){pe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),he[t]=he[e]}))}));var ge=N({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 ve(e,t){if(t){if(ge[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function ye(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var be=null;function xe(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _e=null,Se=null,we=null;function Ee(e){if(e=mi(e)){if("function"!==typeof _e)throw Error(a(280));var t=e.stateNode;t&&(t=vi(t),_e(e.stateNode,e.type,t))}}function Ae(e){Se?we?we.push(e):we=[e]:Se=e}function Me(){if(Se){var e=Se,t=we;if(we=Se=null,Ee(e),t)for(e=0;e<t.length;e++)Ee(t[e])}}function Ce(e,t){return e(t)}function Te(){}var Re=!1;function Pe(e,t,n){if(Re)return e(t,n);Re=!0;try{return Ce(e,t,n)}finally{Re=!1,(null!==Se||null!==we)&&(Te(),Me())}}function Be(e,t){var n=e.stateNode;if(null===n)return null;var r=vi(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}var Ie=!1;if(u)try{var De={};Object.defineProperty(De,"passive",{get:function(){Ie=!0}}),window.addEventListener("test",De,De),window.removeEventListener("test",De,De)}catch(eu){Ie=!1}function Le(e,t,n,r,i,a,o,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var ke=!1,Oe=null,Ne=!1,Fe=null,Ue={onError:function(e){ke=!0,Oe=e}};function ze(e,t,n,r,i,a,o,s,l){ke=!1,Oe=null,Le.apply(Ue,arguments)}function He(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ge(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function je(e){if(He(e)!==e)throw Error(a(188))}function Ve(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=He(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return je(i),e;if(o===r)return je(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e))?We(e):null}function We(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=We(e);if(null!==t)return t;e=e.sibling}return null}var Xe=i.unstable_scheduleCallback,Je=i.unstable_cancelCallback,$e=i.unstable_shouldYield,Ke=i.unstable_requestPaint,Ye=i.unstable_now,qe=i.unstable_getCurrentPriorityLevel,Qe=i.unstable_ImmediatePriority,Ze=i.unstable_UserBlockingPriority,et=i.unstable_NormalPriority,tt=i.unstable_LowPriority,nt=i.unstable_IdlePriority,rt=null,it=null;var at=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(ot(e)/st|0)|0},ot=Math.log,st=Math.LN2;var lt=64,ct=4194304;function ut(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=268435455&n;if(0!==o){var s=o&~i;0!==s?r=ut(s):0!==(a&=o)&&(r=ut(a))}else 0!==(o=n&~i)?r=ut(o):0!==a&&(r=ut(a));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(a=t&-t)||16===i&&0!==(4194240&a)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-at(t)),r|=e[n],t&=~i;return r}function ht(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function pt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function ft(){var e=lt;return 0===(4194240&(lt<<=1))&&(lt=64),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=n}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var yt=0;function bt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var xt,_t,St,wt,Et,At=!1,Mt=[],Ct=null,Tt=null,Rt=null,Pt=new Map,Bt=new Map,It=[],Dt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Lt(e,t){switch(e){case"focusin":case"focusout":Ct=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":Rt=null;break;case"pointerover":case"pointerout":Pt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bt.delete(t.pointerId)}}function kt(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},null!==t&&(null!==(t=mi(t))&&_t(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Ot(e){var t=fi(e.target);if(null!==t){var n=He(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ge(n)))return e.blockedOn=t,void Et(e.priority,(function(){St(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Nt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=$t(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=mi(n))&&_t(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);be=r,n.target.dispatchEvent(r),be=null,t.shift()}return!0}function Ft(e,t,n){Nt(e)&&n.delete(t)}function Ut(){At=!1,null!==Ct&&Nt(Ct)&&(Ct=null),null!==Tt&&Nt(Tt)&&(Tt=null),null!==Rt&&Nt(Rt)&&(Rt=null),Pt.forEach(Ft),Bt.forEach(Ft)}function zt(e,t){e.blockedOn===t&&(e.blockedOn=null,At||(At=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Ut)))}function Ht(e){function t(t){return zt(t,e)}if(0<Mt.length){zt(Mt[0],e);for(var n=1;n<Mt.length;n++){var r=Mt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Ct&&zt(Ct,e),null!==Tt&&zt(Tt,e),null!==Rt&&zt(Rt,e),Pt.forEach(t),Bt.forEach(t),n=0;n<It.length;n++)(r=It[n]).blockedOn===e&&(r.blockedOn=null);for(;0<It.length&&null===(n=It[0]).blockedOn;)Ot(n),null===n.blockedOn&&It.shift()}var Gt=x.ReactCurrentBatchConfig,jt=!0;function Vt(e,t,n,r){var i=yt,a=Gt.transition;Gt.transition=null;try{yt=1,Xt(e,t,n,r)}finally{yt=i,Gt.transition=a}}function Wt(e,t,n,r){var i=yt,a=Gt.transition;Gt.transition=null;try{yt=4,Xt(e,t,n,r)}finally{yt=i,Gt.transition=a}}function Xt(e,t,n,r){if(jt){var i=$t(e,t,n,r);if(null===i)zr(e,t,r,Jt,n),Lt(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Ct=kt(Ct,e,t,n,r,i),!0;case"dragenter":return Tt=kt(Tt,e,t,n,r,i),!0;case"mouseover":return Rt=kt(Rt,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Pt.set(a,kt(Pt.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Bt.set(a,kt(Bt.get(a)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Lt(e,r),4&t&&-1<Dt.indexOf(e)){for(;null!==i;){var a=mi(i);if(null!==a&&xt(a),null===(a=$t(e,t,n,r))&&zr(e,t,r,Jt,n),a===i)break;i=a}null!==i&&r.stopPropagation()}else zr(e,t,r,null,n)}}var Jt=null;function $t(e,t,n,r){if(Jt=null,null!==(e=fi(e=xe(r))))if(null===(t=He(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Ge(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Jt=e,null}function Kt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(qe()){case Qe:return 1;case Ze:return 4;case et:case tt:return 16;case nt:return 536870912;default:return 16}default:return 16}}var Yt=null,qt=null,Qt=null;function Zt(){if(Qt)return Qt;var e,t,n=qt,r=n.length,i="value"in Yt?Yt.value:Yt.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return Qt=i.slice(e,1<t?1-t:void 0)}function en(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function tn(){return!0}function nn(){return!1}function rn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?tn:nn,this.isPropagationStopped=nn,this}return N(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=tn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=tn)},persist:function(){},isPersistent:tn}),t}var an,on,sn,ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=rn(ln),un=N({},ln,{view:0,detail:0}),dn=rn(un),hn=N({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==sn&&(sn&&"mousemove"===e.type?(an=e.screenX-sn.screenX,on=e.screenY-sn.screenY):on=an=0,sn=e),an)},movementY:function(e){return"movementY"in e?e.movementY:on}}),pn=rn(hn),fn=rn(N({},hn,{dataTransfer:0})),mn=rn(N({},un,{relatedTarget:0})),gn=rn(N({},ln,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=rn(N({},ln,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),yn=rn(N({},ln,{data:0})),bn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_n={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=_n[e])&&!!t[e]}function wn(){return Sn}var En=rn(N({},un,{key:function(e){if(e.key){var t=bn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=en(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?xn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wn,charCode:function(e){return"keypress"===e.type?en(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?en(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),An=rn(N({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Mn=rn(N({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wn})),Cn=rn(N({},ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),Tn=rn(N({},hn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Rn=[9,13,27,32],Pn=u&&"CompositionEvent"in window,Bn=null;u&&"documentMode"in document&&(Bn=document.documentMode);var In=u&&"TextEvent"in window&&!Bn,Dn=u&&(!Pn||Bn&&8<Bn&&11>=Bn),Ln=String.fromCharCode(32),kn=!1;function On(e,t){switch(e){case"keyup":return-1!==Rn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Fn=!1;var Un={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Un[e.type]:"textarea"===t}function Hn(e,t,n,r){Ae(r),0<(t=Gr(t,"onChange")).length&&(n=new cn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Gn=null,jn=null;function Vn(e){Lr(e,0)}function Wn(e){if(J(gi(e)))return e}function Xn(e,t){if("change"===e)return t}var Jn=!1;if(u){var $n;if(u){var Kn="oninput"in document;if(!Kn){var Yn=document.createElement("div");Yn.setAttribute("oninput","return;"),Kn="function"===typeof Yn.oninput}$n=Kn}else $n=!1;Jn=$n&&(!document.documentMode||9<document.documentMode)}function qn(){Gn&&(Gn.detachEvent("onpropertychange",Qn),jn=Gn=null)}function Qn(e){if("value"===e.propertyName&&Wn(jn)){var t=[];Hn(t,jn,e,xe(e)),Pe(Vn,t)}}function Zn(e,t,n){"focusin"===e?(qn(),jn=n,(Gn=t).attachEvent("onpropertychange",Qn)):"focusout"===e&&qn()}function er(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Wn(jn)}function tr(e,t){if("click"===e)return Wn(t)}function nr(e,t){if("input"===e||"change"===e)return Wn(t)}var rr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function ir(e,t){if(rr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!d.call(t,i)||!rr(e[i],t[i]))return!1}return!0}function ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function or(e,t){var n,r=ar(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ar(r)}}function sr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?sr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function lr(){for(var e=window,t=$();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=$((e=t.contentWindow).document)}return t}function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function ur(e){var t=lr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&sr(n.ownerDocument.documentElement,n)){if(null!==r&&cr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=void 0===r.end?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=or(n,a);var o=or(n,r);i&&o&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var dr=u&&"documentMode"in document&&11>=document.documentMode,hr=null,pr=null,fr=null,mr=!1;function gr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;mr||null==hr||hr!==$(r)||("selectionStart"in(r=hr)&&cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},fr&&ir(fr,r)||(fr=r,0<(r=Gr(pr,"onSelect")).length&&(t=new cn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=hr)))}function vr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var yr={animationend:vr("Animation","AnimationEnd"),animationiteration:vr("Animation","AnimationIteration"),animationstart:vr("Animation","AnimationStart"),transitionend:vr("Transition","TransitionEnd")},br={},xr={};function _r(e){if(br[e])return br[e];if(!yr[e])return e;var t,n=yr[e];for(t in n)if(n.hasOwnProperty(t)&&t in xr)return br[e]=n[t];return e}u&&(xr=document.createElement("div").style,"AnimationEvent"in window||(delete yr.animationend.animation,delete yr.animationiteration.animation,delete yr.animationstart.animation),"TransitionEvent"in window||delete yr.transitionend.transition);var Sr=_r("animationend"),wr=_r("animationiteration"),Er=_r("animationstart"),Ar=_r("transitionend"),Mr=new Map,Cr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Tr(e,t){Mr.set(e,t),l(t,[e])}for(var Rr=0;Rr<Cr.length;Rr++){var Pr=Cr[Rr];Tr(Pr.toLowerCase(),"on"+(Pr[0].toUpperCase()+Pr.slice(1)))}Tr(Sr,"onAnimationEnd"),Tr(wr,"onAnimationIteration"),Tr(Er,"onAnimationStart"),Tr("dblclick","onDoubleClick"),Tr("focusin","onFocus"),Tr("focusout","onBlur"),Tr(Ar,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Br="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ir=new Set("cancel close invalid load scroll toggle".split(" ").concat(Br));function Dr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,o,s,l,c){if(ze.apply(this,arguments),ke){if(!ke)throw Error(a(198));var u=Oe;ke=!1,Oe=null,Ne||(Ne=!0,Fe=u)}}(r,t,void 0,e),e.currentTarget=null}function Lr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;Dr(i,s,c),a=l}else for(o=0;o<r.length;o++){if(l=(s=r[o]).instance,c=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;Dr(i,s,c),a=l}}}if(Ne)throw e=Fe,Ne=!1,Fe=null,e}function kr(e,t){var n=t[di];void 0===n&&(n=t[di]=new Set);var r=e+"__bubble";n.has(r)||(Ur(t,e,2,!1),n.add(r))}function Or(e,t,n){var r=0;t&&(r|=4),Ur(n,e,r,t)}var Nr="_reactListening"+Math.random().toString(36).slice(2);function Fr(e){if(!e[Nr]){e[Nr]=!0,o.forEach((function(t){"selectionchange"!==t&&(Ir.has(t)||Or(t,!1,e),Or(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Nr]||(t[Nr]=!0,Or("selectionchange",!1,t))}}function Ur(e,t,n,r){switch(Kt(t)){case 1:var i=Vt;break;case 4:i=Wt;break;default:i=Xt}n=i.bind(null,t,n,e),i=void 0,!Ie||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function zr(e,t,n,r,i){var a=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==s;){if(null===(o=fi(s)))return;if(5===(l=o.tag)||6===l){r=a=o;continue e}s=s.parentNode}}r=r.return}Pe((function(){var r=a,i=xe(n),o=[];e:{var s=Mr.get(e);if(void 0!==s){var l=cn,c=e;switch(e){case"keypress":if(0===en(n))break e;case"keydown":case"keyup":l=En;break;case"focusin":c="focus",l=mn;break;case"focusout":c="blur",l=mn;break;case"beforeblur":case"afterblur":l=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=pn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=fn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Mn;break;case Sr:case wr:case Er:l=gn;break;case Ar:l=Cn;break;case"scroll":l=dn;break;case"wheel":l=Tn;break;case"copy":case"cut":case"paste":l=vn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=An}var u=0!==(4&t),d=!u&&"scroll"===e,h=u?null!==s?s+"Capture":null:s;u=[];for(var p,f=r;null!==f;){var m=(p=f).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==h&&(null!=(m=Be(f,h))&&u.push(Hr(f,m,p)))),d)break;f=f.return}0<u.length&&(s=new l(s,c,null,n,i),o.push({event:s,listeners:u}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===be||!(c=n.relatedTarget||n.fromElement)||!fi(c)&&!c[ui])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?fi(c):null)&&(c!==(d=He(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=pn,m="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(u=An,m="onPointerLeave",h="onPointerEnter",f="pointer"),d=null==l?s:gi(l),p=null==c?s:gi(c),(s=new u(m,f+"leave",l,n,i)).target=d,s.relatedTarget=p,m=null,fi(i)===r&&((u=new u(h,f+"enter",c,n,i)).target=p,u.relatedTarget=d,m=u),d=m,l&&c)e:{for(h=c,f=0,p=u=l;p;p=jr(p))f++;for(p=0,m=h;m;m=jr(m))p++;for(;0<f-p;)u=jr(u),f--;for(;0<p-f;)h=jr(h),p--;for(;f--;){if(u===h||null!==h&&u===h.alternate)break e;u=jr(u),h=jr(h)}u=null}else u=null;null!==l&&Vr(o,s,l,u,!1),null!==c&&null!==d&&Vr(o,d,c,u,!0)}if("select"===(l=(s=r?gi(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Xn;else if(zn(s))if(Jn)g=nr;else{g=er;var v=Zn}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=tr);switch(g&&(g=g(e,r))?Hn(o,g,n,i):(v&&v(e,s,r),"focusout"===e&&(v=s._wrapperState)&&v.controlled&&"number"===s.type&&ee(s,"number",s.value)),v=r?gi(r):window,e){case"focusin":(zn(v)||"true"===v.contentEditable)&&(hr=v,pr=r,fr=null);break;case"focusout":fr=pr=hr=null;break;case"mousedown":mr=!0;break;case"contextmenu":case"mouseup":case"dragend":mr=!1,gr(o,n,i);break;case"selectionchange":if(dr)break;case"keydown":case"keyup":gr(o,n,i)}var y;if(Pn)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Fn?On(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Dn&&"ko"!==n.locale&&(Fn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Fn&&(y=Zt()):(qt="value"in(Yt=i)?Yt.value:Yt.textContent,Fn=!0)),0<(v=Gr(r,b)).length&&(b=new yn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:null!==(y=Nn(n))&&(b.data=y))),(y=In?function(e,t){switch(e){case"compositionend":return Nn(t);case"keypress":return 32!==t.which?null:(kn=!0,Ln);case"textInput":return(e=t.data)===Ln&&kn?null:e;default:return null}}(e,n):function(e,t){if(Fn)return"compositionend"===e||!Pn&&On(e,t)?(e=Zt(),Qt=qt=Yt=null,Fn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Gr(r,"onBeforeInput")).length&&(i=new yn("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=y))}Lr(o,t)}))}function Hr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=Be(e,n))&&r.unshift(Hr(e,a,i)),null!=(a=Be(e,t))&&r.push(Hr(e,a,i))),e=e.return}return r}function jr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Vr(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,i?null!=(l=Be(n,a))&&o.unshift(Hr(n,l,s)):i||null!=(l=Be(n,a))&&o.push(Hr(n,l,s))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var Wr=/\r\n?/g,Xr=/\u0000|\uFFFD/g;function Jr(e){return("string"===typeof e?e:""+e).replace(Wr,"\n").replace(Xr,"")}function $r(e,t,n){if(t=Jr(t),Jr(e)!==t&&n)throw Error(a(425))}function Kr(){}var Yr=null,qr=null;function Qr(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Zr="function"===typeof setTimeout?setTimeout:void 0,ei="function"===typeof clearTimeout?clearTimeout:void 0,ti="function"===typeof Promise?Promise:void 0,ni="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof ti?function(e){return ti.resolve(null).then(e).catch(ri)}:Zr;function ri(e){setTimeout((function(){throw e}))}function ii(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void Ht(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);Ht(t)}function ai(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function oi(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var si=Math.random().toString(36).slice(2),li="__reactFiber$"+si,ci="__reactProps$"+si,ui="__reactContainer$"+si,di="__reactEvents$"+si,hi="__reactListeners$"+si,pi="__reactHandles$"+si;function fi(e){var t=e[li];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ui]||n[li]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=oi(e);null!==e;){if(n=e[li])return n;e=oi(e)}return t}n=(e=n).parentNode}return null}function mi(e){return!(e=e[li]||e[ui])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function gi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function vi(e){return e[ci]||null}var yi=[],bi=-1;function xi(e){return{current:e}}function _i(e){0>bi||(e.current=yi[bi],yi[bi]=null,bi--)}function Si(e,t){bi++,yi[bi]=e.current,e.current=t}var wi={},Ei=xi(wi),Ai=xi(!1),Mi=wi;function Ci(e,t){var n=e.type.contextTypes;if(!n)return wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Ti(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Ri(){_i(Ai),_i(Ei)}function Pi(e,t,n){if(Ei.current!==wi)throw Error(a(168));Si(Ei,t),Si(Ai,n)}function Bi(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(a(108,j(e)||"Unknown",i));return N({},n,r)}function Ii(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wi,Mi=Ei.current,Si(Ei,e),Si(Ai,Ai.current),!0}function Di(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Bi(e,t,Mi),r.__reactInternalMemoizedMergedChildContext=e,_i(Ai),_i(Ei),Si(Ei,e)):_i(Ai),Si(Ai,n)}var Li=null,ki=!1,Oi=!1;function Ni(e){null===Li?Li=[e]:Li.push(e)}function Fi(){if(!Oi&&null!==Li){Oi=!0;var e=0,t=yt;try{var n=Li;for(yt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Li=null,ki=!1}catch(i){throw null!==Li&&(Li=Li.slice(e+1)),Xe(Qe,Fi),i}finally{yt=t,Oi=!1}}return null}var Ui=[],zi=0,Hi=null,Gi=0,ji=[],Vi=0,Wi=null,Xi=1,Ji="";function $i(e,t){Ui[zi++]=Gi,Ui[zi++]=Hi,Hi=e,Gi=t}function Ki(e,t,n){ji[Vi++]=Xi,ji[Vi++]=Ji,ji[Vi++]=Wi,Wi=e;var r=Xi;e=Ji;var i=32-at(r)-1;r&=~(1<<i),n+=1;var a=32-at(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xi=1<<32-at(t)+i|n<<i|r,Ji=a+e}else Xi=1<<a|n<<i|r,Ji=e}function Yi(e){null!==e.return&&($i(e,1),Ki(e,1,0))}function qi(e){for(;e===Hi;)Hi=Ui[--zi],Ui[zi]=null,Gi=Ui[--zi],Ui[zi]=null;for(;e===Wi;)Wi=ji[--Vi],ji[Vi]=null,Ji=ji[--Vi],ji[Vi]=null,Xi=ji[--Vi],ji[Vi]=null}var Qi=null,Zi=null,ea=!1,ta=null;function na(e,t){var n=Cc(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ra(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,Qi=e,Zi=ai(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,Qi=e,Zi=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Wi?{id:Xi,overflow:Ji}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Cc(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Qi=e,Zi=null,!0);default:return!1}}function ia(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function aa(e){if(ea){var t=Zi;if(t){var n=t;if(!ra(e,t)){if(ia(e))throw Error(a(418));t=ai(n.nextSibling);var r=Qi;t&&ra(e,t)?na(r,n):(e.flags=-4097&e.flags|2,ea=!1,Qi=e)}}else{if(ia(e))throw Error(a(418));e.flags=-4097&e.flags|2,ea=!1,Qi=e}}}function oa(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Qi=e}function sa(e){if(e!==Qi)return!1;if(!ea)return oa(e),ea=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!Qr(e.type,e.memoizedProps)),t&&(t=Zi)){if(ia(e))throw la(),Error(a(418));for(;t;)na(e,t),t=ai(t.nextSibling)}if(oa(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Zi=ai(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Zi=null}}else Zi=Qi?ai(e.stateNode.nextSibling):null;return!0}function la(){for(var e=Zi;e;)e=ai(e.nextSibling)}function ca(){Zi=Qi=null,ea=!1}function ua(e){null===ta?ta=[e]:ta.push(e)}var da=x.ReactCurrentBatchConfig;function ha(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var i=r,o=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=i.refs;null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!==typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function pa(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fa(e){return(0,e._init)(e._payload)}function ma(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Rc(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Dc(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){var a=n.type;return a===w?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===I&&fa(a)===t.type)?((r=i(t,n.props)).ref=ha(e,t,n),r.return=e,r):((r=Pc(n.type,n.key,n.props,null,e.mode,r)).ref=ha(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Lc(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,a){return null===t||7!==t.tag?((t=Bc(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Dc(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case _:return(n=Pc(t.type,t.key,t.props,null,e.mode,n)).ref=ha(e,null,t),n.return=e,n;case S:return(t=Lc(t,e.mode,n)).return=e,t;case I:return h(e,(0,t._init)(t._payload),n)}if(te(t)||k(t))return(t=Bc(t,e.mode,n,null)).return=e,t;pa(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==i?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case _:return n.key===i?c(e,t,n,r):null;case S:return n.key===i?u(e,t,n,r):null;case I:return p(e,t,(i=n._init)(n._payload),r)}if(te(n)||k(n))return null!==i?null:d(e,t,n,r,null);pa(e,n)}return null}function f(e,t,n,r,i){if("string"===typeof r&&""!==r||"number"===typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case _:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case S:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case I:return f(e,t,n,(0,r._init)(r._payload),i)}if(te(r)||k(r))return d(t,e=e.get(n)||null,r,i,null);pa(t,r)}return null}function m(i,a,s,l){for(var c=null,u=null,d=a,m=a=0,g=null;null!==d&&m<s.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var v=p(i,d,s[m],l);if(null===v){null===d&&(d=g);break}e&&d&&null===v.alternate&&t(i,d),a=o(v,a,m),null===u?c=v:u.sibling=v,u=v,d=g}if(m===s.length)return n(i,d),ea&&$i(i,m),c;if(null===d){for(;m<s.length;m++)null!==(d=h(i,s[m],l))&&(a=o(d,a,m),null===u?c=d:u.sibling=d,u=d);return ea&&$i(i,m),c}for(d=r(i,d);m<s.length;m++)null!==(g=f(d,i,m,s[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),a=o(g,a,m),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach((function(e){return t(i,e)})),ea&&$i(i,m),c}function g(i,s,l,c){var u=k(l);if("function"!==typeof u)throw Error(a(150));if(null==(l=u.call(l)))throw Error(a(151));for(var d=u=null,m=s,g=s=0,v=null,y=l.next();null!==m&&!y.done;g++,y=l.next()){m.index>g?(v=m,m=null):v=m.sibling;var b=p(i,m,y.value,c);if(null===b){null===m&&(m=v);break}e&&m&&null===b.alternate&&t(i,m),s=o(b,s,g),null===d?u=b:d.sibling=b,d=b,m=v}if(y.done)return n(i,m),ea&&$i(i,g),u;if(null===m){for(;!y.done;g++,y=l.next())null!==(y=h(i,y.value,c))&&(s=o(y,s,g),null===d?u=y:d.sibling=y,d=y);return ea&&$i(i,g),u}for(m=r(i,m);!y.done;g++,y=l.next())null!==(y=f(m,i,g,y.value,c))&&(e&&null!==y.alternate&&m.delete(null===y.key?g:y.key),s=o(y,s,g),null===d?u=y:d.sibling=y,d=y);return e&&m.forEach((function(e){return t(i,e)})),ea&&$i(i,g),u}return function e(r,a,o,l){if("object"===typeof o&&null!==o&&o.type===w&&null===o.key&&(o=o.props.children),"object"===typeof o&&null!==o){switch(o.$$typeof){case _:e:{for(var c=o.key,u=a;null!==u;){if(u.key===c){if((c=o.type)===w){if(7===u.tag){n(r,u.sibling),(a=i(u,o.props.children)).return=r,r=a;break e}}else if(u.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===I&&fa(c)===u.type){n(r,u.sibling),(a=i(u,o.props)).ref=ha(r,u,o),a.return=r,r=a;break e}n(r,u);break}t(r,u),u=u.sibling}o.type===w?((a=Bc(o.props.children,r.mode,l,o.key)).return=r,r=a):((l=Pc(o.type,o.key,o.props,null,r.mode,l)).ref=ha(r,a,o),l.return=r,r=l)}return s(r);case S:e:{for(u=o.key;null!==a;){if(a.key===u){if(4===a.tag&&a.stateNode.containerInfo===o.containerInfo&&a.stateNode.implementation===o.implementation){n(r,a.sibling),(a=i(a,o.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=Lc(o,r.mode,l)).return=r,r=a}return s(r);case I:return e(r,a,(u=o._init)(o._payload),l)}if(te(o))return m(r,a,o,l);if(k(o))return g(r,a,o,l);pa(r,o)}return"string"===typeof o&&""!==o||"number"===typeof o?(o=""+o,null!==a&&6===a.tag?(n(r,a.sibling),(a=i(a,o)).return=r,r=a):(n(r,a),(a=Dc(o,r.mode,l)).return=r,r=a),s(r)):n(r,a)}}var ga=ma(!0),va=ma(!1),ya=xi(null),ba=null,xa=null,_a=null;function Sa(){_a=xa=ba=null}function wa(e){var t=ya.current;_i(ya),e._currentValue=t}function Ea(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Aa(e,t){ba=e,_a=xa=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ms=!0),e.firstContext=null)}function Ma(e){var t=e._currentValue;if(_a!==e)if(e={context:e,memoizedValue:t,next:null},null===xa){if(null===ba)throw Error(a(308));xa=e,ba.dependencies={lanes:0,firstContext:e}}else xa=xa.next=e;return t}var Ca=null;function Ta(e){null===Ca?Ca=[e]:Ca.push(e)}function Ra(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,Ta(t)):(n.next=i.next,i.next=n),t.interleaved=n,Pa(e,r)}function Pa(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ba=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Da(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function La(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ka(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&El)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Pa(e,n)}return null===(i=r.interleaved)?(t.next=t,Ta(r)):(t.next=i.next,i.next=t),r.interleaved=t,Pa(e,n)}function Oa(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}function Na(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Fa(e,t,n,r){var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===o?a=c:o.next=c,o=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==o&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==a){var d=i.baseState;for(o=0,u=c=l=null,s=a;;){var h=s.lane,p=s.eventTime;if((r&h)===h){null!==u&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var f=e,m=s;switch(h=t,p=n,m.tag){case 1:if("function"===typeof(f=m.payload)){d=f.call(p,d,h);break e}d=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(h="function"===typeof(f=m.payload)?f.call(p,d,h):f)||void 0===h)break e;d=N({},d,h);break e;case 2:Ba=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=p,l=d):u=u.next=p,o|=h;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(h=s).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===u&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null!==(t=i.shared.interleaved)){i=t;do{o|=i.lane,i=i.next}while(i!==t)}else null===a&&(i.shared.lanes=0);Il|=o,e.lanes=o,e.memoizedState=d}}function Ua(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!==typeof i)throw Error(a(191,i));i.call(r)}}}var za={},Ha=xi(za),Ga=xi(za),ja=xi(za);function Va(e){if(e===za)throw Error(a(174));return e}function Wa(e,t){switch(Si(ja,t),Si(Ga,e),Si(Ha,za),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}_i(Ha),Si(Ha,t)}function Xa(){_i(Ha),_i(Ga),_i(ja)}function Ja(e){Va(ja.current);var t=Va(Ha.current),n=le(t,e.type);t!==n&&(Si(Ga,e),Si(Ha,n))}function $a(e){Ga.current===e&&(_i(Ha),_i(Ga))}var Ka=xi(0);function Ya(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qa=[];function Qa(){for(var e=0;e<qa.length;e++)qa[e]._workInProgressVersionPrimary=null;qa.length=0}var Za=x.ReactCurrentDispatcher,eo=x.ReactCurrentBatchConfig,to=0,no=null,ro=null,io=null,ao=!1,oo=!1,so=0,lo=0;function co(){throw Error(a(321))}function uo(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!rr(e[n],t[n]))return!1;return!0}function ho(e,t,n,r,i,o){if(to=o,no=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Za.current=null===e||null===e.memoizedState?Ko:Yo,e=n(r,i),oo){o=0;do{if(oo=!1,so=0,25<=o)throw Error(a(301));o+=1,io=ro=null,t.updateQueue=null,Za.current=qo,e=n(r,i)}while(oo)}if(Za.current=$o,t=null!==ro&&null!==ro.next,to=0,io=ro=no=null,ao=!1,t)throw Error(a(300));return e}function po(){var e=0!==so;return so=0,e}function fo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===io?no.memoizedState=io=e:io=io.next=e,io}function mo(){if(null===ro){var e=no.alternate;e=null!==e?e.memoizedState:null}else e=ro.next;var t=null===io?no.memoizedState:io.next;if(null!==t)io=t,ro=e;else{if(null===e)throw Error(a(310));e={memoizedState:(ro=e).memoizedState,baseState:ro.baseState,baseQueue:ro.baseQueue,queue:ro.queue,next:null},null===io?no.memoizedState=io=e:io=io.next=e}return io}function go(e,t){return"function"===typeof t?t(e):t}function vo(e){var t=mo(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=ro,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){o=i.next,r=r.baseState;var l=s=null,c=null,u=o;do{var d=u.lane;if((to&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=h,s=r):c=c.next=h,no.lanes|=d,Il|=d}u=u.next}while(null!==u&&u!==o);null===c?s=r:c.next=l,rr(r,t.memoizedState)||(ms=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{o=i.lane,no.lanes|=o,Il|=o,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function yo(e){var t=mo(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=e(o,s.action),s=s.next}while(s!==i);rr(o,t.memoizedState)||(ms=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function bo(){}function xo(e,t){var n=no,r=mo(),i=t(),o=!rr(r.memoizedState,i);if(o&&(r.memoizedState=i,ms=!0),r=r.queue,Io(wo.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==io&&1&io.memoizedState.tag){if(n.flags|=2048,Co(9,So.bind(null,n,r,i,t),void 0,null),null===Al)throw Error(a(349));0!==(30&to)||_o(n,t,i)}return i}function _o(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=no.updateQueue)?(t={lastEffect:null,stores:null},no.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function So(e,t,n,r){t.value=n,t.getSnapshot=r,Eo(t)&&Ao(e)}function wo(e,t,n){return n((function(){Eo(t)&&Ao(e)}))}function Eo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rr(e,n)}catch(r){return!0}}function Ao(e){var t=Pa(e,1);null!==t&&Ql(t,e,1,-1)}function Mo(e){var t=fo();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:e},t.queue=e,e=e.dispatch=Vo.bind(null,no,e),[t.memoizedState,e]}function Co(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=no.updateQueue)?(t={lastEffect:null,stores:null},no.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function To(){return mo().memoizedState}function Ro(e,t,n,r){var i=fo();no.flags|=e,i.memoizedState=Co(1|t,n,void 0,void 0===r?null:r)}function Po(e,t,n,r){var i=mo();r=void 0===r?null:r;var a=void 0;if(null!==ro){var o=ro.memoizedState;if(a=o.destroy,null!==r&&uo(r,o.deps))return void(i.memoizedState=Co(t,n,a,r))}no.flags|=e,i.memoizedState=Co(1|t,n,a,r)}function Bo(e,t){return Ro(8390656,8,e,t)}function Io(e,t){return Po(2048,8,e,t)}function Do(e,t){return Po(4,2,e,t)}function Lo(e,t){return Po(4,4,e,t)}function ko(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Oo(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Po(4,4,ko.bind(null,t,e),n)}function No(){}function Fo(e,t){var n=mo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&uo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Uo(e,t){var n=mo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&uo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function zo(e,t,n){return 0===(21&to)?(e.baseState&&(e.baseState=!1,ms=!0),e.memoizedState=n):(rr(n,t)||(n=ft(),no.lanes|=n,Il|=n,e.baseState=!0),t)}function Ho(e,t){var n=yt;yt=0!==n&&4>n?n:4,e(!0);var r=eo.transition;eo.transition={};try{e(!1),t()}finally{yt=n,eo.transition=r}}function Go(){return mo().memoizedState}function jo(e,t,n){var r=ql(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wo(e))Xo(t,n);else if(null!==(n=Ra(e,t,n,r))){Ql(n,e,r,Yl()),Jo(n,t,r)}}function Vo(e,t,n){var r=ql(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wo(e))Xo(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,rr(s,o)){var l=t.interleaved;return null===l?(i.next=i,Ta(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(c){}null!==(n=Ra(e,t,i,r))&&(Ql(n,e,r,i=Yl()),Jo(n,t,r))}}function Wo(e){var t=e.alternate;return e===no||null!==t&&t===no}function Xo(e,t){oo=ao=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Jo(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}var $o={readContext:Ma,useCallback:co,useContext:co,useEffect:co,useImperativeHandle:co,useInsertionEffect:co,useLayoutEffect:co,useMemo:co,useReducer:co,useRef:co,useState:co,useDebugValue:co,useDeferredValue:co,useTransition:co,useMutableSource:co,useSyncExternalStore:co,useId:co,unstable_isNewReconciler:!1},Ko={readContext:Ma,useCallback:function(e,t){return fo().memoizedState=[e,void 0===t?null:t],e},useContext:Ma,useEffect:Bo,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Ro(4194308,4,ko.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ro(4,2,e,t)},useMemo:function(e,t){var n=fo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=fo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=jo.bind(null,no,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},fo().memoizedState=e},useState:Mo,useDebugValue:No,useDeferredValue:function(e){return fo().memoizedState=e},useTransition:function(){var e=Mo(!1),t=e[0];return e=Ho.bind(null,e[1]),fo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=no,i=fo();if(ea){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===Al)throw Error(a(349));0!==(30&to)||_o(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Bo(wo.bind(null,r,o,e),[e]),r.flags|=2048,Co(9,So.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=fo(),t=Al.identifierPrefix;if(ea){var n=Ji;t=":"+t+"R"+(n=(Xi&~(1<<32-at(Xi)-1)).toString(32)+n),0<(n=so++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=lo++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Yo={readContext:Ma,useCallback:Fo,useContext:Ma,useEffect:Io,useImperativeHandle:Oo,useInsertionEffect:Do,useLayoutEffect:Lo,useMemo:Uo,useReducer:vo,useRef:To,useState:function(){return vo(go)},useDebugValue:No,useDeferredValue:function(e){return zo(mo(),ro.memoizedState,e)},useTransition:function(){return[vo(go)[0],mo().memoizedState]},useMutableSource:bo,useSyncExternalStore:xo,useId:Go,unstable_isNewReconciler:!1},qo={readContext:Ma,useCallback:Fo,useContext:Ma,useEffect:Io,useImperativeHandle:Oo,useInsertionEffect:Do,useLayoutEffect:Lo,useMemo:Uo,useReducer:yo,useRef:To,useState:function(){return yo(go)},useDebugValue:No,useDeferredValue:function(e){var t=mo();return null===ro?t.memoizedState=e:zo(t,ro.memoizedState,e)},useTransition:function(){return[yo(go)[0],mo().memoizedState]},useMutableSource:bo,useSyncExternalStore:xo,useId:Go,unstable_isNewReconciler:!1};function Qo(e,t){if(e&&e.defaultProps){for(var n in t=N({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function Zo(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:N({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var es={isMounted:function(e){return!!(e=e._reactInternals)&&He(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Yl(),i=ql(e),a=La(r,i);a.payload=t,void 0!==n&&null!==n&&(a.callback=n),null!==(t=ka(e,a,i))&&(Ql(t,e,i,r),Oa(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Yl(),i=ql(e),a=La(r,i);a.tag=1,a.payload=t,void 0!==n&&null!==n&&(a.callback=n),null!==(t=ka(e,a,i))&&(Ql(t,e,i,r),Oa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Yl(),r=ql(e),i=La(n,r);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),null!==(t=ka(e,i,r))&&(Ql(t,e,r,n),Oa(t,e,r))}};function ts(e,t,n,r,i,a,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!ir(n,r)||!ir(i,a))}function ns(e,t,n){var r=!1,i=wi,a=t.contextType;return"object"===typeof a&&null!==a?a=Ma(a):(i=Ti(t)?Mi:Ei.current,a=(r=null!==(r=t.contextTypes)&&void 0!==r)?Ci(e,i):wi),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=es,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function rs(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&es.enqueueReplaceState(t,t.state,null)}function is(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ia(e);var a=t.contextType;"object"===typeof a&&null!==a?i.context=Ma(a):(a=Ti(t)?Mi:Ei.current,i.context=Ci(e,a)),i.state=e.memoizedState,"function"===typeof(a=t.getDerivedStateFromProps)&&(Zo(e,t,a,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&es.enqueueReplaceState(i,i.state,null),Fa(e,n,i,r),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4194308)}function as(e,t){try{var n="",r=t;do{n+=H(r),r=r.return}while(r);var i=n}catch(a){i="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:i,digest:null}}function os(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ss(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var ls="function"===typeof WeakMap?WeakMap:Map;function cs(e,t,n){(n=La(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){zl||(zl=!0,Hl=r),ss(0,t)},n}function us(e,t,n){(n=La(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ss(0,t)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(n.callback=function(){ss(0,t),"function"!==typeof r&&(null===Gl?Gl=new Set([this]):Gl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ds(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ls;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=_c.bind(null,e,t,n),t.then(e,e))}function hs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ps(e,t,n,r,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=La(-1,1)).tag=2,ka(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var fs=x.ReactCurrentOwner,ms=!1;function gs(e,t,n,r){t.child=null===e?va(t,null,n,r):ga(t,e.child,n,r)}function vs(e,t,n,r,i){n=n.render;var a=t.ref;return Aa(t,i),r=ho(e,t,n,r,a,i),n=po(),null===e||ms?(ea&&n&&Yi(t),t.flags|=1,gs(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,zs(e,t,i))}function ys(e,t,n,r,i){if(null===e){var a=n.type;return"function"!==typeof a||Tc(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Pc(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,bs(e,t,a,r,i))}if(a=e.child,0===(e.lanes&i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:ir)(o,r)&&e.ref===t.ref)return zs(e,t,i)}return t.flags|=1,(e=Rc(a,r)).ref=t.ref,e.return=t,t.child=e}function bs(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if(ir(a,r)&&e.ref===t.ref){if(ms=!1,t.pendingProps=r=a,0===(e.lanes&i))return t.lanes=e.lanes,zs(e,t,i);0!==(131072&e.flags)&&(ms=!0)}}return Ss(e,t,n,r,i)}function xs(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Si(Rl,Tl),Tl|=n;else{if(0===(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Si(Rl,Tl),Tl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,Si(Rl,Tl),Tl|=r}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,Si(Rl,Tl),Tl|=r;return gs(e,t,i,n),t.child}function _s(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ss(e,t,n,r,i){var a=Ti(n)?Mi:Ei.current;return a=Ci(t,a),Aa(t,i),n=ho(e,t,n,r,a,i),r=po(),null===e||ms?(ea&&r&&Yi(t),t.flags|=1,gs(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,zs(e,t,i))}function ws(e,t,n,r,i){if(Ti(n)){var a=!0;Ii(t)}else a=!1;if(Aa(t,i),null===t.stateNode)Us(e,t),ns(t,n,r),is(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,c=n.contextType;"object"===typeof c&&null!==c?c=Ma(c):c=Ci(t,c=Ti(n)?Mi:Ei.current);var u=n.getDerivedStateFromProps,d="function"===typeof u||"function"===typeof o.getSnapshotBeforeUpdate;d||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||l!==c)&&rs(t,o,r,c),Ba=!1;var h=t.memoizedState;o.state=h,Fa(t,r,o,i),l=t.memoizedState,s!==r||h!==l||Ai.current||Ba?("function"===typeof u&&(Zo(t,n,u,r),l=t.memoizedState),(s=Ba||ts(t,n,s,r,h,l,c))?(d||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.flags|=4194308)):("function"===typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=s):("function"===typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Da(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Qo(t.type,s),o.props=c,d=t.pendingProps,h=o.context,"object"===typeof(l=n.contextType)&&null!==l?l=Ma(l):l=Ci(t,l=Ti(n)?Mi:Ei.current);var p=n.getDerivedStateFromProps;(u="function"===typeof p||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==d||h!==l)&&rs(t,o,r,l),Ba=!1,h=t.memoizedState,o.state=h,Fa(t,r,o,i);var f=t.memoizedState;s!==d||h!==f||Ai.current||Ba?("function"===typeof p&&(Zo(t,n,p,r),f=t.memoizedState),(c=Ba||ts(t,n,c,r,h,f,l)||!1)?(u||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,f,l),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,f,l)),"function"===typeof o.componentDidUpdate&&(t.flags|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),o.props=r,o.state=f,o.context=l,r=c):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Es(e,t,n,r,a,i)}function Es(e,t,n,r,i,a){_s(e,t);var o=0!==(128&t.flags);if(!r&&!o)return i&&Di(t,n,!1),zs(e,t,a);r=t.stateNode,fs.current=t;var s=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=ga(t,e.child,null,a),t.child=ga(t,null,s,a)):gs(e,t,s,a),t.memoizedState=r.state,i&&Di(t,n,!0),t.child}function As(e){var t=e.stateNode;t.pendingContext?Pi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Pi(0,t.context,!1),Wa(e,t.containerInfo)}function Ms(e,t,n,r,i){return ca(),ua(i),t.flags|=256,gs(e,t,n,r),t.child}var Cs,Ts,Rs,Ps,Bs={dehydrated:null,treeContext:null,retryLane:0};function Is(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ds(e,t,n){var r,i=t.pendingProps,o=Ka.current,s=!1,l=0!==(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!==(2&o)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),Si(Ka,1&o),null===e)return aa(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=i.children,e=i.fallback,s?(i=t.mode,s=t.child,l={mode:"hidden",children:l},0===(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=Ic(l,i,0,null),e=Bc(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Is(n),t.memoizedState=Bs,e):Ls(t,l));if(null!==(o=e.memoizedState)&&null!==(r=o.dehydrated))return function(e,t,n,r,i,o,s){if(n)return 256&t.flags?(t.flags&=-257,ks(e,t,s,r=os(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Ic({mode:"visible",children:r.children},i,0,null),(o=Bc(o,i,s,null)).flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,0!==(1&t.mode)&&ga(t,e.child,null,s),t.child.memoizedState=Is(s),t.memoizedState=Bs,o);if(0===(1&t.mode))return ks(e,t,s,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var l=r.dgst;return r=l,ks(e,t,s,r=os(o=Error(a(419)),r,void 0))}if(l=0!==(s&e.childLanes),ms||l){if(null!==(r=Al)){switch(s&-s){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(r.suspendedLanes|s))?0:i)&&i!==o.retryLane&&(o.retryLane=i,Pa(e,i),Ql(r,e,i,-1))}return dc(),ks(e,t,s,r=os(Error(a(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=wc.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Zi=ai(i.nextSibling),Qi=t,ea=!0,ta=null,null!==e&&(ji[Vi++]=Xi,ji[Vi++]=Ji,ji[Vi++]=Wi,Xi=e.id,Ji=e.overflow,Wi=t),t=Ls(t,r.children),t.flags|=4096,t)}(e,t,l,i,r,o,n);if(s){s=i.fallback,l=t.mode,r=(o=e.child).sibling;var c={mode:"hidden",children:i.children};return 0===(1&l)&&t.child!==o?((i=t.child).childLanes=0,i.pendingProps=c,t.deletions=null):(i=Rc(o,c)).subtreeFlags=14680064&o.subtreeFlags,null!==r?s=Rc(r,s):(s=Bc(s,l,n,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,l=null===(l=e.child.memoizedState)?Is(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Bs,i}return e=(s=e.child).sibling,i=Rc(s,{mode:"visible",children:i.children}),0===(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ls(e,t){return(t=Ic({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ks(e,t,n,r){return null!==r&&ua(r),ga(t,e.child,null,n),(e=Ls(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Os(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ea(e.return,t,n)}function Ns(e,t,n,r,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Fs(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(gs(e,t,r.children,n),0!==(2&(r=Ka.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Os(e,n,t);else if(19===e.tag)Os(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Si(Ka,r),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Ya(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ns(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Ya(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ns(t,!0,n,null,a);break;case"together":Ns(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Us(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Il|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Rc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Rc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Hs(e,t){if(!ea)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Gs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function js(e,t,n){var r=t.pendingProps;switch(qi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gs(t),null;case 1:case 17:return Ti(t.type)&&Ri(),Gs(t),null;case 3:return r=t.stateNode,Xa(),_i(Ai),_i(Ei),Qa(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(sa(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==ta&&(nc(ta),ta=null))),Ts(e,t),Gs(t),null;case 5:$a(t);var i=Va(ja.current);if(n=t.type,null!==e&&null!=t.stateNode)Rs(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(a(166));return Gs(t),null}if(e=Va(Ha.current),sa(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[li]=t,r[ci]=o,e=0!==(1&t.mode),n){case"dialog":kr("cancel",r),kr("close",r);break;case"iframe":case"object":case"embed":kr("load",r);break;case"video":case"audio":for(i=0;i<Br.length;i++)kr(Br[i],r);break;case"source":kr("error",r);break;case"img":case"image":case"link":kr("error",r),kr("load",r);break;case"details":kr("toggle",r);break;case"input":Y(r,o),kr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},kr("invalid",r);break;case"textarea":ie(r,o),kr("invalid",r)}for(var l in ve(n,o),i=null,o)if(o.hasOwnProperty(l)){var c=o[l];"children"===l?"string"===typeof c?r.textContent!==c&&(!0!==o.suppressHydrationWarning&&$r(r.textContent,c,e),i=["children",c]):"number"===typeof c&&r.textContent!==""+c&&(!0!==o.suppressHydrationWarning&&$r(r.textContent,c,e),i=["children",""+c]):s.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&kr("scroll",r)}switch(n){case"input":X(r),Z(r,o,!0);break;case"textarea":X(r),oe(r);break;case"select":case"option":break;default:"function"===typeof o.onClick&&(r.onclick=Kr)}r=i,t.updateQueue=r,null!==r&&(t.flags|=4)}else{l=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=se(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[li]=t,e[ci]=r,Cs(e,t,!1,!1),t.stateNode=e;e:{switch(l=ye(n,r),n){case"dialog":kr("cancel",e),kr("close",e),i=r;break;case"iframe":case"object":case"embed":kr("load",e),i=r;break;case"video":case"audio":for(i=0;i<Br.length;i++)kr(Br[i],e);i=r;break;case"source":kr("error",e),i=r;break;case"img":case"image":case"link":kr("error",e),kr("load",e),i=r;break;case"details":kr("toggle",e),i=r;break;case"input":Y(e,r),i=K(e,r),kr("invalid",e);break;case"option":default:i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=N({},r,{value:void 0}),kr("invalid",e);break;case"textarea":ie(e,r),i=re(e,r),kr("invalid",e)}for(o in ve(n,i),c=i)if(c.hasOwnProperty(o)){var u=c[o];"style"===o?me(e,u):"dangerouslySetInnerHTML"===o?null!=(u=u?u.__html:void 0)&&ue(e,u):"children"===o?"string"===typeof u?("textarea"!==n||""!==u)&&de(e,u):"number"===typeof u&&de(e,""+u):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(s.hasOwnProperty(o)?null!=u&&"onScroll"===o&&kr("scroll",e):null!=u&&b(e,o,u,l))}switch(n){case"input":X(e),Z(e,r,!1);break;case"textarea":X(e),oe(e);break;case"option":null!=r.value&&e.setAttribute("value",""+V(r.value));break;case"select":e.multiple=!!r.multiple,null!=(o=r.value)?ne(e,!!r.multiple,o,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof i.onClick&&(e.onclick=Kr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Gs(t),null;case 6:if(e&&null!=t.stateNode)Ps(e,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(a(166));if(n=Va(ja.current),Va(Ha.current),sa(t)){if(r=t.stateNode,n=t.memoizedProps,r[li]=t,(o=r.nodeValue!==n)&&null!==(e=Qi))switch(e.tag){case 3:$r(r.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&$r(r.nodeValue,n,0!==(1&e.mode))}o&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[li]=t,t.stateNode=r}return Gs(t),null;case 13:if(_i(Ka),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ea&&null!==Zi&&0!==(1&t.mode)&&0===(128&t.flags))la(),ca(),t.flags|=98560,o=!1;else if(o=sa(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(a(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(a(317));o[li]=t}else ca(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Gs(t),o=!1}else null!==ta&&(nc(ta),ta=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&Ka.current)?0===Pl&&(Pl=3):dc())),null!==t.updateQueue&&(t.flags|=4),Gs(t),null);case 4:return Xa(),Ts(e,t),null===e&&Fr(t.stateNode.containerInfo),Gs(t),null;case 10:return wa(t.type._context),Gs(t),null;case 19:if(_i(Ka),null===(o=t.memoizedState))return Gs(t),null;if(r=0!==(128&t.flags),null===(l=o.rendering))if(r)Hs(o,!1);else{if(0!==Pl||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=Ya(e))){for(t.flags|=128,Hs(o,!1),null!==(r=l.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(o=n).flags&=14680066,null===(l=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,e=l.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Si(Ka,1&Ka.current|2),t.child}e=e.sibling}null!==o.tail&&Ye()>Fl&&(t.flags|=128,r=!0,Hs(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=Ya(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Hs(o,!0),null===o.tail&&"hidden"===o.tailMode&&!l.alternate&&!ea)return Gs(t),null}else 2*Ye()-o.renderingStartTime>Fl&&1073741824!==n&&(t.flags|=128,r=!0,Hs(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=o.last)?n.sibling=l:t.child=l,o.last=l)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ye(),t.sibling=null,n=Ka.current,Si(Ka,r?1&n|2:1&n),t):(Gs(t),null);case 22:case 23:return sc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Tl)&&(Gs(t),6&t.subtreeFlags&&(t.flags|=8192)):Gs(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function Vs(e,t){switch(qi(t),t.tag){case 1:return Ti(t.type)&&Ri(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Xa(),_i(Ai),_i(Ei),Qa(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return $a(t),null;case 13:if(_i(Ka),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));ca()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return _i(Ka),null;case 4:return Xa(),null;case 10:return wa(t.type._context),null;case 22:case 23:return sc(),null;default:return null}}Cs=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ts=function(){},Rs=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Va(Ha.current);var a,o=null;switch(n){case"input":i=K(e,i),r=K(e,r),o=[];break;case"select":i=N({},i,{value:void 0}),r=N({},r,{value:void 0}),o=[];break;case"textarea":i=re(e,i),r=re(e,r),o=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(e.onclick=Kr)}for(u in ve(n,r),n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var l=i[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(s.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var c=r[u];if(l=null!=i?i[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(o||(o=[]),o.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(o=o||[]).push(u,c)):"children"===u?"string"!==typeof c&&"number"!==typeof c||(o=o||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(s.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&kr("scroll",e),o||l===c||(o=[])):(o=o||[]).push(u,c))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},Ps=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ws=!1,Xs=!1,Js="function"===typeof WeakSet?WeakSet:Set,$s=null;function Ks(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){xc(e,t,r)}else n.current=null}function Ys(e,t,n){try{n()}catch(r){xc(e,t,r)}}var qs=!1;function Qs(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&Ys(t,n,a)}i=i.next}while(i!==r)}}function Zs(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function el(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function tl(e){var t=e.alternate;null!==t&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[li],delete t[ci],delete t[di],delete t[hi],delete t[pi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nl(e){return 5===e.tag||3===e.tag||4===e.tag}function rl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function il(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Kr));else if(4!==r&&null!==(e=e.child))for(il(e,t,n),e=e.sibling;null!==e;)il(e,t,n),e=e.sibling}function al(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(al(e,t,n),e=e.sibling;null!==e;)al(e,t,n),e=e.sibling}var ol=null,sl=!1;function ll(e,t,n){for(n=n.child;null!==n;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(it&&"function"===typeof it.onCommitFiberUnmount)try{it.onCommitFiberUnmount(rt,n)}catch(s){}switch(n.tag){case 5:Xs||Ks(n,t);case 6:var r=ol,i=sl;ol=null,ll(e,t,n),sl=i,null!==(ol=r)&&(sl?(e=ol,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):ol.removeChild(n.stateNode));break;case 18:null!==ol&&(sl?(e=ol,n=n.stateNode,8===e.nodeType?ii(e.parentNode,n):1===e.nodeType&&ii(e,n),Ht(e)):ii(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,ll(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:if(!Xs&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,void 0!==o&&(0!==(2&a)||0!==(4&a))&&Ys(n,t,o),i=i.next}while(i!==r)}ll(e,t,n);break;case 1:if(!Xs&&(Ks(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){xc(n,t,s)}ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:1&n.mode?(Xs=(r=Xs)||null!==n.memoizedState,ll(e,t,n),Xs=r):ll(e,t,n);break;default:ll(e,t,n)}}function ul(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Js),t.forEach((function(t){var r=Ec.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function dl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:ol=l.stateNode,sl=!1;break e;case 3:case 4:ol=l.stateNode.containerInfo,sl=!0;break e}l=l.return}if(null===ol)throw Error(a(160));cl(o,s,i),ol=null,sl=!1;var c=i.alternate;null!==c&&(c.return=null),i.return=null}catch(u){xc(i,t,u)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)hl(t,e),t=t.sibling}function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dl(t,e),pl(e),4&r){try{Qs(3,e,e.return),Zs(3,e)}catch(g){xc(e,e.return,g)}try{Qs(5,e,e.return)}catch(g){xc(e,e.return,g)}}break;case 1:dl(t,e),pl(e),512&r&&null!==n&&Ks(n,n.return);break;case 5:if(dl(t,e),pl(e),512&r&&null!==n&&Ks(n,n.return),32&e.flags){var i=e.stateNode;try{de(i,"")}catch(g){xc(e,e.return,g)}}if(4&r&&null!=(i=e.stateNode)){var o=e.memoizedProps,s=null!==n?n.memoizedProps:o,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===o.type&&null!=o.name&&q(i,o),ye(l,s);var u=ye(l,o);for(s=0;s<c.length;s+=2){var d=c[s],h=c[s+1];"style"===d?me(i,h):"dangerouslySetInnerHTML"===d?ue(i,h):"children"===d?de(i,h):b(i,d,h,u)}switch(l){case"input":Q(i,o);break;case"textarea":ae(i,o);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var f=o.value;null!=f?ne(i,!!o.multiple,f,!1):p!==!!o.multiple&&(null!=o.defaultValue?ne(i,!!o.multiple,o.defaultValue,!0):ne(i,!!o.multiple,o.multiple?[]:"",!1))}i[ci]=o}catch(g){xc(e,e.return,g)}}break;case 6:if(dl(t,e),pl(e),4&r){if(null===e.stateNode)throw Error(a(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(g){xc(e,e.return,g)}}break;case 3:if(dl(t,e),pl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Ht(t.containerInfo)}catch(g){xc(e,e.return,g)}break;case 4:default:dl(t,e),pl(e);break;case 13:dl(t,e),pl(e),8192&(i=e.child).flags&&(o=null!==i.memoizedState,i.stateNode.isHidden=o,!o||null!==i.alternate&&null!==i.alternate.memoizedState||(Nl=Ye())),4&r&&ul(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Xs=(u=Xs)||d,dl(t,e),Xs=u):dl(t,e),pl(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&0!==(1&e.mode))for($s=e,d=e.child;null!==d;){for(h=$s=d;null!==$s;){switch(f=(p=$s).child,p.tag){case 0:case 11:case 14:case 15:Qs(4,p,p.return);break;case 1:Ks(p,p.return);var m=p.stateNode;if("function"===typeof m.componentWillUnmount){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){xc(r,n,g)}}break;case 5:Ks(p,p.return);break;case 22:if(null!==p.memoizedState){vl(h);continue}}null!==f?(f.return=p,$s=f):vl(h)}d=d.sibling}e:for(d=null,h=e;;){if(5===h.tag){if(null===d){d=h;try{i=h.stateNode,u?"function"===typeof(o=i.style).setProperty?o.setProperty("display","none","important"):o.display="none":(l=h.stateNode,s=void 0!==(c=h.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,l.style.display=fe("display",s))}catch(g){xc(e,e.return,g)}}}else if(6===h.tag){if(null===d)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(g){xc(e,e.return,g)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:dl(t,e),pl(e),4&r&&ul(e);case 21:}}function pl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(nl(n)){var r=n;break e}n=n.return}throw Error(a(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(de(i,""),r.flags&=-33),al(e,rl(e),i);break;case 3:case 4:var o=r.stateNode.containerInfo;il(e,rl(e),o);break;default:throw Error(a(161))}}catch(s){xc(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function fl(e,t,n){$s=e,ml(e,t,n)}function ml(e,t,n){for(var r=0!==(1&e.mode);null!==$s;){var i=$s,a=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||Ws;if(!o){var s=i.alternate,l=null!==s&&null!==s.memoizedState||Xs;s=Ws;var c=Xs;if(Ws=o,(Xs=l)&&!c)for($s=i;null!==$s;)l=(o=$s).child,22===o.tag&&null!==o.memoizedState?yl(i):null!==l?(l.return=o,$s=l):yl(i);for(;null!==a;)$s=a,ml(a,t,n),a=a.sibling;$s=i,Ws=s,Xs=c}gl(e)}else 0!==(8772&i.subtreeFlags)&&null!==a?(a.return=i,$s=a):gl(e)}}function gl(e){for(;null!==$s;){var t=$s;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Xs||Zs(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Xs)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Qo(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;null!==o&&Ua(t,o,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Ua(t,s,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var h=d.dehydrated;null!==h&&Ht(h)}}}break;default:throw Error(a(163))}Xs||512&t.flags&&el(t)}catch(p){xc(t,t.return,p)}}if(t===e){$s=null;break}if(null!==(n=t.sibling)){n.return=t.return,$s=n;break}$s=t.return}}function vl(e){for(;null!==$s;){var t=$s;if(t===e){$s=null;break}var n=t.sibling;if(null!==n){n.return=t.return,$s=n;break}$s=t.return}}function yl(e){for(;null!==$s;){var t=$s;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zs(4,t)}catch(l){xc(t,n,l)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(l){xc(t,i,l)}}var a=t.return;try{el(t)}catch(l){xc(t,a,l)}break;case 5:var o=t.return;try{el(t)}catch(l){xc(t,o,l)}}}catch(l){xc(t,t.return,l)}if(t===e){$s=null;break}var s=t.sibling;if(null!==s){s.return=t.return,$s=s;break}$s=t.return}}var bl,xl=Math.ceil,_l=x.ReactCurrentDispatcher,Sl=x.ReactCurrentOwner,wl=x.ReactCurrentBatchConfig,El=0,Al=null,Ml=null,Cl=0,Tl=0,Rl=xi(0),Pl=0,Bl=null,Il=0,Dl=0,Ll=0,kl=null,Ol=null,Nl=0,Fl=1/0,Ul=null,zl=!1,Hl=null,Gl=null,jl=!1,Vl=null,Wl=0,Xl=0,Jl=null,$l=-1,Kl=0;function Yl(){return 0!==(6&El)?Ye():-1!==$l?$l:$l=Ye()}function ql(e){return 0===(1&e.mode)?1:0!==(2&El)&&0!==Cl?Cl&-Cl:null!==da.transition?(0===Kl&&(Kl=ft()),Kl):0!==(e=yt)?e:e=void 0===(e=window.event)?16:Kt(e.type)}function Ql(e,t,n,r){if(50<Xl)throw Xl=0,Jl=null,Error(a(185));gt(e,n,r),0!==(2&El)&&e===Al||(e===Al&&(0===(2&El)&&(Dl|=n),4===Pl&&rc(e,Cl)),Zl(e,r),1===n&&0===El&&0===(1&t.mode)&&(Fl=Ye()+500,ki&&Fi()))}function Zl(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-at(a),s=1<<o,l=i[o];-1===l?0!==(s&n)&&0===(s&r)||(i[o]=ht(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}}(e,t);var r=dt(e,e===Al?Cl:0);if(0===r)null!==n&&Je(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Je(n),1===t)0===e.tag?function(e){ki=!0,Ni(e)}(ic.bind(null,e)):Ni(ic.bind(null,e)),ni((function(){0===(6&El)&&Fi()})),n=null;else{switch(bt(r)){case 1:n=Qe;break;case 4:n=Ze;break;case 16:default:n=et;break;case 536870912:n=nt}n=Ac(n,ec.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ec(e,t){if($l=-1,Kl=0,0!==(6&El))throw Error(a(327));var n=e.callbackNode;if(yc()&&e.callbackNode!==n)return null;var r=dt(e,e===Al?Cl:0);if(0===r)return null;if(0!==(30&r)||0!==(r&e.expiredLanes)||t)t=hc(e,r);else{t=r;var i=El;El|=2;var o=uc();for(Al===e&&Cl===t||(Ul=null,Fl=Ye()+500,lc(e,t));;)try{fc();break}catch(l){cc(e,l)}Sa(),_l.current=o,El=i,null!==Ml?t=0:(Al=null,Cl=0,t=Pl)}if(0!==t){if(2===t&&(0!==(i=pt(e))&&(r=i,t=tc(e,i))),1===t)throw n=Bl,lc(e,0),rc(e,r),Zl(e,Ye()),n;if(6===t)rc(e,r);else{if(i=e.current.alternate,0===(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!rr(a(),i))return!1}catch(s){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=hc(e,r))&&(0!==(o=pt(e))&&(r=o,t=tc(e,o))),1===t))throw n=Bl,lc(e,0),rc(e,r),Zl(e,Ye()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(a(345));case 2:case 5:vc(e,Ol,Ul);break;case 3:if(rc(e,r),(130023424&r)===r&&10<(t=Nl+500-Ye())){if(0!==dt(e,0))break;if(((i=e.suspendedLanes)&r)!==r){Yl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Zr(vc.bind(null,e,Ol,Ul),t);break}vc(e,Ol,Ul);break;case 4:if(rc(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-at(r);o=1<<s,(s=t[s])>i&&(i=s),r&=~o}if(r=i,10<(r=(120>(r=Ye()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*xl(r/1960))-r)){e.timeoutHandle=Zr(vc.bind(null,e,Ol,Ul),r);break}vc(e,Ol,Ul);break;default:throw Error(a(329))}}}return Zl(e,Ye()),e.callbackNode===n?ec.bind(null,e):null}function tc(e,t){var n=kl;return e.current.memoizedState.isDehydrated&&(lc(e,t).flags|=256),2!==(e=hc(e,t))&&(t=Ol,Ol=n,null!==t&&nc(t)),e}function nc(e){null===Ol?Ol=e:Ol.push.apply(Ol,e)}function rc(e,t){for(t&=~Ll,t&=~Dl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-at(t),r=1<<n;e[n]=-1,t&=~r}}function ic(e){if(0!==(6&El))throw Error(a(327));yc();var t=dt(e,0);if(0===(1&t))return Zl(e,Ye()),null;var n=hc(e,t);if(0!==e.tag&&2===n){var r=pt(e);0!==r&&(t=r,n=tc(e,r))}if(1===n)throw n=Bl,lc(e,0),rc(e,t),Zl(e,Ye()),n;if(6===n)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vc(e,Ol,Ul),Zl(e,Ye()),null}function ac(e,t){var n=El;El|=1;try{return e(t)}finally{0===(El=n)&&(Fl=Ye()+500,ki&&Fi())}}function oc(e){null!==Vl&&0===Vl.tag&&0===(6&El)&&yc();var t=El;El|=1;var n=wl.transition,r=yt;try{if(wl.transition=null,yt=1,e)return e()}finally{yt=r,wl.transition=n,0===(6&(El=t))&&Fi()}}function sc(){Tl=Rl.current,_i(Rl)}function lc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ei(n)),null!==Ml)for(n=Ml.return;null!==n;){var r=n;switch(qi(r),r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&Ri();break;case 3:Xa(),_i(Ai),_i(Ei),Qa();break;case 5:$a(r);break;case 4:Xa();break;case 13:case 19:_i(Ka);break;case 10:wa(r.type._context);break;case 22:case 23:sc()}n=n.return}if(Al=e,Ml=e=Rc(e.current,null),Cl=Tl=t,Pl=0,Bl=null,Ll=Dl=Il=0,Ol=kl=null,null!==Ca){for(t=0;t<Ca.length;t++)if(null!==(r=(n=Ca[t]).interleaved)){n.interleaved=null;var i=r.next,a=n.pending;if(null!==a){var o=a.next;a.next=i,r.next=o}n.pending=r}Ca=null}return e}function cc(e,t){for(;;){var n=Ml;try{if(Sa(),Za.current=$o,ao){for(var r=no.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}ao=!1}if(to=0,io=ro=no=null,oo=!1,so=0,Sl.current=null,null===n||null===n.return){Pl=1,Bl=t,Ml=null;break}e:{var o=e,s=n.return,l=n,c=t;if(t=Cl,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var u=c,d=l,h=d.tag;if(0===(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=hs(s);if(null!==f){f.flags&=-257,ps(f,s,l,0,t),1&f.mode&&ds(o,u,t),c=u;var m=(t=f).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(0===(1&t)){ds(o,u,t),dc();break e}c=Error(a(426))}else if(ea&&1&l.mode){var v=hs(s);if(null!==v){0===(65536&v.flags)&&(v.flags|=256),ps(v,s,l,0,t),ua(as(c,l));break e}}o=c=as(c,l),4!==Pl&&(Pl=2),null===kl?kl=[o]:kl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t,Na(o,cs(0,c,t));break e;case 1:l=c;var y=o.type,b=o.stateNode;if(0===(128&o.flags)&&("function"===typeof y.getDerivedStateFromError||null!==b&&"function"===typeof b.componentDidCatch&&(null===Gl||!Gl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t,Na(o,us(o,l,t));break e}}o=o.return}while(null!==o)}gc(n)}catch(x){t=x,Ml===n&&null!==n&&(Ml=n=n.return);continue}break}}function uc(){var e=_l.current;return _l.current=$o,null===e?$o:e}function dc(){0!==Pl&&3!==Pl&&2!==Pl||(Pl=4),null===Al||0===(268435455&Il)&&0===(268435455&Dl)||rc(Al,Cl)}function hc(e,t){var n=El;El|=2;var r=uc();for(Al===e&&Cl===t||(Ul=null,lc(e,t));;)try{pc();break}catch(i){cc(e,i)}if(Sa(),El=n,_l.current=r,null!==Ml)throw Error(a(261));return Al=null,Cl=0,Pl}function pc(){for(;null!==Ml;)mc(Ml)}function fc(){for(;null!==Ml&&!$e();)mc(Ml)}function mc(e){var t=bl(e.alternate,e,Tl);e.memoizedProps=e.pendingProps,null===t?gc(e):Ml=t,Sl.current=null}function gc(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=js(n,t,Tl)))return void(Ml=n)}else{if(null!==(n=Vs(n,t)))return n.flags&=32767,void(Ml=n);if(null===e)return Pl=6,void(Ml=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Ml=t);Ml=t=e}while(null!==t);0===Pl&&(Pl=5)}function vc(e,t,n){var r=yt,i=wl.transition;try{wl.transition=null,yt=1,function(e,t,n,r){do{yc()}while(null!==Vl);if(0!==(6&El))throw Error(a(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-at(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}(e,o),e===Al&&(Ml=Al=null,Cl=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||jl||(jl=!0,Ac(et,(function(){return yc(),null}))),o=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||o){o=wl.transition,wl.transition=null;var s=yt;yt=1;var l=El;El|=4,Sl.current=null,function(e,t){if(Yr=jt,cr(e=lr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(_){n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,h=e,p=null;t:for(;;){for(var f;h!==n||0!==i&&3!==h.nodeType||(l=s+i),h!==o||0!==r&&3!==h.nodeType||(c=s+r),3===h.nodeType&&(s+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++u===i&&(l=s),p===o&&++d===r&&(c=s),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(qr={focusedElem:e,selectionRange:n},jt=!1,$s=t;null!==$s;)if(e=(t=$s).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,$s=e;else for(;null!==$s;){t=$s;try{var m=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,v=m.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Qo(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;1===x.nodeType?x.textContent="":9===x.nodeType&&x.documentElement&&x.removeChild(x.documentElement);break;default:throw Error(a(163))}}catch(_){xc(t,t.return,_)}if(null!==(e=t.sibling)){e.return=t.return,$s=e;break}$s=t.return}m=qs,qs=!1}(e,n),hl(n,e),ur(qr),jt=!!Yr,qr=Yr=null,e.current=n,fl(n,e,i),Ke(),El=l,yt=s,wl.transition=o}else e.current=n;if(jl&&(jl=!1,Vl=e,Wl=i),o=e.pendingLanes,0===o&&(Gl=null),function(e){if(it&&"function"===typeof it.onCommitFiberRoot)try{it.onCommitFiberRoot(rt,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),Zl(e,Ye()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(zl)throw zl=!1,e=Hl,Hl=null,e;0!==(1&Wl)&&0!==e.tag&&yc(),o=e.pendingLanes,0!==(1&o)?e===Jl?Xl++:(Xl=0,Jl=e):Xl=0,Fi()}(e,t,n,r)}finally{wl.transition=i,yt=r}return null}function yc(){if(null!==Vl){var e=bt(Wl),t=wl.transition,n=yt;try{if(wl.transition=null,yt=16>e?16:e,null===Vl)var r=!1;else{if(e=Vl,Vl=null,Wl=0,0!==(6&El))throw Error(a(331));var i=El;for(El|=4,$s=e.current;null!==$s;){var o=$s,s=o.child;if(0!==(16&$s.flags)){var l=o.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for($s=u;null!==$s;){var d=$s;switch(d.tag){case 0:case 11:case 15:Qs(8,d,o)}var h=d.child;if(null!==h)h.return=d,$s=h;else for(;null!==$s;){var p=(d=$s).sibling,f=d.return;if(tl(d),d===u){$s=null;break}if(null!==p){p.return=f,$s=p;break}$s=f}}}var m=o.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}$s=o}}if(0!==(2064&o.subtreeFlags)&&null!==s)s.return=o,$s=s;else e:for(;null!==$s;){if(0!==(2048&(o=$s).flags))switch(o.tag){case 0:case 11:case 15:Qs(9,o,o.return)}var y=o.sibling;if(null!==y){y.return=o.return,$s=y;break e}$s=o.return}}var b=e.current;for($s=b;null!==$s;){var x=(s=$s).child;if(0!==(2064&s.subtreeFlags)&&null!==x)x.return=s,$s=x;else e:for(s=b;null!==$s;){if(0!==(2048&(l=$s).flags))try{switch(l.tag){case 0:case 11:case 15:Zs(9,l)}}catch(S){xc(l,l.return,S)}if(l===s){$s=null;break e}var _=l.sibling;if(null!==_){_.return=l.return,$s=_;break e}$s=l.return}}if(El=i,Fi(),it&&"function"===typeof it.onPostCommitFiberRoot)try{it.onPostCommitFiberRoot(rt,e)}catch(S){}r=!0}return r}finally{yt=n,wl.transition=t}}return!1}function bc(e,t,n){e=ka(e,t=cs(0,t=as(n,t),1),1),t=Yl(),null!==e&&(gt(e,1,t),Zl(e,t))}function xc(e,t,n){if(3===e.tag)bc(e,e,n);else for(;null!==t;){if(3===t.tag){bc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Gl||!Gl.has(r))){t=ka(t,e=us(t,e=as(n,e),1),1),e=Yl(),null!==t&&(gt(t,1,e),Zl(t,e));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Yl(),e.pingedLanes|=e.suspendedLanes&n,Al===e&&(Cl&n)===n&&(4===Pl||3===Pl&&(130023424&Cl)===Cl&&500>Ye()-Nl?lc(e,0):Ll|=n),Zl(e,t)}function Sc(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ct,0===(130023424&(ct<<=1))&&(ct=4194304)));var n=Yl();null!==(e=Pa(e,t))&&(gt(e,t,n),Zl(e,n))}function wc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Sc(e,n)}function Ec(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}null!==r&&r.delete(t),Sc(e,n)}function Ac(e,t){return Xe(e,t)}function Mc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 Cc(e,t,n,r){return new Mc(e,t,n,r)}function Tc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Rc(e,t){var n=e.alternate;return null===n?((n=Cc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pc(e,t,n,r,i,o){var s=2;if(r=e,"function"===typeof e)Tc(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case w:return Bc(n.children,i,o,t);case E:s=8,i|=8;break;case A:return(e=Cc(12,n,t,2|i)).elementType=A,e.lanes=o,e;case R:return(e=Cc(13,n,t,i)).elementType=R,e.lanes=o,e;case P:return(e=Cc(19,n,t,i)).elementType=P,e.lanes=o,e;case D:return Ic(n,i,o,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case M:s=10;break e;case C:s=9;break e;case T:s=11;break e;case B:s=14;break e;case I:s=16,r=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Cc(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Bc(e,t,n,r){return(e=Cc(7,e,r,t)).lanes=n,e}function Ic(e,t,n,r){return(e=Cc(22,e,r,t)).elementType=D,e.lanes=n,e.stateNode={isHidden:!1},e}function Dc(e,t,n){return(e=Cc(6,e,null,t)).lanes=n,e}function Lc(e,t,n){return(t=Cc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kc(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mt(0),this.expirationTimes=mt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Oc(e,t,n,r,i,a,o,s,l){return e=new kc(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Cc(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ia(a),e}function Nc(e){if(!e)return wi;e:{if(He(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ti(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var n=e.type;if(Ti(n))return Bi(e,n,t)}return t}function Fc(e,t,n,r,i,a,o,s,l){return(e=Oc(n,r,!0,e,0,a,0,s,l)).context=Nc(null),n=e.current,(a=La(r=Yl(),i=ql(n))).callback=void 0!==t&&null!==t?t:null,ka(n,a,i),e.current.lanes=i,gt(e,i,r),Zl(e,r),e}function Uc(e,t,n,r){var i=t.current,a=Yl(),o=ql(i);return n=Nc(n),null===t.context?t.context=n:t.pendingContext=n,(t=La(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=ka(i,t,o))&&(Ql(e,i,o,a),Oa(e,i,o)),o}function zc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Hc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Gc(e,t){Hc(e,t),(e=e.alternate)&&Hc(e,t)}bl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Ai.current)ms=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return ms=!1,function(e,t,n){switch(t.tag){case 3:As(t),ca();break;case 5:Ja(t);break;case 1:Ti(t.type)&&Ii(t);break;case 4:Wa(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Si(ya,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Si(Ka,1&Ka.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Ds(e,t,n):(Si(Ka,1&Ka.current),null!==(e=zs(e,t,n))?e.sibling:null);Si(Ka,1&Ka.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(128&e.flags)){if(r)return Fs(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Si(Ka,Ka.current),r)break;return null;case 22:case 23:return t.lanes=0,xs(e,t,n)}return zs(e,t,n)}(e,t,n);ms=0!==(131072&e.flags)}else ms=!1,ea&&0!==(1048576&t.flags)&&Ki(t,Gi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Us(e,t),e=t.pendingProps;var i=Ci(t,Ei.current);Aa(t,n),i=ho(null,t,r,e,i,n);var o=po();return t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ti(r)?(o=!0,Ii(t)):o=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Ia(t),i.updater=es,t.stateNode=i,i._reactInternals=t,is(t,r,e,n),t=Es(null,t,r,!0,o,n)):(t.tag=0,ea&&o&&Yi(t),gs(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Us(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"===typeof e)return Tc(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===T)return 11;if(e===B)return 14}return 2}(r),e=Qo(r,e),i){case 0:t=Ss(null,t,r,e,n);break e;case 1:t=ws(null,t,r,e,n);break e;case 11:t=vs(null,t,r,e,n);break e;case 14:t=ys(null,t,r,Qo(r.type,e),n);break e}throw Error(a(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ss(e,t,r,i=t.elementType===r?i:Qo(r,i),n);case 1:return r=t.type,i=t.pendingProps,ws(e,t,r,i=t.elementType===r?i:Qo(r,i),n);case 3:e:{if(As(t),null===e)throw Error(a(387));r=t.pendingProps,i=(o=t.memoizedState).element,Da(e,t),Fa(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Ms(e,t,r,n,i=as(Error(a(423)),t));break e}if(r!==i){t=Ms(e,t,r,n,i=as(Error(a(424)),t));break e}for(Zi=ai(t.stateNode.containerInfo.firstChild),Qi=t,ea=!0,ta=null,n=va(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(ca(),r===i){t=zs(e,t,n);break e}gs(e,t,r,n)}t=t.child}return t;case 5:return Ja(t),null===e&&aa(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,Qr(r,i)?s=null:null!==o&&Qr(r,o)&&(t.flags|=32),_s(e,t),gs(e,t,s,n),t.child;case 6:return null===e&&aa(t),null;case 13:return Ds(e,t,n);case 4:return Wa(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ga(t,null,r,n):gs(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,vs(e,t,r,i=t.elementType===r?i:Qo(r,i),n);case 7:return gs(e,t,t.pendingProps,n),t.child;case 8:case 12:return gs(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Si(ya,r._currentValue),r._currentValue=s,null!==o)if(rr(o.value,s)){if(o.children===i.children&&!Ai.current){t=zs(e,t,n);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var l=o.dependencies;if(null!==l){s=o.child;for(var c=l.firstContext;null!==c;){if(c.context===r){if(1===o.tag){(c=La(-1,n&-n)).tag=2;var u=o.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}o.lanes|=n,null!==(c=o.alternate)&&(c.lanes|=n),Ea(o.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===o.tag)s=o.type===t.type?null:o.child;else if(18===o.tag){if(null===(s=o.return))throw Error(a(341));s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),Ea(s,n,t),s=o.sibling}else s=o.child;if(null!==s)s.return=o;else for(s=o;null!==s;){if(s===t){s=null;break}if(null!==(o=s.sibling)){o.return=s.return,s=o;break}s=s.return}o=s}gs(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Aa(t,n),r=r(i=Ma(i)),t.flags|=1,gs(e,t,r,n),t.child;case 14:return i=Qo(r=t.type,t.pendingProps),ys(e,t,r,i=Qo(r.type,i),n);case 15:return bs(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Qo(r,i),Us(e,t),t.tag=1,Ti(r)?(e=!0,Ii(t)):e=!1,Aa(t,n),ns(t,r,i),is(t,r,i,n),Es(null,t,r,!0,e,n);case 19:return Fs(e,t,n);case 22:return xs(e,t,n)}throw Error(a(156,t.tag))};var jc="function"===typeof reportError?reportError:function(e){console.error(e)};function Vc(e){this._internalRoot=e}function Wc(e){this._internalRoot=e}function Xc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Jc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function $c(){}function Kc(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if("function"===typeof i){var s=i;i=function(){var e=zc(o);s.call(e)}}Uc(t,o,e,i)}else o=function(e,t,n,r,i){if(i){if("function"===typeof r){var a=r;r=function(){var e=zc(o);a.call(e)}}var o=Fc(t,r,e,0,null,!1,0,"",$c);return e._reactRootContainer=o,e[ui]=o.current,Fr(8===e.nodeType?e.parentNode:e),oc(),o}for(;i=e.lastChild;)e.removeChild(i);if("function"===typeof r){var s=r;r=function(){var e=zc(l);s.call(e)}}var l=Oc(e,0,!1,null,0,!1,0,"",$c);return e._reactRootContainer=l,e[ui]=l.current,Fr(8===e.nodeType?e.parentNode:e),oc((function(){Uc(t,l,n,r)})),l}(n,t,e,i,r);return zc(o)}Wc.prototype.render=Vc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));Uc(e,t,null,null)},Wc.prototype.unmount=Vc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;oc((function(){Uc(null,e,null,null)})),t[ui]=null}},Wc.prototype.unstable_scheduleHydration=function(e){if(e){var t=wt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<It.length&&0!==t&&t<It[n].priority;n++);It.splice(n,0,e),0===n&&Ot(e)}},xt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ut(t.pendingLanes);0!==n&&(vt(t,1|n),Zl(t,Ye()),0===(6&El)&&(Fl=Ye()+500,Fi()))}break;case 13:oc((function(){var t=Pa(e,1);if(null!==t){var n=Yl();Ql(t,e,1,n)}})),Gc(e,1)}},_t=function(e){if(13===e.tag){var t=Pa(e,134217728);if(null!==t)Ql(t,e,134217728,Yl());Gc(e,134217728)}},St=function(e){if(13===e.tag){var t=ql(e),n=Pa(e,t);if(null!==n)Ql(n,e,t,Yl());Gc(e,t)}},wt=function(){return yt},Et=function(e,t){var n=yt;try{return yt=e,t()}finally{yt=n}},_e=function(e,t,n){switch(t){case"input":if(Q(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=vi(r);if(!i)throw Error(a(90));J(r),Q(r,i)}}}break;case"textarea":ae(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Ce=ac,Te=oc;var Yc={usingClientEntryPoint:!1,Events:[mi,gi,vi,Ae,Me,ac]},qc={findFiberByHostInstance:fi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Qc={bundleType:qc.bundleType,version:qc.version,rendererPackageName:qc.rendererPackageName,rendererConfig:qc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ve(e))?null:e.stateNode},findFiberByHostInstance:qc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zc.isDisabled&&Zc.supportsFiber)try{rt=Zc.inject(Qc),it=Zc}catch(eu){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yc,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Xc(t))throw Error(a(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Xc(e))throw Error(a(299));var n=!1,r="",i=jc;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Oc(e,1,!1,null,0,n,0,r,i),e[ui]=t.current,Fr(8===e.nodeType?e.parentNode:e),new Vc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=null===(e=Ve(t))?null:e.stateNode},t.flushSync=function(e){return oc(e)},t.hydrate=function(e,t,n){if(!Jc(t))throw Error(a(200));return Kc(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Xc(e))throw Error(a(405));var r=null!=n&&n.hydratedSources||null,i=!1,o="",s=jc;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError)),t=Fc(t,null,e,1,null!=n?n:null,i,0,o,s),e[ui]=t.current,Fr(e),r)for(e=0;e<r.length;e++)i=(i=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Wc(t)},t.render=function(e,t,n){if(!Jc(t))throw Error(a(200));return Kc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Jc(e))throw Error(a(40));return!!e._reactRootContainer&&(oc((function(){Kc(null,null,e,!1,(function(){e._reactRootContainer=null,e[ui]=null}))})),!0)},t.unstable_batchedUpdates=ac,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Jc(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return Kc(e,t,n,!1,r)},t.version="18.3.1-next-f1338f8080-20240426"},4391:(e,t,n)=>{"use strict";var r=n(7950);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},7950:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(2730)},4612:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<a(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>a(l,n))c<i&&0>a(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<i&&0>a(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,h=null,p=3,f=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=r(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function _(e){if(g=!1,x(e),!m)if(null!==r(c))m=!0,D(S);else{var t=r(u);null!==t&&L(_,t.startTime-e)}}function S(e,n){m=!1,g&&(g=!1,y(M),M=-1),f=!0;var a=p;try{for(x(n),h=r(c);null!==h&&(!(h.expirationTime>n)||e&&!R());){var o=h.callback;if("function"===typeof o){h.callback=null,p=h.priorityLevel;var s=o(h.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?h.callback=s:h===r(c)&&i(c),x(n)}else i(c);h=r(c)}if(null!==h)var l=!0;else{var d=r(u);null!==d&&L(_,d.startTime-n),l=!1}return l}finally{h=null,p=a,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var w,E=!1,A=null,M=-1,C=5,T=-1;function R(){return!(t.unstable_now()-T<C)}function P(){if(null!==A){var e=t.unstable_now();T=e;var n=!0;try{n=A(!0,e)}finally{n?w():(E=!1,A=null)}}else E=!1}if("function"===typeof b)w=function(){b(P)};else if("undefined"!==typeof MessageChannel){var B=new MessageChannel,I=B.port2;B.port1.onmessage=P,w=function(){I.postMessage(null)}}else w=function(){v(P,0)};function D(e){A=e,E||(E=!0,w())}function L(e,n){M=v((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,D(S))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,i,a){var o=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?o+a:o:a=o,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(e.sortIndex=a,n(u,e),null===r(c)&&e===r(u)&&(g?(y(M),M=-1):g=!0,L(_,a-o))):(e.sortIndex=s,n(c,e),m||f||(m=!0,D(S))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},7067:(e,t,n)=>{"use strict";e.exports=n(4612)},7302:(e,t)=>{"use strict";t.ConcurrentRoot=1,t.ContinuousEventPriority=4,t.DefaultEventPriority=16,t.DiscreteEventPriority=1},6958:(e,t,n)=>{e.exports=function(e){var t={},r=n(5043),i=n(8853),a=Object.assign;function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var x=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var _=Symbol.iterator;function S(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=_&&e[_]||e["@@iterator"])?e:null}function w(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case u:return"Fragment";case c:return"Portal";case h:return"Profiler";case d:return"StrictMode";case g:return"Suspense";case v:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case f:return(e.displayName||"Context")+".Consumer";case p:return(e._context.displayName||"Context")+".Provider";case m:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case y:return null!==(t=e.displayName||null)?t:w(e.type)||"Memo";case b:t=e._payload,e=e._init;try{return w(e(t))}catch(n){}}return null}function E(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return w(t);case 8:return t===d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function A(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function M(e){if(A(e)!==e)throw Error(o(188))}function C(e){var t=e.alternate;if(!t){if(null===(t=A(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return M(i),e;if(a===r)return M(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}function T(e){return null!==(e=C(e))?R(e):null}function R(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=R(e);if(null!==t)return t;e=e.sibling}return null}function P(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){if(4!==e.tag){var t=P(e);if(null!==t)return t}e=e.sibling}return null}var B,I=Array.isArray,D=e.getPublicInstance,L=e.getRootHostContext,k=e.getChildHostContext,O=e.prepareForCommit,N=e.resetAfterCommit,F=e.createInstance,U=e.appendInitialChild,z=e.finalizeInitialChildren,H=e.prepareUpdate,G=e.shouldSetTextContent,j=e.createTextInstance,V=e.scheduleTimeout,W=e.cancelTimeout,X=e.noTimeout,J=e.isPrimaryRenderer,$=e.supportsMutation,K=e.supportsPersistence,Y=e.supportsHydration,q=e.getInstanceFromNode,Q=e.preparePortalMount,Z=e.getCurrentEventPriority,ee=e.detachDeletedInstance,te=e.supportsMicrotasks,ne=e.scheduleMicrotask,re=e.supportsTestSelectors,ie=e.findFiberRoot,ae=e.getBoundingRect,oe=e.getTextContent,se=e.isHiddenSubtree,le=e.matchAccessibilityRole,ce=e.setFocusIfFocusable,ue=e.setupIntersectionObserver,de=e.appendChild,he=e.appendChildToContainer,pe=e.commitTextUpdate,fe=e.commitMount,me=e.commitUpdate,ge=e.insertBefore,ve=e.insertInContainerBefore,ye=e.removeChild,be=e.removeChildFromContainer,xe=e.resetTextContent,_e=e.hideInstance,Se=e.hideTextInstance,we=e.unhideInstance,Ee=e.unhideTextInstance,Ae=e.clearContainer,Me=e.cloneInstance,Ce=e.createContainerChildSet,Te=e.appendChildToContainerChildSet,Re=e.finalizeContainerChildren,Pe=e.replaceContainerChildren,Be=e.cloneHiddenInstance,Ie=e.cloneHiddenTextInstance,De=e.canHydrateInstance,Le=e.canHydrateTextInstance,ke=e.canHydrateSuspenseInstance,Oe=e.isSuspenseInstancePending,Ne=e.isSuspenseInstanceFallback,Fe=e.registerSuspenseInstanceRetry,Ue=e.getNextHydratableSibling,ze=e.getFirstHydratableChild,He=e.getFirstHydratableChildWithinContainer,Ge=e.getFirstHydratableChildWithinSuspenseInstance,je=e.hydrateInstance,Ve=e.hydrateTextInstance,We=e.hydrateSuspenseInstance,Xe=e.getNextHydratableInstanceAfterSuspenseInstance,Je=e.commitHydratedContainer,$e=e.commitHydratedSuspenseInstance,Ke=e.clearSuspenseBoundary,Ye=e.clearSuspenseBoundaryFromContainer,qe=e.shouldDeleteUnhydratedTailInstances,Qe=e.didNotMatchHydratedContainerTextInstance,Ze=e.didNotMatchHydratedTextInstance;function et(e){if(void 0===B)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);B=t&&t[1]||""}return"\n"+B+e}var tt=!1;function nt(e,t){if(!e||tt)return"";tt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"===typeof c.stack){for(var i=c.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,0>--s||i[o]!==a[s]){var l="\n"+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=o&&0<=s);break}}}finally{tt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?et(e):""}var rt=Object.prototype.hasOwnProperty,it=[],at=-1;function ot(e){return{current:e}}function st(e){0>at||(e.current=it[at],it[at]=null,at--)}function lt(e,t){at++,it[at]=e.current,e.current=t}var ct={},ut=ot(ct),dt=ot(!1),ht=ct;function pt(e,t){var n=e.type.contextTypes;if(!n)return ct;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ft(e){return null!==(e=e.childContextTypes)&&void 0!==e}function mt(){st(dt),st(ut)}function gt(e,t,n){if(ut.current!==ct)throw Error(o(168));lt(ut,t),lt(dt,n)}function vt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(o(108,E(e)||"Unknown",i));return a({},n,r)}function yt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ct,ht=ut.current,lt(ut,e),lt(dt,dt.current),!0}function bt(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=vt(e,t,ht),r.__reactInternalMemoizedMergedChildContext=e,st(dt),st(ut),lt(ut,e)):st(dt),lt(dt,n)}var xt=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(_t(e)/St|0)|0},_t=Math.log,St=Math.LN2;var wt=64,Et=4194304;function At(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Mt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=268435455&n;if(0!==o){var s=o&~i;0!==s?r=At(s):0!==(a&=o)&&(r=At(a))}else 0!==(o=n&~i)?r=At(o):0!==a&&(r=At(a));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(a=t&-t)||16===i&&0!==(4194240&a)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-xt(t)),r|=e[n],t&=~i;return r}function Ct(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Tt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-xt(t)]=n}function Bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-xt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var It=0;function Dt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var Lt=i.unstable_scheduleCallback,kt=i.unstable_cancelCallback,Ot=i.unstable_shouldYield,Nt=i.unstable_requestPaint,Ft=i.unstable_now,Ut=i.unstable_ImmediatePriority,zt=i.unstable_UserBlockingPriority,Ht=i.unstable_NormalPriority,Gt=i.unstable_IdlePriority,jt=null,Vt=null;var Wt="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},Xt=null,Jt=!1,$t=!1;function Kt(e){null===Xt?Xt=[e]:Xt.push(e)}function Yt(){if(!$t&&null!==Xt){$t=!0;var e=0,t=It;try{var n=Xt;for(It=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Xt=null,Jt=!1}catch(i){throw null!==Xt&&(Xt=Xt.slice(e+1)),Lt(Ut,Yt),i}finally{It=t,$t=!1}}return null}var qt=s.ReactCurrentBatchConfig;function Qt(e,t){if(Wt(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!rt.call(t,i)||!Wt(e[i],t[i]))return!1}return!0}function Zt(e){switch(e.tag){case 5:return et(e.type);case 16:return et("Lazy");case 13:return et("Suspense");case 19:return et("SuspenseList");case 0:case 2:case 15:return e=nt(e.type,!1);case 11:return e=nt(e.type.render,!1);case 1:return e=nt(e.type,!0);default:return""}}function en(e,t){if(e&&e.defaultProps){for(var n in t=a({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var tn=ot(null),nn=null,rn=null,an=null;function on(){an=rn=nn=null}function sn(e,t,n){J?(lt(tn,t._currentValue),t._currentValue=n):(lt(tn,t._currentValue2),t._currentValue2=n)}function ln(e){var t=tn.current;st(tn),J?e._currentValue=t:e._currentValue2=t}function cn(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function un(e,t){nn=e,an=rn=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Oi=!0),e.firstContext=null)}function dn(e){var t=J?e._currentValue:e._currentValue2;if(an!==e)if(e={context:e,memoizedValue:t,next:null},null===rn){if(null===nn)throw Error(o(308));rn=e,nn.dependencies={lanes:0,firstContext:e}}else rn=rn.next=e;return t}var hn=null,pn=!1;function fn(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mn(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function vn(e,t){var n=e.updateQueue;null!==n&&(n=n.shared,null!==$a&&0!==(1&e.mode)&&0===(2&Ja)?(null===(e=n.interleaved)?(t.next=t,null===hn?hn=[n]:hn.push(n)):(t.next=e.next,e.next=t),n.interleaved=t):(null===(e=n.pending)?t.next=t:(t.next=e.next,e.next=t),n.pending=t))}function yn(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Bt(e,n)}}function bn(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function xn(e,t,n,r){var i=e.updateQueue;pn=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(null!==l){i.shared.pending=null;var c=l,u=c.next;c.next=null,null===s?o=u:s.next=u,s=c;var d=e.alternate;null!==d&&((l=(d=d.updateQueue).lastBaseUpdate)!==s&&(null===l?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(null!==o){var h=i.baseState;for(s=0,d=u=c=null,l=o;;){var p=l.lane,f=l.eventTime;if((r&p)===p){null!==d&&(d=d.next={eventTime:f,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(p=t,f=n,g.tag){case 1:if("function"===typeof(m=g.payload)){h=m.call(f,h,p);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null===(p="function"===typeof(m=g.payload)?m.call(f,h,p):m)||void 0===p)break e;h=a({},h,p);break e;case 2:pn=!0}}null!==l.callback&&0!==l.lane&&(e.flags|=64,null===(p=i.effects)?i.effects=[l]:p.push(l))}else f={eventTime:f,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===d?(u=d=f,c=h):d=d.next=f,s|=p;if(null===(l=l.next)){if(null===(l=i.shared.pending))break;l=(p=l).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}if(null===d&&(c=h),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,null!==(t=i.shared.interleaved)){i=t;do{s|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);to|=s,e.lanes=s,e.memoizedState=h}}function _n(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!==typeof i)throw Error(o(191,i));i.call(r)}}}var Sn=(new r.Component).refs;function wn(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:a({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var En={isMounted:function(e){return!!(e=e._reactInternals)&&A(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_o(),i=So(e),a=gn(r,i);a.payload=t,void 0!==n&&null!==n&&(a.callback=n),vn(e,a),null!==(t=wo(e,i,r))&&yn(t,e,i)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_o(),i=So(e),a=gn(r,i);a.tag=1,a.payload=t,void 0!==n&&null!==n&&(a.callback=n),vn(e,a),null!==(t=wo(e,i,r))&&yn(t,e,i)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_o(),r=So(e),i=gn(n,r);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),vn(e,i),null!==(t=wo(e,r,n))&&yn(t,e,r)}};function An(e,t,n,r,i,a,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!Qt(n,r)||!Qt(i,a))}function Mn(e,t,n){var r=!1,i=ct,a=t.contextType;return"object"===typeof a&&null!==a?a=dn(a):(i=ft(t)?ht:ut.current,a=(r=null!==(r=t.contextTypes)&&void 0!==r)?pt(e,i):ct),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=En,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Cn(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&En.enqueueReplaceState(t,t.state,null)}function Tn(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Sn,fn(e);var a=t.contextType;"object"===typeof a&&null!==a?i.context=dn(a):(a=ft(t)?ht:ut.current,i.context=pt(e,a)),i.state=e.memoizedState,"function"===typeof(a=t.getDerivedStateFromProps)&&(wn(e,t,a,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&En.enqueueReplaceState(i,i.state,null),xn(e,n,i,r),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4194308)}var Rn=[],Pn=0,Bn=null,In=0,Dn=[],Ln=0,kn=null,On=1,Nn="";function Fn(e,t){Rn[Pn++]=In,Rn[Pn++]=Bn,Bn=e,In=t}function Un(e,t,n){Dn[Ln++]=On,Dn[Ln++]=Nn,Dn[Ln++]=kn,kn=e;var r=On;e=Nn;var i=32-xt(r)-1;r&=~(1<<i),n+=1;var a=32-xt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,On=1<<32-xt(t)+i|n<<i|r,Nn=a+e}else On=1<<a|n<<i|r,Nn=e}function zn(e){null!==e.return&&(Fn(e,1),Un(e,1,0))}function Hn(e){for(;e===Bn;)Bn=Rn[--Pn],Rn[Pn]=null,In=Rn[--Pn],Rn[Pn]=null;for(;e===kn;)kn=Dn[--Ln],Dn[Ln]=null,Nn=Dn[--Ln],Dn[Ln]=null,On=Dn[--Ln],Dn[Ln]=null}var Gn=null,jn=null,Vn=!1,Wn=!1,Xn=null;function Jn(e,t){var n=Qo(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function $n(e,t){switch(e.tag){case 5:return null!==(t=De(t,e.type,e.pendingProps))&&(e.stateNode=t,Gn=e,jn=ze(t),!0);case 6:return null!==(t=Le(t,e.pendingProps))&&(e.stateNode=t,Gn=e,jn=null,!0);case 13:if(null!==(t=ke(t))){var n=null!==kn?{id:On,overflow:Nn}:null;return e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Qo(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Gn=e,jn=null,!0}return!1;default:return!1}}function Kn(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function Yn(e){if(Vn){var t=jn;if(t){var n=t;if(!$n(e,t)){if(Kn(e))throw Error(o(418));t=Ue(n);var r=Gn;t&&$n(e,t)?Jn(r,n):(e.flags=-4097&e.flags|2,Vn=!1,Gn=e)}}else{if(Kn(e))throw Error(o(418));e.flags=-4097&e.flags|2,Vn=!1,Gn=e}}}function qn(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Gn=e}function Qn(e){if(!Y||e!==Gn)return!1;if(!Vn)return qn(e),Vn=!0,!1;if(3!==e.tag&&(5!==e.tag||qe(e.type)&&!G(e.type,e.memoizedProps))){var t=jn;if(t){if(Kn(e)){for(e=jn;e;)e=Ue(e);throw Error(o(418))}for(;t;)Jn(e,t),t=Ue(t)}}if(qn(e),13===e.tag){if(!Y)throw Error(o(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));jn=Xe(e)}else jn=Gn?Ue(e.stateNode):null;return!0}function Zn(){Y&&(jn=Gn=null,Wn=Vn=!1)}function er(e){null===Xn?Xn=[e]:Xn.push(e)}function tr(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=r,a=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=i.refs;t===Sn&&(t=i.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!==typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function nr(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function rr(e){return(0,e._init)(e._payload)}function ir(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=es(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function d(e,t,n,r){return null===t||6!==t.tag?((t=is(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n,r){var a=n.type;return a===u?f(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===b&&rr(a)===t.type)?((r=i(t,n.props)).ref=tr(e,t,n),r.return=e,r):((r=ts(n.type,n.key,n.props,null,e.mode,r)).ref=tr(e,t,n),r.return=e,r)}function p(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=as(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,a){return null===t||7!==t.tag?((t=ns(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function m(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=is(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case l:return(n=ts(t.type,t.key,t.props,null,e.mode,n)).ref=tr(e,null,t),n.return=e,n;case c:return(t=as(t,e.mode,n)).return=e,t;case b:return m(e,(0,t._init)(t._payload),n)}if(I(t)||S(t))return(t=ns(t,e.mode,n,null)).return=e,t;nr(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==i?null:d(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case l:return n.key===i?h(e,t,n,r):null;case c:return n.key===i?p(e,t,n,r):null;case b:return g(e,t,(i=n._init)(n._payload),r)}if(I(n)||S(n))return null!==i?null:f(e,t,n,r,null);nr(e,n)}return null}function v(e,t,n,r,i){if("string"===typeof r&&""!==r||"number"===typeof r)return d(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case l:return h(t,e=e.get(null===r.key?n:r.key)||null,r,i);case c:return p(t,e=e.get(null===r.key?n:r.key)||null,r,i);case b:return v(e,t,n,(0,r._init)(r._payload),i)}if(I(r)||S(r))return f(t,e=e.get(n)||null,r,i,null);nr(t,r)}return null}function y(i,o,s,l){for(var c=null,u=null,d=o,h=o=0,p=null;null!==d&&h<s.length;h++){d.index>h?(p=d,d=null):p=d.sibling;var f=g(i,d,s[h],l);if(null===f){null===d&&(d=p);break}e&&d&&null===f.alternate&&t(i,d),o=a(f,o,h),null===u?c=f:u.sibling=f,u=f,d=p}if(h===s.length)return n(i,d),Vn&&Fn(i,h),c;if(null===d){for(;h<s.length;h++)null!==(d=m(i,s[h],l))&&(o=a(d,o,h),null===u?c=d:u.sibling=d,u=d);return Vn&&Fn(i,h),c}for(d=r(i,d);h<s.length;h++)null!==(p=v(d,i,h,s[h],l))&&(e&&null!==p.alternate&&d.delete(null===p.key?h:p.key),o=a(p,o,h),null===u?c=p:u.sibling=p,u=p);return e&&d.forEach((function(e){return t(i,e)})),Vn&&Fn(i,h),c}function x(i,s,l,c){var u=S(l);if("function"!==typeof u)throw Error(o(150));if(null==(l=u.call(l)))throw Error(o(151));for(var d=u=null,h=s,p=s=0,f=null,y=l.next();null!==h&&!y.done;p++,y=l.next()){h.index>p?(f=h,h=null):f=h.sibling;var b=g(i,h,y.value,c);if(null===b){null===h&&(h=f);break}e&&h&&null===b.alternate&&t(i,h),s=a(b,s,p),null===d?u=b:d.sibling=b,d=b,h=f}if(y.done)return n(i,h),Vn&&Fn(i,p),u;if(null===h){for(;!y.done;p++,y=l.next())null!==(y=m(i,y.value,c))&&(s=a(y,s,p),null===d?u=y:d.sibling=y,d=y);return Vn&&Fn(i,p),u}for(h=r(i,h);!y.done;p++,y=l.next())null!==(y=v(h,i,p,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?p:y.key),s=a(y,s,p),null===d?u=y:d.sibling=y,d=y);return e&&h.forEach((function(e){return t(i,e)})),Vn&&Fn(i,p),u}return function e(r,a,o,d){if("object"===typeof o&&null!==o&&o.type===u&&null===o.key&&(o=o.props.children),"object"===typeof o&&null!==o){switch(o.$$typeof){case l:e:{for(var h=o.key,p=a;null!==p;){if(p.key===h){if((h=o.type)===u){if(7===p.tag){n(r,p.sibling),(a=i(p,o.props.children)).return=r,r=a;break e}}else if(p.elementType===h||"object"===typeof h&&null!==h&&h.$$typeof===b&&rr(h)===p.type){n(r,p.sibling),(a=i(p,o.props)).ref=tr(r,p,o),a.return=r,r=a;break e}n(r,p);break}t(r,p),p=p.sibling}o.type===u?((a=ns(o.props.children,r.mode,d,o.key)).return=r,r=a):((d=ts(o.type,o.key,o.props,null,r.mode,d)).ref=tr(r,a,o),d.return=r,r=d)}return s(r);case c:e:{for(p=o.key;null!==a;){if(a.key===p){if(4===a.tag&&a.stateNode.containerInfo===o.containerInfo&&a.stateNode.implementation===o.implementation){n(r,a.sibling),(a=i(a,o.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=as(o,r.mode,d)).return=r,r=a}return s(r);case b:return e(r,a,(p=o._init)(o._payload),d)}if(I(o))return y(r,a,o,d);if(S(o))return x(r,a,o,d);nr(r,o)}return"string"===typeof o&&""!==o||"number"===typeof o?(o=""+o,null!==a&&6===a.tag?(n(r,a.sibling),(a=i(a,o)).return=r,r=a):(n(r,a),(a=is(o,r.mode,d)).return=r,r=a),s(r)):n(r,a)}}var ar=ir(!0),or=ir(!1),sr={},lr=ot(sr),cr=ot(sr),ur=ot(sr);function dr(e){if(e===sr)throw Error(o(174));return e}function hr(e,t){lt(ur,t),lt(cr,e),lt(lr,sr),e=L(t),st(lr),lt(lr,e)}function pr(){st(lr),st(cr),st(ur)}function fr(e){var t=dr(ur.current),n=dr(lr.current);n!==(t=k(n,e.type,t))&&(lt(cr,e),lt(lr,t))}function mr(e){cr.current===e&&(st(lr),st(cr))}var gr=ot(0);function vr(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Oe(n)||Ne(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var yr=[];function br(){for(var e=0;e<yr.length;e++){var t=yr[e];J?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}yr.length=0}var xr=s.ReactCurrentDispatcher,_r=s.ReactCurrentBatchConfig,Sr=0,wr=null,Er=null,Ar=null,Mr=!1,Cr=!1,Tr=0,Rr=0;function Pr(){throw Error(o(321))}function Br(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wt(e[n],t[n]))return!1;return!0}function Ir(e,t,n,r,i,a){if(Sr=a,wr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,xr.current=null===e||null===e.memoizedState?fi:mi,e=n(r,i),Cr){a=0;do{if(Cr=!1,Tr=0,25<=a)throw Error(o(301));a+=1,Ar=Er=null,t.updateQueue=null,xr.current=gi,e=n(r,i)}while(Cr)}if(xr.current=pi,t=null!==Er&&null!==Er.next,Sr=0,Ar=Er=wr=null,Mr=!1,t)throw Error(o(300));return e}function Dr(){var e=0!==Tr;return Tr=0,e}function Lr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ar?wr.memoizedState=Ar=e:Ar=Ar.next=e,Ar}function kr(){if(null===Er){var e=wr.alternate;e=null!==e?e.memoizedState:null}else e=Er.next;var t=null===Ar?wr.memoizedState:Ar.next;if(null!==t)Ar=t,Er=e;else{if(null===e)throw Error(o(310));e={memoizedState:(Er=e).memoizedState,baseState:Er.baseState,baseQueue:Er.baseQueue,queue:Er.queue,next:null},null===Ar?wr.memoizedState=Ar=e:Ar=Ar.next=e}return Ar}function Or(e,t){return"function"===typeof t?t(e):t}function Nr(e){var t=kr(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=Er,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(null!==i){a=i.next,r=r.baseState;var l=s=null,c=null,u=a;do{var d=u.lane;if((Sr&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=h,s=r):c=c.next=h,wr.lanes|=d,to|=d}u=u.next}while(null!==u&&u!==a);null===c?s=r:c.next=l,Wt(r,t.memoizedState)||(Oi=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{a=i.lane,wr.lanes|=a,to|=a,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fr(e){var t=kr(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);Wt(a,t.memoizedState)||(Oi=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Ur(){}function zr(e,t){var n=wr,r=kr(),i=t(),a=!Wt(r.memoizedState,i);if(a&&(r.memoizedState=i,Oi=!0),r=r.queue,qr(jr.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||null!==Ar&&1&Ar.memoizedState.tag){if(n.flags|=2048,Xr(9,Gr.bind(null,n,r,i,t),void 0,null),null===$a)throw Error(o(349));0!==(30&Sr)||Hr(n,t,i)}return i}function Hr(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=wr.updateQueue)?(t={lastEffect:null,stores:null},wr.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Gr(e,t,n,r){t.value=n,t.getSnapshot=r,Vr(t)&&wo(e,1,-1)}function jr(e,t,n){return n((function(){Vr(t)&&wo(e,1,-1)}))}function Vr(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wt(e,n)}catch(r){return!0}}function Wr(e){var t=Lr();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Or,lastRenderedState:e},t.queue=e,e=e.dispatch=li.bind(null,wr,e),[t.memoizedState,e]}function Xr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=wr.updateQueue)?(t={lastEffect:null,stores:null},wr.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Jr(){return kr().memoizedState}function $r(e,t,n,r){var i=Lr();wr.flags|=e,i.memoizedState=Xr(1|t,n,void 0,void 0===r?null:r)}function Kr(e,t,n,r){var i=kr();r=void 0===r?null:r;var a=void 0;if(null!==Er){var o=Er.memoizedState;if(a=o.destroy,null!==r&&Br(r,o.deps))return void(i.memoizedState=Xr(t,n,a,r))}wr.flags|=e,i.memoizedState=Xr(1|t,n,a,r)}function Yr(e,t){return $r(8390656,8,e,t)}function qr(e,t){return Kr(2048,8,e,t)}function Qr(e,t){return Kr(4,2,e,t)}function Zr(e,t){return Kr(4,4,e,t)}function ei(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function ti(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Kr(4,4,ei.bind(null,t,e),n)}function ni(){}function ri(e,t){var n=kr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Br(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ii(e,t){var n=kr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Br(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ai(e,t){var n=It;It=0!==n&&4>n?n:4,e(!0);var r=_r.transition;_r.transition={};try{e(!1),t()}finally{It=n,_r.transition=r}}function oi(){return kr().memoizedState}function si(e,t,n){var r=So(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ci(e)?ui(t,n):(di(e,t,n),null!==(e=wo(e,r,n=_o()))&&hi(e,t,r))}function li(e,t,n){var r=So(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ci(e))ui(t,i);else{di(e,t,i);var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Wt(s,o))return}catch(l){}null!==(e=wo(e,r,n=_o()))&&hi(e,t,r)}}function ci(e){var t=e.alternate;return e===wr||null!==t&&t===wr}function ui(e,t){Cr=Mr=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function di(e,t,n){null!==$a&&0!==(1&e.mode)&&0===(2&Ja)?(null===(e=t.interleaved)?(n.next=n,null===hn?hn=[t]:hn.push(t)):(n.next=e.next,e.next=n),t.interleaved=n):(null===(e=t.pending)?n.next=n:(n.next=e.next,e.next=n),t.pending=n)}function hi(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Bt(e,n)}}var pi={readContext:dn,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useInsertionEffect:Pr,useLayoutEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useMutableSource:Pr,useSyncExternalStore:Pr,useId:Pr,unstable_isNewReconciler:!1},fi={readContext:dn,useCallback:function(e,t){return Lr().memoizedState=[e,void 0===t?null:t],e},useContext:dn,useEffect:Yr,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,$r(4194308,4,ei.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $r(4194308,4,e,t)},useInsertionEffect:function(e,t){return $r(4,2,e,t)},useMemo:function(e,t){var n=Lr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lr();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=si.bind(null,wr,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Lr().memoizedState=e},useState:Wr,useDebugValue:ni,useDeferredValue:function(e){var t=Wr(e),n=t[0],r=t[1];return Yr((function(){var t=_r.transition;_r.transition={};try{r(e)}finally{_r.transition=t}}),[e]),n},useTransition:function(){var e=Wr(!1),t=e[0];return e=ai.bind(null,e[1]),Lr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=wr,i=Lr();if(Vn){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===$a)throw Error(o(349));0!==(30&Sr)||Hr(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Yr(jr.bind(null,r,a,e),[e]),r.flags|=2048,Xr(9,Gr.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Lr(),t=$a.identifierPrefix;if(Vn){var n=Nn;t=":"+t+"R"+(n=(On&~(1<<32-xt(On)-1)).toString(32)+n),0<(n=Tr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Rr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},mi={readContext:dn,useCallback:ri,useContext:dn,useEffect:qr,useImperativeHandle:ti,useInsertionEffect:Qr,useLayoutEffect:Zr,useMemo:ii,useReducer:Nr,useRef:Jr,useState:function(){return Nr(Or)},useDebugValue:ni,useDeferredValue:function(e){var t=Nr(Or),n=t[0],r=t[1];return qr((function(){var t=_r.transition;_r.transition={};try{r(e)}finally{_r.transition=t}}),[e]),n},useTransition:function(){return[Nr(Or)[0],kr().memoizedState]},useMutableSource:Ur,useSyncExternalStore:zr,useId:oi,unstable_isNewReconciler:!1},gi={readContext:dn,useCallback:ri,useContext:dn,useEffect:qr,useImperativeHandle:ti,useInsertionEffect:Qr,useLayoutEffect:Zr,useMemo:ii,useReducer:Fr,useRef:Jr,useState:function(){return Fr(Or)},useDebugValue:ni,useDeferredValue:function(e){var t=Fr(Or),n=t[0],r=t[1];return qr((function(){var t=_r.transition;_r.transition={};try{r(e)}finally{_r.transition=t}}),[e]),n},useTransition:function(){return[Fr(Or)[0],kr().memoizedState]},useMutableSource:Ur,useSyncExternalStore:zr,useId:oi,unstable_isNewReconciler:!1};function vi(e,t){try{var n="",r=t;do{n+=Zt(r),r=r.return}while(r);var i=n}catch(a){i="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:i}}function yi(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var bi,xi,_i,Si,wi="function"===typeof WeakMap?WeakMap:Map;function Ei(e,t,n){(n=gn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){uo||(uo=!0,ho=r),yi(0,t)},n}function Ai(e,t,n){(n=gn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){yi(0,t)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(n.callback=function(){yi(0,t),"function"!==typeof r&&(null===po?po=new Set([this]):po.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Mi(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new wi;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Xo.bind(null,e,t,n),t.then(e,e))}function Ci(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function Ti(e,t,n,r,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=gn(-1,1)).tag=2,vn(n,t))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}function Ri(e){e.flags|=4}function Pi(e,t){if(null!==e&&e.child===t.child)return!0;if(0!==(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!==(12854&e.flags)||0!==(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if($)bi=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)U(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},xi=function(){},_i=function(e,t,n,r,i){if((e=e.memoizedProps)!==r){var a=t.stateNode,o=dr(lr.current);n=H(a,n,e,r,i,o),(t.updateQueue=n)&&Ri(t)}},Si=function(e,t,n,r){n!==r&&Ri(t)};else if(K){bi=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var a=i.stateNode;n&&r&&(a=Be(a,i.type,i.memoizedProps,i)),U(e,a)}else if(6===i.tag)a=i.stateNode,n&&r&&(a=Ie(a,i.memoizedProps,i)),U(e,a);else if(4!==i.tag)if(22===i.tag&&null!==i.memoizedState)null!==(a=i.child)&&(a.return=i),bi(e,i,!0,!0);else if(null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var Bi=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var a=i.stateNode;n&&r&&(a=Be(a,i.type,i.memoizedProps,i)),Te(e,a)}else if(6===i.tag)a=i.stateNode,n&&r&&(a=Ie(a,i.memoizedProps,i)),Te(e,a);else if(4!==i.tag)if(22===i.tag&&null!==i.memoizedState)null!==(a=i.child)&&(a.return=i),Bi(e,i,!0,!0);else if(null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};xi=function(e,t){var n=t.stateNode;if(!Pi(e,t)){e=n.containerInfo;var r=Ce(e);Bi(r,t,!1,!1),n.pendingChildren=r,Ri(t),Re(e,r)}},_i=function(e,t,n,r,i){var a=e.stateNode,o=e.memoizedProps;if((e=Pi(e,t))&&o===r)t.stateNode=a;else{var s=t.stateNode,l=dr(lr.current),c=null;o!==r&&(c=H(s,n,o,r,i,l)),e&&null===c?t.stateNode=a:(a=Me(a,c,n,o,r,t,e,s),z(a,n,r,i,l)&&Ri(t),t.stateNode=a,e?Ri(t):bi(a,t,!1,!1))}},Si=function(e,t,n,r){n!==r?(e=dr(ur.current),n=dr(lr.current),t.stateNode=j(r,e,n,t),Ri(t)):t.stateNode=e.stateNode}}else xi=function(){},_i=function(){},Si=function(){};function Ii(e,t){if(!Vn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Di(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Li(e,t,n){var r=t.pendingProps;switch(Hn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Di(t),null;case 1:case 17:return ft(t.type)&&mt(),Di(t),null;case 3:return r=t.stateNode,pr(),st(dt),st(ut),br(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Qn(t)?Ri(t):null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==Xn&&(To(Xn),Xn=null))),xi(e,t),Di(t),null;case 5:mr(t),n=dr(ur.current);var i=t.type;if(null!==e&&null!=t.stateNode)_i(e,t,i,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(o(166));return Di(t),null}if(e=dr(lr.current),Qn(t)){if(!Y)throw Error(o(175));e=je(t.stateNode,t.type,t.memoizedProps,n,e,t,!Wn),t.updateQueue=e,null!==e&&Ri(t)}else{var a=F(i,r,n,e,t);bi(a,t,!1,!1),t.stateNode=a,z(a,i,r,n,e)&&Ri(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Di(t),null;case 6:if(e&&null!=t.stateNode)Si(e,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(o(166));if(e=dr(ur.current),n=dr(lr.current),Qn(t)){if(!Y)throw Error(o(176));if(e=t.stateNode,r=t.memoizedProps,(n=Ve(e,r,t,!Wn))&&null!==(i=Gn))switch(a=0!==(1&i.mode),i.tag){case 3:Qe(i.stateNode.containerInfo,e,r,a);break;case 5:Ze(i.type,i.memoizedProps,i.stateNode,e,r,a)}n&&Ri(t)}else t.stateNode=j(r,e,n,t)}return Di(t),null;case 13:if(st(gr),r=t.memoizedState,Vn&&null!==jn&&0!==(1&t.mode)&&0===(128&t.flags)){for(e=jn;e;)e=Ue(e);return Zn(),t.flags|=98560,t}if(null!==r&&null!==r.dehydrated){if(r=Qn(t),null===e){if(!r)throw Error(o(318));if(!Y)throw Error(o(344));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(317));We(e,t)}else Zn(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;return Di(t),null}return null!==Xn&&(To(Xn),Xn=null),0!==(128&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?Qn(t):n=null!==e.memoizedState,r&&!n&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&gr.current)?0===Za&&(Za=3):Oo())),null!==t.updateQueue&&(t.flags|=4),Di(t),null);case 4:return pr(),xi(e,t),null===e&&Q(t.stateNode.containerInfo),Di(t),null;case 10:return ln(t.type._context),Di(t),null;case 19:if(st(gr),null===(i=t.memoizedState))return Di(t),null;if(r=0!==(128&t.flags),null===(a=i.rendering))if(r)Ii(i,!1);else{if(0!==Za||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=vr(e))){for(t.flags|=128,Ii(i,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,r=t.child;null!==r;)i=e,(n=r).flags&=14680066,null===(a=n.alternate)?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,i=a.dependencies,n.dependencies=null===i?null:{lanes:i.lanes,firstContext:i.firstContext}),r=r.sibling;return lt(gr,1&gr.current|2),t.child}e=e.sibling}null!==i.tail&&Ft()>so&&(t.flags|=128,r=!0,Ii(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=vr(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),Ii(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!Vn)return Di(t),null}else 2*Ft()-i.renderingStartTime>so&&1073741824!==n&&(t.flags|=128,r=!0,Ii(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=i.last)?e.sibling=a:t.child=a,i.last=a)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ft(),t.sibling=null,e=gr.current,lt(gr,r?1&e|2:1&e),t):(Di(t),null);case 22:case 23:return Io(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&qa)&&(Di(t),$&&6&t.subtreeFlags&&(t.flags|=8192)):Di(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}var ki=s.ReactCurrentOwner,Oi=!1;function Ni(e,t,n,r){t.child=null===e?or(t,null,n,r):ar(t,e.child,n,r)}function Fi(e,t,n,r,i){n=n.render;var a=t.ref;return un(t,i),r=Ir(e,t,n,r,a,i),n=Dr(),null===e||Oi?(Vn&&n&&zn(t),t.flags|=1,Ni(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ia(e,t,i))}function Ui(e,t,n,r,i){if(null===e){var a=n.type;return"function"!==typeof a||Zo(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=ts(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,zi(e,t,a,r,i))}if(a=e.child,0===(e.lanes&i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:Qt)(o,r)&&e.ref===t.ref)return ia(e,t,i)}return t.flags|=1,(e=es(a,r)).ref=t.ref,e.return=t,t.child=e}function zi(e,t,n,r,i){if(null!==e&&Qt(e.memoizedProps,r)&&e.ref===t.ref){if(Oi=!1,0===(e.lanes&i))return t.lanes=e.lanes,ia(e,t,i);0!==(131072&e.flags)&&(Oi=!0)}return ji(e,t,n,r,i)}function Hi(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null},lt(Qa,qa),qa|=n;else{if(0===(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null},t.updateQueue=null,lt(Qa,qa),qa|=e,null;t.memoizedState={baseLanes:0,cachePool:null},r=null!==a?a.baseLanes:n,lt(Qa,qa),qa|=r}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,lt(Qa,qa),qa|=r;return Ni(e,t,i,n),t.child}function Gi(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ji(e,t,n,r,i){var a=ft(n)?ht:ut.current;return a=pt(t,a),un(t,i),n=Ir(e,t,n,r,a,i),r=Dr(),null===e||Oi?(Vn&&r&&zn(t),t.flags|=1,Ni(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ia(e,t,i))}function Vi(e,t,n,r,i){if(ft(n)){var a=!0;yt(t)}else a=!1;if(un(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),Mn(t,n,r),Tn(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,c=n.contextType;"object"===typeof c&&null!==c?c=dn(c):c=pt(t,c=ft(n)?ht:ut.current);var u=n.getDerivedStateFromProps,d="function"===typeof u||"function"===typeof o.getSnapshotBeforeUpdate;d||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||l!==c)&&Cn(t,o,r,c),pn=!1;var h=t.memoizedState;o.state=h,xn(t,r,o,i),l=t.memoizedState,s!==r||h!==l||dt.current||pn?("function"===typeof u&&(wn(t,n,u,r),l=t.memoizedState),(s=pn||An(t,n,s,r,h,l,c))?(d||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.flags|=4194308)):("function"===typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=s):("function"===typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,mn(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:en(t.type,s),o.props=c,d=t.pendingProps,h=o.context,"object"===typeof(l=n.contextType)&&null!==l?l=dn(l):l=pt(t,l=ft(n)?ht:ut.current);var p=n.getDerivedStateFromProps;(u="function"===typeof p||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==d||h!==l)&&Cn(t,o,r,l),pn=!1,h=t.memoizedState,o.state=h,xn(t,r,o,i);var f=t.memoizedState;s!==d||h!==f||dt.current||pn?("function"===typeof p&&(wn(t,n,p,r),f=t.memoizedState),(c=pn||An(t,n,c,r,h,f,l)||!1)?(u||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,f,l),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,f,l)),"function"===typeof o.componentDidUpdate&&(t.flags|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),o.props=r,o.state=f,o.context=l,r=c):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Wi(e,t,n,r,a,i)}function Wi(e,t,n,r,i,a){Gi(e,t);var o=0!==(128&t.flags);if(!r&&!o)return i&&bt(t,n,!1),ia(e,t,a);r=t.stateNode,ki.current=t;var s=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=ar(t,e.child,null,a),t.child=ar(t,null,s,a)):Ni(e,t,s,a),t.memoizedState=r.state,i&&bt(t,n,!0),t.child}function Xi(e){var t=e.stateNode;t.pendingContext?gt(0,t.pendingContext,t.pendingContext!==t.context):t.context&&gt(0,t.context,!1),hr(e,t.containerInfo)}function Ji(e,t,n,r,i){return Zn(),er(i),t.flags|=256,Ni(e,t,n,r),t.child}var $i={dehydrated:null,treeContext:null,retryLane:0};function Ki(e){return{baseLanes:e,cachePool:null}}function Yi(e,t,n){var r,i=t.pendingProps,a=gr.current,s=!1,l=0!==(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!==(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),lt(gr,1&a),null===e)return Yn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:Ne(e)?t.lanes=8:t.lanes=1073741824,null):(a=i.children,e=i.fallback,s?(i=t.mode,s=t.child,a={mode:"hidden",children:a},0===(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=a):s=rs(a,i,0,null),e=ns(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ki(n),t.memoizedState=$i,e):qi(t,a));if(null!==(a=e.memoizedState)){if(null!==(r=a.dehydrated)){if(l)return 256&t.flags?(t.flags&=-257,ea(e,t,n,Error(o(422)))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=i.fallback,a=t.mode,i=rs({mode:"visible",children:i.children},a,0,null),(s=ns(s,a,n,null)).flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,0!==(1&t.mode)&&ar(t,e.child,null,n),t.child.memoizedState=Ki(n),t.memoizedState=$i,s);if(0===(1&t.mode))t=ea(e,t,n,null);else if(Ne(r))t=ea(e,t,n,Error(o(419)));else if(i=0!==(n&e.childLanes),Oi||i){if(null!==(i=$a)){switch(n&-n){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}0!==(i=0!==(s&(i.suspendedLanes|n))?0:s)&&i!==a.retryLane&&(a.retryLane=i,wo(e,i,-1))}Oo(),t=ea(e,t,n,Error(o(421)))}else Oe(r)?(t.flags|=128,t.child=e.child,t=$o.bind(null,e),Fe(r,t),t=null):(n=a.treeContext,Y&&(jn=Ge(r),Gn=t,Vn=!0,Xn=null,Wn=!1,null!==n&&(Dn[Ln++]=On,Dn[Ln++]=Nn,Dn[Ln++]=kn,On=n.id,Nn=n.overflow,kn=t)),(t=qi(t,t.pendingProps.children)).flags|=4096);return t}return s?(i=Zi(e,t,i.children,i.fallback,n),s=t.child,a=e.child.memoizedState,s.memoizedState=null===a?Ki(n):{baseLanes:a.baseLanes|n,cachePool:null},s.childLanes=e.childLanes&~n,t.memoizedState=$i,i):(n=Qi(e,t,i.children,n),t.memoizedState=null,n)}return s?(i=Zi(e,t,i.children,i.fallback,n),s=t.child,a=e.child.memoizedState,s.memoizedState=null===a?Ki(n):{baseLanes:a.baseLanes|n,cachePool:null},s.childLanes=e.childLanes&~n,t.memoizedState=$i,i):(n=Qi(e,t,i.children,n),t.memoizedState=null,n)}function qi(e,t){return(t=rs({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Qi(e,t,n,r){var i=e.child;return e=i.sibling,n=es(i,{mode:"visible",children:n}),0===(1&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n}function Zi(e,t,n,r,i){var a=t.mode,o=(e=e.child).sibling,s={mode:"hidden",children:n};return 0===(1&a)&&t.child!==e?((n=t.child).childLanes=0,n.pendingProps=s,t.deletions=null):(n=es(e,s)).subtreeFlags=14680064&e.subtreeFlags,null!==o?r=es(o,r):(r=ns(r,a,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ea(e,t,n,r){return null!==r&&er(r),ar(t,e.child,null,n),(e=qi(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function ta(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),cn(e.return,t,n)}function na(e,t,n,r,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ra(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ni(e,t,r.children,n),0!==(2&(r=gr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ta(e,n,t);else if(19===e.tag)ta(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(lt(gr,r),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===vr(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),na(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===vr(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}na(t,!0,n,null,a);break;case"together":na(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ia(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),to|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=es(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=es(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function aa(e,t){switch(Hn(t),t.tag){case 1:return ft(t.type)&&mt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return pr(),st(dt),st(ut),br(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return mr(t),null;case 13:if(st(gr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));Zn()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return st(gr),null;case 4:return pr(),null;case 10:return ln(t.type._context),null;case 22:case 23:return Io(),null;default:return null}}var oa=!1,sa=!1,la="function"===typeof WeakSet?WeakSet:Set,ca=null;function ua(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){Wo(e,t,r)}else n.current=null}function da(e,t,n){try{n()}catch(r){Wo(e,t,r)}}var ha=!1;function pa(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&da(t,n,a)}i=i.next}while(i!==r)}}function fa(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ma(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=D(n);else e=n;"function"===typeof t?t(e):t.current=e}}function ga(e,t,n){if(Vt&&"function"===typeof Vt.onCommitFiberUnmount)try{Vt.onCommitFiberUnmount(jt,t)}catch(o){}switch(t.tag){case 0:case 11:case 14:case 15:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e=e.next;do{var i=r,a=i.destroy;i=i.tag,void 0!==a&&(0!==(2&i)||0!==(4&i))&&da(t,n,a),r=r.next}while(r!==e)}break;case 1:if(ua(t,n),"function"===typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(o){Wo(t,n,o)}break;case 5:ua(t,n);break;case 4:$?Ea(e,t,n):K&&K&&(t=t.stateNode.containerInfo,n=Ce(t),Pe(t,n))}}function va(e,t,n){for(var r=t;;)if(ga(e,r,n),null===r.child||$&&4===r.tag){if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}else r.child.return=r,r=r.child}function ya(e){var t=e.alternate;null!==t&&(e.alternate=null,ya(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&ee(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ba(e){return 5===e.tag||3===e.tag||4===e.tag}function xa(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ba(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function _a(e){if($){e:{for(var t=e.return;null!==t;){if(ba(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(n.tag){case 5:t=n.stateNode,32&n.flags&&(xe(t),n.flags&=-33),wa(e,n=xa(e),t);break;case 3:case 4:t=n.stateNode.containerInfo,Sa(e,n=xa(e),t);break;default:throw Error(o(161))}}}function Sa(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):he(n,e);else if(4!==r&&null!==(e=e.child))for(Sa(e,t,n),e=e.sibling;null!==e;)Sa(e,t,n),e=e.sibling}function wa(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ge(n,e,t):de(n,e);else if(4!==r&&null!==(e=e.child))for(wa(e,t,n),e=e.sibling;null!==e;)wa(e,t,n),e=e.sibling}function Ea(e,t,n){for(var r,i,a=t,s=!1;;){if(!s){s=a.return;e:for(;;){if(null===s)throw Error(o(160));switch(r=s.stateNode,s.tag){case 5:i=!1;break e;case 3:case 4:r=r.containerInfo,i=!0;break e}s=s.return}s=!0}if(5===a.tag||6===a.tag)va(e,a,n),i?be(r,a.stateNode):ye(r,a.stateNode);else if(18===a.tag)i?Ye(r,a.stateNode):Ke(r,a.stateNode);else if(4===a.tag){if(null!==a.child){r=a.stateNode.containerInfo,i=!0,a.child.return=a,a=a.child;continue}}else if(ga(e,a,n),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(s=!1)}a.sibling.return=a.return,a=a.sibling}}function Aa(e,t){if($){switch(t.tag){case 0:case 11:case 14:case 15:return pa(3,t,t.return),fa(3,t),void pa(5,t,t.return);case 1:case 12:case 17:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var i=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&me(n,a,i,e,r,t)}return;case 6:if(null===t.stateNode)throw Error(o(162));return n=t.memoizedProps,void pe(t.stateNode,null!==e?e.memoizedProps:n,n);case 3:return void(Y&&null!==e&&e.memoizedState.isDehydrated&&Je(t.stateNode.containerInfo));case 13:case 19:return void Ma(t)}throw Error(o(163))}switch(t.tag){case 0:case 11:case 14:case 15:return pa(3,t,t.return),fa(3,t),void pa(5,t,t.return);case 12:case 22:case 23:return;case 13:case 19:return void Ma(t);case 3:Y&&null!==e&&e.memoizedState.isDehydrated&&Je(t.stateNode.containerInfo)}e:if(K){switch(t.tag){case 1:case 5:case 6:break e;case 3:case 4:t=t.stateNode,Pe(t.containerInfo,t.pendingChildren);break e}throw Error(o(163))}}function Ma(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new la),t.forEach((function(t){var r=Ko.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Ca(e,t,n){ca=e,Ta(e,t,n)}function Ta(e,t,n){for(var r=0!==(1&e.mode);null!==ca;){var i=ca,a=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||oa;if(!o){var s=i.alternate,l=null!==s&&null!==s.memoizedState||sa;s=oa;var c=sa;if(oa=o,(sa=l)&&!c)for(ca=i;null!==ca;)l=(o=ca).child,22===o.tag&&null!==o.memoizedState?Ba(i):null!==l?(l.return=o,ca=l):Ba(i);for(;null!==a;)ca=a,Ta(a,t,n),a=a.sibling;ca=i,oa=s,sa=c}Ra(e)}else 0!==(8772&i.subtreeFlags)&&null!==a?(a.return=i,ca=a):Ra(e)}}function Ra(e){for(;null!==ca;){var t=ca;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:sa||fa(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!sa)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:en(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&_n(t,a,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:n=D(t.child.stateNode);break;case 1:n=t.child.stateNode}_n(t,s,n)}break;case 5:var l=t.stateNode;null===n&&4&t.flags&&fe(l,t.type,t.memoizedProps,t);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:break;case 13:if(Y&&null===t.memoizedState){var c=t.alternate;if(null!==c){var u=c.memoizedState;if(null!==u){var d=u.dehydrated;null!==d&&$e(d)}}}break;default:throw Error(o(163))}sa||512&t.flags&&ma(t)}catch(h){Wo(t,t.return,h)}}if(t===e){ca=null;break}if(null!==(n=t.sibling)){n.return=t.return,ca=n;break}ca=t.return}}function Pa(e){for(;null!==ca;){var t=ca;if(t===e){ca=null;break}var n=t.sibling;if(null!==n){n.return=t.return,ca=n;break}ca=t.return}}function Ba(e){for(;null!==ca;){var t=ca;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fa(4,t)}catch(l){Wo(t,n,l)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(l){Wo(t,i,l)}}var a=t.return;try{ma(t)}catch(l){Wo(t,a,l)}break;case 5:var o=t.return;try{ma(t)}catch(l){Wo(t,o,l)}}}catch(l){Wo(t,t.return,l)}if(t===e){ca=null;break}var s=t.sibling;if(null!==s){s.return=t.return,ca=s;break}ca=t.return}}var Ia=0,Da=1,La=2,ka=3,Oa=4;if("function"===typeof Symbol&&Symbol.for){var Na=Symbol.for;Ia=Na("selector.component"),Da=Na("selector.has_pseudo_class"),La=Na("selector.role"),ka=Na("selector.test_id"),Oa=Na("selector.text")}function Fa(e){var t=q(e);if(null!=t){if("string"!==typeof t.memoizedProps["data-testname"])throw Error(o(364));return t}if(null===(e=ie(e)))throw Error(o(362));return e.stateNode.current}function Ua(e,t){switch(t.$$typeof){case Ia:if(e.type===t.value)return!0;break;case Da:e:{t=t.value,e=[e,0];for(var n=0;n<e.length;){var r=e[n++],i=e[n++],a=t[i];if(5!==r.tag||!se(r)){for(;null!=a&&Ua(r,a);)a=t[++i];if(i===t.length){t=!0;break e}for(r=r.child;null!==r;)e.push(r,i),r=r.sibling}}t=!1}return t;case La:if(5===e.tag&&le(e.stateNode,t.value))return!0;break;case Oa:if((5===e.tag||6===e.tag)&&(null!==(e=oe(e))&&0<=e.indexOf(t.value)))return!0;break;case ka:if(5===e.tag&&("string"===typeof(e=e.memoizedProps["data-testname"])&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function za(e){switch(e.$$typeof){case Ia:return"<"+(w(e.value)||"Unknown")+">";case Da:return":has("+(za(e)||"")+")";case La:return'[role="'+e.value+'"]';case Oa:return'"'+e.value+'"';case ka:return'[data-testname="'+e.value+'"]';default:throw Error(o(365))}}function Ha(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],a=e[r++],o=t[a];if(5!==i.tag||!se(i)){for(;null!=o&&Ua(i,o);)o=t[++a];if(a===t.length)n.push(i);else for(i=i.child;null!==i;)e.push(i,a),i=i.sibling}}return n}function Ga(e,t){if(!re)throw Error(o(363));e=Ha(e=Fa(e),t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var r=e[n++];if(5===r.tag)se(r)||t.push(r.stateNode);else for(r=r.child;null!==r;)e.push(r),r=r.sibling}return t}var ja=Math.ceil,Va=s.ReactCurrentDispatcher,Wa=s.ReactCurrentOwner,Xa=s.ReactCurrentBatchConfig,Ja=0,$a=null,Ka=null,Ya=0,qa=0,Qa=ot(0),Za=0,eo=null,to=0,no=0,ro=0,io=null,ao=null,oo=0,so=1/0;function lo(){so=Ft()+500}var co,uo=!1,ho=null,po=null,fo=!1,mo=null,go=0,vo=0,yo=null,bo=-1,xo=0;function _o(){return 0!==(6&Ja)?Ft():-1!==bo?bo:bo=Ft()}function So(e){return 0===(1&e.mode)?1:0!==(2&Ja)&&0!==Ya?Ya&-Ya:null!==qt.transition?(0===xo&&(e=wt,0===(4194240&(wt<<=1))&&(wt=64),xo=e),xo):0!==(e=It)?e:Z()}function wo(e,t,n){if(50<vo)throw vo=0,yo=null,Error(o(185));var r=Eo(e,t);return null===r?null:(Pt(r,t,n),0!==(2&Ja)&&r===$a||(r===$a&&(0===(2&Ja)&&(no|=t),4===Za&&Ro(r,Ya)),Ao(r,n),1===t&&0===Ja&&0===(1&e.mode)&&(lo(),Jt&&Yt())),r)}function Eo(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function Ao(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-xt(a),s=1<<o,l=i[o];-1===l?0!==(s&n)&&0===(s&r)||(i[o]=Ct(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}}(e,t);var r=Mt(e,e===$a?Ya:0);if(0===r)null!==n&&kt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&kt(n),1===t)0===e.tag?function(e){Jt=!0,Kt(e)}(Po.bind(null,e)):Kt(Po.bind(null,e)),te?ne((function(){0===Ja&&Yt()})):Lt(Ut,Yt),n=null;else{switch(Dt(r)){case 1:n=Ut;break;case 4:n=zt;break;case 16:default:n=Ht;break;case 536870912:n=Gt}n=Yo(n,Mo.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Mo(e,t){if(bo=-1,xo=0,0!==(6&Ja))throw Error(o(327));var n=e.callbackNode;if(jo()&&e.callbackNode!==n)return null;var r=Mt(e,e===$a?Ya:0);if(0===r)return null;if(0!==(30&r)||0!==(r&e.expiredLanes)||t)t=No(e,r);else{t=r;var i=Ja;Ja|=2;var a=ko();for($a===e&&Ya===t||(lo(),Do(e,t));;)try{Uo();break}catch(l){Lo(e,l)}on(),Va.current=a,Ja=i,null!==Ka?t=0:($a=null,Ya=0,t=Za)}if(0!==t){if(2===t&&(0!==(i=Tt(e))&&(r=i,t=Co(e,i))),1===t)throw n=eo,Do(e,0),Ro(e,r),Ao(e,Ft()),n;if(6===t)Ro(e,r);else{if(i=e.current.alternate,0===(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Wt(a(),i))return!1}catch(s){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=No(e,r))&&(0!==(a=Tt(e))&&(r=a,t=Co(e,a))),1===t))throw n=eo,Do(e,0),Ro(e,r),Ao(e,Ft()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(o(345));case 2:case 5:Go(e,ao);break;case 3:if(Ro(e,r),(130023424&r)===r&&10<(t=oo+500-Ft())){if(0!==Mt(e,0))break;if(((i=e.suspendedLanes)&r)!==r){_o(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=V(Go.bind(null,e,ao),t);break}Go(e,ao);break;case 4:if(Ro(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-xt(r);a=1<<s,(s=t[s])>i&&(i=s),r&=~a}if(r=i,10<(r=(120>(r=Ft()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ja(r/1960))-r)){e.timeoutHandle=V(Go.bind(null,e,ao),r);break}Go(e,ao);break;default:throw Error(o(329))}}}return Ao(e,Ft()),e.callbackNode===n?Mo.bind(null,e):null}function Co(e,t){var n=io;return e.current.memoizedState.isDehydrated&&(Do(e,t).flags|=256),2!==(e=No(e,t))&&(t=ao,ao=n,null!==t&&To(t)),e}function To(e){null===ao?ao=e:ao.push.apply(ao,e)}function Ro(e,t){for(t&=~ro,t&=~no,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-xt(t),r=1<<n;e[n]=-1,t&=~r}}function Po(e){if(0!==(6&Ja))throw Error(o(327));jo();var t=Mt(e,0);if(0===(1&t))return Ao(e,Ft()),null;var n=No(e,t);if(0!==e.tag&&2===n){var r=Tt(e);0!==r&&(t=r,n=Co(e,r))}if(1===n)throw n=eo,Do(e,0),Ro(e,t),Ao(e,Ft()),n;if(6===n)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Go(e,ao),Ao(e,Ft()),null}function Bo(e){null!==mo&&0===mo.tag&&0===(6&Ja)&&jo();var t=Ja;Ja|=1;var n=Xa.transition,r=It;try{if(Xa.transition=null,It=1,e)return e()}finally{It=r,Xa.transition=n,0===(6&(Ja=t))&&Yt()}}function Io(){qa=Qa.current,st(Qa)}function Do(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==X&&(e.timeoutHandle=X,W(n)),null!==Ka)for(n=Ka.return;null!==n;){var r=n;switch(Hn(r),r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&mt();break;case 3:pr(),st(dt),st(ut),br();break;case 5:mr(r);break;case 4:pr();break;case 13:case 19:st(gr);break;case 10:ln(r.type._context);break;case 22:case 23:Io()}n=n.return}if($a=e,Ka=e=es(e.current,null),Ya=qa=t,Za=0,eo=null,ro=no=to=0,ao=io=null,null!==hn){for(t=0;t<hn.length;t++)if(null!==(r=(n=hn[t]).interleaved)){n.interleaved=null;var i=r.next,a=n.pending;if(null!==a){var o=a.next;a.next=i,r.next=o}n.pending=r}hn=null}return e}function Lo(e,t){for(;;){var n=Ka;try{if(on(),xr.current=pi,Mr){for(var r=wr.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}Mr=!1}if(Sr=0,Ar=Er=wr=null,Cr=!1,Tr=0,Wa.current=null,null===n||null===n.return){Za=1,eo=t,Ka=null;break}e:{var a=e,s=n.return,l=n,c=t;if(t=Ya,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var u=c,d=l,h=d.tag;if(0===(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=Ci(s);if(null!==f){f.flags&=-257,Ti(f,s,l,0,t),1&f.mode&&Mi(a,u,t),c=u;var m=(t=f).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(0===(1&t)){Mi(a,u,t),Oo();break e}c=Error(o(426))}else if(Vn&&1&l.mode){var v=Ci(s);if(null!==v){0===(65536&v.flags)&&(v.flags|=256),Ti(v,s,l,0,t),er(c);break e}}a=c,4!==Za&&(Za=2),null===io?io=[a]:io.push(a),c=vi(c,l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t,bn(l,Ei(0,c,t));break e;case 1:a=c;var y=l.type,b=l.stateNode;if(0===(128&l.flags)&&("function"===typeof y.getDerivedStateFromError||null!==b&&"function"===typeof b.componentDidCatch&&(null===po||!po.has(b)))){l.flags|=65536,t&=-t,l.lanes|=t,bn(l,Ai(l,a,t));break e}}l=l.return}while(null!==l)}Ho(n)}catch(x){t=x,Ka===n&&null!==n&&(Ka=n=n.return);continue}break}}function ko(){var e=Va.current;return Va.current=pi,null===e?pi:e}function Oo(){0!==Za&&3!==Za&&2!==Za||(Za=4),null===$a||0===(268435455&to)&&0===(268435455&no)||Ro($a,Ya)}function No(e,t){var n=Ja;Ja|=2;var r=ko();for($a===e&&Ya===t||Do(e,t);;)try{Fo();break}catch(i){Lo(e,i)}if(on(),Ja=n,Va.current=r,null!==Ka)throw Error(o(261));return $a=null,Ya=0,Za}function Fo(){for(;null!==Ka;)zo(Ka)}function Uo(){for(;null!==Ka&&!Ot();)zo(Ka)}function zo(e){var t=co(e.alternate,e,qa);e.memoizedProps=e.pendingProps,null===t?Ho(e):Ka=t,Wa.current=null}function Ho(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=Li(n,t,qa)))return void(Ka=n)}else{if(null!==(n=aa(n,t)))return n.flags&=32767,void(Ka=n);if(null===e)return Za=6,void(Ka=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Ka=t);Ka=t=e}while(null!==t);0===Za&&(Za=5)}function Go(e,t){var n=It,r=Xa.transition;try{Xa.transition=null,It=1,function(e,t,n){do{jo()}while(null!==mo);if(0!==(6&Ja))throw Error(o(327));var r=e.finishedWork,i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-xt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}(e,a),e===$a&&(Ka=$a=null,Ya=0),0===(2064&r.subtreeFlags)&&0===(2064&r.flags)||fo||(fo=!0,Yo(Ht,(function(){return jo(),null}))),a=0!==(15990&r.flags),0!==(15990&r.subtreeFlags)||a){a=Xa.transition,Xa.transition=null;var s=It;It=1;var l=Ja;Ja|=4,Wa.current=null,function(e,t){for(O(e.containerInfo),ca=t;null!==ca;)if(t=(e=ca).child,0!==(1028&e.subtreeFlags)&&null!==t)t.return=e,ca=t;else for(;null!==ca;){e=ca;try{var n=e.alternate;if(0!==(1024&e.flags))switch(e.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==n){var r=n.memoizedProps,i=n.memoizedState,a=e.stateNode,s=a.getSnapshotBeforeUpdate(e.elementType===e.type?r:en(e.type,r),i);a.__reactInternalSnapshotBeforeUpdate=s}break;case 3:$&&Ae(e.stateNode.containerInfo);break;default:throw Error(o(163))}}catch(l){Wo(e,e.return,l)}if(null!==(t=e.sibling)){t.return=e.return,ca=t;break}ca=e.return}n=ha,ha=!1}(e,r),function(e,t){for(ca=t;null!==ca;){var n=(t=ca).deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e;$?Ea(a,i,t):va(a,i,t);var o=i.alternate;null!==o&&(o.return=null),i.return=null}catch(_){Wo(i,t,_)}}if(n=t.child,0!==(12854&t.subtreeFlags)&&null!==n)n.return=t,ca=n;else for(;null!==ca;){t=ca;try{var s=t.flags;if(32&s&&$&&xe(t.stateNode),512&s){var l=t.alternate;if(null!==l){var c=l.ref;null!==c&&("function"===typeof c?c(null):c.current=null)}}if(8192&s)switch(t.tag){case 13:if(null!==t.memoizedState){var u=t.alternate;null!==u&&null!==u.memoizedState||(oo=Ft())}break;case 22:var d=null!==t.memoizedState,h=t.alternate,p=null!==h&&null!==h.memoizedState;if(n=t,$)e:if(r=n,i=d,a=null,$)for(var f=r;;){if(5===f.tag){if(null===a){a=f;var m=f.stateNode;i?_e(m):we(f.stateNode,f.memoizedProps)}}else if(6===f.tag){if(null===a){var g=f.stateNode;i?Se(g):Ee(g,f.memoizedProps)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===r)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===r)break;for(;null===f.sibling;){if(null===f.return||f.return===r)break e;a===f&&(a=null),f=f.return}a===f&&(a=null),f.sibling.return=f.return,f=f.sibling}if(d&&!p&&0!==(1&n.mode)){ca=n;for(var v=n.child;null!==v;){for(n=ca=v;null!==ca;){var y=(r=ca).child;switch(r.tag){case 0:case 11:case 14:case 15:pa(4,r,r.return);break;case 1:ua(r,r.return);var b=r.stateNode;if("function"===typeof b.componentWillUnmount){var x=r.return;try{b.props=r.memoizedProps,b.state=r.memoizedState,b.componentWillUnmount()}catch(_){Wo(r,x,_)}}break;case 5:ua(r,r.return);break;case 22:if(null!==r.memoizedState){Pa(n);continue}}null!==y?(y.return=r,ca=y):Pa(n)}v=v.sibling}}}switch(4102&s){case 2:_a(t),t.flags&=-3;break;case 6:_a(t),t.flags&=-3,Aa(t.alternate,t);break;case 4096:t.flags&=-4097;break;case 4100:t.flags&=-4097,Aa(t.alternate,t);break;case 4:Aa(t.alternate,t)}}catch(_){Wo(t,t.return,_)}if(null!==(n=t.sibling)){n.return=t.return,ca=n;break}ca=t.return}}}(e,r),N(e.containerInfo),e.current=r,Ca(r,e,i),Nt(),Ja=l,It=s,Xa.transition=a}else e.current=r;if(fo&&(fo=!1,mo=e,go=i),a=e.pendingLanes,0===a&&(po=null),function(e){if(Vt&&"function"===typeof Vt.onCommitFiberRoot)try{Vt.onCommitFiberRoot(jt,e,void 0,128===(128&e.current.flags))}catch(t){}}(r.stateNode),Ao(e,Ft()),null!==t)for(n=e.onRecoverableError,r=0;r<t.length;r++)n(t[r]);if(uo)throw uo=!1,e=ho,ho=null,e;0!==(1&go)&&0!==e.tag&&jo(),a=e.pendingLanes,0!==(1&a)?e===yo?vo++:(vo=0,yo=e):vo=0,Yt()}(e,t,n)}finally{Xa.transition=r,It=n}return null}function jo(){if(null!==mo){var e=Dt(go),t=Xa.transition,n=It;try{if(Xa.transition=null,It=16>e?16:e,null===mo)var r=!1;else{if(e=mo,mo=null,go=0,0!==(6&Ja))throw Error(o(331));var i=Ja;for(Ja|=4,ca=e.current;null!==ca;){var a=ca,s=a.child;if(0!==(16&ca.flags)){var l=a.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(ca=u;null!==ca;){var d=ca;switch(d.tag){case 0:case 11:case 15:pa(8,d,a)}var h=d.child;if(null!==h)h.return=d,ca=h;else for(;null!==ca;){var p=(d=ca).sibling,f=d.return;if(ya(d),d===u){ca=null;break}if(null!==p){p.return=f,ca=p;break}ca=f}}}var m=a.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}ca=a}}if(0!==(2064&a.subtreeFlags)&&null!==s)s.return=a,ca=s;else e:for(;null!==ca;){if(0!==(2048&(a=ca).flags))switch(a.tag){case 0:case 11:case 15:pa(9,a,a.return)}var y=a.sibling;if(null!==y){y.return=a.return,ca=y;break e}ca=a.return}}var b=e.current;for(ca=b;null!==ca;){var x=(s=ca).child;if(0!==(2064&s.subtreeFlags)&&null!==x)x.return=s,ca=x;else e:for(s=b;null!==ca;){if(0!==(2048&(l=ca).flags))try{switch(l.tag){case 0:case 11:case 15:fa(9,l)}}catch(S){Wo(l,l.return,S)}if(l===s){ca=null;break e}var _=l.sibling;if(null!==_){_.return=l.return,ca=_;break e}ca=l.return}}if(Ja=i,Yt(),Vt&&"function"===typeof Vt.onPostCommitFiberRoot)try{Vt.onPostCommitFiberRoot(jt,e)}catch(S){}r=!0}return r}finally{It=n,Xa.transition=t}}return!1}function Vo(e,t,n){vn(e,t=Ei(0,t=vi(n,t),1)),t=_o(),null!==(e=Eo(e,1))&&(Pt(e,1,t),Ao(e,t))}function Wo(e,t,n){if(3===e.tag)Vo(e,e,n);else for(;null!==t;){if(3===t.tag){Vo(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===po||!po.has(r))){vn(t,e=Ai(t,e=vi(n,e),1)),e=_o(),null!==(t=Eo(t,1))&&(Pt(t,1,e),Ao(t,e));break}}t=t.return}}function Xo(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=_o(),e.pingedLanes|=e.suspendedLanes&n,$a===e&&(Ya&n)===n&&(4===Za||3===Za&&(130023424&Ya)===Ya&&500>Ft()-oo?Do(e,0):ro|=n),Ao(e,t)}function Jo(e,t){0===t&&(0===(1&e.mode)?t=1:(t=Et,0===(130023424&(Et<<=1))&&(Et=4194304)));var n=_o();null!==(e=Eo(e,t))&&(Pt(e,t,n),Ao(e,n))}function $o(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Jo(e,n)}function Ko(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(o(314))}null!==r&&r.delete(t),Jo(e,n)}function Yo(e,t){return Lt(e,t)}function qo(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 Qo(e,t,n,r){return new qo(e,t,n,r)}function Zo(e){return!(!(e=e.prototype)||!e.isReactComponent)}function es(e,t){var n=e.alternate;return null===n?((n=Qo(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ts(e,t,n,r,i,a){var s=2;if(r=e,"function"===typeof e)Zo(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case u:return ns(n.children,i,a,t);case d:s=8,i|=8;break;case h:return(e=Qo(12,n,t,2|i)).elementType=h,e.lanes=a,e;case g:return(e=Qo(13,n,t,i)).elementType=g,e.lanes=a,e;case v:return(e=Qo(19,n,t,i)).elementType=v,e.lanes=a,e;case x:return rs(n,i,a,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case p:s=10;break e;case f:s=9;break e;case m:s=11;break e;case y:s=14;break e;case b:s=16,r=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Qo(s,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function ns(e,t,n,r){return(e=Qo(7,e,r,t)).lanes=n,e}function rs(e,t,n,r){return(e=Qo(22,e,r,t)).elementType=x,e.lanes=n,e.stateNode={},e}function is(e,t,n){return(e=Qo(6,e,null,t)).lanes=n,e}function as(e,t,n){return(t=Qo(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function os(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=X,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rt(0),this.expirationTimes=Rt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rt(0),this.identifierPrefix=r,this.onRecoverableError=i,Y&&(this.mutableSourceEagerHydrationData=null)}function ss(e,t,n,r,i,a,o,s,l){return e=new os(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Qo(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null},fn(a),e}function ls(e){if(!e)return ct;e:{if(A(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ft(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(ft(n))return vt(e,n,t)}return t}function cs(e){var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return null===(e=T(t))?null:e.stateNode}function us(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function ds(e,t){us(e,t),(e=e.alternate)&&us(e,t)}function hs(e){return null===(e=T(e))?null:e.stateNode}function ps(){return null}return co=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||dt.current)Oi=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return Oi=!1,function(e,t,n){switch(t.tag){case 3:Xi(t),Zn();break;case 5:fr(t);break;case 1:ft(t.type)&&yt(t);break;case 4:hr(t,t.stateNode.containerInfo);break;case 10:sn(0,t.type._context,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(lt(gr,1&gr.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Yi(e,t,n):(lt(gr,1&gr.current),null!==(e=ia(e,t,n))?e.sibling:null);lt(gr,1&gr.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(128&e.flags)){if(r)return ra(e,t,n);t.flags|=128}var i=t.memoizedState;if(null!==i&&(i.rendering=null,i.tail=null,i.lastEffect=null),lt(gr,gr.current),r)break;return null;case 22:case 23:return t.lanes=0,Hi(e,t,n)}return ia(e,t,n)}(e,t,n);Oi=0!==(131072&e.flags)}else Oi=!1,Vn&&0!==(1048576&t.flags)&&Un(t,In,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps;var i=pt(t,ut.current);un(t,n),i=Ir(null,t,r,e,i,n);var a=Dr();return t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ft(r)?(a=!0,yt(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,fn(t),i.updater=En,t.stateNode=i,i._reactInternals=t,Tn(t,r,e,n),t=Wi(null,t,r,!0,a,n)):(t.tag=0,Vn&&a&&zn(t),Ni(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"===typeof e)return Zo(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===m)return 11;if(e===y)return 14}return 2}(r),e=en(r,e),i){case 0:t=ji(null,t,r,e,n);break e;case 1:t=Vi(null,t,r,e,n);break e;case 11:t=Fi(null,t,r,e,n);break e;case 14:t=Ui(null,t,r,en(r.type,e),n);break e}throw Error(o(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,ji(e,t,r,i=t.elementType===r?i:en(r,i),n);case 1:return r=t.type,i=t.pendingProps,Vi(e,t,r,i=t.elementType===r?i:en(r,i),n);case 3:e:{if(Xi(t),null===e)throw Error(o(387));r=t.pendingProps,i=(a=t.memoizedState).element,mn(e,t),xn(t,r,null,n);var s=t.memoizedState;if(r=s.element,Y&&a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Ji(e,t,r,n,i=Error(o(423)));break e}if(r!==i){t=Ji(e,t,r,n,i=Error(o(424)));break e}for(Y&&(jn=He(t.stateNode.containerInfo),Gn=t,Vn=!0,Xn=null,Wn=!1),n=or(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Zn(),r===i){t=ia(e,t,n);break e}Ni(e,t,r,n)}t=t.child}return t;case 5:return fr(t),null===e&&Yn(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,G(r,i)?s=null:null!==a&&G(r,a)&&(t.flags|=32),Gi(e,t),Ni(e,t,s,n),t.child;case 6:return null===e&&Yn(t),null;case 13:return Yi(e,t,n);case 4:return hr(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ar(t,null,r,n):Ni(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Fi(e,t,r,i=t.elementType===r?i:en(r,i),n);case 7:return Ni(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ni(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,sn(0,r,s=i.value),null!==a)if(Wt(a.value,s)){if(a.children===i.children&&!dt.current){t=ia(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var c=l.firstContext;null!==c;){if(c.context===r){if(1===a.tag){(c=gn(-1,n&-n)).tag=2;var u=a.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,null!==(c=a.alternate)&&(c.lanes|=n),cn(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(o(341));s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),cn(s,n,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}Ni(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,un(t,n),r=r(i=dn(i)),t.flags|=1,Ni(e,t,r,n),t.child;case 14:return i=en(r=t.type,t.pendingProps),Ui(e,t,r,i=en(r.type,i),n);case 15:return zi(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:en(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,ft(r)?(e=!0,yt(t)):e=!1,un(t,n),Mn(t,r,i),Tn(t,r,i,n),Wi(null,t,r,!0,e,n);case 19:return ra(e,t,n);case 22:return Hi(e,t,n)}throw Error(o(156,t.tag))},t.attemptContinuousHydration=function(e){13===e.tag&&(wo(e,134217728,_o()),ds(e,134217728))},t.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag){var t=_o(),n=So(e);wo(e,n,t),ds(e,n)}},t.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=At(t.pendingLanes);0!==n&&(Bt(t,1|n),Ao(t,Ft()),0===(6&Ja)&&(lo(),Yt()))}break;case 13:var r=_o();Bo((function(){return wo(e,1,r)})),ds(e,1)}},t.batchedUpdates=function(e,t){var n=Ja;Ja|=1;try{return e(t)}finally{0===(Ja=n)&&(lo(),Jt&&Yt())}},t.createComponentSelector=function(e){return{$$typeof:Ia,value:e}},t.createContainer=function(e,t,n,r,i,a,o){return ss(e,t,!1,null,0,r,0,a,o)},t.createHasPseudoClassSelector=function(e){return{$$typeof:Da,value:e}},t.createHydrationContainer=function(e,t,n,r,i,a,o,s,l){return(e=ss(n,r,!0,e,0,a,0,s,l)).context=ls(null),n=e.current,(a=gn(r=_o(),i=So(n))).callback=void 0!==t&&null!==t?t:null,vn(n,a),e.current.lanes=i,Pt(e,i,r),Ao(e,r),e},t.createPortal=function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:c,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}},t.createRoleSelector=function(e){return{$$typeof:La,value:e}},t.createTestNameSelector=function(e){return{$$typeof:ka,value:e}},t.createTextSelector=function(e){return{$$typeof:Oa,value:e}},t.deferredUpdates=function(e){var t=It,n=Xa.transition;try{return Xa.transition=null,It=16,e()}finally{It=t,Xa.transition=n}},t.discreteUpdates=function(e,t,n,r,i){var a=It,o=Xa.transition;try{return Xa.transition=null,It=1,e(t,n,r,i)}finally{It=a,Xa.transition=o,0===Ja&&lo()}},t.findAllNodes=Ga,t.findBoundingRects=function(e,t){if(!re)throw Error(o(363));t=Ga(e,t),e=[];for(var n=0;n<t.length;n++)e.push(ae(t[n]));for(t=e.length-1;0<t;t--)for(var r=(n=e[t]).x,i=r+n.width,a=n.y,s=a+n.height,l=t-1;0<=l;l--)if(t!==l){var c=e[l],u=c.x,d=u+c.width,h=c.y,p=h+c.height;if(r>=u&&a>=h&&i<=d&&s<=p){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||p<a||h>s)){h>a&&(c.height+=h-a,c.y=a),p<s&&(c.height=s-h),e.splice(t,1);break}if(!(a!==h||n.height!==c.height||d<r||u>i)){u>r&&(c.width+=u-r,c.x=r),d<i&&(c.width=i-u),e.splice(t,1);break}}return e},t.findHostInstance=cs,t.findHostInstanceWithNoPortals=function(e){return null===(e=null!==(e=C(e))?P(e):null)?null:e.stateNode},t.findHostInstanceWithWarning=function(e){return cs(e)},t.flushControlled=function(e){var t=Ja;Ja|=1;var n=Xa.transition,r=It;try{Xa.transition=null,It=1,e()}finally{It=r,Xa.transition=n,0===(Ja=t)&&(lo(),Yt())}},t.flushPassiveEffects=jo,t.flushSync=Bo,t.focusWithin=function(e,t){if(!re)throw Error(o(363));for(t=Ha(e=Fa(e),t),t=Array.from(t),e=0;e<t.length;){var n=t[e++];if(!se(n)){if(5===n.tag&&ce(n.stateNode))return!0;for(n=n.child;null!==n;)t.push(n),n=n.sibling}}return!1},t.getCurrentUpdatePriority=function(){return It},t.getFindAllNodesFailureDescription=function(e,t){if(!re)throw Error(o(363));var n=0,r=[];e=[Fa(e),0];for(var i=0;i<e.length;){var a=e[i++],s=e[i++],l=t[s];if((5!==a.tag||!se(a))&&(Ua(a,l)&&(r.push(za(l)),++s>n&&(n=s)),s<t.length))for(a=a.child;null!==a;)e.push(a,s),a=a.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(za(t[n]));return"findAllNodes was able to match part of the selector:\n  "+r.join(" > ")+"\n\nNo matching component was found for:\n  "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?D(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:hs,findFiberByHostInstance:e.findFiberByHostInstance||ps,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},"undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{jt=t.inject(e),Vt=t}catch(n){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!re)throw Error(o(363));e=Ga(e,t);var i=ue(e,n,r).disconnect;return{disconnect:function(){i()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=It;try{return It=e,t()}finally{It=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var i=t.current,a=_o(),o=So(i);return n=ls(n),null===t.context?t.context=n:t.pendingContext=n,(t=gn(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),vn(i,t),null!==(e=wo(i,o,a))&&yn(e,i,o),o},t}},7205:(e,t,n)=>{"use strict";e.exports=n(7302)},2016:(e,t,n)=>{"use strict";e.exports=n(6958)},1153:(e,t,n)=>{"use strict";var r=n(5043),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,r)&&!l.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:u,props:a,_owner:s.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},4202:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)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,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var x=b.prototype=new y;x.constructor=b,m(x,v.prototype),x.isPureReactComponent=!0;var _=Array.isArray,S=Object.prototype.hasOwnProperty,w={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function A(e,t,r){var i,a={},o=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)S.call(t,i)&&!E.hasOwnProperty(i)&&(a[i]=t[i]);var l=arguments.length-2;if(1===l)a.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===a[i]&&(a[i]=l[i]);return{$$typeof:n,type:e,key:o,ref:s,props:a,_owner:w.current}}function M(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var C=/\/+/g;function T(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function R(e,t,i,a,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return o=o(l=e),e=""===a?"."+T(l,0):a,_(o)?(i="",null!=e&&(i=e.replace(C,"$&/")+"/"),R(o,t,i,"",(function(e){return e}))):null!=o&&(M(o)&&(o=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,i+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(C,"$&/")+"/")+e)),t.push(o)),1;if(l=0,a=""===a?".":a+":",_(e))for(var c=0;c<e.length;c++){var u=a+T(s=e[c],c);l+=R(s,t,i,u,o)}else if(u=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"===typeof u)for(e=u.call(e),c=0;!(s=e.next()).done;)l+=R(s=s.value,t,i,u=a+T(s,c++),o);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function P(e,t,n){if(null==e)return e;var r=[],i=0;return R(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function B(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I={current:null},D={transition:null},L={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:D,ReactCurrentOwner:w};function k(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:P,forEach:function(e,t,n){P(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!M(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=i,t.Profiler=o,t.PureComponent=b,t.StrictMode=a,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,t.act=k,t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=m({},e.props),a=e.key,o=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,s=w.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)S.call(t,c)&&!E.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];i.children=l}return{$$typeof:n,type:e.type,key:a,ref:o,props:i,_owner:s}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=A,t.createFactory=function(e){var t=A.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=M,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:B}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},t.unstable_act=k,t.useCallback=function(e,t){return I.current.useCallback(e,t)},t.useContext=function(e){return I.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return I.current.useDeferredValue(e)},t.useEffect=function(e,t){return I.current.useEffect(e,t)},t.useId=function(){return I.current.useId()},t.useImperativeHandle=function(e,t,n){return I.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return I.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return I.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return I.current.useMemo(e,t)},t.useReducer=function(e,t,n){return I.current.useReducer(e,t,n)},t.useRef=function(e){return I.current.useRef(e)},t.useState=function(e){return I.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return I.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return I.current.useTransition()},t.version="18.3.1"},5043:(e,t,n)=>{"use strict";e.exports=n(4202)},579:(e,t,n)=>{"use strict";e.exports=n(1153)},7234:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<a(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>a(l,n))c<i&&0>a(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<i&&0>a(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,h=null,p=3,f=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=r(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function _(e){if(g=!1,x(e),!m)if(null!==r(c))m=!0,D(S);else{var t=r(u);null!==t&&L(_,t.startTime-e)}}function S(e,n){m=!1,g&&(g=!1,y(M),M=-1),f=!0;var a=p;try{for(x(n),h=r(c);null!==h&&(!(h.expirationTime>n)||e&&!R());){var o=h.callback;if("function"===typeof o){h.callback=null,p=h.priorityLevel;var s=o(h.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?h.callback=s:h===r(c)&&i(c),x(n)}else i(c);h=r(c)}if(null!==h)var l=!0;else{var d=r(u);null!==d&&L(_,d.startTime-n),l=!1}return l}finally{h=null,p=a,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var w,E=!1,A=null,M=-1,C=5,T=-1;function R(){return!(t.unstable_now()-T<C)}function P(){if(null!==A){var e=t.unstable_now();T=e;var n=!0;try{n=A(!0,e)}finally{n?w():(E=!1,A=null)}}else E=!1}if("function"===typeof b)w=function(){b(P)};else if("undefined"!==typeof MessageChannel){var B=new MessageChannel,I=B.port2;B.port1.onmessage=P,w=function(){I.postMessage(null)}}else w=function(){v(P,0)};function D(e){A=e,E||(E=!0,w())}function L(e,n){M=v((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,D(S))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,i,a){var o=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?o+a:o:a=o,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(e.sortIndex=a,n(u,e),null===r(c)&&e===r(u)&&(g?(y(M),M=-1):g=!0,L(_,a-o))):(e.sortIndex=s,n(c,e),m||f||(m=!0,D(S))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},8853:(e,t,n)=>{"use strict";e.exports=n(7234)},692:(e,t,n)=>{"use strict";var r=n(7974),i=n(6533),a=n(6927),o=n(8431);function s(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e}e.exports=function(e,t,n){if(!o(e))return e;if(Array.isArray(t)&&(t=[].concat.apply([],t).join(".")),"string"!==typeof t)return e;for(var l=r(t,{sep:".",brackets:!0}).filter(s),c=l.length,u=-1,d=e;++u<c;){var h=l[u];u===c-1?a(d[h])&&a(n)?d[h]=i({},d[h],n):d[h]=n:(o(d[h])||(d[h]={}),d=d[h])}return e}},8431:e=>{"use strict";e.exports=function(e){return"undefined"!==typeof e&&null!==e&&("object"===typeof e||"function"===typeof e)}},7324:e=>{e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<a.length;l++){var c=a[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(i=n?n.call(r,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},7974:(e,t,n)=>{"use strict";var r=n(6307);function i(e,t,n,r){var a=e.indexOf(t,n);return"\\"===e.charAt(a-1)?i(e,t,a+1):a}function a(e,t){return!0===t.keepDoubleQuotes&&'"'===e||(!0===t.keepSingleQuotes&&"'"===e||t.keepQuotes)}function o(e,t,n){return"function"===typeof e.keepEscaping?e.keepEscaping(t,n):!0===e.keepEscaping||"\\"===t[n+1]}e.exports=function(e,t,n){if("string"!==typeof e)throw new TypeError("expected a string");"function"===typeof t&&(n=t,t=null),"string"===typeof t&&(t={sep:t});var s,l=r({sep:"."},t),c=l.quotes||['"',"'","`"];!0===l.brackets?s={"<":">","(":")","[":"]","{":"}"}:l.brackets&&(s=l.brackets);var u,d=[],h=[],p=[""],f=l.sep,m=e.length,g=-1;function v(){if(s&&h.length)return s[h[h.length-1]]}for(;++g<m;){var y=e[g],b=e[g+1],x={val:y,idx:g,arr:p,str:e};if(d.push(x),"\\"!==y){if(s&&s[y]){h.push(y);var _=v(),S=g+1;if(-1!==e.indexOf(_,S+1))for(;h.length&&S<m;){var w=e[++S];if("\\"!==w)if(-1===c.indexOf(w)){if(_=v(),h.length&&-1===e.indexOf(_,S+1))break;s[w]?h.push(w):_===w&&h.pop()}else S=i(e,w,S+1);else w++}if(-1===(u=S)){p[p.length-1]+=y;continue}y=e.slice(g,u+1),x.val=y,x.idx=g=u}if(-1!==c.indexOf(y)){if(-1===(u=i(e,y,g+1))){p[p.length-1]+=y;continue}y=!0===a(y,l)?e.slice(g,u+1):e.slice(g+1,u),x.val=y,x.idx=g=u}"function"===typeof n&&(n(x,d),y=x.val,g=x.idx),x.val!==f||!1===x.split?p[p.length-1]+=x.val:p.push("")}else x.val=!0===o(l,e,g)?y+b:b,x.escaped=!0,"function"===typeof n&&n(x),p[p.length-1]+=x.val,g++}return p}},6307:(e,t,n)=>{"use strict";var r=n(9959),i=n(1273);function a(e,t){for(var n in t)c(t,n)&&(e[n]=t[n])}function o(e){return e&&"string"===typeof e}function s(e){var t={};for(var n in e)t[n]=e[n];return t}function l(e){return e&&"object"===typeof e||r(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=Object.assign||function(e){if(null===e||"undefined"===typeof e)throw new TypeError("Cannot convert undefined or null to object");l(e)||(e={});for(var t=1;t<arguments.length;t++){var n=arguments[t];o(n)&&(n=s(n)),l(n)&&(a(e,n),i(e,n))}return e}},1844:e=>{e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},2829:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"\u062d\u0648\u0644","governance":"\u0625\u062f\u0627\u0631\u0629","careers":"\u0648\u0638\u0627\u0626\u0641","buttonLogIn":"\u062a\u0633\u062c\u064a\u0644 \u0627\u0644\u062f\u062e\u0648\u0644"},"footer":""}}')},7119:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"\u0645\u0633\u062a\u0642\u0628\u0644 \u0627\u0644\u0636\u0645\u0627\u0646 \u0627\u0644\u0627\u062c\u062a\u0645\u0627\u0639\u064a \u0627\u0644\u0639\u0627\u0644\u0645\u064a"},"mission":{"title":"\u0645\u0647\u0645\u0629-","text":"\u062a\u0645\u0643\u064a\u0646 \u0627\u0644\u0623\u0641\u0631\u0627\u062f \u0645\u0646 \u062e\u0644\u0627\u0644 \u0645\u0639\u0627\u0644\u062c\u0629 \u0627\u0644\u062a\u0641\u0627\u0648\u062a\u0627\u062a \u0627\u0644\u0645\u0627\u0644\u064a\u0629\u060c \u0648\u062a\u0639\u0632\u064a\u0632 \u0627\u0644\u062d\u0631\u064a\u0629 \u0627\u0644\u0627\u0642\u062a\u0635\u0627\u062f\u064a\u0629\u060c \u0648\u062f\u0641\u0639 \u0627\u0644\u062a\u063a\u064a\u064a\u0631 \u0627\u0644\u0627\u062c\u062a\u0645\u0627\u0639\u064a \u0627\u0644\u0625\u064a\u062c\u0627\u0628\u064a. \u0627\u0644\u0631\u0624\u064a\u0629: \u0646\u0638\u0627\u0645 \u0628\u064a\u0626\u064a \u0639\u0627\u0644\u0645\u064a \u0634\u0627\u0645\u0644 \u0648\u0645\u0633\u062a\u062f\u0627\u0645 \u0645\u062f\u0639\u0648\u0645 \u0628\u0627\u0644\u062a\u0639\u0627\u0648\u0646 \u0627\u0644\u062f\u0648\u0644\u064a."},"tokenomics":{"title":"tokenomics","text":"\u062a\u064f\u0628\u0646\u0649 \u0627\u0644\u0631\u0645\u0648\u0632 \u0627\u0644\u0645\u0645\u064a\u0632\u0629 \u0644\u0640 BlueBag \u0639\u0644\u0649 \u0628\u0644\u0648\u0643\u0634\u064a\u0646 Solana\u060c \u0627\u0644\u0630\u064a \u062a\u0645 \u0627\u062e\u062a\u064a\u0627\u0631\u0647 \u0644\u0633\u0631\u0639\u062a\u0647 \u0627\u0644\u0639\u0627\u0644\u064a\u0629 \u0648\u0643\u0641\u0627\u0621\u062a\u0647\u060c \u0648\u0627\u0646\u062e\u0641\u0627\u0636 \u0627\u0644\u0631\u0633\u0648\u0645 \u0648\u0642\u0627\u0628\u0644\u064a\u062a\u0647 \u0644\u0644\u062a\u0648\u0633\u0639\u060c \u0648\u0647\u064a \u062e\u0635\u0627\u0626\u0635 \u0636\u0631\u0648\u0631\u064a\u0629 \u0644\u062f\u0639\u0645 \u0646\u0638\u0627\u0645 \u0645\u0627\u0644\u064a \u0639\u0627\u0644\u0645\u064a \u0648\u0641\u0639\u0651\u0627\u0644. TSD \u2013 \u0631\u0645\u0632 \u062f\u0627\u0639\u0645\u064a BlueBag \u062a\u0645 \u062a\u0635\u0645\u064a\u0645 \u0647\u0630\u0627 \u0627\u0644\u0631\u0645\u0632 \u0628\u0634\u0643\u0644 \u0623\u0633\u0627\u0633\u064a \u0643\u0623\u062f\u0627\u0629 \u0644\u062c\u0645\u0639 \u0627\u0644\u0623\u0645\u0648\u0627\u0644 \u0644\u0644\u0645\u0624\u064a\u062f\u064a\u0646 \u0627\u0644\u0623\u0648\u0627\u0626\u0644 \u0644\u0640 BlueBag. \u064a\u062a\u064a\u062d \u0647\u0630\u0627 \u0627\u0644\u0631\u0645\u0632 \u0627\u0644\u0641\u0631\u0635\u0629 \u0644\u0644\u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646 \u0627\u0644\u0623\u0648\u0627\u0626\u0644 \u0644\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u0631\u0645\u0648\u0632 \u0627\u0644\u0623\u0635\u0644\u064a\u0629 \u0644\u0640 BlueBag (TED) \u0628\u0633\u0639\u0631 \u062a\u0641\u0636\u064a\u0644\u064a \u0642\u0628\u0644 \u0627\u0644\u0628\u064a\u0639 \u0627\u0644\u0639\u0627\u0645. \u064a\u0639\u062f \u0647\u0630\u0627 \u062c\u0632\u0621\u064b\u0627 \u0645\u0646 \u0627\u0633\u062a\u0631\u0627\u062a\u064a\u062c\u064a\u062a\u0646\u0627 \u0644\u062a\u062d\u0641\u064a\u0632 \u0627\u0644\u0645\u0634\u0627\u0631\u0643\u0629 \u0627\u0644\u0645\u0628\u0643\u0631\u0629 \u0648\u0636\u0645\u0627\u0646 \u0623\u0633\u0627\u0633 \u0642\u0648\u064a \u0644\u0644\u0645\u0646\u0635\u0629. \u0627\u062d\u0635\u0644 \u0639\u0644\u0649 \u0648\u0635\u0648\u0644 \u0645\u0628\u0643\u0631 \u0625\u0644\u0649 \u0631\u0645\u0648\u0632 TSD \u0645\u0646 \u062e\u0644\u0627\u0644 \u0623\u0646 \u062a\u0643\u0648\u0646 \u0645\u062e\u062a\u0628\u0631\u064b\u0627 \u062a\u062c\u0631\u064a\u0628\u064a\u064b\u0627. TED - \u0631\u0645\u0632 BlueBag.app TED \u0647\u0648 \u0627\u0644\u0631\u0645\u0632 \u0627\u0644\u0645\u0645\u064a\u0632 \u0627\u0644\u0623\u0633\u0627\u0633\u064a \u0644\u0646\u0638\u0627\u0645 BlueBag. \u0625\u0646\u0647 \u0645\u062d\u0648\u0631\u064a \u0641\u064a \u062c\u0645\u064a\u0639 \u0623\u0646\u0634\u0637\u0629 \u0627\u0644\u0645\u0646\u0635\u0629\u060c \u0628\u0645\u0627 \u0641\u064a \u0630\u0644\u0643 \u0628\u0631\u0627\u0645\u062c \u0627\u0644\u062f\u062e\u0644\u060c \u0628\u0631\u0627\u0645\u062c \u0627\u0644\u0645\u0643\u0627\u0641\u0622\u062a\u060c \u062a\u062d\u0635\u064a\u0644 \u0627\u0644\u0636\u0631\u0627\u0626\u0628\u060c \u0648\u062d\u0648\u0627\u0641\u0632 \u0627\u0644\u0645\u062c\u062a\u0645\u0639. \u0633\u064a\u064f\u062f\u064a\u0631 TED \u0648\u0638\u0627\u0626\u0641 \u0648\u062a\u0641\u0627\u0639\u0644\u0627\u062a \u0627\u0644\u0645\u0646\u0635\u0629\u060c \u0648\u064a\u062f\u0639\u0645 \u0627\u0644\u0631\u0624\u064a\u0629 \u0627\u0644\u0623\u0648\u0633\u0639 \u0644\u0644\u062a\u0645\u0643\u064a\u0646 \u0627\u0644\u0645\u0627\u0644\u064a \u0648\u0627\u0644\u0634\u0645\u0648\u0644\u064a\u0629."},"want_to_learn_more":{"title":"\u0647\u0644 \u062a\u0631\u064a\u062f \u0645\u0639\u0631\u0641\u0629 \u0627\u0644\u0645\u0632\u064a\u062f\u061f","text":"\u0633\u062a\u0643\u0634\u0627\u0641 \u0631\u0624\u064a\u062a\u0646\u0627 \u0625\u0630\u0627 \u0623\u062b\u0627\u0631 \u0645\u0627 \u0646\u0627\u0642\u0634\u0646\u0627\u0647 \u0627\u0647\u062a\u0645\u0627\u0645\u0643 \u0648\u062a\u0631\u063a\u0628 \u0641\u064a \u0645\u0639\u0631\u0641\u0629 \u0627\u0644\u0645\u0632\u064a\u062f \u062d\u0648\u0644 \u0643\u064a\u0641\u064a\u0629 \u0642\u064a\u0627\u0645 BlueBag \u0628\u0625\u062d\u062f\u0627\u062b \u062a\u062d\u0648\u0644 \u0641\u064a \u0627\u0644\u0623\u0646\u0638\u0645\u0629 \u0627\u0644\u0645\u0627\u0644\u064a\u0629 \u0627\u0644\u0639\u0627\u0644\u0645\u064a\u0629\u060c \u0646\u062f\u0639\u0648\u0643 \u0644\u0627\u0633\u062a\u0643\u0634\u0627\u0641 \u0627\u0644\u0648\u0631\u0642\u0629 \u0627\u0644\u0628\u064a\u0636\u0627\u0621 \u0627\u0644\u062e\u0627\u0635\u0629 \u0628\u0646\u0627. \u0641\u0647\u064a \u062a\u0648\u0641\u0631 \u0646\u0638\u0631\u0629 \u0634\u0627\u0645\u0644\u0629 \u0639\u0644\u0649 \u0645\u0647\u0645\u062a\u0646\u0627\u060c \u0631\u0624\u064a\u062a\u0646\u0627\u060c \u0648\u0627\u0644\u062c\u0648\u0627\u0646\u0628 \u0627\u0644\u062a\u0642\u0646\u064a\u0629 \u0644\u0645\u0646\u0638\u0648\u0645\u062a\u0646\u0627. \u0627\u0643\u062a\u0634\u0641 \u0627\u0644\u0645\u0632\u064a\u062f: \u2022 \u0627\u0642\u0631\u0623 \u0627\u0644\u0648\u0631\u0642\u0629 \u0627\u0644\u0628\u064a\u0636\u0627\u0621: [\u0642\u0645 \u0628\u0627\u0644\u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0622\u0646] \u0644\u0644\u062d\u0635\u0648\u0644 \u0639\u0644\u0649 \u0641\u0647\u0645 \u0645\u062a\u0639\u0645\u0642 \u0644\u0645\u0646\u0635\u062a\u0646\u0627 \u0648\u0625\u0645\u0643\u0627\u0646\u0627\u062a\u0647\u0627. \u2022 \u0627\u0646\u0636\u0645 \u0625\u0644\u0649 \u0645\u062c\u062a\u0645\u0639\u0646\u0627: \u0627\u0628\u0642\u064e \u0639\u0644\u0649 \u0627\u0637\u0644\u0627\u0639 \u0648\u0634\u0627\u0631\u0643\u0646\u0627 \u0639\u0628\u0631 \u0642\u0646\u0648\u0627\u062a\u0646\u0627 \u0639\u0644\u0649 \u0648\u0633\u0627\u0626\u0644 \u0627\u0644\u062a\u0648\u0627\u0635\u0644 \u0627\u0644\u0627\u062c\u062a\u0645\u0627\u0639\u064a. DISCORD / REDDIT / X / TELEGRAM"},"work_with_us":{"title":"\u0627\u0644\u0639\u0645\u0644 \u0645\u0639\u0646\u0627: \u0627\u0646\u0636\u0645 \u0625\u0644\u064a\u0646\u0627 \u0641\u064a \u062a\u0634\u0643\u064a\u0644 \u0645\u0633\u062a\u0642\u0628\u0644 \u0627\u0644\u062a\u0645\u0643\u064a\u0646 \u0627\u0644\u0645\u0627\u0644\u064a \u0627\u0644\u0639\u0627\u0644\u0645\u064a","text":"\u0646\u062d\u0646 \u0646\u0633\u0639\u0649 \u0628\u0646\u0634\u0627\u0637 \u0625\u0644\u0649 \u062c\u0630\u0628 \u0627\u0644\u0623\u0641\u0631\u0627\u062f \u0648\u0627\u0644\u0645\u0646\u0638\u0645\u0627\u062a \u0627\u0644\u0645\u0644\u062a\u0632\u0645\u064a\u0646 \u0628\u0627\u0644\u0627\u0646\u0636\u0645\u0627\u0645 \u0625\u0644\u0649 \u0645\u0647\u0645\u062a\u0646\u0627. \u0625\u0630\u0627 \u0643\u0646\u062a \u0634\u063a\u0648\u0641\u064b\u0627 \u0628\u062a\u0637\u0648\u064a\u0631 \u0627\u0644\u0623\u0646\u0638\u0645\u0629 \u0627\u0644\u0645\u0627\u0644\u064a\u0629 \u0627\u0644\u0639\u0627\u0644\u0645\u064a\u0629\u060c \u0641\u0625\u0646\u0646\u0627 \u0646\u0648\u062f \u0633\u0645\u0627\u0639 \u0631\u0623\u064a\u0643. \u0633\u0648\u0627\u0621 \u0643\u0646\u062a \u0645\u0637\u0648\u0631\u064b\u0627\u060c \u0623\u0648 \u0645\u062a\u062e\u0635\u0635\u064b\u0627 \u0641\u064a \u0627\u0644\u062a\u0633\u0648\u064a\u0642\u060c \u0623\u0648 \u0644\u062f\u064a\u0643 \u0623\u0641\u0643\u0627\u0631 \u0648\u062a\u062c\u0627\u0631\u0628 \u0641\u0631\u064a\u062f\u0629\u060c \u0641\u0647\u0646\u0627\u0643 \u0627\u0644\u0639\u062f\u064a\u062f \u0645\u0646 \u0627\u0644\u0637\u0631\u0642 \u0627\u0644\u062a\u064a \u064a\u0645\u0643\u0646\u0643 \u0645\u0646 \u062e\u0644\u0627\u0644\u0647\u0627 \u0627\u0644\u062a\u0639\u0627\u0648\u0646 \u0645\u0639\u0646\u0627.\\n\\n\u0643\u064a\u0641\u064a\u0629 \u0627\u0644\u0627\u0646\u062e\u0631\u0627\u0637:\\n\u2022 \u0641\u0631\u0635 \u0627\u0644\u0639\u0645\u0644: \u0625\u0630\u0627 \u0643\u0646\u062a \u0645\u0647\u062a\u0645\u064b\u0627 \u0628\u0627\u0644\u0627\u0646\u0636\u0645\u0627\u0645 \u0625\u0644\u0649 \u0641\u0631\u064a\u0642 \u0627\u0644\u0639\u0645\u0644 \u0641\u064a BlueBag\u060c \u064a\u0631\u062c\u0649 \u0625\u0631\u0633\u0627\u0644 \u0633\u064a\u0631\u062a\u0643 \u0627\u0644\u0630\u0627\u062a\u064a\u0629 \u0648\u0631\u0633\u0627\u0644\u0629 \u062a\u0642\u062f\u064a\u0645 \u0645\u062e\u062a\u0635\u0631\u0629 \u0625\u0644\u0649 jobs@bluebag.app.\\n\u2022 \u0627\u0644\u0634\u0631\u0627\u0643\u0627\u062a: \u0644\u0644\u062a\u0648\u0627\u0635\u0644 \u0628\u062e\u0635\u0648\u0635 \u0627\u0644\u0634\u0631\u0627\u0643\u0627\u062a\u060c \u064a\u0631\u062c\u0649 \u0625\u0631\u0633\u0627\u0644 \u0631\u0633\u0627\u0644\u0629 \u0625\u0644\u0649 Partnerships@bluebag.app. \u0642\u062f\u0645 \u062a\u0641\u0627\u0635\u064a\u0644 \u0639\u0646 \u0646\u0641\u0633\u0643 \u0623\u0648 \u0645\u0646\u0638\u0645\u062a\u0643 \u0648\u0643\u064a\u0641 \u062a\u0631\u0649 \u0625\u0645\u0643\u0627\u0646\u064a\u0627\u062a \u0627\u0644\u062a\u0639\u0627\u0648\u0646.\\n\u2022 \u0634\u0627\u0631\u0643 \u0623\u0641\u0643\u0627\u0631\u0643: \u0646\u062d\u0646 \u0646\u0631\u062d\u0628 \u0628\u0627\u0644\u0623\u0641\u0643\u0627\u0631 \u0648\u0627\u0644\u0645\u0642\u062a\u0631\u062d\u0627\u062a \u0627\u0644\u0645\u0628\u062a\u0643\u0631\u0629. \u0625\u0630\u0627 \u0643\u0627\u0646\u062a \u0644\u062f\u064a\u0643 \u0627\u0642\u062a\u0631\u0627\u062d\u0627\u062a \u062d\u0648\u0644 \u0643\u064a\u0641\u064a\u0629 \u0645\u0633\u0627\u0647\u0645\u062a\u0643 \u0623\u0648 \u0645\u0633\u0627\u0647\u0645\u0629 \u0645\u0646\u0638\u0645\u062a\u0643 \u0641\u064a \u062a\u062d\u0642\u064a\u0642 \u0631\u0624\u064a\u062a\u0646\u0627\u060c \u064a\u0631\u062c\u0649 \u0627\u0644\u0627\u062a\u0635\u0627\u0644 \u0628\u0646\u0627 \u0639\u0628\u0631 nextbigthing@bluebag.app."}}}')},8684:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"Sobre","governance":"Governan\xe7a","careers":"Carreiras","buttonLogIn":"Fazer login"},"footer":""}}')},3226:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"O Futuro da Seguran\xe7a Social Global"},"mission":{"title":"Miss\xe3o-","text":"Empoderar indiv\xedduos ao abordar desigualdades financeiras, promover a liberdade econ\xf4mica e impulsionar mudan\xe7as sociais positivas. Vis\xe3o: um ecossistema global inclusivo e sustent\xe1vel, apoiado pela colabora\xe7\xe3o mundial."},"tokenomics":{"title":"tokenomics","text":"Os tokens da BlueBag s\xe3o constru\xeddos na blockchain Solana, escolhida por sua alta velocidade e efici\xeancia, baixas taxas e escalabilidade, que s\xe3o essenciais para apoiar um ecossistema financeiro global e eficiente. TSD \u2013 Token dos Apoiadores da BlueBag Este token \xe9 projetado principalmente como uma ferramenta de arrecada\xe7\xe3o de fundos para os primeiros apoiadores da BlueBag. Oferece aos primeiros adotantes a oportunidade de acessar os tokens nativos da BlueBag (TED) a uma taxa favor\xe1vel antes da venda p\xfablica. Isso faz parte da nossa estrat\xe9gia para incentivar a participa\xe7\xe3o precoce e garantir uma base s\xf3lida para a plataforma. Obtenha acesso antecipado aos tokens TSD tornando-se um beta tester. TED - Token BlueBag.app TED \xe9 o token utilit\xe1rio central do ecossistema BlueBag. Ele \xe9 central para todas as atividades da plataforma, incluindo programas de renda, programas de recompensas, coleta de impostos e incentivos comunit\xe1rios. O TED impulsionar\xe1 as funcionalidades e intera\xe7\xf5es da plataforma, apoiando a vis\xe3o mais ampla de empoderamento financeiro e inclus\xe3o."},"want_to_learn_more":{"title":"Quer saber mais?","text":"Explore Nossa Vis\xe3o Se voc\xea est\xe1 intrigado com o que discutimos e deseja se aprofundar em como a BlueBag est\xe1 transformando os sistemas financeiros globais, convidamos voc\xea a explorar nosso whitepaper. Ele oferece uma vis\xe3o abrangente sobre nossa miss\xe3o, vis\xe3o e os aspectos t\xe9cnicos de nosso ecossistema. Descubra Mais: \u2022 Leia o Whitepaper: [Baixe Agora] para obter uma compreens\xe3o detalhada de nossa plataforma e seu potencial. \u2022 Junte-se \xe0 Nossa Comunidade: Mantenha-se atualizado e engaje-se conosco atrav\xe9s de nossos canais de redes sociais. DISCORD / REDDIT / X / TELEGRAM"},"work_with_us":{"title":"Trabalhe Conosco- Destaque: \xabJunte-se a N\xf3s na Constru\xe7\xe3o do Futuro da Capacita\xe7\xe3o Financeira Global\xbb","text":"Estamos ativamente \xe0 procura de indiv\xedduos e organiza\xe7\xf5es dedicados para se unirem \xe0 nossa miss\xe3o. Se voc\xea \xe9 apaixonado por avan\xe7ar os sistemas financeiros globais, queremos ouvir voc\xea. Seja voc\xea um desenvolvedor, um especialista em marketing ou tenha ideias e expertise \xfanicas, h\xe1 v\xe1rias formas de colaborar conosco. Como Participar: \u2022 Oportunidades de Trabalho: Se voc\xea est\xe1 interessado em oportunidades de carreira com a BlueBag, envie seu curr\xedculo e uma breve introdu\xe7\xe3o/carta de apresenta\xe7\xe3o para jobs@bluebag.app. \u2022 Parcerias: Para parcerias, entre em contato conosco atrav\xe9s de Partnerships@bluebag.app. Forne\xe7a detalhes sobre voc\xea/sua organiza\xe7\xe3o e como imagina uma colabora\xe7\xe3o. \u2022 Compartilhe Suas Ideias: Agradecemos ideias e propostas inovadoras. Se voc\xea tem sugest\xf5es sobre como voc\xea ou sua organiza\xe7\xe3o pode contribuir para nossa vis\xe3o, entre em contato conosco atrav\xe9s de nextbigthing@bluebag.app."}}}')},1085:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"\u5173\u4e8e","governance":"\u6cbb\u7406","careers":"\u804c\u4e1a\u53d1\u5c55","buttonLogIn":"\u767b\u5f55"},"footer":""}}')},2671:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"\u5168\u7403\u793e\u4f1a\u4fdd\u969c\u7684\u672a\u6765"},"mission":{"title":"\u4f7f\u547d-","text":"\u901a\u8fc7\u89e3\u51b3\u91d1\u878d\u4e0d\u5e73\u7b49\u95ee\u9898\u3001\u4fc3\u8fdb\u7ecf\u6d4e\u81ea\u7531\u548c\u63a8\u52a8\u79ef\u6781\u7684\u793e\u4f1a\u53d8\u9769\u6765\u8d4b\u80fd\u4e2a\u4eba\u3002\u613f\u666f\uff1a\u4e00\u4e2a\u5305\u5bb9\u6027\u5f3a\u3001\u53ef\u6301\u7eed\u7684\u5168\u7403\u751f\u6001\u7cfb\u7edf\uff0c\u7531\u5168\u7403\u5408\u4f5c\u652f\u6301\u3002"},"tokenomics":{"title":"tokenomics","text":"BlueBag \u7684\u4ee3\u5e01\u5efa\u7acb\u5728 Solana \u533a\u5757\u94fe\u4e0a\uff0c\u8be5\u533a\u5757\u94fe\u56e0\u5176\u9ad8\u901f\u5ea6\u4e0e\u6548\u7387\u3001\u4f4e\u8d39\u7528\u548c\u53ef\u6269\u5c55\u6027\u800c\u88ab\u9009\u4e2d\uff0c\u8fd9\u4e9b\u7279\u6027\u5bf9\u4e8e\u652f\u6301\u4e00\u4e2a\u5168\u7403\u9ad8\u6548\u7684\u91d1\u878d\u751f\u6001\u7cfb\u7edf\u81f3\u5173\u91cd\u8981\u3002TSD \u2013 BlueBag \u8d44\u52a9\u8005\u4ee3\u5e01 \u6b64\u4ee3\u5e01\u4e3b\u8981\u4f5c\u4e3a BlueBag \u65e9\u671f\u652f\u6301\u8005\u7684\u7b79\u6b3e\u5de5\u5177\u3002\u5b83\u4e3a\u65e9\u671f\u91c7\u7528\u8005\u63d0\u4f9b\u4e86\u5728\u516c\u5f00\u9500\u552e\u524d\u4ee5\u4f18\u60e0\u4ef7\u683c\u83b7\u53d6 BlueBag \u539f\u751f\u4ee3\u5e01 (TED) \u7684\u673a\u4f1a\u3002\u8fd9\u662f\u6211\u4eec\u6fc0\u52b1\u65e9\u671f\u53c2\u4e0e\u5e76\u786e\u4fdd\u5e73\u53f0\u7a33\u56fa\u57fa\u7840\u7684\u7b56\u7565\u7684\u4e00\u90e8\u5206\u3002\u901a\u8fc7\u6210\u4e3a Beta \u6d4b\u8bd5\u8005\uff0c\u83b7\u5f97 TSD \u4ee3\u5e01\u7684\u65e9\u671f\u8bbf\u95ee\u6743\u9650 TED - BlueBag.app \u4ee3\u5e01 TED \u662f BlueBag \u751f\u6001\u7cfb\u7edf\u7684\u6838\u5fc3\u5b9e\u7528\u4ee3\u5e01\u3002\u5b83\u5728\u6240\u6709\u5e73\u53f0\u6d3b\u52a8\u4e2d\u90fd\u53d1\u6325\u7740\u6838\u5fc3\u4f5c\u7528\uff0c\u5305\u62ec\u6536\u5165\u9879\u76ee\u3001\u5956\u52b1\u9879\u76ee\u3001\u7a0e\u6536\u5f81\u96c6\u548c\u793e\u533a\u6fc0\u52b1\u3002TED \u5c06\u63a8\u52a8\u5e73\u53f0\u7684\u529f\u80fd\u548c\u4e92\u52a8\uff0c\u652f\u6301\u66f4\u5e7f\u6cdb\u7684\u91d1\u878d\u8d4b\u80fd\u548c\u5305\u5bb9\u6027\u613f\u666f\u3002"},"want_to_learn_more":{"title":"\u60f3\u4e86\u89e3\u66f4\u591a\u5417\uff1f","text":"\u63a2\u7d22\u6211\u4eec\u7684\u613f\u666f \u5982\u679c\u60a8\u5bf9\u6211\u4eec\u8ba8\u8bba\u7684\u5185\u5bb9\u611f\u5230\u5174\u8da3\uff0c\u5e76\u5e0c\u671b\u6df1\u5165\u4e86\u89e3 BlueBag \u5982\u4f55\u53d8\u9769\u5168\u7403\u91d1\u878d\u7cfb\u7edf\uff0c\u6211\u4eec\u9080\u8bf7\u60a8\u63a2\u7d22\u6211\u4eec\u7684\u767d\u76ae\u4e66\u3002\u5b83\u63d0\u4f9b\u4e86\u5bf9\u6211\u4eec\u4f7f\u547d\u3001\u613f\u666f\u4ee5\u53ca\u751f\u6001\u7cfb\u7edf\u6280\u672f\u65b9\u9762\u7684\u5168\u9762\u4ecb\u7ecd\u3002\u4e86\u89e3\u66f4\u591a\uff1a \u2022 \u9605\u8bfb\u767d\u76ae\u4e66\uff1a[\u7acb\u5373\u4e0b\u8f7d]\uff0c\u4ee5\u6df1\u5165\u4e86\u89e3\u6211\u4eec\u7684\u5e73\u53f0\u53ca\u5176\u6f5c\u529b\u3002 \u2022 \u52a0\u5165\u6211\u4eec\u7684\u793e\u533a\uff1a\u901a\u8fc7\u6211\u4eec\u7684\u793e\u4ea4\u5a92\u4f53\u6e20\u9053\u4fdd\u6301\u66f4\u65b0\u5e76\u4e0e\u6211\u4eec\u4e92\u52a8\u3002DISCORD / REDDIT / X / TELEGRAM"},"work_with_us":{"title":" \u4e0e\u6211\u4eec\u5408\u4f5c- ","text":" \u6807\u9898: \u201c\u4e0e\u6211\u4eec\u4e00\u8d77\u5851\u9020\u5168\u7403\u91d1\u878d\u8d4b\u80fd\u7684\u672a\u6765\u201d \u6211\u4eec\u6b63\u5728\u79ef\u6781\u5bfb\u627e\u81f4\u529b\u4e8e\u6211\u4eec\u4f7f\u547d\u7684\u4e2a\u4eba\u548c\u7ec4\u7ec7\u3002\u5982\u679c\u60a8\u5bf9\u63a8\u52a8\u5168\u7403\u91d1\u878d\u7cfb\u7edf\u5145\u6ee1\u70ed\u60c5\uff0c\u6211\u4eec\u5e0c\u671b\u542c\u5230\u60a8\u7684\u58f0\u97f3\u3002\u65e0\u8bba\u60a8\u662f\u5f00\u53d1\u8005\u3001\u5e02\u573a\u8425\u9500\u4eba\u5458\uff0c\u8fd8\u662f\u62e5\u6709\u72ec\u7279\u7684\u60f3\u6cd5\u548c\u4e13\u4e1a\u77e5\u8bc6\uff0c\u90fd\u6709\u8bb8\u591a\u65b9\u5f0f\u53ef\u4ee5\u4e0e\u6211\u4eec\u5408\u4f5c\u3002\u5982\u4f55\u53c2\u4e0e\uff1a \u2022 \u804c\u4e1a\u673a\u4f1a\uff1a\u5982\u679c\u60a8\u5bf9\u5728 BlueBag \u7684\u804c\u4e1a\u673a\u4f1a\u611f\u5174\u8da3\uff0c\u8bf7\u5c06\u60a8\u7684\u7b80\u5386\u548c\u7b80\u8981\u4ecb\u7ecd/\u6c42\u804c\u4fe1\u53d1\u9001\u81f3 jobs@bluebag.app\u3002 \u2022 \u5408\u4f5c\u4f19\u4f34\u5173\u7cfb\uff1a\u6709\u5173\u5408\u4f5c\u4f19\u4f34\u5173\u7cfb\uff0c\u8bf7\u8054\u7cfb Partnerships@bluebag.app\u3002\u63d0\u4f9b\u60a8/\u60a8\u7ec4\u7ec7\u7684\u8be6\u7ec6\u4fe1\u606f\u4ee5\u53ca\u60a8\u5982\u4f55\u8bbe\u60f3\u5408\u4f5c\u3002 \u2022 \u5206\u4eab\u60a8\u7684\u60f3\u6cd5\uff1a\u6211\u4eec\u6b22\u8fce\u521b\u65b0\u7684\u60f3\u6cd5\u548c\u63d0\u6848\u3002\u5982\u679c\u60a8\u6709\u5173\u4e8e\u60a8\u6216\u60a8\u7684\u7ec4\u7ec7\u5982\u4f55\u4e3a\u6211\u4eec\u7684\u613f\u666f\u505a\u51fa\u8d21\u732e\u7684\u5efa\u8bae\uff0c\u8bf7\u901a\u8fc7 nextbigthing@bluebag.app \u8054\u7cfb\u6211\u4eec\u3002"}}}')},4197:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"\xdcber","governance":"Unternehmensf\xfchrung","careers":"Karriere","buttonLogIn":"Anmelden"},"footer":""}}')},3879:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"Die Zukunft der globalen Sozialversicherung"},"mission":{"title":"Mission-","text":"Menschen st\xe4rken, indem finanzielle Ungleichheiten angegangen, wirtschaftliche Freiheit gef\xf6rdert und positive soziale Ver\xe4nderungen vorangetrieben werden. Vision: Ein inklusives, nachhaltiges globales \xd6kosystem, unterst\xfctzt durch weltweite Zusammenarbeit."},"tokenomics":{"title":"tokenomics","text":"Die Token von BlueBag basieren auf der Solana-Blockchain, die wegen ihrer hohen Geschwindigkeit und Effizienz, niedrigen Geb\xfchren und Skalierbarkeit ausgew\xe4hlt wurde, die f\xfcr die Unterst\xfctzung eines globalen und effizienten Finanz\xf6kosystems unerl\xe4sslich sind. TSD \u2013 BlueBag Funders Token Dieser Token ist haupts\xe4chlich als Fundraising-Werkzeug f\xfcr die fr\xfchen Unterst\xfctzer von BlueBag konzipiert. Er bietet den fr\xfchen Anwendern die Gelegenheit, Zugang zu den nativen Token von BlueBag (TED) zu einem g\xfcnstigen Preis vor dem \xf6ffentlichen Verkauf zu erhalten. Dies ist Teil unserer Strategie, fr\xfches Engagement zu f\xf6rdern und eine solide Grundlage f\xfcr die Plattform zu gew\xe4hrleisten. Erhalten Sie fr\xfchen Zugang zu TSD-Token, indem Sie Beta-Tester werden. TED - BlueBag.app Token TED ist der zentrale Utility-Token des BlueBag-\xd6kosystems. Er ist f\xfcr alle Plattformaktivit\xe4ten von zentraler Bedeutung, einschlie\xdflich Einkommensprogrammen, Belohnungsprogrammen, Steuererhebung und Gemeinschaftsincentives. TED wird die Funktionen und Interaktionen der Plattform vorantreiben und die umfassendere Vision der finanziellen Erm\xe4chtigung und Inklusion unterst\xfctzen."},"want_to_learn_more":{"title":"M\xf6chten Sie mehr erfahren?  ","text":" Entdecken Sie Unsere Vision Wenn Sie von dem, was wir besprochen haben, fasziniert sind und tiefer in die Transformation der globalen Finanzsysteme durch BlueBag eintauchen m\xf6chten, laden wir Sie ein, unser Whitepaper zu erkunden. Es bietet einen umfassenden Einblick in unsere Mission, Vision und die technischen Aspekte unseres \xd6kosystems. Erfahren Sie Mehr: \u2022 Lesen Sie das Whitepaper: [Jetzt herunterladen], um ein tiefgehendes Verst\xe4ndnis unserer Plattform und ihres Potentials zu erhalten. \u2022 Treten Sie unserer Gemeinschaft bei: Bleiben Sie informiert und engagieren Sie sich \xfcber unsere sozialen Medienkan\xe4le. DISCORD / REDDIT / X / TELEGRAM"},"work_with_us":{"title":" Arbeiten Sie mit uns-    \xdcberschrift: \u201eSchlie\xdfen Sie sich uns an, um die Zukunft der globalen finanziellen Erm\xe4chtigung zu gestalten\u201c","text":"Wir suchen aktiv engagierte Einzelpersonen und Organisationen, die sich unserer Mission anschlie\xdfen. Wenn Sie leidenschaftlich daran interessiert sind, globale Finanzsysteme voranzubringen, m\xf6chten wir von Ihnen h\xf6ren. Egal, ob Sie Entwickler, Marketer sind oder einzigartige Ideen und Expertise haben, es gibt viele M\xf6glichkeiten zur Zusammenarbeit mit uns. So k\xf6nnen Sie sich einbringen: \u2022 Berufsm\xf6glichkeiten: Wenn Sie an Karrierem\xf6glichkeiten bei BlueBag interessiert sind, senden Sie bitte Ihren Lebenslauf und eine kurze Einf\xfchrung/Bewerbung an jobs@bluebag.app. \u2022 Partnerschaften: F\xfcr Partnerschaften kontaktieren Sie uns bitte unter Partnerships@bluebag.app. Geben Sie Details \xfcber sich/Ihre Organisation an und wie Sie sich eine Zusammenarbeit vorstellen. \u2022 Teilen Sie Ihre Ideen: Wir begr\xfc\xdfen innovative Ideen und Vorschl\xe4ge. Wenn Sie Vorschl\xe4ge haben, wie Sie oder Ihre Organisation zu unserer Vision beitragen k\xf6nnen, kontaktieren Sie uns bitte unter nextbigthing@bluebag.app."}}}')},8189:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"About","governance":"Governance","careers":"Careers","buttonLogIn":"Log In"},"footer":""}}')},8799:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"The Future of Social Security"},"mission":{"title":"Mission","text":"Empowering individuals by addressing financial inequalities, promoting economic freedom, and driving positive social change. Vision: an inclusive, sustainable global ecosystem supported by worldwide collaboration"},"tokenomics":{"title":"Tokenomics","paragraph1":"BlueBag\u2019s tokens are built on the Solana blockchain, chosen for its high-speed & efficiency, low fees, and scalability, which are essential for supporting a global and efficient financial ecosystem.","paragraph2":{"bold":"BlueBag Funders Token (TSD)","normal":"This token is designed primarily as a fundraising tool for early supporters of BlueBag.app. It provides an opportunity for early adopters to gain access to BlueBag\u2019s native tokens (TED) at a favorable rate before the public sale. This is part of our strategy to incentivize early involvement and ensure a solid foundation for the platform. Get Early access to TSD tokens by being a beta tester"},"paragraph3":{"bold":"BlueBag.app Token (TED)","normal":"TED is the core utility token of the BlueBag ecosystem. It is central to all platform activities, including income & rewards programs, tax collection and community incentives. TED will drive the platform\u2019s functionalities and interactions, supporting the broader vision of financial empowerment and inclusion."}},"want_to_learn_more":{"title":"Want to Learn More?","test":"Explore Our Vision If you\u2019re intrigued by what we\u2019ve discussed and want to dive deeper into how BlueBag is transforming global financial systems, we invite you to explore our whitepaper. It offers a comprehensive look at our mission, vision, and the technical aspects of our ecosystem. Discover More: \u2022 Read the Whitepaper: Coming soon","test2":"Explore Our Vision If you\u2019re intrigued by what we\u2019ve discussed and want to dive deeper into how BlueBag is transforming global financial systems, we invite you to explore our whitepaper. It offers a comprehensive look at our mission, vision, and the technical aspects of our ecosystem. Discover More: \u2022 Read the Whitepaper: [Download Now] to get an in-depth understanding of our platform and its potential. \u2022 Join Our Community: Stay updated and engage with us through our social media channels. DISCORD / REDDIT / X / TELEGRAM","intro":"Explore Our Vision If you\u2019re intrigued by what we\u2019ve discussed and want to dive deeper into how BlueBag is transforming global financial systems."},"work_with_us":{"title":"Work with Us","text":"We\u2019re actively seeking dedicated individuals and organizations to join us in our mission. If you\u2019re passionate about advancing global financial systems, we want to hear from you. Whether you\u2019re a developer, marketer, or have unique ideas and expertise, there are many ways to collaborate with us. How to Get Involved: \u2022 Job Opportunities: If you\u2019re interested in career opportunities with BlueBag, please send your CV and a brief introduction/cover letter to jobs@bluebag.app. \u2022 Partnerships: For partnership reach out to us at Partnerships@bluebag.app. Provide details about you/your organization and how you envision a collaboration. \u2022 Share Your Ideas: We welcome innovative ideas and proposals. If you have suggestions on how you or your organization can contribute to our vision, please contact us via nextbigthing@bluebag.app ."}}}')},6352:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"\xc0 propos","governance":"Gouvernance","careers":"Carri\xe8res","buttonLogIn":"Se connecter"},"footer":""}}')},270:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"L\'avenir de la s\xe9curit\xe9 sociale mondiale"},"mission":{"title":"Mission-","text":"Donner du pouvoir aux individus en s\'attaquant aux in\xe9galit\xe9s financi\xe8res, en promouvant la libert\xe9 \xe9conomique et en favorisant un changement social positif. Vision : un \xe9cosyst\xe8me mondial inclusif et durable soutenu par une collaboration mondiale."},"tokenomics":{"title":"tokenomics","text":"Les tokens de BlueBag sont construits sur la blockchain Solana, choisie pour sa haute vitesse et son efficacit\xe9, ses faibles frais et sa scalabilit\xe9, qui sont essentiels pour soutenir un \xe9cosyst\xe8me financier mondial et efficace. TSD \u2013 Token de Financement de BlueBag Ce token est principalement con\xe7u comme un outil de collecte de fonds pour les premiers supporters de BlueBag. Il offre aux premiers adopteurs l\'opportunit\xe9 d\'acc\xe9der aux tokens natifs de BlueBag (TED) \xe0 un tarif avantageux avant la vente publique. Cela fait partie de notre strat\xe9gie pour encourager une participation pr\xe9coce et assurer une base solide pour la plateforme. Obtenez un acc\xe8s anticip\xe9 aux tokens TSD en devenant testeur b\xeata TED - Token de BlueBag.app TED est le token utilitaire central de l\'\xe9cosyst\xe8me BlueBag. Il est au c\u0153ur de toutes les activit\xe9s de la plateforme, y compris les programmes de revenus, les programmes de r\xe9compenses, la collecte des imp\xf4ts et les incitations communautaires. TED soutiendra les fonctionnalit\xe9s et les interactions de la plateforme, appuyant la vision plus large de l\'autonomisation financi\xe8re et de l\'inclusion."},"want_to_learn_more":{"title":"Vous voulez en savoir plus ? ","text":"Explorez Notre Vision Si vous \xeates intrigu\xe9 par ce que nous avons discut\xe9 et souhaitez approfondir comment BlueBag transforme les syst\xe8mes financiers mondiaux, nous vous invitons \xe0 explorer notre livre blanc. Il offre un aper\xe7u complet de notre mission, de notre vision et des aspects techniques de notre \xe9cosyst\xe8me. D\xe9couvrez-en davantage : \u2022 Lisez le Livre Blanc : [T\xe9l\xe9chargez Maintenant] pour obtenir une compr\xe9hension approfondie de notre plateforme et de son potentiel. \u2022 Rejoignez Notre Communaut\xe9 : Restez inform\xe9 et engagez-vous avec nous via nos canaux de m\xe9dias sociaux. DISCORD / REDDIT / X / TELEGRAM"},"work_with_us":{"title":"Travaillez avec Nous-  En-t\xeate : \xab Rejoignez-nous pour Fa\xe7onner l\u2019Avenir de l\u2019Autonomisation Financi\xe8re Mondiale \xbb","text":"Nous recherchons activement des individus et des organisations d\xe9vou\xe9s pour se joindre \xe0 nous dans notre mission. Si vous \xeates passionn\xe9 par l\'avancement des syst\xe8mes financiers mondiaux, nous souhaitons avoir de vos nouvelles. Que vous soyez d\xe9veloppeur, sp\xe9cialiste du marketing ou que vous poss\xe9diez des id\xe9es et une expertise uniques, il existe de nombreuses fa\xe7ons de collaborer avec nous. Comment Participer : \u2022 Opportunit\xe9s d\'Emploi : Si vous \xeates int\xe9ress\xe9 par des opportunit\xe9s de carri\xe8re avec BlueBag, veuillez envoyer votre CV et une br\xe8ve introduction/courrier de motivation \xe0 jobs@bluebag.app. \u2022 Partenariats : Pour les partenariats, contactez-nous \xe0 Partnerships@bluebag.app. Fournissez des d\xe9tails sur vous/your organisation et comment vous envisagez une collaboration. \u2022 Partagez Vos Id\xe9es : Nous accueillons les id\xe9es et propositions innovantes. Si vous avez des suggestions sur la fa\xe7on dont vous ou votre organisation pouvez contribuer \xe0 notre vision, veuillez nous contacter \xe0 nextbigthing@bluebag.app."}}}')},6701:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"\u092c\u093e\u0930\u0947 \u092e\u0947\u0902","governance":"\u092a\u094d\u0930\u0936\u093e\u0938\u0928","careers":"\u0915\u0930\u093f\u092f\u0930","buttonLogIn":"\u0932\u0949\u0917 \u0907\u0928"},"footer":""}}')},7807:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"\u0935\u0948\u0936\u094d\u0935\u093f\u0915 \u0938\u093e\u092e\u093e\u091c\u093f\u0915 \u0938\u0941\u0930\u0915\u094d\u0937\u093e \u0915\u093e \u092d\u0935\u093f\u0937\u094d\u092f"},"mission":{"title":"\u092e\u093f\u0936\u0928-","text":"\u0935\u094d\u092f\u0915\u094d\u0924\u093f\u092f\u094b\u0902 \u0915\u094b \u0935\u093f\u0924\u094d\u0924\u0940\u092f \u0935\u093f\u0937\u092e\u0924\u093e\u0913\u0902 \u0915\u094b \u0938\u0902\u092c\u094b\u0927\u093f\u0924 \u0915\u0930\u0915\u0947, \u0906\u0930\u094d\u0925\u093f\u0915 \u0938\u094d\u0935\u0924\u0902\u0924\u094d\u0930\u0924\u093e \u0915\u094b \u092c\u0922\u093c\u093e\u0935\u093e \u0926\u0947\u0915\u0930, \u0914\u0930 \u0938\u0915\u093e\u0930\u093e\u0924\u094d\u092e\u0915 \u0938\u093e\u092e\u093e\u091c\u093f\u0915 \u092a\u0930\u093f\u0935\u0930\u094d\u0924\u0928 \u0915\u094b \u092a\u094d\u0930\u0947\u0930\u093f\u0924 \u0915\u0930\u0915\u0947 \u0938\u0936\u0915\u094d\u0924 \u092c\u0928\u093e\u0928\u093e\u0964 \u0926\u0943\u0937\u094d\u091f\u093f\u0915\u094b\u0923: \u090f\u0915 \u0938\u092e\u093e\u0935\u0947\u0936\u0940, \u0938\u094d\u0925\u093e\u092f\u0940 \u0935\u0948\u0936\u094d\u0935\u093f\u0915 \u092a\u093e\u0930\u093f\u0938\u094d\u0925\u093f\u0924\u093f\u0915\u0940 \u0924\u0902\u0924\u094d\u0930 \u091c\u094b \u0935\u0948\u0936\u094d\u0935\u093f\u0915 \u0938\u0939\u092f\u094b\u0917 \u0926\u094d\u0935\u093e\u0930\u093e \u0938\u092e\u0930\u094d\u0925\u093f\u0924 \u0939\u0948\u0964"},"tokenomics":{"title":"tokenomics","text":"\u092c\u094d\u0932\u0942\u092c\u0948\u0917 \u0915\u0947 \u091f\u094b\u0915\u0928 \u0938\u094b\u0932\u093e\u0928\u093e \u092c\u094d\u0932\u0949\u0915\u091a\u0947\u0928 \u092a\u0930 \u092c\u0928\u093e\u090f \u0917\u090f \u0939\u0948\u0902, \u091c\u093f\u0938\u0947 \u0907\u0938\u0915\u0940 \u0909\u091a\u094d\u091a \u0917\u0924\u093f \u0914\u0930 \u0926\u0915\u094d\u0937\u0924\u093e, \u0915\u092e \u0936\u0941\u0932\u094d\u0915 \u0914\u0930 \u0938\u094d\u0915\u0947\u0932\u0947\u092c\u093f\u0932\u093f\u091f\u0940 \u0915\u0947 \u0932\u093f\u090f \u091a\u0941\u0928\u093e \u0917\u092f\u093e \u0939\u0948, \u091c\u094b \u090f\u0915 \u0935\u0948\u0936\u094d\u0935\u093f\u0915 \u0914\u0930 \u092a\u094d\u0930\u092d\u093e\u0935\u0940 \u0935\u093f\u0924\u094d\u0924\u0940\u092f \u092a\u093e\u0930\u093f\u0938\u094d\u0925\u093f\u0924\u093f\u0915\u0940 \u0924\u0902\u0924\u094d\u0930 \u0915\u093e \u0938\u092e\u0930\u094d\u0925\u0928 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0906\u0935\u0936\u094d\u092f\u0915 \u0939\u0948\u0902\u0964 \u091f\u0940\u090f\u0938\u0921\u0940 \u2013 \u092c\u094d\u0932\u0942\u092c\u0948\u0917 \u092b\u0902\u0921\u0930\u094d\u0938 \u091f\u094b\u0915\u0928 \u092f\u0939 \u091f\u094b\u0915\u0928 \u092e\u0941\u0916\u094d\u092f \u0930\u0942\u092a \u0938\u0947 \u092c\u094d\u0932\u0942\u092c\u0948\u0917 \u0915\u0947 \u0936\u0941\u0930\u0941\u0906\u0924\u0940 \u0938\u092e\u0930\u094d\u0925\u0915\u094b\u0902 \u0915\u0947 \u0932\u093f\u090f \u090f\u0915 \u092b\u0902\u0921\u0930\u0947\u091c\u093f\u0902\u0917 \u091f\u0942\u0932 \u0915\u0947 \u0930\u0942\u092a \u092e\u0947\u0902 \u0921\u093f\u091c\u093c\u093e\u0907\u0928 \u0915\u093f\u092f\u093e \u0917\u092f\u093e \u0939\u0948\u0964 \u092f\u0939 \u092a\u094d\u0930\u093e\u0930\u0902\u092d\u093f\u0915 \u0905\u092a\u0928\u093e\u0928\u0947 \u0935\u093e\u0932\u094b\u0902 \u0915\u094b \u0938\u093e\u0930\u094d\u0935\u091c\u0928\u093f\u0915 \u092c\u093f\u0915\u094d\u0930\u0940 \u0938\u0947 \u092a\u0939\u0932\u0947 \u092c\u094d\u0932\u0942\u092c\u0948\u0917 \u0915\u0947 \u0938\u094d\u0935\u0926\u0947\u0936\u0940 \u091f\u094b\u0915\u0928 (TED) \u0915\u094b \u090f\u0915 \u0905\u0928\u0941\u0915\u0942\u0932 \u0926\u0930 \u092a\u0930 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u0928\u0947 \u0915\u093e \u0905\u0935\u0938\u0930 \u092a\u094d\u0930\u0926\u093e\u0928 \u0915\u0930\u0924\u093e \u0939\u0948\u0964 \u092f\u0939 \u0939\u092e\u093e\u0930\u0940 \u0930\u0923\u0928\u0940\u0924\u093f \u0915\u093e \u0939\u093f\u0938\u094d\u0938\u093e \u0939\u0948 \u091c\u094b \u092a\u094d\u0930\u093e\u0930\u0902\u092d\u093f\u0915 \u092d\u093e\u0917\u0940\u0926\u093e\u0930\u0940 \u0915\u094b \u092a\u094d\u0930\u094b\u0924\u094d\u0938\u093e\u0939\u093f\u0924 \u0915\u0930\u0924\u093e \u0939\u0948 \u0914\u0930 \u092a\u094d\u0932\u0947\u091f\u092b\u093c\u0949\u0930\u094d\u092e \u0915\u0947 \u0932\u093f\u090f \u090f\u0915 \u0920\u094b\u0938 \u0906\u0927\u093e\u0930 \u0938\u0941\u0928\u093f\u0936\u094d\u091a\u093f\u0924 \u0915\u0930\u0924\u093e \u0939\u0948\u0964 \u092c\u0940\u091f\u093e \u091f\u0947\u0938\u094d\u091f\u0930\u094d\u0938 \u092c\u0928\u0915\u0930 \u091f\u0940\u090f\u0938\u0921\u0940 \u091f\u094b\u0915\u0928\u094b\u0902 \u0915\u0940 \u092a\u094d\u0930\u093e\u0930\u0902\u092d\u093f\u0915 \u092a\u0939\u0941\u0902\u091a \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u0947\u0902\u0964 TED - \u092c\u094d\u0932\u0942\u092c\u0948\u0917.\u090f\u092a \u091f\u094b\u0915\u0928 TED \u092c\u094d\u0932\u0942\u092c\u0948\u0917 \u092a\u093e\u0930\u093f\u0938\u094d\u0925\u093f\u0924\u093f\u0915\u0940 \u0924\u0902\u0924\u094d\u0930 \u0915\u093e \u092e\u0941\u0916\u094d\u092f \u0909\u092a\u092f\u094b\u0917\u093f\u0924\u093e \u091f\u094b\u0915\u0928 \u0939\u0948\u0964 \u092f\u0939 \u0938\u092d\u0940 \u092a\u094d\u0932\u0947\u091f\u092b\u093c\u0949\u0930\u094d\u092e \u0917\u0924\u093f\u0935\u093f\u0927\u093f\u092f\u094b\u0902 \u0915\u0947 \u0915\u0947\u0902\u0926\u094d\u0930\u0940\u092f \u092c\u093f\u0902\u0926\u0941 \u0915\u0947 \u0930\u0942\u092a \u092e\u0947\u0902 \u0915\u093e\u0930\u094d\u092f \u0915\u0930\u0924\u093e \u0939\u0948, \u091c\u093f\u0938\u092e\u0947\u0902 \u0906\u092f \u0915\u093e\u0930\u094d\u092f\u0915\u094d\u0930\u092e, \u092a\u0941\u0930\u0938\u094d\u0915\u093e\u0930 \u0915\u093e\u0930\u094d\u092f\u0915\u094d\u0930\u092e, \u0915\u0930 \u0938\u0902\u0917\u094d\u0930\u0939 \u0914\u0930 \u0938\u093e\u092e\u0941\u0926\u093e\u092f\u093f\u0915 \u092a\u094d\u0930\u094b\u0924\u094d\u0938\u093e\u0939\u0928 \u0936\u093e\u092e\u093f\u0932 \u0939\u0948\u0902\u0964 TED \u092a\u094d\u0932\u0947\u091f\u092b\u093c\u0949\u0930\u094d\u092e \u0915\u0940 \u0915\u093e\u0930\u094d\u092f\u0915\u094d\u0937\u092e\u0924\u093e\u0913\u0902 \u0914\u0930 \u0907\u0902\u091f\u0930\u0948\u0915\u094d\u0936\u0928 \u0915\u094b \u0938\u0902\u091a\u093e\u0932\u093f\u0924 \u0915\u0930\u0947\u0917\u093e, \u091c\u094b \u0935\u093f\u0924\u094d\u0924\u0940\u092f \u0938\u0936\u0915\u094d\u0924\u093f\u0915\u0930\u0923 \u0914\u0930 \u0938\u092e\u093e\u0935\u0947\u0936\u0928 \u0915\u0940 \u0935\u094d\u092f\u093e\u092a\u0915 \u0926\u0943\u0937\u094d\u091f\u093f \u0915\u093e \u0938\u092e\u0930\u094d\u0925\u0928 \u0915\u0930\u0947\u0917\u093e\u0964"},"want_to_learn_more":{"title":"\u0905\u0927\u093f\u0915 \u091c\u093e\u0928\u0928\u093e \u091a\u093e\u0939\u0924\u0947 \u0939\u0948\u0902?","text":" \u0939\u092e\u093e\u0930\u0940 \u0926\u0943\u0937\u094d\u091f\u093f \u0915\u093e \u0905\u0928\u094d\u0935\u0947\u0937\u0923 \u0915\u0930\u0947\u0902 \u092f\u0926\u093f \u0906\u092a \u0939\u092e\u093e\u0930\u0940 \u091a\u0930\u094d\u091a\u093e \u0938\u0947 \u092a\u094d\u0930\u092d\u093e\u0935\u093f\u0924 \u0939\u0948\u0902 \u0914\u0930 \u091c\u093e\u0928\u0928\u093e \u091a\u093e\u0939\u0924\u0947 \u0939\u0948\u0902 \u0915\u093f \u092c\u094d\u0932\u0942\u092c\u0948\u0917 \u0935\u0948\u0936\u094d\u0935\u093f\u0915 \u0935\u093f\u0924\u094d\u0924\u0940\u092f \u092a\u094d\u0930\u0923\u093e\u0932\u093f\u092f\u094b\u0902 \u0915\u094b \u0915\u0948\u0938\u0947 \u092c\u0926\u0932 \u0930\u0939\u093e \u0939\u0948, \u0924\u094b \u0939\u092e \u0906\u092a\u0915\u094b \u0939\u092e\u093e\u0930\u0947 \u0936\u094d\u0935\u0947\u0924\u092a\u0924\u094d\u0930 \u0915\u093e \u0905\u0928\u094d\u0935\u0947\u0937\u0923 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0906\u092e\u0902\u0924\u094d\u0930\u093f\u0924 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902\u0964 \u092f\u0939 \u0939\u092e\u093e\u0930\u0947 \u092e\u093f\u0936\u0928, \u0926\u0943\u0937\u094d\u091f\u093f \u0914\u0930 \u0939\u092e\u093e\u0930\u0947 \u092a\u093e\u0930\u093f\u0938\u094d\u0925\u093f\u0924\u093f\u0915\u0940 \u0924\u0902\u0924\u094d\u0930 \u0915\u0947 \u0924\u0915\u0928\u0940\u0915\u0940 \u092a\u0939\u0932\u0941\u0913\u0902 \u092a\u0930 \u090f\u0915 \u0938\u092e\u0917\u094d\u0930 \u0926\u0943\u0937\u094d\u091f\u093f\u0915\u094b\u0923 \u092a\u094d\u0930\u0926\u093e\u0928 \u0915\u0930\u0924\u093e \u0939\u0948\u0964 \u0905\u0927\u093f\u0915 \u091c\u093e\u0928\u0947\u0902: \u2022 \u0936\u094d\u0935\u0947\u0924\u092a\u0924\u094d\u0930 \u092a\u0922\u093c\u0947\u0902: [\u0921\u093e\u0909\u0928\u0932\u094b\u0921 \u0915\u0930\u0947\u0902] \u0939\u092e\u093e\u0930\u0947 \u092a\u094d\u0932\u0947\u091f\u092b\u093c\u0949\u0930\u094d\u092e \u0914\u0930 \u0907\u0938\u0915\u0940 \u0938\u0902\u092d\u093e\u0935\u0928\u093e\u0913\u0902 \u0915\u0940 \u0917\u0939\u0930\u0940 \u0938\u092e\u091d \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f\u0964 \u2022 \u0939\u092e\u093e\u0930\u0947 \u0938\u092e\u0941\u0926\u093e\u092f \u092e\u0947\u0902 \u0936\u093e\u092e\u093f\u0932 \u0939\u094b\u0902: \u0905\u0926\u094d\u092f\u0924\u093f\u0924 \u0930\u0939\u0947\u0902 \u0914\u0930 \u0939\u092e\u093e\u0930\u0947 \u0938\u094b\u0936\u0932 \u092e\u0940\u0921\u093f\u092f\u093e \u091a\u0948\u0928\u0932\u094b\u0902 \u0915\u0947 \u092e\u093e\u0927\u094d\u092f\u092e \u0938\u0947 \u0939\u092e\u0938\u0947 \u091c\u0941\u0921\u093c\u0947\u0902\u0964 \u0921\u093f\u0938\u094d\u0915\u0949\u0930\u094d\u0921 / \u0930\u0947\u0921\u093f\u091f / \u090f\u0915\u094d\u0938 / \u091f\u0947\u0932\u0940\u0917\u094d\u0930\u093e\u092e"},"work_with_us":{"title":"\u0939\u092e\u093e\u0930\u0947 \u0938\u093e\u0925 \u0915\u093e\u092e \u0915\u0930\u0947\u0902 -  \u0939\u0947\u0921\u0932\u093e\u0907\u0928: \u0935\u0948\u0936\u094d\u0935\u093f\u0915 \u0935\u093f\u0924\u094d\u0924\u0940\u092f \u0938\u0936\u0915\u094d\u0924\u093f\u0915\u0930\u0923 \u0915\u0947 \u092d\u0935\u093f\u0937\u094d\u092f \u0915\u094b \u0906\u0915\u093e\u0930 \u0926\u0947\u0928\u0947 \u092e\u0947\u0902 \u0939\u092e\u093e\u0930\u0947 \u0938\u093e\u0925 \u0936\u093e\u092e\u093f\u0932 \u0939\u094b\u0902 ","text":"\u0939\u092e \u0938\u0915\u094d\u0930\u093f\u092f \u0930\u0942\u092a \u0938\u0947 \u0938\u092e\u0930\u094d\u092a\u093f\u0924 \u0935\u094d\u092f\u0915\u094d\u0924\u093f\u092f\u094b\u0902 \u0914\u0930 \u0938\u0902\u0917\u0920\u0928\u094b\u0902 \u0915\u0940 \u0916\u094b\u091c \u0915\u0930 \u0930\u0939\u0947 \u0939\u0948\u0902 \u091c\u094b \u0939\u092e\u093e\u0930\u0947 \u092e\u093f\u0936\u0928 \u092e\u0947\u0902 \u0936\u093e\u092e\u093f\u0932 \u0939\u094b\u0902\u0964 \u092f\u0926\u093f \u0906\u092a \u0935\u0948\u0936\u094d\u0935\u093f\u0915 \u0935\u093f\u0924\u094d\u0924\u0940\u092f \u092a\u094d\u0930\u0923\u093e\u0932\u093f\u092f\u094b\u0902 \u0915\u094b \u0906\u0917\u0947 \u092c\u0922\u093c\u093e\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0909\u0924\u094d\u0938\u093e\u0939\u0940 \u0939\u0948\u0902, \u0924\u094b \u0939\u092e \u0906\u092a\u0915\u0947 \u0938\u0902\u092a\u0930\u094d\u0915 \u092e\u0947\u0902 \u0930\u0939\u0928\u093e \u091a\u093e\u0939\u0924\u0947 \u0939\u0948\u0902\u0964 \u091a\u093e\u0939\u0947 \u0906\u092a \u090f\u0915 \u0921\u0947\u0935\u0932\u092a\u0930 \u0939\u094b\u0902, \u092e\u093e\u0930\u094d\u0915\u0947\u091f\u0930 \u0939\u094b\u0902, \u092f\u093e \u0906\u092a\u0915\u0947 \u092a\u093e\u0938 \u0905\u0928\u0942\u0920\u0947 \u0935\u093f\u091a\u093e\u0930 \u0914\u0930 \u0935\u093f\u0936\u0947\u0937\u091c\u094d\u091e\u0924\u093e \u0939\u094b, \u0939\u092e\u093e\u0930\u0947 \u0938\u093e\u0925 \u0938\u0939\u092f\u094b\u0917 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0915\u0908 \u0924\u0930\u0940\u0915\u0947 \u0939\u0948\u0902\u0964 \u0936\u093e\u092e\u093f\u0932 \u0939\u094b\u0928\u0947 \u0915\u0947 \u0924\u0930\u0940\u0915\u0947: \u2022 \u0928\u094c\u0915\u0930\u0940 \u0915\u0947 \u0905\u0935\u0938\u0930: \u092f\u0926\u093f \u0906\u092a \u092c\u094d\u0932\u0942\u092c\u0948\u0917 \u0915\u0947 \u0938\u093e\u0925 \u0915\u0930\u093f\u092f\u0930 \u0915\u0947 \u0905\u0935\u0938\u0930\u094b\u0902 \u092e\u0947\u0902 \u0930\u0941\u091a\u093f \u0930\u0916\u0924\u0947 \u0939\u0948\u0902, \u0924\u094b \u0915\u0943\u092a\u092f\u093e \u0905\u092a\u0928\u093e \u0938\u0940\u0935\u0940 \u0914\u0930 \u090f\u0915 \u0938\u0902\u0915\u094d\u0937\u093f\u092a\u094d\u0924 \u092a\u0930\u093f\u091a\u092f/\u0915\u0935\u0930 \u0932\u0947\u091f\u0930 jobs@bluebag.app \u092a\u0930 \u092d\u0947\u091c\u0947\u0902\u0964 \u2022 \u0938\u093e\u091d\u0947\u0926\u093e\u0930\u093f\u092f\u093e\u0902: \u0938\u093e\u091d\u0947\u0926\u093e\u0930\u0940 \u0915\u0947 \u0932\u093f\u090f, \u0915\u0943\u092a\u092f\u093e Partnerships@bluebag.app \u092a\u0930 \u0938\u0902\u092a\u0930\u094d\u0915 \u0915\u0930\u0947\u0902\u0964 \u0905\u092a\u0928\u0947/\u0905\u092a\u0928\u0940 \u0938\u0902\u0917\u0920\u0928 \u0915\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947\u0902 \u0935\u093f\u0935\u0930\u0923 \u092a\u094d\u0930\u0926\u093e\u0928 \u0915\u0930\u0947\u0902 \u0914\u0930 \u0906\u092a \u0938\u0939\u092f\u094b\u0917 \u0915\u094b \u0915\u0948\u0938\u0947 \u0926\u0947\u0916\u0924\u0947 \u0939\u0948\u0902, \u092f\u0939 \u092c\u0924\u093e\u090f\u0902\u0964 \u2022 \u0905\u092a\u0928\u0947 \u0935\u093f\u091a\u093e\u0930 \u0938\u093e\u091d\u093e \u0915\u0930\u0947\u0902: \u0939\u092e \u0928\u0935\u094b\u0928\u094d\u092e\u0947\u0937\u0915 \u0935\u093f\u091a\u093e\u0930\u094b\u0902 \u0914\u0930 \u092a\u094d\u0930\u0938\u094d\u0924\u093e\u0935\u094b\u0902 \u0915\u093e \u0938\u094d\u0935\u093e\u0917\u0924 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902\u0964 \u092f\u0926\u093f \u0906\u092a\u0915\u0947 \u092a\u093e\u0938 \u0938\u0941\u091d\u093e\u0935 \u0939\u0948\u0902 \u0915\u093f \u0906\u092a \u092f\u093e \u0906\u092a\u0915\u093e \u0938\u0902\u0917\u0920\u0928 \u0939\u092e\u093e\u0930\u0940 \u0926\u0943\u0937\u094d\u091f\u093f \u092e\u0947\u0902 \u0915\u0948\u0938\u0947 \u092f\u094b\u0917\u0926\u093e\u0928 \u0926\u0947 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902, \u0924\u094b \u0915\u0943\u092a\u092f\u093e nextbigthing@bluebag.app \u092a\u0930 \u0938\u0902\u092a\u0930\u094d\u0915 \u0915\u0930\u0947\u0902\u0964"}}}')},8670:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"\u306b\u3064\u3044\u3066","governance":"\u30ac\u30d0\u30ca\u30f3\u30b9","careers":"\u30ad\u30e3\u30ea\u30a2","buttonLogIn":"\u30ed\u30b0\u30a4\u30f3"},"footer":""}}')},5512:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"\u30b0\u30ed\u30fc\u30d0\u30eb\u793e\u4f1a\u4fdd\u969c\u306e\u672a\u6765"},"mission":{"title":"\u30df\u30c3\u30b7\u30e7\u30f3-","text":"\u300c\u7d4c\u6e08\u7684\u4e0d\u5e73\u7b49\u306b\u5bfe\u51e6\u3057\u3001\u7d4c\u6e08\u7684\u81ea\u7531\u3092\u4fc3\u9032\u3057\u3001\u30dd\u30b8\u30c6\u30a3\u30d6\u306a\u793e\u4f1a\u5909\u9769\u3092\u63a8\u9032\u3059\u308b\u3053\u3068\u3067\u3001\u500b\u4eba\u306b\u529b\u3092\u4e0e\u3048\u308b\u3002\u30d3\u30b8\u30e7\u30f3: \u5305\u6442\u7684\u3067\u6301\u7d9a\u53ef\u80fd\u306a\u30b0\u30ed\u30fc\u30d0\u30eb\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u3092\u3001\u4e16\u754c\u4e2d\u306e\u5354\u529b\u306b\u3088\u3063\u3066\u652f\u3048\u308b\u3002\u300d"},"tokenomics":{"title":"tokenomics","text":"\u300cBlueBag\u306e\u30c8\u30fc\u30af\u30f3\u306f\u3001Solana\u30d6\u30ed\u30c3\u30af\u30c1\u30a7\u30fc\u30f3\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u3066\u304a\u308a\u3001\u9ad8\u901f\u6027\u3068\u52b9\u7387\u6027\u3001\u4f4e\u6599\u91d1\u3001\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\u304c\u9078\u3070\u308c\u305f\u7406\u7531\u3067\u3059\u3002\u3053\u308c\u3089\u306f\u3001\u30b0\u30ed\u30fc\u30d0\u30eb\u3067\u52b9\u7387\u7684\u306a\u91d1\u878d\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u305f\u3081\u306b\u4e0d\u53ef\u6b20\u3067\u3059\u3002TSD \u2013 BlueBag Funders Token \u3053\u306e\u30c8\u30fc\u30af\u30f3\u306f\u4e3b\u306b\u3001BlueBag\u306e\u521d\u671f\u30b5\u30dd\u30fc\u30bf\u30fc\u306e\u305f\u3081\u306e\u8cc7\u91d1\u8abf\u9054\u30c4\u30fc\u30eb\u3068\u3057\u3066\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u65e9\u671f\u63a1\u7528\u8005\u306f\u516c\u958b\u8ca9\u58f2\u524d\u306bBlueBag\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30c8\u30fc\u30af\u30f3\uff08TED\uff09\u3092\u6709\u5229\u306a\u30ec\u30fc\u30c8\u3067\u53d6\u5f97\u3059\u308b\u6a5f\u4f1a\u304c\u5f97\u3089\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u65e9\u671f\u306e\u95a2\u4e0e\u3092\u4fc3\u9032\u3057\u3001\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u5805\u56fa\u306a\u57fa\u76e4\u3092\u78ba\u4fdd\u3059\u308b\u305f\u3081\u306e\u6226\u7565\u306e\u4e00\u90e8\u3067\u3059\u3002\u30d9\u30fc\u30bf\u30c6\u30b9\u30bf\u30fc\u3068\u3057\u3066TSD\u30c8\u30fc\u30af\u30f3\u3078\u306e\u65e9\u671f\u30a2\u30af\u30bb\u30b9\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002TED - BlueBag.app\u30c8\u30fc\u30af\u30f3 TED\u306fBlueBag\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u306e\u4e3b\u8981\u306a\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30c8\u30fc\u30af\u30f3\u3067\u3059\u3002\u3059\u3079\u3066\u306e\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u6d3b\u52d5\u306e\u4e2d\u5fc3\u3067\u3042\u308a\u3001\u53ce\u76ca\u30d7\u30ed\u30b0\u30e9\u30e0\u3001\u5831\u916c\u30d7\u30ed\u30b0\u30e9\u30e0\u3001\u7a0e\u91d1\u5fb4\u53ce\u3001\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30a4\u30f3\u30bb\u30f3\u30c6\u30a3\u30d6\u306a\u3069\u304c\u542b\u307e\u308c\u307e\u3059\u3002TED\u306f\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u6a5f\u80fd\u3068\u76f8\u4e92\u4f5c\u7528\u3092\u99c6\u52d5\u3057\u3001\u91d1\u878d\u306e\u529b\u3092\u5f37\u5316\u3057\u3001\u5305\u62ec\u6027\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u5e83\u7bc4\u306a\u30d3\u30b8\u30e7\u30f3\u3092\u652f\u3048\u307e\u3059\u3002\u300d"},"want_to_learn_more":{"title":"\u3082\u3063\u3068\u77e5\u308a\u305f\u3044\u3067\u3059\u304b\uff1f","text":"\u300c\u79c1\u305f\u3061\u306e\u30d3\u30b8\u30e7\u30f3\u3092\u63a2\u6c42\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u79c1\u305f\u3061\u304c\u8b70\u8ad6\u3057\u305f\u5185\u5bb9\u306b\u8208\u5473\u3092\u6301\u3061\u3001BlueBag\u304c\u3069\u306e\u3088\u3046\u306b\u30b0\u30ed\u30fc\u30d0\u30eb\u306a\u91d1\u878d\u30b7\u30b9\u30c6\u30e0\u3092\u5909\u9769\u3057\u3066\u3044\u308b\u304b\u3092\u3088\u308a\u6df1\u304f\u77e5\u308a\u305f\u3044\u5834\u5408\u306f\u3001\u305c\u3072\u79c1\u305f\u3061\u306e\u30db\u30ef\u30a4\u30c8\u30da\u30fc\u30d1\u30fc\u3092\u63a2\u7d22\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30db\u30ef\u30a4\u30c8\u30da\u30fc\u30d1\u30fc\u3067\u306f\u3001\u79c1\u305f\u3061\u306e\u4f7f\u547d\u3001\u30d3\u30b8\u30e7\u30f3\u3001\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u306e\u6280\u8853\u7684\u5074\u9762\u306b\u3064\u3044\u3066\u5305\u62ec\u7684\u306b\u3054\u89a7\u3044\u305f\u3060\u3051\u307e\u3059\u3002\u8a73\u7d30\u60c5\u5831: \u2022 \u30db\u30ef\u30a4\u30c8\u30da\u30fc\u30d1\u30fc\u3092\u8aad\u3080: [\u4eca\u3059\u3050\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9] \u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3068\u305d\u306e\u53ef\u80fd\u6027\u306b\u3064\u3044\u3066\u6df1\u304f\u7406\u89e3\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u2022 \u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u53c2\u52a0\u3059\u308b: \u30bd\u30fc\u30b7\u30e3\u30eb\u30e1\u30c7\u30a3\u30a2\u30c1\u30e3\u30f3\u30cd\u30eb\u3092\u901a\u3058\u3066\u6700\u65b0\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001\u79c1\u305f\u3061\u3068\u4ea4\u6d41\u3057\u3066\u304f\u3060\u3055\u3044\u3002DISCORD / REDDIT / X / TELEGRAM\u300d"},"work_with_us":{"title":"\u79c1\u305f\u3061\u3068\u4e00\u7dd2\u306b\u50cd\u304f- ","text":" \u300c\u898b\u51fa\u3057: \u300c\u30b0\u30ed\u30fc\u30d0\u30eb\u306a\u91d1\u878d\u30a8\u30f3\u30d1\u30ef\u30fc\u30e1\u30f3\u30c8\u306e\u672a\u6765\u3092\u5f62\u4f5c\u308b\u305f\u3081\u306b\u3001\u79c1\u305f\u3061\u3068\u5171\u306b\u53c2\u52a0\u3057\u307e\u305b\u3093\u304b\u300d \u79c1\u305f\u3061\u306f\u3001\u30df\u30c3\u30b7\u30e7\u30f3\u306b\u53c2\u52a0\u3057\u3066\u3044\u305f\u3060\u3051\u308b\u732e\u8eab\u7684\u306a\u500b\u4eba\u3084\u7d44\u7e54\u3092\u7a4d\u6975\u7684\u306b\u52df\u96c6\u3057\u3066\u3044\u307e\u3059\u3002\u30b0\u30ed\u30fc\u30d0\u30eb\u306a\u91d1\u878d\u30b7\u30b9\u30c6\u30e0\u306e\u9032\u5c55\u306b\u60c5\u71b1\u3092\u6301\u3063\u3066\u3044\u308b\u65b9\u3005\u304b\u3089\u306e\u3054\u9023\u7d61\u3092\u304a\u5f85\u3061\u3057\u3066\u3044\u307e\u3059\u3002\u958b\u767a\u8005\u3001\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u62c5\u5f53\u8005\u3001\u307e\u305f\u306f\u30e6\u30cb\u30fc\u30af\u306a\u30a2\u30a4\u30c7\u30a2\u3084\u5c02\u9580\u77e5\u8b58\u3092\u304a\u6301\u3061\u306e\u65b9\u3005\u3001\u3069\u306e\u3088\u3046\u306a\u5f62\u3067\u3082\u79c1\u305f\u3061\u3068\u5354\u529b\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u53c2\u52a0\u65b9\u6cd5: \u2022 \u6c42\u4eba\u60c5\u5831: BlueBag\u3067\u306e\u30ad\u30e3\u30ea\u30a2\u6a5f\u4f1a\u306b\u8208\u5473\u304c\u3042\u308b\u65b9\u306f\u3001\u5c65\u6b74\u66f8\u3068\u7c21\u5358\u306a\u81ea\u5df1\u7d39\u4ecb/\u30ab\u30d0\u30fc\u30ec\u30bf\u30fc\u3092 jobs@bluebag.app \u307e\u3067\u304a\u9001\u308a\u304f\u3060\u3055\u3044\u3002 \u2022 \u30d1\u30fc\u30c8\u30ca\u30fc\u30b7\u30c3\u30d7: \u30d1\u30fc\u30c8\u30ca\u30fc\u30b7\u30c3\u30d7\u306b\u3064\u3044\u3066\u306f\u3001Partnerships@bluebag.app \u307e\u3067\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002\u3042\u306a\u305f\u307e\u305f\u306f\u3042\u306a\u305f\u306e\u7d44\u7e54\u306b\u95a2\u3059\u308b\u8a73\u7d30\u3068\u3001\u3069\u306e\u3088\u3046\u306a\u5354\u529b\u3092\u8003\u3048\u3066\u3044\u308b\u304b\u3092\u304a\u77e5\u3089\u305b\u304f\u3060\u3055\u3044\u3002 \u2022 \u30a2\u30a4\u30c7\u30a2\u306e\u5171\u6709: \u9769\u65b0\u7684\u306a\u30a2\u30a4\u30c7\u30a2\u3084\u63d0\u6848\u3092\u6b53\u8fce\u3057\u307e\u3059\u3002\u3042\u306a\u305f\u3084\u3042\u306a\u305f\u306e\u7d44\u7e54\u304c\u3069\u306e\u3088\u3046\u306b\u79c1\u305f\u3061\u306e\u30d3\u30b8\u30e7\u30f3\u306b\u8ca2\u732e\u3067\u304d\u308b\u304b\u306b\u3064\u3044\u3066\u306e\u63d0\u6848\u304c\u3042\u308c\u3070\u3001nextbigthing@bluebag.app \u307e\u3067\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002\u300d"}}}')},9916:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"Sobre","governance":"Governa\xe7\xe3o","careers":"Carreiras","buttonLogIn":"Iniciar sess\xe3o"},"footer":""}}')},4362:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"O Futuro da Seguran\xe7a Social Global"},"mission":{"title":" Miss\xe3o-","text":"Empoderar indiv\xedduos ao abordar desigualdades financeiras, promover a liberdade econ\xf4mica e impulsionar mudan\xe7as sociais positivas. Vis\xe3o: um ecossistema global inclusivo e sustent\xe1vel, apoiado por colabora\xe7\xe3o mundial."},"tokenomics":{"title":"tokenomics","text":"Os tokens da BlueBag s\xe3o constru\xeddos na blockchain Solana, escolhida pela sua alta velocidade e efici\xeancia, baixas taxas e escalabilidade, que s\xe3o essenciais para suportar um ecossistema financeiro global e eficiente. TSD \u2013 Token de Financiadores BlueBag Este token \xe9 projetado principalmente como uma ferramenta de angaria\xe7\xe3o de fundos para os primeiros apoiantes da BlueBag. Oferece aos primeiros adotantes a oportunidade de aceder aos tokens nativos da BlueBag (TED) a uma taxa favor\xe1vel antes da venda p\xfablica. Isto faz parte da nossa estrat\xe9gia para incentivar a participa\xe7\xe3o precoce e garantir uma base s\xf3lida para a plataforma. Obtenha acesso antecipado aos tokens TSD ao tornar-se um beta tester. TED - Token BlueBag.app TED \xe9 o token utilit\xe1rio central do ecossistema BlueBag. \xc9 central para todas as atividades da plataforma, incluindo programas de rendimento, programas de recompensas, recolha de impostos e incentivos comunit\xe1rios. O TED impulsionar\xe1 as funcionalidades e intera\xe7\xf5es da plataforma, apoiando a vis\xe3o mais ampla de empoderamento financeiro e inclus\xe3o."},"want_to_learn_more":{"title":"Quer saber mais?","text":" Explore a Nossa Vis\xe3o Se est\xe1 intrigado com o que discutimos e deseja aprofundar como a BlueBag est\xe1 a transformar os sistemas financeiros globais, convidamo-lo a explorar o nosso documento t\xe9cnico. Ele oferece uma vis\xe3o abrangente da nossa miss\xe3o, vis\xe3o e dos aspetos t\xe9cnicos do nosso ecossistema. Descubra Mais: \u2022 Leia o documento t\xe9cnico: [Descarregue Agora] para obter uma compreens\xe3o detalhada da nossa plataforma e do seu potencial. \u2022 Junte-se \xe0 Nossa Comunidade: Mantenha-se atualizado e envolva-se connosco atrav\xe9s dos nossos canais de redes sociais. DISCORD / REDDIT / X / TELEGRAM"},"work_with_us":{"title":"Trabalhe Conosco-  Em destaque: \xabJunte-se a N\xf3s para Moldar o Futuro da Capacita\xe7\xe3o Financeira Global\xbb","text":"Estamos ativamente \xe0 procura de indiv\xedduos e organiza\xe7\xf5es dedicados para se juntarem \xe0 nossa miss\xe3o. Se \xe9 apaixonado por avan\xe7ar os sistemas financeiros globais, queremos ouvir de si. Seja voc\xea um desenvolvedor, um especialista em marketing ou tenha ideias e expertise \xfanicas, h\xe1 muitas formas de colaborar connosco. Como Participar: \u2022 Oportunidades de Trabalho: Se est\xe1 interessado em oportunidades de carreira com a BlueBag, envie o seu CV e uma breve introdu\xe7\xe3o/carta de apresenta\xe7\xe3o para jobs@bluebag.app. \u2022 Parcerias: Para parcerias, entre em contacto connosco atrav\xe9s de Partnerships@bluebag.app. Forne\xe7a detalhes sobre si/sua organiza\xe7\xe3o e como imagina uma colabora\xe7\xe3o. \u2022 Partilhe as Suas Ideias: Agradecemos ideias e propostas inovadoras. Se tem sugest\xf5es sobre como voc\xea ou a sua organiza\xe7\xe3o pode contribuir para a nossa vis\xe3o, por favor, contacte-nos atrav\xe9s de nextbigthing@bluebag.app."}}}')},569:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"\u041e \u043d\u0430\u0441","governance":"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435","careers":"\u041a\u0430\u0440\u044c\u0435\u0440\u0430","buttonLogIn":"\u0412\u043e\u0439\u0442\u0438"},"footer":""}}')},5835:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"\u0411\u0443\u0434\u0443\u0449\u0435\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b"},"mission":{"title":"\u041c\u0438\u0441\u0441\u0438\u044f-","text":"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043b\u044e\u0434\u0435\u0439, \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044f \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0435 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e, \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0432\u043e\u0431\u043e\u0434\u0443 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u044f \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u043c \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c. \u041d\u0430\u0448\u0430 \u0432\u0438\u0437\u0438\u044f: \u0438\u043d\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u0430\u044f, \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0430\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u044b\u043c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c."},"tokenomics":{"title":"tokenomics","text":"\u0422\u043e\u043a\u0435\u043d\u044b BlueBag \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435 Solana, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0437\u0430 \u0435\u0433\u043e \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c, \u043d\u0438\u0437\u043a\u0438\u0435 \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u0438 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u0438 \u0444\u0430\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0439 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b. TSD \u2013 \u0422\u043e\u043a\u0435\u043d \u0444\u043e\u043d\u0434\u043e\u0432 BlueBag \u042d\u0442\u043e\u0442 \u0442\u043e\u043a\u0435\u043d \u0441\u043e\u0437\u0434\u0430\u043d \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043e\u0442 \u0440\u0430\u043d\u043d\u0438\u0445 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043a\u043e\u0432 BlueBag. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u043d\u043d\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u0442\u043e\u043a\u0435\u043d\u0430\u043c BlueBag (TED) \u043f\u043e \u0432\u044b\u0433\u043e\u0434\u043d\u043e\u0439 \u0446\u0435\u043d\u0435 \u0434\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0434\u0430\u0436\u0438. \u042d\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043f\u043e \u0441\u0442\u0438\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0440\u0430\u043d\u043d\u0435\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044e \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u044b \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0440\u0430\u043d\u043d\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0442\u043e\u043a\u0435\u043d\u0430\u043c TSD, \u0441\u0442\u0430\u0432 \u0431\u0435\u0442\u0430-\u0442\u0435\u0441\u0442\u0435\u0440\u043e\u043c. TED \u2013 \u0422\u043e\u043a\u0435\u043d BlueBag.app TED \u2013 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0440\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b BlueBag. \u041e\u043d \u043b\u0435\u0436\u0438\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0441\u0435\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043e\u0445\u043e\u0434\u043e\u0432, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0439, \u0441\u0431\u043e\u0440 \u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u0438 \u0441\u0442\u0438\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430. TED \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044f \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u043e\u0435 \u0432\u0438\u0434\u0435\u043d\u0438\u0435 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0438\u043d\u043a\u043b\u044e\u0437\u0438\u0438."},"want_to_learn_more":{"title":"\u0425\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435?","text":"\u0418\u0441\u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u041d\u0430\u0448\u0435 \u0412\u0438\u0434\u0435\u043d\u0438\u0435 \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0433\u043b\u0443\u0431\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a BlueBag \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0430\u0441 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0448\u0438\u043c \u0431\u0435\u043b\u044b\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043c. \u041e\u043d \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u0441\u0435\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u043d\u0430\u0448\u0443 \u043c\u0438\u0441\u0441\u0438\u044e, \u0432\u0438\u0434\u0435\u043d\u0438\u0435 \u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u043d\u0430\u0448\u0435\u0439 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0423\u0437\u043d\u0430\u0439\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435: \u2022 \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0411\u0435\u043b\u044b\u0439 \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442: [\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0421\u0435\u0439\u0447\u0430\u0441], \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u0435\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u0430. \u2022 \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a \u041d\u0430\u0448\u0435\u043c\u0443 \u0421\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443: \u041e\u0441\u0442\u0430\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0432 \u043a\u0443\u0440\u0441\u0435 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0441 \u043d\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0448\u0438 \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0438. DISCORD / REDDIT / X / TELEGRAM"},"work_with_us":{"title":"\u0420\u0430\u0431\u043e\u0442\u0430\u0439\u0442\u0435 \u0441 \u043d\u0430\u043c\u0438-  \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a: \xab\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a \u043d\u0430\u043c \u0432 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0433\u043e \u0443\u0441\u0438\u043b\u0435\u043d\u0438\u044f\xbb.","text":"\u041c\u044b \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0449\u0435\u043c \u043f\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u043b\u044e\u0434\u0435\u0439 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u043c\u0438\u0441\u0441\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0432\u043b\u0435\u0447\u0435\u043d\u044b \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u0432\u0430\u0441. \u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0435\u0441\u044c \u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c, \u043c\u0430\u0440\u043a\u0435\u0442\u043e\u043b\u043e\u0433\u043e\u043c \u0438\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 \u0438 \u043e\u043f\u044b\u0442, \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441 \u043d\u0430\u043c\u0438. \u041a\u0430\u043a \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0443\u0447\u0430\u0441\u0442\u0438\u0435: \u2022 \u0412\u0430\u043a\u0430\u043d\u0441\u0438\u0438: \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u044b \u0432 \u043a\u0430\u0440\u044c\u0435\u0440\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0432 BlueBag, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0432\u0430\u0448\u0435 \u0440\u0435\u0437\u044e\u043c\u0435 \u0438 \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435/\u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u043e \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 jobs@bluebag.app. \u2022 \u041f\u0430\u0440\u0442\u043d\u0451\u0440\u0441\u0442\u0432\u0430: \u0414\u043b\u044f \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0441\u0442\u0432\u0430 \u0441\u0432\u044f\u0436\u0438\u0442\u0435\u0441\u044c \u0441 \u043d\u0430\u043c\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 Partnerships@bluebag.app. \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0435\u0431\u0435/\u0432\u0430\u0448\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435, \u043a\u0430\u043a \u0432\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u043e. \u2022 \u041f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0432\u0430\u0448\u0438\u043c\u0438 \u0438\u0434\u0435\u044f\u043c\u0438: \u041c\u044b \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u043c \u0438\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u044b \u0438\u043b\u0438 \u0432\u0430\u0448\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435\u0439 \u043c\u0438\u0441\u0441\u0438\u0438, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0441\u0432\u044f\u0436\u0438\u0442\u0435\u0441\u044c \u0441 \u043d\u0430\u043c\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 nextbigthing@bluebag.app."}}}')},9989:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"Acerca de","governance":"Gobernanza","careers":"Carreras","buttonLogIn":"Iniciar sesi\xf3n"},"footer":""}}')},5511:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"El Futuro de la Seguridad Social Global"},"mission":{"title":"Mission-","text":"Los tokens de BlueBag est\xe1n construidos sobre la blockchain de Solana, elegida por su alta velocidad y eficiencia, bajas tarifas y escalabilidad, que son esenciales para apoyar un ecosistema financiero global y eficiente. TSD \u2013 Token de Financiamiento de BlueBag Este token est\xe1 dise\xf1ado principalmente como una herramienta de recaudaci\xf3n de fondos para los primeros patrocinadores de BlueBag. Ofrece la oportunidad a los primeros adoptantes de obtener los tokens nativos de BlueBag (TED) a una tasa favorable antes de la venta p\xfablica. Esto es parte de nuestra estrategia para incentivar la participaci\xf3n temprana y garantizar una base s\xf3lida para la plataforma. Obt\xe9n acceso anticipado a los tokens TSD al ser un probador beta. TED - Token de BlueBag.app TED es el token de utilidad central del ecosistema BlueBag. Es fundamental para todas las actividades de la plataforma, incluidos los programas de ingresos, programas de recompensas, recaudaci\xf3n de impuestos e incentivos comunitarios. TED impulsar\xe1 las funcionalidades e interacciones de la plataforma, apoyando la visi\xf3n m\xe1s amplia de empoderamiento financiero e inclusi\xf3n."},"tokenomics":{"title":"Tokenomics -","text":"Los tokens de BlueBag est\xe1n construidos sobre la blockchain de Solana, elegida por su alta velocidad y eficiencia, bajas tarifas y escalabilidad, que son esenciales para apoyar un ecosistema financiero global y eficiente. TSD \u2013 Token de Financiamiento de BlueBag Este token est\xe1 dise\xf1ado principalmente como una herramienta de recaudaci\xf3n de fondos para los primeros patrocinadores de BlueBag. Ofrece la oportunidad a los primeros adoptantes de obtener los tokens nativos de BlueBag (TED) a una tasa favorable antes de la venta p\xfablica. Esto es parte de nuestra estrategia para incentivar la participaci\xf3n temprana y garantizar una base s\xf3lida para la plataforma. Obt\xe9n acceso anticipado a los tokens TSD al ser un probador beta. TED - Token de BlueBag.app TED es el token de utilidad central del ecosistema BlueBag. Es fundamental para todas las actividades de la plataforma, incluidos los programas de ingresos, programas de recompensas, recaudaci\xf3n de impuestos e incentivos comunitarios. TED impulsar\xe1 las funcionalidades e interacciones de la plataforma, apoyando la visi\xf3n m\xe1s amplia de empoderamiento financiero e inclusi\xf3n."},"want_to_learn_more":{"title":" \xbfQuieres aprender m\xe1s? ","text":"Explora Nuestra Visi\xf3n Si te ha intrigado lo que hemos discutido y deseas profundizar en c\xf3mo BlueBag est\xe1 transformando los sistemas financieros globales, te invitamos a explorar nuestro whitepaper. Ofrece una visi\xf3n integral de nuestra misi\xf3n, visi\xf3n y los aspectos t\xe9cnicos de nuestro ecosistema. Descubre M\xe1s: \u2022 Lee el Whitepaper: [Desc\xe1rgalo Ahora] para obtener una comprensi\xf3n detallada de nuestra plataforma y su potencial. \u2022 \xdanete a Nuestra Comunidad: Mantente actualizado e interact\xfaa con nosotros a trav\xe9s de nuestros canales de redes sociales. DISCORDIA / REDDIT / X / TELEGRAM"},"work_with_us":{"title":"Trabaja con Nosotros- \xdanete a Nosotros para Moldear el Futuro del Empoderamiento Financiero Global ","text":"Estamos buscando activamente individuos y organizaciones dedicados para unirse a nuestra misi\xf3n. Si tienes pasi\xf3n por avanzar en los sistemas financieros globales, queremos saber de ti. Ya seas desarrollador, mercad\xf3logo o tengas ideas y conocimientos \xfanicos, hay muchas formas de colaborar con nosotros. C\xf3mo Participar: \u2022 Oportunidades de Empleo: Si est\xe1s interesado en oportunidades de carrera con BlueBag, env\xeda tu CV y una breve carta de presentaci\xf3n a jobs@bluebag.app. \u2022 Asociaciones: Para asociaciones, cont\xe1ctanos en Partnerships@bluebag.app. Proporciona detalles sobre ti o tu organizaci\xf3n y c\xf3mo visualizas una colaboraci\xf3n. \u2022 Comparte Tus Ideas: Agradecemos ideas y propuestas innovadoras. Si tienes sugerencias sobre c\xf3mo t\xfa o tu organizaci\xf3n pueden contribuir a nuestra visi\xf3n, por favor cont\xe1ctanos a trav\xe9s de nextbigthing@bluebag.app."}}}')},9806:e=>{"use strict";e.exports=JSON.parse('{"common":{"navbar":{"about":"\u041f\u0440\u043e \u043d\u0430\u0441","governance":"\u0423\u043f\u0440\u0430\u0432\u043b\u0456\u043d\u043d\u044f","careers":"\u041a\u0430\u0440\'\u0454\u0440\u0430","buttonLogIn":"\u0423\u0432\u0456\u0439\u0442\u0438"},"footer":""}}')},8008:e=>{"use strict";e.exports=JSON.parse('{"home":{"hero":{"title":"\u041c\u0430\u0439\u0431\u0443\u0442\u043d\u0454 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0457 \u0441\u043e\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0457 \u0431\u0435\u0437\u043f\u0435\u043a\u0438"},"mission":{"title":"\u041c\u0456\u0441\u0456\u044f-","text":"\u041d\u0430\u0434\u0430\u043d\u043d\u044f \u043c\u043e\u0436\u043b\u0438\u0432\u043e\u0441\u0442\u0435\u0439 \u043b\u044e\u0434\u044f\u043c \u0448\u043b\u044f\u0445\u043e\u043c \u0432\u0438\u0440\u0456\u0448\u0435\u043d\u043d\u044f \u0444\u0456\u043d\u0430\u043d\u0441\u043e\u0432\u0438\u0445 \u043d\u0435\u0440\u0456\u0432\u043d\u043e\u0441\u0442\u0435\u0439, \u0441\u043f\u0440\u0438\u044f\u043d\u043d\u044f \u0435\u043a\u043e\u043d\u043e\u043c\u0456\u0447\u043d\u0456\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u0456 \u0442\u0430 \u0441\u043f\u0440\u0438\u044f\u043d\u043d\u044f \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u0438\u043c \u0441\u043e\u0446\u0456\u0430\u043b\u044c\u043d\u0438\u043c \u0437\u043c\u0456\u043d\u0430\u043c. \u0412\u0456\u0437\u0456\u044f: \u0456\u043d\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u0430, \u0441\u0442\u0456\u0439\u043a\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430 \u0435\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0430 \u0432\u0441\u0435\u0441\u0432\u0456\u0442\u043d\u044c\u043e\u044e \u0441\u043f\u0456\u0432\u043f\u0440\u0430\u0446\u0435\u044e"},"tokenomics":{"title":"tokenomics","text":"\u0422\u043e\u043a\u0435\u043d\u0438 BlueBag \u043f\u043e\u0431\u0443\u0434\u043e\u0432\u0430\u043d\u0456 \u043d\u0430 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0456 Solana, \u043e\u0431\u0440\u0430\u043d\u043e\u043c\u0443 \u0437\u0430 \u0439\u043e\u0433\u043e \u0432\u0438\u0441\u043e\u043a\u0443 \u0448\u0432\u0438\u0434\u043a\u0456\u0441\u0442\u044c \u0456 \u0435\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0456\u0441\u0442\u044c, \u043d\u0438\u0437\u044c\u043a\u0456 \u0437\u0431\u043e\u0440\u0438 \u0442\u0430 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043e\u0432\u0430\u043d\u0456\u0441\u0442\u044c, \u044f\u043a\u0456 \u0454 \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u0438\u043c\u0438 \u0434\u043b\u044f \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u043a\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0457 \u0442\u0430 \u0435\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0457 \u0444\u0456\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0457 \u0435\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0438. TSD \u2013 \u0422\u043e\u043a\u0435\u043d \u0406\u043d\u0432\u0435\u0441\u0442\u043e\u0440\u0456\u0432 BlueBag \u0426\u0435\u0439 \u0442\u043e\u043a\u0435\u043d \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u044f\u043a \u0456\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0437\u0431\u043e\u0440\u0443 \u043a\u043e\u0448\u0442\u0456\u0432 \u0432\u0456\u0434 \u0440\u0430\u043d\u043d\u0456\u0445 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u0447\u0456\u0432 BlueBag. \u0412\u0456\u043d \u043d\u0430\u0434\u0430\u0454 \u043c\u043e\u0436\u043b\u0438\u0432\u0456\u0441\u0442\u044c \u0440\u0430\u043d\u043d\u0456\u043c adopters \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u0440\u0456\u0434\u043d\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u0456\u0432 BlueBag (TED) \u0437\u0430 \u0432\u0438\u0433\u0456\u0434\u043d\u043e\u044e \u0446\u0456\u043d\u043e\u044e \u0434\u043e \u043f\u0443\u0431\u043b\u0456\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0443. \u0426\u0435 \u0447\u0430\u0441\u0442\u0438\u043d\u0430 \u043d\u0430\u0448\u043e\u0457 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0456\u0457 \u0437\u0430\u043e\u0445\u043e\u0447\u0435\u043d\u043d\u044f \u0440\u0430\u043d\u043d\u044c\u043e\u0457 \u0443\u0447\u0430\u0441\u0442\u0456 \u0442\u0430 \u0437\u0430\u0431\u0435\u0437\u043f\u0435\u0447\u0435\u043d\u043d\u044f \u043d\u0430\u0434\u0456\u0439\u043d\u043e\u0457 \u043e\u0441\u043d\u043e\u0432\u0438 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0438. \u041e\u0442\u0440\u0438\u043c\u0430\u0439\u0442\u0435 \u0440\u0430\u043d\u043d\u0456\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u0442\u043e\u043a\u0435\u043d\u0456\u0432 TSD, \u0441\u0442\u0430\u0432\u0448\u0438 \u0431\u0435\u0442\u0430-\u0442\u0435\u0441\u0442\u0435\u0440\u043e\u043c TED - \u0422\u043e\u043a\u0435\u043d BlueBag.app TED \u0454 \u043e\u0441\u043d\u043e\u0432\u043d\u0438\u043c \u0443\u0442\u0438\u043b\u0456\u0442\u0430\u0440\u043d\u0438\u043c \u0442\u043e\u043a\u0435\u043d\u043e\u043c \u0435\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0438 BlueBag. \u0412\u0456\u043d \u0454 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u0438\u043c \u0434\u043b\u044f \u0432\u0441\u0456\u0445 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 \u0434\u043e\u0445\u043e\u0434\u0456\u0432, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 \u0432\u0438\u043d\u0430\u0433\u043e\u0440\u043e\u0434, \u0437\u0431\u043e\u0440\u0438 \u043f\u043e\u0434\u0430\u0442\u043a\u0456\u0432 \u0456 \u0441\u043f\u0456\u043b\u044c\u043d\u043e\u0442\u043d\u0456 \u0441\u0442\u0438\u043c\u0443\u043b\u0438. TED \u0431\u0443\u0434\u0435 \u0437\u0430\u0431\u0435\u0437\u043f\u0435\u0447\u0443\u0432\u0430\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0456\u043e\u043d\u0430\u043b\u044c\u043d\u0456\u0441\u0442\u044c \u0456 \u0432\u0437\u0430\u0454\u043c\u043e\u0434\u0456\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0438, \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u044e\u0447\u0438 \u0448\u0438\u0440\u0448\u0443 \u0432\u0456\u0437\u0456\u044e \u0444\u0456\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0433\u043e \u0440\u043e\u0437\u0448\u0438\u0440\u0435\u043d\u043d\u044f \u043c\u043e\u0436\u043b\u0438\u0432\u043e\u0441\u0442\u0435\u0439 \u0442\u0430 \u0456\u043d\u043a\u043b\u044e\u0437\u0456\u0457."},"want_to_learn_more":{"title":"\u0425\u043e\u0447\u0435\u0442\u0435 \u0434\u0456\u0437\u043d\u0430\u0442\u0438\u0441\u044f \u0431\u0456\u043b\u044c\u0448\u0435?","text":"\u041e\u0437\u043d\u0430\u0439\u043e\u043c\u0442\u0435\u0441\u044c \u0437 \u043d\u0430\u0448\u043e\u044e \u0412\u0456\u0437\u0456\u0454\u044e \u042f\u043a\u0449\u043e \u0432\u0438 \u0437\u0430\u0446\u0456\u043a\u0430\u0432\u043b\u0435\u043d\u0456 \u0432 \u0442\u043e\u043c\u0443, \u043f\u0440\u043e \u0449\u043e \u043c\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438, \u0456 \u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u043e\u0433\u043b\u0438\u0431\u0438\u0442\u0438 \u0441\u0432\u043e\u0457 \u0437\u043d\u0430\u043d\u043d\u044f \u043f\u0440\u043e \u0442\u0435, \u044f\u043a BlueBag \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0443\u0454 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0456 \u0444\u0456\u043d\u0430\u043d\u0441\u043e\u0432\u0456 \u0441\u0438\u0441\u0442\u0435\u043c\u0438, \u0437\u0430\u043f\u0440\u043e\u0448\u0443\u0454\u043c\u043e \u0432\u0430\u0441 \u043e\u0437\u043d\u0430\u0439\u043e\u043c\u0438\u0442\u0438\u0441\u044f \u0437 \u043d\u0430\u0448\u0438\u043c \u0431\u0456\u043b\u0438\u043c \u043f\u0430\u043f\u0435\u0440\u043e\u043c. \u0412\u0456\u043d \u043f\u0440\u043e\u043f\u043e\u043d\u0443\u0454 \u0432\u0441\u0435\u0431\u0456\u0447\u043d\u0438\u0439 \u043f\u043e\u0433\u043b\u044f\u0434 \u043d\u0430 \u043d\u0430\u0448\u0443 \u043c\u0456\u0441\u0456\u044e, \u0432\u0456\u0437\u0456\u044e \u0442\u0430 \u0442\u0435\u0445\u043d\u0456\u0447\u043d\u0456 \u0430\u0441\u043f\u0435\u043a\u0442\u0438 \u043d\u0430\u0448\u043e\u0457 \u0435\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0438. \u0414\u0456\u0437\u043d\u0430\u0439\u0442\u0435\u0441\u044c \u0431\u0456\u043b\u044c\u0448\u0435: \u2022 \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0411\u0456\u043b\u0438\u0439 \u043f\u0430\u043f\u0456\u0440: [\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0437\u0430\u0440\u0430\u0437], \u0449\u043e\u0431 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0433\u043b\u0438\u0431\u043e\u043a\u0435 \u0440\u043e\u0437\u0443\u043c\u0456\u043d\u043d\u044f \u043d\u0430\u0448\u043e\u0457 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0438 \u0442\u0430 \u0457\u0457 \u043f\u043e\u0442\u0435\u043d\u0446\u0456\u0430\u043b\u0443. \u2022 \u041f\u0440\u0438\u0454\u0434\u043d\u0443\u0439\u0442\u0435\u0441\u044c \u0434\u043e \u043d\u0430\u0448\u043e\u0457 \u0441\u043f\u0456\u043b\u044c\u043d\u043e\u0442\u0438: \u041e\u043d\u043e\u0432\u043b\u044e\u0439\u0442\u0435\u0441\u044c \u0456 \u0432\u0437\u0430\u0454\u043c\u043e\u0434\u0456\u0439\u0442\u0435 \u0437 \u043d\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0448\u0456 \u043a\u0430\u043d\u0430\u043b\u0438 \u0432 \u0441\u043e\u0446\u0456\u0430\u043b\u044c\u043d\u0438\u0445 \u043c\u0435\u0440\u0435\u0436\u0430\u0445. DISCORD / REDDIT / X / TELEGRAM"},"work_with_us":{"title":"\u041f\u0440\u0430\u0446\u044e\u0439\u0442\u0435 \u0437 \u043d\u0430\u043c\u0438-   \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a: \xab\u041f\u0440\u0438\u0454\u0434\u043d\u0443\u0439\u0442\u0435\u0441\u044c \u0434\u043e \u043d\u0430\u0441 \u0443 \u0444\u043e\u0440\u043c\u0443\u0432\u0430\u043d\u043d\u0456 \u043c\u0430\u0439\u0431\u0443\u0442\u043d\u044c\u043e\u0433\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0456\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u0433\u043e \u0440\u043e\u0437\u0448\u0438\u0440\u0435\u043d\u043d\u044f\xbb","text":"\u041c\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0448\u0443\u043a\u0430\u0454\u043c\u043e \u0432\u0456\u0434\u0434\u0430\u043d\u0438\u0445 \u043e\u0441\u0456\u0431 \u0442\u0430 \u043e\u0440\u0433\u0430\u043d\u0456\u0437\u0430\u0446\u0456\u0439, \u044f\u043a\u0456 \u043f\u0440\u0438\u0454\u0434\u043d\u0430\u044e\u0442\u044c\u0441\u044f \u0434\u043e \u043d\u0430\u0448\u043e\u0457 \u043c\u0456\u0441\u0456\u0457. \u042f\u043a\u0449\u043e \u0432\u0438 \u0437\u0430\u0445\u043e\u043f\u043b\u0435\u043d\u0456 \u0440\u043e\u0437\u0432\u0438\u0442\u043a\u043e\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0438\u0445 \u0444\u0456\u043d\u0430\u043d\u0441\u043e\u0432\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043c\u0438 \u0445\u043e\u0447\u0435\u043c\u043e \u043f\u043e\u0447\u0443\u0442\u0438 \u0432\u0430\u0441. \u041d\u0435\u0437\u0430\u043b\u0435\u0436\u043d\u043e \u0432\u0456\u0434 \u0442\u043e\u0433\u043e, \u0447\u0438 \u0454 \u0432\u0438 \u0440\u043e\u0437\u0440\u043e\u0431\u043d\u0438\u043a\u043e\u043c, \u043c\u0430\u0440\u043a\u0435\u0442\u043e\u043b\u043e\u0433\u043e\u043c, \u0447\u0438 \u043c\u0430\u0454\u0442\u0435 \u0443\u043d\u0456\u043a\u0430\u043b\u044c\u043d\u0456 \u0456\u0434\u0435\u0457 \u0442\u0430 \u0435\u043a\u0441\u043f\u0435\u0440\u0442\u0438\u0437\u0443, \u0454 \u0431\u0430\u0433\u0430\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0456\u0432 \u0441\u043f\u0456\u0432\u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438 \u0437 \u043d\u0430\u043c\u0438. \u042f\u043a \u0432\u0437\u044f\u0442\u0438 \u0443\u0447\u0430\u0441\u0442\u044c: \u2022 \u041a\u0430\u0440\'\u0454\u0440\u043d\u0456 \u043c\u043e\u0436\u043b\u0438\u0432\u043e\u0441\u0442\u0456: \u042f\u043a\u0449\u043e \u0432\u0438 \u0437\u0430\u0446\u0456\u043a\u0430\u0432\u043b\u0435\u043d\u0456 \u0432 \u043a\u0430\u0440\'\u0454\u0440\u043d\u0438\u0445 \u043c\u043e\u0436\u043b\u0438\u0432\u043e\u0441\u0442\u044f\u0445 \u0437 BlueBag, \u0431\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u043d\u0430\u0434\u0456\u0448\u043b\u0456\u0442\u044c \u0441\u0432\u043e\u0454 \u0440\u0435\u0437\u044e\u043c\u0435 \u0442\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f/\u0441\u0443\u043f\u0440\u043e\u0432\u0456\u0434\u043d\u0438\u0439 \u043b\u0438\u0441\u0442 \u043d\u0430 jobs@bluebag.app. \u2022 \u041f\u0430\u0440\u0442\u043d\u0435\u0440\u0441\u0442\u0432\u043e: \u0414\u043b\u044f \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0441\u0442\u0432\u0430 \u0437\u0432\u0435\u0440\u0442\u0430\u0439\u0442\u0435\u0441\u044f \u0434\u043e \u043d\u0430\u0441 \u043d\u0430 Partnerships@bluebag.app. \u041d\u0430\u0434\u0430\u0439\u0442\u0435 \u0434\u0435\u0442\u0430\u043b\u0456 \u043f\u0440\u043e \u0441\u0435\u0431\u0435/\u0432\u0430\u0448\u0443 \u043e\u0440\u0433\u0430\u043d\u0456\u0437\u0430\u0446\u0456\u044e \u0442\u0430 \u0442\u0435, \u044f\u043a \u0432\u0438 \u0443\u044f\u0432\u043b\u044f\u0454\u0442\u0435 \u0441\u043f\u0456\u0432\u043f\u0440\u0430\u0446\u044e. \u2022 \u041f\u043e\u0434\u0456\u043b\u0456\u0442\u044c\u0441\u044f \u0432\u0430\u0448\u0438\u043c\u0438 \u0456\u0434\u0435\u044f\u043c\u0438: \u041c\u0438 \u0432\u0456\u0442\u0430\u0454\u043c\u043e \u0456\u043d\u043d\u043e\u0432\u0430\u0446\u0456\u0439\u043d\u0456 \u0456\u0434\u0435\u0457 \u0442\u0430 \u043f\u0440\u043e\u043f\u043e\u0437\u0438\u0446\u0456\u0457. \u042f\u043a\u0449\u043e \u0443 \u0432\u0430\u0441 \u0454 \u043f\u0440\u043e\u043f\u043e\u0437\u0438\u0446\u0456\u0457 \u043f\u0440\u043e \u0442\u0435, \u044f\u043a \u0432\u0438 \u0447\u0438 \u0432\u0430\u0448\u0430 \u043e\u0440\u0433\u0430\u043d\u0456\u0437\u0430\u0446\u0456\u044f \u043c\u043e\u0436\u0443\u0442\u044c \u0441\u043f\u0440\u0438\u044f\u0442\u0438 \u043d\u0430\u0448\u0456\u0439 \u0432\u0456\u0437\u0456\u0457, \u0431\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0437\u0432\'\u044f\u0436\u0456\u0442\u044c\u0441\u044f \u0437 \u043d\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 nextbigthing@bluebag.app."}}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(r,i){if(1&i&&(r=this(r)),8&i)return r;if("object"===typeof r&&r){if(4&i&&r.__esModule)return r;if(16&i&&"function"===typeof r.then)return r}var a=Object.create(null);n.r(a);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&i&&r;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>o[e]=()=>r[e]));return o.default=()=>r,n.d(a,o),a}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"static/js/"+e+".63834957.chunk.js",n.miniCssF=e=>{},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="webapp:";n.l=(r,i,a,o)=>{if(e[r])e[r].push(i);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+a){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+a),s.src=r),e[r]=[i];var h=(t,n)=>{s.onerror=s.onload=null,clearTimeout(p);var i=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),l&&document.head.appendChild(s)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/",(()=>{var e={792:0};n.f.j=(t,r)=>{var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var a=new Promise(((n,r)=>i=e[t]=[n,r]));r.push(i[2]=a);var o=n.p+n.u(t),s=new Error;n.l(o,(r=>{if(n.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",s.name="ChunkLoadError",s.type=a,s.request=o,i[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var i,a,o=r[0],s=r[1],l=r[2],c=0;if(o.some((t=>0!==e[t]))){for(i in s)n.o(s,i)&&(n.m[i]=s[i]);if(l)l(n)}for(t&&t(r);c<o.length;c++)a=o[c],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=self.webpackChunkwebapp=self.webpackChunkwebapp||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),n.nc=void 0,(()=>{"use strict";var e={};n.r(e),n.d(e,{ACESFilmicToneMapping:()=>wb,AddEquation:()=>Gy,AddOperation:()=>yb,AdditiveAnimationBlendMode:()=>s_,AdditiveBlending:()=>Fy,AgXToneMapping:()=>Ab,AlphaFormat:()=>ox,AlwaysCompare:()=>K_,AlwaysDepth:()=>cb,AlwaysStencilFunc:()=>H_,AmbientLight:()=>HI,AnimationAction:()=>PD,AnimationClip:()=>dI,AnimationLoader:()=>xI,AnimationMixer:()=>ID,AnimationObjectGroup:()=>RD,AnimationUtils:()=>QB,ArcCurve:()=>gP,ArrayCamera:()=>gT,ArrowHelper:()=>AL,AttachedBindMode:()=>Cb,Audio:()=>fD,AudioAnalyser:()=>xD,AudioContext:()=>tD,AudioListener:()=>pD,AudioLoader:()=>nD,AxesHelper:()=>ML,BackSide:()=>Ly,BasicDepthPacking:()=>d_,BasicShadowMap:()=>Ry,BatchedMesh:()=>zR,Bone:()=>lR,BooleanKeyframeTrack:()=>iI,Box2:()=>XD,Box3:()=>nw,Box3Helper:()=>xL,BoxGeometry:()=>pA,BoxHelper:()=>bL,BufferAttribute:()=>PE,BufferGeometry:()=>JE,BufferGeometryLoader:()=>$I,ByteType:()=>Kb,Cache:()=>pI,Camera:()=>bA,CameraHelper:()=>gL,CanvasTexture:()=>pP,CapsuleGeometry:()=>NP,CatmullRomCurve3:()=>SP,CineonToneMapping:()=>Sb,CircleGeometry:()=>FP,ClampToEdgeWrapping:()=>Ob,Clock:()=>sD,Color:()=>yE,ColorKeyframeTrack:()=>aI,ColorManagement:()=>kS,CompressedArrayTexture:()=>dP,CompressedCubeTexture:()=>hP,CompressedTexture:()=>uP,CompressedTextureLoader:()=>_I,ConeGeometry:()=>zP,ConstantAlphaFactor:()=>ob,ConstantColorFactor:()=>ib,Controls:()=>TL,CubeCamera:()=>AA,CubeReflectionMapping:()=>Pb,CubeRefractionMapping:()=>Bb,CubeTexture:()=>MA,CubeTextureLoader:()=>wI,CubeUVReflectionMapping:()=>Lb,CubicBezierCurve:()=>MP,CubicBezierCurve3:()=>CP,CubicInterpolant:()=>eI,CullFaceBack:()=>My,CullFaceFront:()=>Cy,CullFaceFrontBack:()=>Ty,CullFaceNone:()=>Ay,Curve:()=>fP,CurvePath:()=>LP,CustomBlending:()=>Hy,CustomToneMapping:()=>Eb,CylinderGeometry:()=>UP,Cylindrical:()=>jD,Data3DTexture:()=>YS,DataArrayTexture:()=>$S,DataTexture:()=>cR,DataTextureLoader:()=>EI,DataUtils:()=>CE,DecrementStencilOp:()=>P_,DecrementWrapStencilOp:()=>I_,DefaultLoadingManager:()=>mI,DepthFormat:()=>dx,DepthStencilFormat:()=>hx,DepthTexture:()=>_M,DetachedBindMode:()=>Tb,DirectionalLight:()=>zI,DirectionalLightHelper:()=>pL,DiscreteInterpolant:()=>nI,DisplayP3ColorSpace:()=>x_,DodecahedronGeometry:()=>GP,DoubleSide:()=>ky,DstAlphaFactor:()=>Zy,DstColorFactor:()=>tb,DynamicCopyUsage:()=>rS,DynamicDrawUsage:()=>q_,DynamicReadUsage:()=>eS,EdgesGeometry:()=>JP,EllipseCurve:()=>mP,EqualCompare:()=>V_,EqualDepth:()=>hb,EqualStencilFunc:()=>O_,EquirectangularReflectionMapping:()=>Ib,EquirectangularRefractionMapping:()=>Db,Euler:()=>Uw,EventDispatcher:()=>cS,ExtrudeGeometry:()=>wB,FileLoader:()=>bI,Float16BufferAttribute:()=>FE,Float32BufferAttribute:()=>UE,FloatType:()=>ex,Fog:()=>TT,FogExp2:()=>CT,FramebufferTexture:()=>cP,FrontSide:()=>Dy,Frustum:()=>LA,GLBufferAttribute:()=>ND,GLSL1:()=>aS,GLSL3:()=>oS,GreaterCompare:()=>X_,GreaterDepth:()=>fb,GreaterEqualCompare:()=>$_,GreaterEqualDepth:()=>pb,GreaterEqualStencilFunc:()=>z_,GreaterStencilFunc:()=>F_,GridHelper:()=>lL,Group:()=>vT,HalfFloatType:()=>tx,HemisphereLight:()=>CI,HemisphereLightHelper:()=>sL,IcosahedronGeometry:()=>AB,ImageBitmapLoader:()=>ZI,ImageLoader:()=>SI,ImageUtils:()=>US,IncrementStencilOp:()=>R_,IncrementWrapStencilOp:()=>B_,InstancedBufferAttribute:()=>pR,InstancedBufferGeometry:()=>JI,InstancedInterleavedBuffer:()=>OD,InstancedMesh:()=>_R,Int16BufferAttribute:()=>LE,Int32BufferAttribute:()=>OE,Int8BufferAttribute:()=>BE,IntType:()=>Qb,InterleavedBuffer:()=>PT,InterleavedBufferAttribute:()=>IT,Interpolant:()=>ZB,InterpolateDiscrete:()=>e_,InterpolateLinear:()=>t_,InterpolateSmooth:()=>n_,InvertStencilOp:()=>D_,KeepStencilOp:()=>C_,KeyframeTrack:()=>rI,LOD:()=>qT,LatheGeometry:()=>OP,Layers:()=>zw,LessCompare:()=>j_,LessDepth:()=>ub,LessEqualCompare:()=>W_,LessEqualDepth:()=>db,LessEqualStencilFunc:()=>N_,LessStencilFunc:()=>k_,Light:()=>MI,LightProbe:()=>VI,Line:()=>KR,Line3:()=>KD,LineBasicMaterial:()=>HR,LineCurve:()=>TP,LineCurve3:()=>RP,LineDashedMaterial:()=>XB,LineLoop:()=>eP,LineSegments:()=>ZR,LinearDisplayP3ColorSpace:()=>__,LinearFilter:()=>jb,LinearInterpolant:()=>tI,LinearMipMapLinearFilter:()=>Jb,LinearMipMapNearestFilter:()=>Wb,LinearMipmapLinearFilter:()=>Xb,LinearMipmapNearestFilter:()=>Vb,LinearSRGBColorSpace:()=>b_,LinearToneMapping:()=>xb,LinearTransfer:()=>S_,Loader:()=>gI,LoaderUtils:()=>XI,LoadingManager:()=>fI,LoopOnce:()=>qx,LoopPingPong:()=>Zx,LoopRepeat:()=>Qx,LuminanceAlphaFormat:()=>ux,LuminanceFormat:()=>cx,MOUSE:()=>wy,Material:()=>_E,MaterialLoader:()=>WI,MathUtils:()=>xS,Matrix2:()=>VD,Matrix3:()=>SS,Matrix4:()=>Rw,MaxEquation:()=>Xy,Mesh:()=>dA,MeshBasicMaterial:()=>SE,MeshDepthMaterial:()=>lT,MeshDistanceMaterial:()=>cT,MeshLambertMaterial:()=>VB,MeshMatcapMaterial:()=>WB,MeshNormalMaterial:()=>jB,MeshPhongMaterial:()=>HB,MeshPhysicalMaterial:()=>zB,MeshStandardMaterial:()=>UB,MeshToonMaterial:()=>GB,MinEquation:()=>Wy,MirroredRepeatWrapping:()=>Nb,MixOperation:()=>vb,MultiplyBlending:()=>zy,MultiplyOperation:()=>gb,NearestFilter:()=>Fb,NearestMipMapLinearFilter:()=>Gb,NearestMipMapNearestFilter:()=>zb,NearestMipmapLinearFilter:()=>Hb,NearestMipmapNearestFilter:()=>Ub,NeutralToneMapping:()=>Mb,NeverCompare:()=>G_,NeverDepth:()=>lb,NeverStencilFunc:()=>L_,NoBlending:()=>Oy,NoColorSpace:()=>v_,NoToneMapping:()=>bb,NormalAnimationBlendMode:()=>o_,NormalBlending:()=>Ny,NotEqualCompare:()=>J_,NotEqualDepth:()=>mb,NotEqualStencilFunc:()=>U_,NumberKeyframeTrack:()=>oI,Object3D:()=>nE,ObjectLoader:()=>KI,ObjectSpaceNormalMap:()=>g_,OctahedronGeometry:()=>MB,OneFactor:()=>$y,OneMinusConstantAlphaFactor:()=>sb,OneMinusConstantColorFactor:()=>ab,OneMinusDstAlphaFactor:()=>eb,OneMinusDstColorFactor:()=>nb,OneMinusSrcAlphaFactor:()=>Qy,OneMinusSrcColorFactor:()=>Yy,OrthographicCamera:()=>YA,P3Primaries:()=>A_,PCFShadowMap:()=>Py,PCFSoftShadowMap:()=>By,PMREMGenerator:()=>lM,Path:()=>kP,PerspectiveCamera:()=>wA,Plane:()=>BA,PlaneGeometry:()=>NA,PlaneHelper:()=>_L,PointLight:()=>FI,PointLightHelper:()=>rL,Points:()=>oP,PointsMaterial:()=>tP,PolarGridHelper:()=>cL,PolyhedronGeometry:()=>HP,PositionalAudio:()=>bD,PropertyBinding:()=>TD,PropertyMixer:()=>_D,QuadraticBezierCurve:()=>PP,QuadraticBezierCurve3:()=>BP,Quaternion:()=>QS,QuaternionKeyframeTrack:()=>lI,QuaternionLinearInterpolant:()=>sI,RED_GREEN_RGTC2_Format:()=>Kx,RED_RGTC1_Format:()=>Jx,REVISION:()=>Sy,RGBADepthPacking:()=>h_,RGBAFormat:()=>lx,RGBAIntegerFormat:()=>yx,RGBA_ASTC_10x10_Format:()=>Hx,RGBA_ASTC_10x5_Format:()=>Fx,RGBA_ASTC_10x6_Format:()=>Ux,RGBA_ASTC_10x8_Format:()=>zx,RGBA_ASTC_12x10_Format:()=>Gx,RGBA_ASTC_12x12_Format:()=>jx,RGBA_ASTC_4x4_Format:()=>Px,RGBA_ASTC_5x4_Format:()=>Bx,RGBA_ASTC_5x5_Format:()=>Ix,RGBA_ASTC_6x5_Format:()=>Dx,RGBA_ASTC_6x6_Format:()=>Lx,RGBA_ASTC_8x5_Format:()=>kx,RGBA_ASTC_8x6_Format:()=>Ox,RGBA_ASTC_8x8_Format:()=>Nx,RGBA_BPTC_Format:()=>Vx,RGBA_ETC2_EAC_Format:()=>Rx,RGBA_PVRTC_2BPPV1_Format:()=>Mx,RGBA_PVRTC_4BPPV1_Format:()=>Ax,RGBA_S3TC_DXT1_Format:()=>xx,RGBA_S3TC_DXT3_Format:()=>_x,RGBA_S3TC_DXT5_Format:()=>Sx,RGBDepthPacking:()=>p_,RGBFormat:()=>sx,RGBIntegerFormat:()=>vx,RGB_BPTC_SIGNED_Format:()=>Wx,RGB_BPTC_UNSIGNED_Format:()=>Xx,RGB_ETC1_Format:()=>Cx,RGB_ETC2_Format:()=>Tx,RGB_PVRTC_2BPPV1_Format:()=>Ex,RGB_PVRTC_4BPPV1_Format:()=>wx,RGB_S3TC_DXT1_Format:()=>bx,RGDepthPacking:()=>f_,RGFormat:()=>mx,RGIntegerFormat:()=>gx,RawShaderMaterial:()=>FB,Ray:()=>Tw,Raycaster:()=>UD,Rec709Primaries:()=>E_,RectAreaLight:()=>GI,RedFormat:()=>px,RedIntegerFormat:()=>fx,ReinhardToneMapping:()=>_b,RenderTarget:()=>XS,RepeatWrapping:()=>kb,ReplaceStencilOp:()=>T_,ReverseSubtractEquation:()=>Vy,RingGeometry:()=>CB,SIGNED_RED_GREEN_RGTC2_Format:()=>Yx,SIGNED_RED_RGTC1_Format:()=>$x,SRGBColorSpace:()=>y_,SRGBTransfer:()=>w_,Scene:()=>RT,ShaderChunk:()=>FA,ShaderLib:()=>zA,ShaderMaterial:()=>yA,ShadowMaterial:()=>NB,Shape:()=>$P,ShapeGeometry:()=>TB,ShapePath:()=>CL,ShapeUtils:()=>xB,ShortType:()=>Yb,Skeleton:()=>hR,SkeletonHelper:()=>tL,SkinnedMesh:()=>sR,Source:()=>HS,Sphere:()=>xw,SphereGeometry:()=>RB,Spherical:()=>GD,SphericalHarmonics3:()=>jI,SplineCurve:()=>IP,SpotLight:()=>DI,SpotLightHelper:()=>qD,Sprite:()=>JT,SpriteMaterial:()=>DT,SrcAlphaFactor:()=>qy,SrcAlphaSaturateFactor:()=>rb,SrcColorFactor:()=>Ky,StaticCopyUsage:()=>nS,StaticDrawUsage:()=>Y_,StaticReadUsage:()=>Z_,StereoCamera:()=>oD,StreamCopyUsage:()=>iS,StreamDrawUsage:()=>Q_,StreamReadUsage:()=>tS,StringKeyframeTrack:()=>cI,SubtractEquation:()=>jy,SubtractiveBlending:()=>Uy,TOUCH:()=>Ey,TangentSpaceNormalMap:()=>m_,TetrahedronGeometry:()=>PB,Texture:()=>VS,TextureLoader:()=>AI,TextureUtils:()=>pT,TorusGeometry:()=>BB,TorusKnotGeometry:()=>IB,Triangle:()=>pE,TriangleFanDrawMode:()=>u_,TriangleStripDrawMode:()=>c_,TrianglesDrawMode:()=>l_,TubeGeometry:()=>DB,UVMapping:()=>Rb,Uint16BufferAttribute:()=>kE,Uint32BufferAttribute:()=>NE,Uint8BufferAttribute:()=>IE,Uint8ClampedBufferAttribute:()=>DE,Uniform:()=>DD,UniformsGroup:()=>kD,UniformsLib:()=>UA,UniformsUtils:()=>vA,UnsignedByteType:()=>$b,UnsignedInt248Type:()=>ix,UnsignedInt5999Type:()=>ax,UnsignedIntType:()=>Zb,UnsignedShort4444Type:()=>nx,UnsignedShort5551Type:()=>rx,UnsignedShortType:()=>qb,VSMShadowMap:()=>Iy,Vector2:()=>_S,Vector3:()=>ZS,Vector4:()=>WS,VectorKeyframeTrack:()=>uI,VideoTexture:()=>lP,WebGL3DRenderTarget:()=>qS,WebGLArrayRenderTarget:()=>KS,WebGLCoordinateSystem:()=>sS,WebGLCubeRenderTarget:()=>CA,WebGLMultipleRenderTargets:()=>RL,WebGLRenderTarget:()=>JS,WebGLRenderer:()=>MT,WebGLUtils:()=>mT,WebGPUCoordinateSystem:()=>lS,WireframeGeometry:()=>LB,WrapAroundEnding:()=>a_,ZeroCurvatureEnding:()=>r_,ZeroFactor:()=>Jy,ZeroSlopeEnding:()=>i_,ZeroStencilOp:()=>M_,createCanvasElement:()=>TS});var t=n(5043),r=n.t(t,2),i=n(4391);const a=e=>{e&&e instanceof Function&&n.e(453).then(n.bind(n,6453)).then((t=>{let{getCLS:n,getFID:r,getFCP:i,getLCP:a,getTTFB:o}=t;n(e),r(e),i(e),a(e),o(e)}))};var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};Object.create;function s(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var l=n(7324),c=n.n(l),u="-ms-",d="-moz-",h="-webkit-",p="comm",f="rule",m="decl",g="@import",v="@keyframes",y="@layer",b=Math.abs,x=String.fromCharCode,_=Object.assign;function S(e){return e.trim()}function w(e,t){return(e=t.exec(e))?e[0]:e}function E(e,t,n){return e.replace(t,n)}function A(e,t,n){return e.indexOf(t,n)}function M(e,t){return 0|e.charCodeAt(t)}function C(e,t,n){return e.slice(t,n)}function T(e){return e.length}function R(e){return e.length}function P(e,t){return t.push(e),e}function B(e,t){return e.filter((function(e){return!w(e,t)}))}var I=1,D=1,L=0,k=0,O=0,N="";function F(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:I,column:D,length:o,return:"",siblings:s}}function U(e,t){return _(F("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function z(e){for(;e.root;)e=U(e.root,{children:[e]});P(e,e.siblings)}function H(){return O=k>0?M(N,--k):0,D--,10===O&&(D=1,I--),O}function G(){return O=k<L?M(N,k++):0,D++,10===O&&(D=1,I++),O}function j(){return M(N,k)}function V(){return k}function W(e,t){return C(N,e,t)}function X(e){switch(e){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 J(e){return I=D=1,L=T(N=e),k=0,[]}function $(e){return N="",e}function K(e){return S(W(k-1,Q(91===e?e+2:40===e?e+1:e)))}function Y(e){for(;(O=j())&&O<33;)G();return X(e)>2||X(O)>3?"":" "}function q(e,t){for(;--t&&G()&&!(O<48||O>102||O>57&&O<65||O>70&&O<97););return W(e,V()+(t<6&&32==j()&&32==G()))}function Q(e){for(;G();)switch(O){case e:return k;case 34:case 39:34!==e&&39!==e&&Q(O);break;case 40:41===e&&Q(e);break;case 92:G()}return k}function Z(e,t){for(;G()&&e+O!==57&&(e+O!==84||47!==j()););return"/*"+W(t,k-1)+"*"+x(47===e?e:G())}function ee(e){for(;!X(j());)G();return W(e,k)}function te(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function ne(e,t,n,r){switch(e.type){case y:if(e.children.length)break;case g:case m:return e.return=e.return||e.value;case p:return"";case v:return e.return=e.value+"{"+te(e.children,r)+"}";case f:if(!T(e.value=e.props.join(",")))return""}return T(n=te(e.children,r))?e.return=e.value+"{"+n+"}":""}function re(e,t,n){switch(function(e,t){return 45^M(e,0)?(((t<<2^M(e,0))<<2^M(e,1))<<2^M(e,2))<<2^M(e,3):0}(e,t)){case 5103:return h+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return h+e+e;case 4789:return d+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return h+e+d+e+u+e+e;case 5936:switch(M(e,t+11)){case 114:return h+e+u+E(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return h+e+u+E(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return h+e+u+E(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return h+e+u+e+e;case 6165:return h+e+u+"flex-"+e+e;case 5187:return h+e+E(e,/(\w+).+(:[^]+)/,h+"box-$1$2"+u+"flex-$1$2")+e;case 5443:return h+e+u+"flex-item-"+E(e,/flex-|-self/g,"")+(w(e,/flex-|baseline/)?"":u+"grid-row-"+E(e,/flex-|-self/g,""))+e;case 4675:return h+e+u+"flex-line-pack"+E(e,/align-content|flex-|-self/g,"")+e;case 5548:return h+e+u+E(e,"shrink","negative")+e;case 5292:return h+e+u+E(e,"basis","preferred-size")+e;case 6060:return h+"box-"+E(e,"-grow","")+h+e+u+E(e,"grow","positive")+e;case 4554:return h+E(e,/([^-])(transform)/g,"$1"+h+"$2")+e;case 6187:return E(E(E(e,/(zoom-|grab)/,h+"$1"),/(image-set)/,h+"$1"),e,"")+e;case 5495:case 3959:return E(e,/(image-set\([^]*)/,h+"$1$`$1");case 4968:return E(E(e,/(.+:)(flex-)?(.*)/,h+"box-pack:$3"+u+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+h+e+e;case 4200:if(!w(e,/flex-|baseline/))return u+"grid-column-align"+C(e,t)+e;break;case 2592:case 3360:return u+E(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,w(e.props,/grid-\w+-end/)}))?~A(e+(n=n[t].value),"span",0)?e:u+E(e,"-start","")+e+u+"grid-row-span:"+(~A(n,"span",0)?w(n,/\d+/):+w(n,/\d+/)-+w(e,/\d+/))+";":u+E(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return w(e.props,/grid-\w+-start/)}))?e:u+E(E(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return E(e,/(.+)-inline(.+)/,h+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(T(e)-1-t>6)switch(M(e,t+1)){case 109:if(45!==M(e,t+4))break;case 102:return E(e,/(.+:)(.+)-([^]+)/,"$1"+h+"$2-$3$1"+d+(108==M(e,t+3)?"$3":"$2-$3"))+e;case 115:return~A(e,"stretch",0)?re(E(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return E(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,i,a,o,s){return u+n+":"+r+s+(i?u+n+"-span:"+(a?o:+o-+r)+s:"")+e}));case 4949:if(121===M(e,t+6))return E(e,":",":"+h)+e;break;case 6444:switch(M(e,45===M(e,14)?18:11)){case 120:return E(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+h+(45===M(e,14)?"inline-":"")+"box$3$1"+h+"$2$3$1"+u+"$2box$3")+e;case 100:return E(e,":",":"+u)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return E(e,"scroll-","scroll-snap-")+e}return e}function ie(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case m:return void(e.return=re(e.value,e.length,n));case v:return te([U(e,{value:E(e.value,"@","@"+h)})],r);case f:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(w(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":z(U(e,{props:[E(t,/:(read-\w+)/,":"+d+"$1")]})),z(U(e,{props:[t]})),_(e,{props:B(n,r)});break;case"::placeholder":z(U(e,{props:[E(t,/:(plac\w+)/,":"+h+"input-$1")]})),z(U(e,{props:[E(t,/:(plac\w+)/,":"+d+"$1")]})),z(U(e,{props:[E(t,/:(plac\w+)/,u+"input-$1")]})),z(U(e,{props:[t]})),_(e,{props:B(n,r)})}return""}))}}function ae(e){return $(oe("",null,null,null,[""],e=J(e),0,[0],e))}function oe(e,t,n,r,i,a,o,s,l){for(var c=0,u=0,d=o,h=0,p=0,f=0,m=1,g=1,v=1,y=0,_="",S=i,w=a,C=r,R=_;g;)switch(f=y,y=G()){case 40:if(108!=f&&58==M(R,d-1)){-1!=A(R+=E(K(y),"&","&\f"),"&\f",b(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:R+=K(y);break;case 9:case 10:case 13:case 32:R+=Y(f);break;case 92:R+=q(V()-1,7);continue;case 47:switch(j()){case 42:case 47:P(le(Z(G(),V()),t,n,l),l);break;default:R+="/"}break;case 123*m:s[c++]=T(R)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==v&&(R=E(R,/\f/g,"")),p>0&&T(R)-d&&P(p>32?ce(R+";",r,n,d-1,l):ce(E(R," ","")+";",r,n,d-2,l),l);break;case 59:R+=";";default:if(P(C=se(R,t,n,c,u,i,s,_,S=[],w=[],d,a),a),123===y)if(0===u)oe(R,t,C,C,S,a,d,s,w);else switch(99===h&&110===M(R,3)?100:h){case 100:case 108:case 109:case 115:oe(e,C,C,r&&P(se(e,C,C,0,0,i,s,_,i,S=[],d,w),w),i,w,d,s,r?S:w);break;default:oe(R,C,C,C,[""],w,0,s,w)}}c=u=p=0,m=v=1,_=R="",d=o;break;case 58:d=1+T(R),p=f;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==H())continue;switch(R+=x(y),y*m){case 38:v=u>0?1:(R+="\f",-1);break;case 44:s[c++]=(T(R)-1)*v,v=1;break;case 64:45===j()&&(R+=K(G())),h=j(),u=d=T(_=R+=ee(V())),y++;break;case 45:45===f&&2==T(R)&&(m=0)}}return a}function se(e,t,n,r,i,a,o,s,l,c,u,d){for(var h=i-1,p=0===i?a:[""],m=R(p),g=0,v=0,y=0;g<r;++g)for(var x=0,_=C(e,h+1,h=b(v=o[g])),w=e;x<m;++x)(w=S(v>0?p[x]+" "+_:E(_,/&\f/g,p[x])))&&(l[y++]=w);return F(e,t,n,0===i?f:s,l,c,u,d)}function le(e,t,n,r){return F(e,t,n,p,x(O),C(e,2,-2),0,r)}function ce(e,t,n,r,i){return F(e,t,n,m,C(e,0,r),C(e,r+1,-1),r,i)}var ue={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},de="undefined"!=typeof process&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}&&({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.REACT_APP_SC_ATTR||{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.SC_ATTR)||"data-styled",he="active",pe="data-styled-version",fe="6.1.13",me="/*!sc*/\n",ge="undefined"!=typeof window&&"HTMLElement"in window,ve=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.REACT_APP_SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.REACT_APP_SC_DISABLE_SPEEDY?"false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.REACT_APP_SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.SC_DISABLE_SPEEDY&&("false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SHOW_3D_GUI:"false",REACT_APP_WEB3_FORMS_API_KEY:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}.SC_DISABLE_SPEEDY)),ye={},be=(new Set,Object.freeze([])),xe=Object.freeze({});function _e(e,t,n){return void 0===n&&(n=xe),e.theme!==n.theme&&e.theme||t||n.theme}var Se=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),we=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ee=/(^-|-$)/g;function Ae(e){return e.replace(we,"-").replace(Ee,"")}var Me=/(a)(d)/gi,Ce=52,Te=function(e){return String.fromCharCode(e+(e>25?39:97))};function Re(e){var t,n="";for(t=Math.abs(e);t>Ce;t=t/Ce|0)n=Te(t%Ce)+n;return(Te(t%Ce)+n).replace(Me,"$1-$2")}var Pe,Be=5381,Ie=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},De=function(e){return Ie(Be,e)};function Le(e){return Re(De(e)>>>0)}function ke(e){return e.displayName||e.name||"Component"}function Oe(e){return"string"==typeof e&&!0}var Ne="function"==typeof Symbol&&Symbol.for,Fe=Ne?Symbol.for("react.memo"):60115,Ue=Ne?Symbol.for("react.forward_ref"):60112,ze={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},He={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ge={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},je=((Pe={})[Ue]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Pe[Fe]=Ge,Pe);function Ve(e){return("type"in(t=e)&&t.type.$$typeof)===Fe?Ge:"$$typeof"in e?je[e.$$typeof]:ze;var t}var We=Object.defineProperty,Xe=Object.getOwnPropertyNames,Je=Object.getOwnPropertySymbols,$e=Object.getOwnPropertyDescriptor,Ke=Object.getPrototypeOf,Ye=Object.prototype;function qe(e,t,n){if("string"!=typeof t){if(Ye){var r=Ke(t);r&&r!==Ye&&qe(e,r,n)}var i=Xe(t);Je&&(i=i.concat(Je(t)));for(var a=Ve(e),o=Ve(t),s=0;s<i.length;++s){var l=i[s];if(!(l in He||n&&n[l]||o&&l in o||a&&l in a)){var c=$e(t,l);try{We(e,l,c)}catch(e){}}}}return e}function Qe(e){return"function"==typeof e}function Ze(e){return"object"==typeof e&&"styledComponentId"in e}function et(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function tt(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=t?t+e[r]:e[r];return n}function nt(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function rt(e,t,n){if(void 0===n&&(n=!1),!n&&!nt(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=rt(e[r],t[r]);else if(nt(t))for(var r in t)e[r]=rt(e[r],t[r]);return e}function it(e,t){Object.defineProperty(e,"toString",{value:t})}function at(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var ot=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)if((i<<=1)<0)throw at(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var a=r;a<i;a++)this.groupSizes[a]=0}for(var o=this.indexOfGroup(e+1),s=(a=0,t.length);a<s;a++)this.tag.insertRule(o,t[a])&&(this.groupSizes[e]++,o++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var i=n;i<r;i++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,a=r;a<i;a++)t+="".concat(this.tag.getRule(a)).concat(me);return t},e}(),st=new Map,lt=new Map,ct=1,ut=function(e){if(st.has(e))return st.get(e);for(;lt.has(ct);)ct++;var t=ct++;return st.set(e,t),lt.set(t,e),t},dt=function(e,t){ct=t+1,st.set(e,t),lt.set(t,e)},ht="style[".concat(de,"][").concat(pe,'="').concat(fe,'"]'),pt=new RegExp("^".concat(de,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ft=function(e,t,n){for(var r,i=n.split(","),a=0,o=i.length;a<o;a++)(r=i[a])&&e.registerName(t,r)},mt=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(me),i=[],a=0,o=r.length;a<o;a++){var s=r[a].trim();if(s){var l=s.match(pt);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(dt(u,c),ft(e,u,l[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}},gt=function(e){for(var t=document.querySelectorAll(ht),n=0,r=t.length;n<r;n++){var i=t[n];i&&i.getAttribute(de)!==he&&(mt(e,i),i.parentNode&&i.parentNode.removeChild(i))}};function vt(){return n.nc}var yt=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(e){var t=Array.from(e.querySelectorAll("style[".concat(de,"]")));return t[t.length-1]}(n),a=void 0!==i?i.nextSibling:null;r.setAttribute(de,he),r.setAttribute(pe,fe);var o=vt();return o&&r.setAttribute("nonce",o),n.insertBefore(r,a),r},bt=function(){function e(e){this.element=yt(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var i=t[n];if(i.ownerNode===e)return i}throw at(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),xt=function(){function e(e){this.element=yt(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),_t=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),St=ge,wt={isServer:!ge,useCSSOMInjection:!ve},Et=function(){function e(e,t,n){void 0===e&&(e=xe),void 0===t&&(t={});var r=this;this.options=o(o({},wt),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&ge&&St&&(St=!1,gt(this)),it(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,r="",i=function(n){var i=function(e){return lt.get(e)}(n);if(void 0===i)return"continue";var a=e.names.get(i),o=t.getGroup(n);if(void 0===a||!a.size||0===o.length)return"continue";var s="".concat(de,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==a&&a.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),r+="".concat(o).concat(s,'{content:"').concat(l,'"}').concat(me)},a=0;a<n;a++)i(a);return r}(r)}))}return e.registerId=function(e){return ut(e)},e.prototype.rehydrate=function(){!this.server&&ge&&gt(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(o(o({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new _t(n):t?new bt(n):new xt(n)}(this.options),new ot(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(ut(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(ut(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(ut(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),At=/&/g,Mt=/^\s*\/\/.*$/gm;function Ct(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=Ct(e.children,t)),e}))}function Tt(e){var t,n,r,i=void 0===e?xe:e,a=i.options,o=void 0===a?xe:a,s=i.plugins,l=void 0===s?be:s,c=function(e,r,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(t):e},u=l.slice();u.push((function(e){e.type===f&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(At,n).replace(r,c))})),o.prefix&&u.push(ie),u.push(ne);var d=function(e,i,a,s){void 0===i&&(i=""),void 0===a&&(a=""),void 0===s&&(s="&"),t=s,n=i,r=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(Mt,""),c=ae(a||i?"".concat(a," ").concat(i," { ").concat(l," }"):l);o.namespace&&(c=Ct(c,o.namespace));var d,h=[];return te(c,function(e){var t=R(e);return function(n,r,i,a){for(var o="",s=0;s<t;s++)o+=e[s](n,r,i,a)||"";return o}}(u.concat((d=function(e){return h.push(e)},function(e){e.root||(e=e.return)&&d(e)})))),h};return d.hash=l.length?l.reduce((function(e,t){return t.name||at(15),Ie(e,t.name)}),Be).toString():"",d}var Rt=new Et,Pt=Tt(),Bt=t.createContext({shouldForwardProp:void 0,styleSheet:Rt,stylis:Pt}),It=(Bt.Consumer,t.createContext(void 0));function Dt(){return(0,t.useContext)(Bt)}function Lt(e){var n=(0,t.useState)(e.stylisPlugins),r=n[0],i=n[1],a=Dt().styleSheet,o=(0,t.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target,a]),s=(0,t.useMemo)((function(){return Tt({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:r})}),[e.enableVendorPrefixes,e.namespace,r]);(0,t.useEffect)((function(){c()(r,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]);var l=(0,t.useMemo)((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:o,stylis:s}}),[e.shouldForwardProp,o,s]);return t.createElement(Bt.Provider,{value:l},t.createElement(It.Provider,{value:s},e.children))}var kt=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Pt);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,it(this,(function(){throw at(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=Pt),this.name+e.hash},e}(),Ot=function(e){return e>="A"&&e<="Z"};function Nt(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Ot(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Ft=function(e){return null==e||!1===e||""===e},Ut=function(e){var t,n,r=[];for(var i in e){var a=e[i];e.hasOwnProperty(i)&&!Ft(a)&&(Array.isArray(a)&&a.isCss||Qe(a)?r.push("".concat(Nt(i),":"),a,";"):nt(a)?r.push.apply(r,s(s(["".concat(i," {")],Ut(a),!1),["}"],!1)):r.push("".concat(Nt(i),": ").concat((t=i,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in ue||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function zt(e,t,n,r){return Ft(e)?[]:Ze(e)?[".".concat(e.styledComponentId)]:Qe(e)?!Qe(i=e)||i.prototype&&i.prototype.isReactComponent||!t?[e]:zt(e(t),t,n,r):e instanceof kt?n?(e.inject(n,r),[e.getName(r)]):[e]:nt(e)?Ut(e):Array.isArray(e)?Array.prototype.concat.apply(be,e.map((function(e){return zt(e,t,n,r)}))):[e.toString()];var i}function Ht(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Qe(n)&&!Ze(n))return!1}return!0}var Gt=De(fe),jt=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Ht(e),this.componentId=t,this.baseHash=Ie(Gt,t),this.baseStyle=n,Et.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=et(r,this.staticRulesId);else{var i=tt(zt(this.rules,e,t,n)),a=Re(Ie(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,a)){var o=n(i,".".concat(a),void 0,this.componentId);t.insertRules(this.componentId,a,o)}r=et(r,a),this.staticRulesId=a}else{for(var s=Ie(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=tt(zt(u,e,t,n));s=Ie(s,d+c),l+=d}}if(l){var h=Re(s>>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),r=et(r,h)}}return r},e}(),Vt=t.createContext(void 0);Vt.Consumer;var Wt={};new Set;function Xt(e,n,r){var i=Ze(e),a=e,s=!Oe(e),l=n.attrs,c=void 0===l?be:l,u=n.componentId,d=void 0===u?function(e,t){var n="string"!=typeof e?"sc":Ae(e);Wt[n]=(Wt[n]||0)+1;var r="".concat(n,"-").concat(Le(fe+n+Wt[n]));return t?"".concat(t,"-").concat(r):r}(n.displayName,n.parentComponentId):u,h=n.displayName,p=void 0===h?function(e){return Oe(e)?"styled.".concat(e):"Styled(".concat(ke(e),")")}(e):h,f=n.displayName&&n.componentId?"".concat(Ae(n.displayName),"-").concat(n.componentId):n.componentId||d,m=i&&a.attrs?a.attrs.concat(c).filter(Boolean):c,g=n.shouldForwardProp;if(i&&a.shouldForwardProp){var v=a.shouldForwardProp;if(n.shouldForwardProp){var y=n.shouldForwardProp;g=function(e,t){return v(e,t)&&y(e,t)}}else g=v}var b=new jt(r,f,i?a.componentStyle:void 0);function x(e,n){return function(e,n,r){var i=e.attrs,a=e.componentStyle,s=e.defaultProps,l=e.foldedComponentIds,c=e.styledComponentId,u=e.target,d=t.useContext(Vt),h=Dt(),p=e.shouldForwardProp||h.shouldForwardProp,f=_e(n,d,s)||xe,m=function(e,t,n){for(var r,i=o(o({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var s=Qe(r=e[a])?r(i):r;for(var l in s)i[l]="className"===l?et(i[l],s[l]):"style"===l?o(o({},i[l]),s[l]):s[l]}return t.className&&(i.className=et(i.className,t.className)),i}(i,n,f),g=m.as||u,v={};for(var y in m)void 0===m[y]||"$"===y[0]||"as"===y||"theme"===y&&m.theme===f||("forwardedAs"===y?v.as=m.forwardedAs:p&&!p(y,g)||(v[y]=m[y]));var b=function(e,t){var n=Dt();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(a,m),x=et(l,c);return b&&(x+=" "+b),m.className&&(x+=" "+m.className),v[Oe(g)&&!Se.has(g)?"class":"className"]=x,v.ref=r,(0,t.createElement)(g,v)}(_,e,n)}x.displayName=p;var _=t.forwardRef(x);return _.attrs=m,_.componentStyle=b,_.displayName=p,_.shouldForwardProp=g,_.foldedComponentIds=i?et(a.foldedComponentIds,a.styledComponentId):"",_.styledComponentId=f,_.target=i?a.target:e,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++)rt(e,i[r],!0);return e}({},a.defaultProps,e):e}}),it(_,(function(){return".".concat(_.styledComponentId)})),s&&qe(_,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function Jt(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var $t=function(e){return Object.assign(e,{isCss:!0})};function Kt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Qe(e)||nt(e))return $t(zt(Jt(be,s([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?zt(r):$t(zt(Jt(r,t)))}function Yt(e,t,n){if(void 0===n&&(n=xe),!t)throw at(1,t);var r=function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return e(t,n,Kt.apply(void 0,s([r],i,!1)))};return r.attrs=function(r){return Yt(e,t,o(o({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return Yt(e,t,o(o({},n),r))},r}var qt=function(e){return Yt(Xt,e)},Qt=qt;Se.forEach((function(e){Qt[e]=qt(e)}));var Zt=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Ht(e),Et.registerId(this.componentId+1)}return e.prototype.createStyles=function(e,t,n,r){var i=r(tt(zt(this.rules,t,n,r)),""),a=this.componentId+e;n.insertRules(a,a,i)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,r){e>2&&Et.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();var en;(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=vt(),r=tt([n&&'nonce="'.concat(n,'"'),"".concat(de,'="true"'),"".concat(pe,'="').concat(fe,'"')].filter(Boolean)," ");return"<style ".concat(r,">").concat(t,"</style>")},this.getStyleTags=function(){if(e.sealed)throw at(2);return e._emitSheetCSS()},this.getStyleElement=function(){var n;if(e.sealed)throw at(2);var r=e.instance.toString();if(!r)return[];var i=((n={})[de]="",n[pe]=fe,n.dangerouslySetInnerHTML={__html:r},n),a=vt();return a&&(i.nonce=a),[t.createElement("style",o({},i,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Et({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw at(2);return t.createElement(Lt,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw at(3)}})(),"__sc-".concat(de,"__");function tn(){return tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tn.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(en||(en={}));const nn="popstate";function rn(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function an(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function on(e,t){return{usr:e.state,key:e.key,idx:t}}function sn(e,t,n,r){return void 0===n&&(n=null),tn({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?cn(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function ln(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function cn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function un(e,t,n,r){void 0===r&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=en.Pop,l=null,c=u();function u(){return(o.state||{idx:null}).idx}function d(){s=en.Pop;let e=u(),t=null==e?null:e-c;c=e,l&&l({action:s,location:p.location,delta:t})}function h(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"===typeof e?e:ln(e);return n=n.replace(/ $/,"%20"),rn(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==c&&(c=0,o.replaceState(tn({},o.state,{idx:c}),""));let p={get action(){return s},get location(){return e(i,o)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(nn,d),l=e,()=>{i.removeEventListener(nn,d),l=null}},createHref:e=>t(i,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s=en.Push;let r=sn(p.location,e,t);n&&n(r,e),c=u()+1;let d=on(r,c),h=p.createHref(r);try{o.pushState(d,"",h)}catch(cO){if(cO instanceof DOMException&&"DataCloneError"===cO.name)throw cO;i.location.assign(h)}a&&l&&l({action:s,location:p.location,delta:1})},replace:function(e,t){s=en.Replace;let r=sn(p.location,e,t);n&&n(r,e),c=u();let i=on(r,c),d=p.createHref(r);o.replaceState(i,"",d),a&&l&&l({action:s,location:p.location,delta:0})},go:e=>o.go(e)};return p}var dn;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(dn||(dn={}));const hn=new Set(["lazy","caseSensitive","path","id","index","children"]);function pn(e,t,n,r){return void 0===n&&(n=[]),void 0===r&&(r={}),e.map(((e,i)=>{let a=[...n,String(i)],o="string"===typeof e.id?e.id:a.join("-");if(rn(!0!==e.index||!e.children,"Cannot specify children on an index route"),rn(!r[o],'Found a route id collision on id "'+o+"\".  Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let n=tn({},e,t(e),{id:o});return r[o]=n,n}{let n=tn({},e,t(e),{id:o,children:void 0});return r[o]=n,e.children&&(n.children=pn(e.children,t,a,r)),n}}))}function fn(e,t,n){return void 0===n&&(n="/"),mn(e,t,n,!1)}function mn(e,t,n,r){let i=Rn(("string"===typeof t?cn(t):t).pathname||"/",n);if(null==i)return null;let a=gn(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let o=null;for(let s=0;null==o&&s<a.length;++s){let e=Tn(i);o=Mn(a[s],e,r)}return o}function gn(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let i=(e,i,a)=>{let o={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};o.relativePath.startsWith("/")&&(rn(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(r.length));let s=Ln([r,o.relativePath]),l=n.concat(o);e.children&&e.children.length>0&&(rn(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),gn(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:An(s,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of vn(e.path))i(e,t,r);else i(e,t)})),t}function vn(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return i?[a,""]:[a];let o=vn(r.join("/")),s=[];return s.push(...o.map((e=>""===e?a:[a,e].join("/")))),i&&s.push(...o),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const yn=/^:[\w-]+$/,bn=3,xn=2,_n=1,Sn=10,wn=-2,En=e=>"*"===e;function An(e,t){let n=e.split("/"),r=n.length;return n.some(En)&&(r+=wn),t&&(r+=xn),n.filter((e=>!En(e))).reduce(((e,t)=>e+(yn.test(t)?bn:""===t?_n:Sn)),r)}function Mn(e,t,n){void 0===n&&(n=!1);let{routesMeta:r}=e,i={},a="/",o=[];for(let s=0;s<r.length;++s){let e=r[s],l=s===r.length-1,c="/"===a?t:t.slice(a.length)||"/",u=Cn({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=Cn({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Ln([a,u.pathname]),pathnameBase:kn(Ln([a,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(a=Ln([a,u.pathnameBase]))}return o}function Cn(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);an("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");let a=new RegExp(i,t?void 0:"i");return[a,r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),s=i.slice(1),l=r.reduce(((e,t,n)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=s[n]||"";o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{});return{params:l,pathname:a,pathnameBase:o,pattern:e}}function Tn(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(cO){return an(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+cO+")."),e}}function Rn(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function Pn(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function Bn(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function In(e,t){let n=Bn(e);return t?n.map(((e,t)=>t===n.length-1?e.pathname:e.pathnameBase)):n.map((e=>e.pathnameBase))}function Dn(e,t,n,r){let i;void 0===r&&(r=!1),"string"===typeof e?i=cn(e):(i=tn({},e),rn(!i.pathname||!i.pathname.includes("?"),Pn("?","pathname","search",i)),rn(!i.pathname||!i.pathname.includes("#"),Pn("#","pathname","hash",i)),rn(!i.search||!i.search.includes("#"),Pn("#","search","hash",i)));let a,o=""===e||""===i.pathname,s=o?"/":i.pathname;if(null==s)a=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"===typeof e?cn(e):e,a=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:a,search:On(r),hash:Nn(i)}}(i,a),c=s&&"/"!==s&&s.endsWith("/"),u=(o||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}const Ln=e=>e.join("/").replace(/\/\/+/g,"/"),kn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),On=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Nn=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;class Fn{constructor(e,t,n,r){void 0===r&&(r=!1),this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Un(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const zn=["post","put","patch","delete"],Hn=new Set(zn),Gn=["get",...zn],jn=new Set(Gn),Vn=new Set([301,302,303,307,308]),Wn=new Set([307,308]),Xn={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Jn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$n={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Kn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yn=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),qn="remix-router-transitions";function Qn(e){const t=e.window?e.window:"undefined"!==typeof window?window:void 0,n="undefined"!==typeof t&&"undefined"!==typeof t.document&&"undefined"!==typeof t.document.createElement,r=!n;let i;if(rn(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=Yn;let a,o,s,l={},c=pn(e.routes,i,void 0,l),u=e.basename||"/",d=e.unstable_dataStrategy||sr,h=e.unstable_patchRoutesOnNavigation,p=tn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,m=new Set,g=1e3,v=new Set,y=null,b=null,x=null,_=null!=e.hydrationData,S=fn(c,e.history.location,u),w=null;if(null==S&&!h){let t=_r(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=xr(c);S=n,w={[r.id]:t}}if(S&&!e.hydrationData){ve(S,c,e.history.location.pathname).active&&(S=null)}if(S)if(S.some((e=>e.route.lazy)))o=!1;else if(S.some((e=>e.route.loader)))if(p.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=e=>!e.route.loader||("function"!==typeof e.route.loader||!0!==e.route.loader.hydrate)&&(t&&void 0!==t[e.route.id]||n&&void 0!==n[e.route.id]);if(n){let e=S.findIndex((e=>void 0!==n[e.route.id]));o=S.slice(0,e+1).every(r)}else o=S.every(r)}else o=null!=e.hydrationData;else o=!0;else if(o=!1,S=[],p.v7_partialHydration){let t=ve(null,c,e.history.location.pathname);t.active&&t.matches&&(S=t.matches)}let E,A,M={historyAction:e.history.action,location:e.history.location,matches:S,initialized:o,navigation:Xn,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},C=en.Pop,T=!1,R=!1,P=new Map,B=null,I=!1,D=!1,L=[],k=new Set,O=new Map,N=0,F=-1,U=new Map,z=new Set,H=new Map,G=new Map,j=new Set,V=new Map,W=new Map,X=new Map;function J(e,t){void 0===t&&(t={}),M=tn({},M,e);let n=[],r=[];p.v7_fetcherPersist&&M.fetchers.forEach(((e,t)=>{"idle"===e.state&&(j.has(t)?r.push(t):n.push(t))})),[...m].forEach((e=>e(M,{deletedFetchers:r,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),p.v7_fetcherPersist&&(n.forEach((e=>M.fetchers.delete(e))),r.forEach((e=>ie(e))))}function $(t,n,r){var i,o;let s,{flushSync:l}=void 0===r?{}:r,u=null!=M.actionData&&null!=M.navigation.formMethod&&Br(M.navigation.formMethod)&&"loading"===M.navigation.state&&!0!==(null==(i=t.state)?void 0:i._isRedirect);s=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:u?M.actionData:null;let d=n.loaderData?vr(M.loaderData,n.loaderData,n.matches||[],n.errors):M.loaderData,h=M.blockers;h.size>0&&(h=new Map(h),h.forEach(((e,t)=>h.set(t,$n))));let p,f=!0===T||null!=M.navigation.formMethod&&Br(M.navigation.formMethod)&&!0!==(null==(o=t.state)?void 0:o._isRedirect);if(a&&(c=a,a=void 0),I||C===en.Pop||(C===en.Push?e.history.push(t,t.state):C===en.Replace&&e.history.replace(t,t.state)),C===en.Pop){let e=P.get(M.location.pathname);e&&e.has(t.pathname)?p={currentLocation:M.location,nextLocation:t}:P.has(t.pathname)&&(p={currentLocation:t,nextLocation:M.location})}else if(R){let e=P.get(M.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),P.set(M.location.pathname,e)),p={currentLocation:M.location,nextLocation:t}}J(tn({},n,{actionData:s,loaderData:d,historyAction:C,location:t,initialized:!0,navigation:Xn,revalidation:"idle",restoreScrollPosition:ge(t,n.matches||M.matches),preventScrollReset:f,blockers:h}),{viewTransitionOpts:p,flushSync:!0===l}),C=en.Pop,T=!1,R=!1,I=!1,D=!1,L=[]}async function K(t,n,r){E&&E.abort(),E=null,C=t,I=!0===(r&&r.startUninterruptedRevalidation),function(e,t){if(y&&x){let n=me(e,t);y[n]=x()}}(M.location,M.matches),T=!0===(r&&r.preventScrollReset),R=!0===(r&&r.enableViewTransition);let i=a||c,o=r&&r.overrideNavigation,s=fn(i,n,u),l=!0===(r&&r.flushSync),d=ve(s,i,n.pathname);if(d.active&&d.matches&&(s=d.matches),!s){let{error:e,notFoundMatches:t,route:r}=he(n.pathname);return void $(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:l})}if(M.initialized&&!D&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(M.location,n)&&!(r&&r.submission&&Br(r.submission.formMethod)))return void $(n,{matches:s},{flushSync:l});E=new AbortController;let h,f=hr(e.history,n,E.signal,r&&r.submission);if(r&&r.pendingError)h=[br(s).route.id,{type:dn.error,error:r.pendingError}];else if(r&&r.submission&&Br(r.submission.formMethod)){let t=await async function(e,t,n,r,i,a){void 0===a&&(a={});ee();let o,s=function(e,t){let n={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return n}(t,n);if(J({navigation:s},{flushSync:!0===a.flushSync}),i){let n=await ye(r,t.pathname,e.signal);if("aborted"===n.type)return{shortCircuited:!0};if("error"===n.type){let{boundaryId:e,error:r}=pe(t.pathname,n);return{matches:n.partialMatches,pendingActionResult:[e,{type:dn.error,error:r}]}}if(!n.matches){let{notFoundMatches:e,error:n,route:r}=he(t.pathname);return{matches:e,pendingActionResult:[r.id,{type:dn.error,error:n}]}}r=n.matches}let l=Or(r,t);if(l.route.action||l.route.lazy){if(o=(await Q("action",M,e,[l],r,null))[l.route.id],e.signal.aborted)return{shortCircuited:!0}}else o={type:dn.error,error:_r(405,{method:e.method,pathname:t.pathname,routeId:l.route.id})};if(Cr(o)){let t;if(a&&null!=a.replace)t=a.replace;else{t=dr(o.response.headers.get("Location"),new URL(e.url),u)===M.location.pathname+M.location.search}return await q(e,o,!0,{submission:n,replace:t}),{shortCircuited:!0}}if(Ar(o))throw _r(400,{type:"defer-action"});if(Mr(o)){let e=br(r,l.route.id);return!0!==(a&&a.replace)&&(C=en.Push),{matches:r,pendingActionResult:[e.route.id,o]}}return{matches:r,pendingActionResult:[l.route.id,o]}}(f,n,r.submission,s,d.active,{replace:r.replace,flushSync:l});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Mr(r)&&Un(r.error)&&404===r.error.status)return E=null,void $(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}s=t.matches||s,h=t.pendingActionResult,o=Fr(n,r.submission),l=!1,d.active=!1,f=hr(e.history,f.url,f.signal)}let{shortCircuited:m,matches:g,loaderData:v,errors:b}=await async function(t,n,r,i,o,s,l,d,h,f,m){let g=o||Fr(n,s),v=s||l||Nr(g),y=!I&&(!p.v7_partialHydration||!h);if(i){if(y){let e=Y(m);J(tn({navigation:g},void 0!==e?{actionData:e}:{}),{flushSync:f})}let e=await ye(r,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let{boundaryId:t,error:r}=pe(n.pathname,e);return{matches:e.partialMatches,loaderData:{},errors:{[t]:r}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=he(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}r=e.matches}let b=a||c,[x,_]=nr(e.history,M,r,v,n,p.v7_partialHydration&&!0===h,p.v7_skipActionErrorRevalidation,D,L,k,j,H,z,b,u,m);if(fe((e=>!(r&&r.some((t=>t.route.id===e)))||x&&x.some((t=>t.route.id===e)))),F=++N,0===x.length&&0===_.length){let e=se();return $(n,tn({matches:r,loaderData:{},errors:m&&Mr(m[1])?{[m[0]]:m[1].error}:null},yr(m),e?{fetchers:new Map(M.fetchers)}:{}),{flushSync:f}),{shortCircuited:!0}}if(y){let e={};if(!i){e.navigation=g;let t=Y(m);void 0!==t&&(e.actionData=t)}_.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=M.fetchers.get(e.key),n=Ur(void 0,t?t.data:void 0);M.fetchers.set(e.key,n)})),new Map(M.fetchers)}(_)),J(e,{flushSync:f})}_.forEach((e=>{O.has(e.key)&&ae(e.key),e.controller&&O.set(e.key,e.controller)}));let S=()=>_.forEach((e=>ae(e.key)));E&&E.signal.addEventListener("abort",S);let{loaderResults:w,fetcherResults:A}=await Z(M,r,x,_,t);if(t.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener("abort",S);_.forEach((e=>O.delete(e.key)));let C=Sr(w);if(C)return await q(t,C.result,!0,{replace:d}),{shortCircuited:!0};if(C=Sr(A),C)return z.add(C.key),await q(t,C.result,!0,{replace:d}),{shortCircuited:!0};let{loaderData:T,errors:R}=gr(M,r,x,w,m,_,A,V);V.forEach(((e,t)=>{e.subscribe((n=>{(n||e.done)&&V.delete(t)}))})),p.v7_partialHydration&&h&&M.errors&&Object.entries(M.errors).filter((e=>{let[t]=e;return!x.some((e=>e.route.id===t))})).forEach((e=>{let[t,n]=e;R=Object.assign(R||{},{[t]:n})}));let P=se(),B=le(F),U=P||B||_.length>0;return tn({matches:r,loaderData:T,errors:R},U?{fetchers:new Map(M.fetchers)}:{})}(f,n,s,d.active,o,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&!0===r.initialHydration,l,h);m||(E=null,$(n,tn({matches:g||s},yr(h),{loaderData:v,errors:b})))}function Y(e){return e&&!Mr(e[1])?{[e[0]]:e[1].data}:M.actionData?0===Object.keys(M.actionData).length?null:M.actionData:void 0}async function q(r,i,a,o){let{submission:s,fetcherSubmission:l,replace:c}=void 0===o?{}:o;i.response.headers.has("X-Remix-Revalidate")&&(D=!0);let d=i.response.headers.get("Location");rn(d,"Expected a Location header on the redirect Response"),d=dr(d,new URL(r.url),u);let h=sn(M.location,d,{_isRedirect:!0});if(n){let n=!1;if(i.response.headers.has("X-Remix-Reload-Document"))n=!0;else if(Kn.test(d)){const r=e.history.createURL(d);n=r.origin!==t.location.origin||null==Rn(r.pathname,u)}if(n)return void(c?t.location.replace(d):t.location.assign(d))}E=null;let p=!0===c||i.response.headers.has("X-Remix-Replace")?en.Replace:en.Push,{formMethod:f,formAction:m,formEncType:g}=M.navigation;!s&&!l&&f&&m&&g&&(s=Nr(M.navigation));let v=s||l;if(Wn.has(i.response.status)&&v&&Br(v.formMethod))await K(p,h,{submission:tn({},v,{formAction:d}),preventScrollReset:T,enableViewTransition:a?R:void 0});else{let e=Fr(h,s);await K(p,h,{overrideNavigation:e,fetcherSubmission:l,preventScrollReset:T,enableViewTransition:a?R:void 0})}}async function Q(e,t,n,r,a,o){let s,c={};try{s=await lr(d,e,t,n,r,a,o,l,i)}catch(h){return r.forEach((e=>{c[e.route.id]={type:dn.error,error:h}})),c}for(let[i,l]of Object.entries(s))if(Er(l)){let e=l.result;c[i]={type:dn.redirect,response:ur(e,n,i,a,u,p.v7_relativeSplatPath)}}else c[i]=await cr(l);return c}async function Z(t,n,r,i,a){let o=t.matches,s=Q("loader",t,a,r,n,null),l=Promise.all(i.map((async n=>{if(n.matches&&n.match&&n.controller){let r=(await Q("loader",t,hr(e.history,n.path,n.controller.signal),[n.match],n.matches,n.key))[n.match.route.id];return{[n.key]:r}}return Promise.resolve({[n.key]:{type:dn.error,error:_r(404,{pathname:n.path})}})}))),c=await s,u=(await l).reduce(((e,t)=>Object.assign(e,t)),{});return await Promise.all([Ir(n,c,a.signal,o,t.loaderData),Dr(n,u,i)]),{loaderResults:c,fetcherResults:u}}function ee(){D=!0,L.push(...fe()),H.forEach(((e,t)=>{O.has(t)&&(k.add(t),ae(t))}))}function te(e,t,n){void 0===n&&(n={}),M.fetchers.set(e,t),J({fetchers:new Map(M.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function ne(e,t,n,r){void 0===r&&(r={});let i=br(M.matches,t);ie(e),J({errors:{[i.route.id]:n},fetchers:new Map(M.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function re(e){return p.v7_fetcherPersist&&(G.set(e,(G.get(e)||0)+1),j.has(e)&&j.delete(e)),M.fetchers.get(e)||Jn}function ie(e){let t=M.fetchers.get(e);!O.has(e)||t&&"loading"===t.state&&U.has(e)||ae(e),H.delete(e),U.delete(e),z.delete(e),j.delete(e),k.delete(e),M.fetchers.delete(e)}function ae(e){let t=O.get(e);rn(t,"Expected fetch controller: "+e),t.abort(),O.delete(e)}function oe(e){for(let t of e){let e=zr(re(t).data);M.fetchers.set(t,e)}}function se(){let e=[],t=!1;for(let n of z){let r=M.fetchers.get(n);rn(r,"Expected fetcher: "+n),"loading"===r.state&&(z.delete(n),e.push(n),t=!0)}return oe(e),t}function le(e){let t=[];for(let[n,r]of U)if(r<e){let e=M.fetchers.get(n);rn(e,"Expected fetcher: "+n),"loading"===e.state&&(ae(n),U.delete(n),t.push(n))}return oe(t),t.length>0}function ce(e){M.blockers.delete(e),W.delete(e)}function ue(e,t){let n=M.blockers.get(e)||$n;rn("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,"Invalid blocker state transition: "+n.state+" -> "+t.state);let r=new Map(M.blockers);r.set(e,t),J({blockers:r})}function de(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(0===W.size)return;W.size>1&&an(!1,"A router only supports one blocker at a time");let i=Array.from(W.entries()),[a,o]=i[i.length-1],s=M.blockers.get(a);return s&&"proceeding"===s.state?void 0:o({currentLocation:t,nextLocation:n,historyAction:r})?a:void 0}function he(e){let t=_r(404,{pathname:e}),n=a||c,{matches:r,route:i}=xr(n);return fe(),{notFoundMatches:r,route:i,error:t}}function pe(e,t){return{boundaryId:br(t.partialMatches).route.id,error:_r(400,{type:"route-discovery",pathname:e,message:null!=t.error&&"message"in t.error?t.error:String(t.error)})}}function fe(e){let t=[];return V.forEach(((n,r)=>{e&&!e(r)||(n.cancel(),t.push(r),V.delete(r))})),t}function me(e,t){if(b){let n=b(e,t.map((e=>function(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}(e,M.loaderData))));return n||e.key}return e.key}function ge(e,t){if(y){let n=me(e,t),r=y[n];if("number"===typeof r)return r}return null}function ve(e,t,n){if(h){if(v.has(n))return{active:!1,matches:e};if(!e){return{active:!0,matches:mn(t,n,u,!0)||[]}}if(Object.keys(e[0].params).length>0){return{active:!0,matches:mn(t,n,u,!0)}}}return{active:!1,matches:null}}async function ye(e,t,n){let r=e;for(;;){let e=null==a,s=a||c;try{await ar(h,t,r,s,l,i,X,n)}catch(o){return{type:"error",error:o,partialMatches:r}}finally{e&&(c=[...c])}if(n.aborted)return{type:"aborted"};let d=fn(s,t,u);if(d)return be(t,v),{type:"success",matches:d};let p=mn(s,t,u,!0);if(!p||r.length===p.length&&r.every(((e,t)=>e.route.id===p[t].route.id)))return be(t,v),{type:"success",matches:null};r=p}}function be(e,t){if(t.size>=g){let e=t.values().next().value;t.delete(e)}t.add(e)}return s={get basename(){return u},get future(){return p},get state(){return M},get routes(){return c},get window(){return t},initialize:function(){if(f=e.history.listen((t=>{let{action:n,location:r,delta:i}=t;if(A)return A(),void(A=void 0);an(0===W.size||null!=i,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=de({currentLocation:M.location,nextLocation:r,historyAction:n});if(a&&null!=i){let t=new Promise((e=>{A=e}));return e.history.go(-1*i),void ue(a,{state:"blocked",location:r,proceed(){ue(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then((()=>e.history.go(i)))},reset(){let e=new Map(M.blockers);e.set(a,$n),J({blockers:e})}})}return K(n,r)})),n){!function(e,t){try{let n=e.sessionStorage.getItem(qn);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(n){}}(t,P);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(qn,JSON.stringify(n))}catch(cO){an(!1,"Failed to save applied view transitions in sessionStorage ("+cO+").")}}}(t,P);t.addEventListener("pagehide",e),B=()=>t.removeEventListener("pagehide",e)}return M.initialized||K(en.Pop,M.location,{initialHydration:!0}),s},subscribe:function(e){return m.add(e),()=>m.delete(e)},enableScrollRestoration:function(e,t,n){if(y=e,x=t,b=n||null,!_&&M.navigation===Xn){_=!0;let e=ge(M.location,M.matches);null!=e&&J({restoreScrollPosition:e})}return()=>{y=null,x=null,b=null}},navigate:async function t(n,r){if("number"===typeof n)return void e.history.go(n);let i=Zn(M.location,M.matches,u,p.v7_prependBasename,n,p.v7_relativeSplatPath,null==r?void 0:r.fromRouteId,null==r?void 0:r.relative),{path:a,submission:o,error:s}=er(p.v7_normalizeFormMethod,!1,i,r),l=M.location,c=sn(M.location,a,r&&r.state);c=tn({},c,e.history.encodeLocation(c));let d=r&&null!=r.replace?r.replace:void 0,h=en.Push;!0===d?h=en.Replace:!1===d||null!=o&&Br(o.formMethod)&&o.formAction===M.location.pathname+M.location.search&&(h=en.Replace);let f=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,m=!0===(r&&r.unstable_flushSync),g=de({currentLocation:l,nextLocation:c,historyAction:h});if(!g)return await K(h,c,{submission:o,pendingError:s,preventScrollReset:f,replace:r&&r.replace,enableViewTransition:r&&r.unstable_viewTransition,flushSync:m});ue(g,{state:"blocked",location:c,proceed(){ue(g,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),t(n,r)},reset(){let e=new Map(M.blockers);e.set(g,$n),J({blockers:e})}})},fetch:function(t,n,i,o){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");O.has(t)&&ae(t);let s=!0===(o&&o.unstable_flushSync),l=a||c,d=Zn(M.location,M.matches,u,p.v7_prependBasename,i,p.v7_relativeSplatPath,n,null==o?void 0:o.relative),h=fn(l,d,u),f=ve(h,l,d);if(f.active&&f.matches&&(h=f.matches),!h)return void ne(t,n,_r(404,{pathname:d}),{flushSync:s});let{path:m,submission:g,error:v}=er(p.v7_normalizeFormMethod,!0,d,o);if(v)return void ne(t,n,v,{flushSync:s});let y=Or(h,m);T=!0===(o&&o.preventScrollReset),g&&Br(g.formMethod)?async function(t,n,r,i,o,s,l,d){function h(e){if(!e.route.action&&!e.route.lazy){let e=_r(405,{method:d.formMethod,pathname:r,routeId:n});return ne(t,n,e,{flushSync:l}),!0}return!1}if(ee(),H.delete(t),!s&&h(i))return;let f=M.fetchers.get(t);te(t,function(e,t){let n={state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0};return n}(d,f),{flushSync:l});let m=new AbortController,g=hr(e.history,r,m.signal,d);if(s){let e=await ye(o,r,g.signal);if("aborted"===e.type)return;if("error"===e.type){let{error:i}=pe(r,e);return void ne(t,n,i,{flushSync:l})}if(!e.matches)return void ne(t,n,_r(404,{pathname:r}),{flushSync:l});if(h(i=Or(o=e.matches,r)))return}O.set(t,m);let v=N,y=await Q("action",M,g,[i],o,t),b=y[i.route.id];if(g.signal.aborted)return void(O.get(t)===m&&O.delete(t));if(p.v7_fetcherPersist&&j.has(t)){if(Cr(b)||Mr(b))return void te(t,zr(void 0))}else{if(Cr(b))return O.delete(t),F>v?void te(t,zr(void 0)):(z.add(t),te(t,Ur(d)),q(g,b,!1,{fetcherSubmission:d}));if(Mr(b))return void ne(t,n,b.error)}if(Ar(b))throw _r(400,{type:"defer-action"});let x=M.navigation.location||M.location,_=hr(e.history,x,m.signal),S=a||c,w="idle"!==M.navigation.state?fn(S,M.navigation.location,u):M.matches;rn(w,"Didn't find any matches after fetcher action");let A=++N;U.set(t,A);let T=Ur(d,b.data);M.fetchers.set(t,T);let[R,P]=nr(e.history,M,w,d,x,!1,p.v7_skipActionErrorRevalidation,D,L,k,j,H,z,S,u,[i.route.id,b]);P.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,n=M.fetchers.get(t),r=Ur(void 0,n?n.data:void 0);M.fetchers.set(t,r),O.has(t)&&ae(t),e.controller&&O.set(t,e.controller)})),J({fetchers:new Map(M.fetchers)});let B=()=>P.forEach((e=>ae(e.key)));m.signal.addEventListener("abort",B);let{loaderResults:I,fetcherResults:G}=await Z(M,w,R,P,_);if(m.signal.aborted)return;m.signal.removeEventListener("abort",B),U.delete(t),O.delete(t),P.forEach((e=>O.delete(e.key)));let W=Sr(I);if(W)return q(_,W.result,!1);if(W=Sr(G),W)return z.add(W.key),q(_,W.result,!1);let{loaderData:X,errors:K}=gr(M,w,R,I,void 0,P,G,V);if(M.fetchers.has(t)){let e=zr(b.data);M.fetchers.set(t,e)}le(A),"loading"===M.navigation.state&&A>F?(rn(C,"Expected pending action"),E&&E.abort(),$(M.navigation.location,{matches:w,loaderData:X,errors:K,fetchers:new Map(M.fetchers)})):(J({errors:K,loaderData:vr(M.loaderData,X,w,K),fetchers:new Map(M.fetchers)}),D=!1)}(t,n,m,y,h,f.active,s,g):(H.set(t,{routeId:n,path:m}),async function(t,n,r,i,a,o,s,l){let c=M.fetchers.get(t);te(t,Ur(l,c?c.data:void 0),{flushSync:s});let u=new AbortController,d=hr(e.history,r,u.signal);if(o){let e=await ye(a,r,d.signal);if("aborted"===e.type)return;if("error"===e.type){let{error:i}=pe(r,e);return void ne(t,n,i,{flushSync:s})}if(!e.matches)return void ne(t,n,_r(404,{pathname:r}),{flushSync:s});i=Or(a=e.matches,r)}O.set(t,u);let h=N,p=await Q("loader",M,d,[i],a,t),f=p[i.route.id];Ar(f)&&(f=await Lr(f,d.signal,!0)||f);O.get(t)===u&&O.delete(t);if(d.signal.aborted)return;if(j.has(t))return void te(t,zr(void 0));if(Cr(f))return F>h?void te(t,zr(void 0)):(z.add(t),void await q(d,f,!1));if(Mr(f))return void ne(t,n,f.error);rn(!Ar(f),"Unhandled fetcher deferred data"),te(t,zr(f.data))}(t,n,m,y,h,f.active,s,g))},revalidate:function(){ee(),J({revalidation:"loading"}),"submitting"!==M.navigation.state&&("idle"!==M.navigation.state?K(C||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation,enableViewTransition:!0===R}):K(M.historyAction,M.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:re,deleteFetcher:function(e){if(p.v7_fetcherPersist){let t=(G.get(e)||0)-1;t<=0?(G.delete(e),j.add(e)):G.set(e,t)}else ie(e);J({fetchers:new Map(M.fetchers)})},dispose:function(){f&&f(),B&&B(),m.clear(),E&&E.abort(),M.fetchers.forEach(((e,t)=>ie(t))),M.blockers.forEach(((e,t)=>ce(t)))},getBlocker:function(e,t){let n=M.blockers.get(e)||$n;return W.get(e)!==t&&W.set(e,t),n},deleteBlocker:ce,patchRoutes:function(e,t){let n=null==a;or(e,t,a||c,l,i),n&&(c=[...c],J({}))},_internalFetchControllers:O,_internalActiveDeferreds:V,_internalSetRoutes:function(e){l={},a=pn(e,i,void 0,l)}},s}Symbol("deferred");function Zn(e,t,n,r,i,a,o,s){let l,c;if(o){l=[];for(let e of t)if(l.push(e),e.route.id===o){c=e;break}}else l=t,c=t[t.length-1];let u=Dn(i||".",In(l,a),Rn(e.pathname,n)||e.pathname,"path"===s);return null==i&&(u.search=e.search,u.hash=e.hash),null!=i&&""!==i&&"."!==i||!c||!c.route.index||kr(u.search)||(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&"/"!==n&&(u.pathname="/"===u.pathname?n:Ln([n,u.pathname])),ln(u)}function er(e,t,n,r){if(!r||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(r))return{path:n};if(r.formMethod&&!Pr(r.formMethod))return{path:n,error:_r(405,{method:r.formMethod})};let i,a,o=()=>({path:n,error:_r(400,{type:"invalid-body"})}),s=r.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),c=wr(n);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!Br(l))return o();let e="string"===typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce(((e,t)=>{let[n,r]=t;return""+e+n+"="+r+"\n"}),""):String(r.body);return{path:n,submission:{formMethod:l,formAction:c,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===r.formEncType){if(!Br(l))return o();try{let e="string"===typeof r.body?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:c,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(h){return o()}}}if(rn("function"===typeof FormData,"FormData is not available in this environment"),r.formData)i=pr(r.formData),a=r.formData;else if(r.body instanceof FormData)i=pr(r.body),a=r.body;else if(r.body instanceof URLSearchParams)i=r.body,a=fr(i);else if(null==r.body)i=new URLSearchParams,a=new FormData;else try{i=new URLSearchParams(r.body),a=fr(i)}catch(h){return o()}let u={formMethod:l,formAction:c,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:a,json:void 0,text:void 0};if(Br(u.formMethod))return{path:n,submission:u};let d=cn(n);return t&&d.search&&kr(d.search)&&i.append("index",""),d.search="?"+i,{path:ln(d),submission:u}}function tr(e,t){let n=e;if(t){let r=e.findIndex((e=>e.route.id===t));r>=0&&(n=e.slice(0,r))}return n}function nr(e,t,n,r,i,a,o,s,l,c,u,d,h,p,f,m){let g=m?Mr(m[1])?m[1].error:m[1].data:void 0,v=e.createURL(t.location),y=e.createURL(i),b=m&&Mr(m[1])?m[0]:void 0,x=b?tr(n,b):n,_=m?m[1].statusCode:void 0,S=o&&_&&_>=400,w=x.filter(((e,n)=>{let{route:i}=e;if(i.lazy)return!0;if(null==i.loader)return!1;if(a)return!("function"===typeof i.loader&&!i.loader.hydrate)||void 0===t.loaderData[i.id]&&(!t.errors||void 0===t.errors[i.id]);if(function(e,t,n){let r=!t||n.route.id!==t.route.id,i=void 0===e[n.route.id];return r||i}(t.loaderData,t.matches[n],e)||l.some((t=>t===e.route.id)))return!0;let o=t.matches[n],c=e;return ir(e,tn({currentUrl:v,currentParams:o.params,nextUrl:y,nextParams:c.params},r,{actionResult:g,actionStatus:_,defaultShouldRevalidate:!S&&(s||v.pathname+v.search===y.pathname+y.search||v.search!==y.search||rr(o,c))}))})),E=[];return d.forEach(((e,i)=>{if(a||!n.some((t=>t.route.id===e.routeId))||u.has(i))return;let o=fn(p,e.path,f);if(!o)return void E.push({key:i,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let l=t.fetchers.get(i),d=Or(o,e.path),m=!1;h.has(i)?m=!1:c.has(i)?(c.delete(i),m=!0):m=l&&"idle"!==l.state&&void 0===l.data?s:ir(d,tn({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:g,actionStatus:_,defaultShouldRevalidate:!S&&s})),m&&E.push({key:i,routeId:e.routeId,path:e.path,matches:o,match:d,controller:new AbortController})})),[w,E]}function rr(e,t){let n=e.route.path;return e.pathname!==t.pathname||null!=n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ir(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if("boolean"===typeof n)return n}return t.defaultShouldRevalidate}async function ar(e,t,n,r,i,a,o,s){let l=[t,...n.map((e=>e.route.id))].join("-");try{let u=o.get(l);u||(u=e({path:t,matches:n,patch:(e,t)=>{s.aborted||or(e,t,r,i,a)}}),o.set(l,u)),u&&("object"===typeof(c=u)&&null!=c&&"then"in c)&&await u}finally{o.delete(l)}var c}function or(e,t,n,r,i){if(e){var a;let n=r[e];rn(n,"No route found to patch children into: routeId = "+e);let o=pn(t,i,[e,"patch",String((null==(a=n.children)?void 0:a.length)||"0")],r);n.children?n.children.push(...o):n.children=o}else{let e=pn(t,i,["patch",String(n.length||"0")],r);n.push(...e)}}async function sr(e){let{matches:t}=e,n=t.filter((e=>e.shouldLoad)),r=await Promise.all(n.map((e=>e.resolve())));return r.reduce(((e,t,r)=>Object.assign(e,{[n[r].route.id]:t})),{})}async function lr(e,t,n,r,i,a,o,s,l,c){let u=a.map((e=>e.route.lazy?async function(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];rn(i,"No route found in manifest");let a={};for(let o in r){let e=void 0!==i[o]&&"hasErrorBoundary"!==o;an(!e,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+o+'" will be ignored.'),e||hn.has(o)||(a[o]=r[o])}Object.assign(i,a),Object.assign(i,tn({},t(i),{lazy:void 0}))}(e.route,l,s):void 0)),d=a.map(((e,n)=>{let a=u[n],o=i.some((t=>t.route.id===e.route.id));return tn({},e,{shouldLoad:o,resolve:async n=>(n&&"GET"===r.method&&(e.route.lazy||e.route.loader)&&(o=!0),o?async function(e,t,n,r,i,a){let o,s,l=r=>{let o,l=new Promise(((e,t)=>o=t));s=()=>o(),t.signal.addEventListener("abort",s);let c=i=>"function"!==typeof r?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'+e+'" [routeId: '+n.route.id+"]")):r({request:t,params:n.params,context:a},...void 0!==i?[i]:[]),u=(async()=>{try{return{type:"data",result:await(i?i((e=>c(e))):c())}}catch(e){return{type:"error",result:e}}})();return Promise.race([u,l])};try{let i=n.route[e];if(r)if(i){let e,[t]=await Promise.all([l(i).catch((t=>{e=t})),r]);if(void 0!==e)throw e;o=t}else{if(await r,i=n.route[e],!i){if("action"===e){let e=new URL(t.url),r=e.pathname+e.search;throw _r(405,{method:t.method,pathname:r,routeId:n.route.id})}return{type:dn.data,result:void 0}}o=await l(i)}else{if(!i){let e=new URL(t.url);throw _r(404,{pathname:e.pathname+e.search})}o=await l(i)}rn(void 0!==o.result,"You defined "+("action"===e?"an action":"a loader")+' for route "'+n.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(c){return{type:dn.error,result:c}}finally{s&&t.signal.removeEventListener("abort",s)}return o}(t,r,e,a,n,c):Promise.resolve({type:dn.data,result:void 0}))})})),h=await e({matches:d,request:r,params:a[0].params,fetcherKey:o,context:c});try{await Promise.all(u)}catch(p){}return h}async function cr(e){let{result:t,type:n}=e;if(Rr(t)){let e;try{let n=t.headers.get("Content-Type");e=n&&/\bapplication\/json\b/.test(n)?null==t.body?null:await t.json():await t.text()}catch(c){return{type:dn.error,error:c}}return n===dn.error?{type:dn.error,error:new Fn(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:dn.data,data:e,statusCode:t.status,headers:t.headers}}if(n===dn.error){if(Tr(t)){var r,i;if(t.data instanceof Error)return{type:dn.error,error:t.data,statusCode:null==(i=t.init)?void 0:i.status};t=new Fn((null==(r=t.init)?void 0:r.status)||500,void 0,t.data)}return{type:dn.error,error:t,statusCode:Un(t)?t.status:void 0}}var a,o,s,l;return function(e){let t=e;return t&&"object"===typeof t&&"object"===typeof t.data&&"function"===typeof t.subscribe&&"function"===typeof t.cancel&&"function"===typeof t.resolveData}(t)?{type:dn.deferred,deferredData:t,statusCode:null==(a=t.init)?void 0:a.status,headers:(null==(o=t.init)?void 0:o.headers)&&new Headers(t.init.headers)}:Tr(t)?{type:dn.data,data:t.data,statusCode:null==(s=t.init)?void 0:s.status,headers:null!=(l=t.init)&&l.headers?new Headers(t.init.headers):void 0}:{type:dn.data,data:t}}function ur(e,t,n,r,i,a){let o=e.headers.get("Location");if(rn(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Kn.test(o)){let s=r.slice(0,r.findIndex((e=>e.route.id===n))+1);o=Zn(new URL(t.url),s,i,!0,o,a),e.headers.set("Location",o)}return e}function dr(e,t,n){if(Kn.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),a=null!=Rn(i.pathname,n);if(i.origin===t.origin&&a)return i.pathname+i.search+i.hash}return e}function hr(e,t,n,r){let i=e.createURL(wr(t)).toString(),a={signal:n};if(r&&Br(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):"text/plain"===t?a.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?a.body=pr(r.formData):a.body=r.formData}return new Request(i,a)}function pr(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,"string"===typeof r?r:r.name);return t}function fr(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function mr(e,t,n,r,i){let a,o={},s=null,l=!1,c={},u=n&&Mr(n[1])?n[1].error:void 0;return e.forEach((n=>{if(!(n.route.id in t))return;let d=n.route.id,h=t[d];if(rn(!Cr(h),"Cannot handle redirect results in processLoaderData"),Mr(h)){let t=h.error;if(void 0!==u&&(t=u,u=void 0),s=s||{},i)s[d]=t;else{let n=br(e,d);null==s[n.route.id]&&(s[n.route.id]=t)}o[d]=void 0,l||(l=!0,a=Un(h.error)?h.error.status:500),h.headers&&(c[d]=h.headers)}else Ar(h)?(r.set(d,h.deferredData),o[d]=h.deferredData.data,null==h.statusCode||200===h.statusCode||l||(a=h.statusCode),h.headers&&(c[d]=h.headers)):(o[d]=h.data,h.statusCode&&200!==h.statusCode&&!l&&(a=h.statusCode),h.headers&&(c[d]=h.headers))})),void 0!==u&&n&&(s={[n[0]]:u},o[n[0]]=void 0),{loaderData:o,errors:s,statusCode:a||200,loaderHeaders:c}}function gr(e,t,n,r,i,a,o,s){let{loaderData:l,errors:c}=mr(t,r,i,s,!1);return a.forEach((t=>{let{key:n,match:r,controller:i}=t,a=o[n];if(rn(a,"Did not find corresponding fetcher result"),!i||!i.signal.aborted)if(Mr(a)){let t=br(e.matches,null==r?void 0:r.route.id);c&&c[t.route.id]||(c=tn({},c,{[t.route.id]:a.error})),e.fetchers.delete(n)}else if(Cr(a))rn(!1,"Unhandled fetcher revalidation redirect");else if(Ar(a))rn(!1,"Unhandled fetcher deferred data");else{let t=zr(a.data);e.fetchers.set(n,t)}})),{loaderData:l,errors:c}}function vr(e,t,n,r){let i=tn({},t);for(let a of n){let n=a.route.id;if(t.hasOwnProperty(n)?void 0!==t[n]&&(i[n]=t[n]):void 0!==e[n]&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function yr(e){return e?Mr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function br(e,t){let n=t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e];return n.reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function xr(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function _r(e,t){let{pathname:n,routeId:r,method:i,type:a,message:o}=void 0===t?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(s="Bad Request","route-discovery"===a?l='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnNavigation()` function threw the following error:\n'+o:i&&n&&r?l="You made a "+i+' request to "'+n+'" but did not provide a `loader` for route "'+r+'", so there is no way to handle the request.':"defer-action"===a?l="defer() is not supported in actions":"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):404===e?(s="Not Found",l='No route matches URL "'+n+'"'):405===e&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but did not provide an `action` for route "'+r+'", so there is no way to handle the request.':i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new Fn(e||500,s,new Error(l),!0)}function Sr(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[e,r]=t[n];if(Cr(r))return{key:e,result:r}}}function wr(e){return ln(tn({},"string"===typeof e?cn(e):e,{hash:""}))}function Er(e){return Rr(e.result)&&Vn.has(e.result.status)}function Ar(e){return e.type===dn.deferred}function Mr(e){return e.type===dn.error}function Cr(e){return(e&&e.type)===dn.redirect}function Tr(e){return"object"===typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function Rr(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"object"===typeof e.headers&&"undefined"!==typeof e.body}function Pr(e){return jn.has(e.toLowerCase())}function Br(e){return Hn.has(e.toLowerCase())}async function Ir(e,t,n,r,i){let a=Object.entries(t);for(let o=0;o<a.length;o++){let[s,l]=a[o],c=e.find((e=>(null==e?void 0:e.route.id)===s));if(!c)continue;let u=r.find((e=>e.route.id===c.route.id)),d=null!=u&&!rr(u,c)&&void 0!==(i&&i[c.route.id]);Ar(l)&&d&&await Lr(l,n,!1).then((e=>{e&&(t[s]=e)}))}}async function Dr(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:a,controller:o}=n[r],s=t[i],l=e.find((e=>(null==e?void 0:e.route.id)===a));l&&(Ar(s)&&(rn(o,"Expected an AbortController for revalidating fetcher deferred result"),await Lr(s,o.signal,!0).then((e=>{e&&(t[i]=e)}))))}}async function Lr(e,t,n){if(void 0===n&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:dn.data,data:e.deferredData.unwrappedData}}catch(r){return{type:dn.error,error:r}}return{type:dn.data,data:e.deferredData.data}}}function kr(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Or(e,t){let n="string"===typeof t?cn(t).search:t.search;if(e[e.length-1].route.index&&kr(n||""))return e[e.length-1];let r=Bn(e);return r[r.length-1]}function Nr(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r)return null!=i?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i}:null!=a?{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0}:void 0!==o?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}:void 0}function Fr(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ur(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function zr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Hr(){return Hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hr.apply(this,arguments)}const Gr=t.createContext(null);const jr=t.createContext(null);const Vr=t.createContext(null);const Wr=t.createContext(null);const Xr=t.createContext({outlet:null,matches:[],isDataRoute:!1});const Jr=t.createContext(null);function $r(){return null!=t.useContext(Wr)}function Kr(){return $r()||rn(!1),t.useContext(Wr).location}function Yr(e){t.useContext(Vr).static||t.useLayoutEffect(e)}function qr(){let{isDataRoute:e}=t.useContext(Xr);return e?function(){let{router:e}=si(ai.UseNavigateStable),n=ci(oi.UseNavigateStable),r=t.useRef(!1);Yr((()=>{r.current=!0}));let i=t.useCallback((function(t,i){void 0===i&&(i={}),r.current&&("number"===typeof t?e.navigate(t):e.navigate(t,Hr({fromRouteId:n},i)))}),[e,n]);return i}():function(){$r()||rn(!1);let e=t.useContext(Gr),{basename:n,future:r,navigator:i}=t.useContext(Vr),{matches:a}=t.useContext(Xr),{pathname:o}=Kr(),s=JSON.stringify(In(a,r.v7_relativeSplatPath)),l=t.useRef(!1);Yr((()=>{l.current=!0}));let c=t.useCallback((function(t,r){if(void 0===r&&(r={}),!l.current)return;if("number"===typeof t)return void i.go(t);let a=Dn(t,JSON.parse(s),o,"path"===r.relative);null==e&&"/"!==n&&(a.pathname="/"===a.pathname?n:Ln([n,a.pathname])),(r.replace?i.replace:i.push)(a,r.state,r)}),[n,i,s,o,e]);return c}()}const Qr=t.createContext(null);function Zr(e,n,r,i){$r()||rn(!1);let{navigator:a}=t.useContext(Vr),{matches:o}=t.useContext(Xr),s=o[o.length-1],l=s?s.params:{},c=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let u,d=Kr();if(n){var h;let e="string"===typeof n?cn(n):n;"/"===c||(null==(h=e.pathname)?void 0:h.startsWith(c))||rn(!1),u=e}else u=d;let p=u.pathname||"/",f=p;if("/"!==c){let e=c.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=fn(e,{pathname:f});let g=ii(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:Ln([c,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:Ln([c,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),o,r,i);return n&&g?t.createElement(Wr.Provider,{value:{location:Hr({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:en.Pop}},g):g}function ei(){let e=function(){var e;let n=t.useContext(Jr),r=li(oi.UseRouteError),i=ci(oi.UseRouteError);if(void 0!==n)return n;return null==(e=r.errors)?void 0:e[i]}(),n=Un(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:i};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),r?t.createElement("pre",{style:a},r):null,null)}const ti=t.createElement(ei,null);class ni extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(Xr.Provider,{value:this.props.routeContext},t.createElement(Jr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ri(e){let{routeContext:n,match:r,children:i}=e,a=t.useContext(Gr);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),t.createElement(Xr.Provider,{value:n},i)}function ii(e,n,r,i){var a;if(void 0===n&&(n=[]),void 0===r&&(r=null),void 0===i&&(i=null),null==e){var o;if(!r)return null;if(r.errors)e=r.matches;else{if(!(null!=(o=i)&&o.v7_partialHydration&&0===n.length&&!r.initialized&&r.matches.length>0))return null;e=r.matches}}let s=e,l=null==(a=r)?void 0:a.errors;if(null!=l){let e=s.findIndex((e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id])));e>=0||rn(!1),s=s.slice(0,Math.min(s.length,e+1))}let c=!1,u=-1;if(r&&i&&i.v7_partialHydration)for(let t=0;t<s.length;t++){let e=s[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(u=t),e.route.id){let{loaderData:t,errors:n}=r,i=e.route.loader&&void 0===t[e.route.id]&&(!n||void 0===n[e.route.id]);if(e.route.lazy||i){c=!0,s=u>=0?s.slice(0,u+1):[s[0]];break}}}return s.reduceRight(((e,i,a)=>{let o,d=!1,h=null,p=null;var f;r&&(o=l&&i.route.id?l[i.route.id]:void 0,h=i.route.errorElement||ti,c&&(u<0&&0===a?(f="route-fallback",!1||ui[f]||(ui[f]=!0),d=!0,p=null):u===a&&(d=!0,p=i.route.hydrateFallbackElement||null)));let m=n.concat(s.slice(0,a+1)),g=()=>{let n;return n=o?h:d?p:i.route.Component?t.createElement(i.route.Component,null):i.route.element?i.route.element:e,t.createElement(ri,{match:i,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:n})};return r&&(i.route.ErrorBoundary||i.route.errorElement||0===a)?t.createElement(ni,{location:r.location,revalidation:r.revalidation,component:h,error:o,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()}),null)}var ai=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ai||{}),oi=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(oi||{});function si(e){let n=t.useContext(Gr);return n||rn(!1),n}function li(e){let n=t.useContext(jr);return n||rn(!1),n}function ci(e){let n=function(){let e=t.useContext(Xr);return e||rn(!1),e}(),r=n.matches[n.matches.length-1];return r.route.id||rn(!1),r.route.id}const ui={};r.startTransition;function di(e){return function(e){let n=t.useContext(Xr).outlet;return n?t.createElement(Qr.Provider,{value:e},n):n}(e.context)}function hi(e){let{basename:n="/",children:r=null,location:i,navigationType:a=en.Pop,navigator:o,static:s=!1,future:l}=e;$r()&&rn(!1);let c=n.replace(/^\/*/,"/"),u=t.useMemo((()=>({basename:c,navigator:o,static:s,future:Hr({v7_relativeSplatPath:!1},l)})),[c,l,o,s]);"string"===typeof i&&(i=cn(i));let{pathname:d="/",search:h="",hash:p="",state:f=null,key:m="default"}=i,g=t.useMemo((()=>{let e=Rn(d,c);return null==e?null:{location:{pathname:e,search:h,hash:p,state:f,key:m},navigationType:a}}),[c,d,h,p,f,m,a]);return null==g?null:t.createElement(Vr.Provider,{value:u},t.createElement(Wr.Provider,{children:r,value:g}))}new Promise((()=>{}));t.Component;function pi(e){let n={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(n,{element:t.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(n,{hydrateFallbackElement:t.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(n,{errorElement:t.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),n}var fi=n(579);const mi=Qt.nav`
  display: flex;
  justify-content: center;
  background-color: black;
  padding: 10px;
  background-color: #040303;
`,gi=Qt.div`
  position: relative;
  /* width: 1400px; */
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4%; //move this later

  @media only screen and (max-width: 768px) {
    width: 100%;
    padding: 10px;
  }
`,vi=Qt.div`
  display: flex;
  align-items: center;
  gap: 50px;
  @media only screen and (max-width: 500px) {
    display: none;
  }
`,yi=Qt.img`
  height: 22px;
  opacity: 0.86;

  @media only screen and (max-width: 500px) {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: 12px;
  }
`,bi=Qt.ul`
  display: flex;
  gap: 26px;
  list-style: none;
  align-items: center;
  height: 100%;
`,xi=Qt.li`
  cursor: pointer;
  color: white;
  opacity: 0.6;
  font-size: 14px;
  display: flex;
  align-items: center;
  height: 50px;
  justify-content: center;
`,_i=()=>{qr();const e=Kr().pathname.includes("/auth"),t=e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})};return e?(0,fi.jsx)(fi.Fragment,{}):(0,fi.jsx)(mi,{children:(0,fi.jsxs)(gi,{children:[(0,fi.jsx)(yi,{src:"/assets/images/logo-full.png"}),(0,fi.jsx)(vi,{children:(0,fi.jsxs)(bi,{children:[(0,fi.jsx)(xi,{onClick:()=>t("home-mission"),children:"Mission"}),(0,fi.jsx)(xi,{onClick:()=>t("home-tokenomics"),children:"Tokenomics"}),(0,fi.jsx)(xi,{onClick:()=>t("home-learn-more"),children:"Learn More"})]})})]})})};var Si=n(2087),wi={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ei=t.createContext&&t.createContext(wi),Ai=["attr","size","title"];function Mi(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ci(){return Ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ci.apply(this,arguments)}function Ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ri(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ti(Object(n),!0).forEach((function(t){Pi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ti(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pi(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bi(e){return e&&e.map(((e,n)=>t.createElement(e.tag,Ri({key:n},e.attr),Bi(e.child))))}function Ii(e){return n=>t.createElement(Di,Ci({attr:Ri({},e.attr)},n),Bi(e.child))}function Di(e){var n=n=>{var r,{attr:i,size:a,title:o}=e,s=Mi(e,Ai),l=a||n.size||"1em";return n.className&&(r=n.className),e.className&&(r=(r?r+" ":"")+e.className),t.createElement("svg",Ci({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,s,{className:r,style:Ri(Ri({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&t.createElement("title",null,o),e.children)};return void 0!==Ei?t.createElement(Ei.Consumer,null,(e=>n(e))):n(wi)}function Li(e){return Ii({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"},child:[]}]})(e)}function ki(e){return Ii({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224,202.66A53.34,53.34,0,1,0,277.36,256,53.38,53.38,0,0,0,224,202.66Zm124.71-41a54,54,0,0,0-30.41-30.41c-21-8.29-71-6.43-94.3-6.43s-73.25-1.93-94.31,6.43a54,54,0,0,0-30.41,30.41c-8.28,21-6.43,71.05-6.43,94.33S91,329.26,99.32,350.33a54,54,0,0,0,30.41,30.41c21,8.29,71,6.43,94.31,6.43s73.24,1.93,94.3-6.43a54,54,0,0,0,30.41-30.41c8.35-21,6.43-71.05,6.43-94.33S357.1,182.74,348.75,161.67ZM224,338a82,82,0,1,1,82-82A81.9,81.9,0,0,1,224,338Zm85.38-148.3a19.14,19.14,0,1,1,19.13-19.14A19.1,19.1,0,0,1,309.42,189.74ZM400,32H48A48,48,0,0,0,0,80V432a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V80A48,48,0,0,0,400,32ZM382.88,322c-1.29,25.63-7.14,48.34-25.85,67s-41.4,24.63-67,25.85c-26.41,1.49-105.59,1.49-132,0-25.63-1.29-48.26-7.15-67-25.85s-24.63-41.42-25.85-67c-1.49-26.42-1.49-105.61,0-132,1.29-25.63,7.07-48.34,25.85-67s41.47-24.56,67-25.78c26.41-1.49,105.59-1.49,132,0,25.63,1.29,48.33,7.15,67,25.85s24.63,41.42,25.85,67.05C384.37,216.44,384.37,295.56,382.88,322Z"},child:[]}]})(e)}function Oi(e){return Ii({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"},child:[]}]})(e)}function Ni(e){return Ii({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M201.5 305.5c-13.8 0-24.9-11.1-24.9-24.6 0-13.8 11.1-24.9 24.9-24.9 13.6 0 24.6 11.1 24.6 24.9 0 13.6-11.1 24.6-24.6 24.6zM504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-132.3-41.2c-9.4 0-17.7 3.9-23.8 10-22.4-15.5-52.6-25.5-86.1-26.6l17.4-78.3 55.4 12.5c0 13.6 11.1 24.6 24.6 24.6 13.8 0 24.9-11.3 24.9-24.9s-11.1-24.9-24.9-24.9c-9.7 0-18 5.8-22.1 13.8l-61.2-13.6c-3-.8-6.1 1.4-6.9 4.4l-19.1 86.4c-33.2 1.4-63.1 11.3-85.5 26.8-6.1-6.4-14.7-10.2-24.1-10.2-34.9 0-46.3 46.9-14.4 62.8-1.1 5-1.7 10.2-1.7 15.5 0 52.6 59.2 95.2 132 95.2 73.1 0 132.3-42.6 132.3-95.2 0-5.3-.6-10.8-1.9-15.8 31.3-16 19.8-62.5-14.9-62.5zM302.8 331c-18.2 18.2-76.1 17.9-93.6 0-2.2-2.2-6.1-2.2-8.3 0-2.5 2.5-2.5 6.4 0 8.6 22.8 22.8 87.3 22.8 110.2 0 2.5-2.2 2.5-6.1 0-8.6-2.2-2.2-6.1-2.2-8.3 0zm7.7-75c-13.6 0-24.6 11.1-24.6 24.9 0 13.6 11.1 24.6 24.6 24.6 13.8 0 24.9-11.1 24.9-24.6 0-13.8-11-24.9-24.9-24.9z"},child:[]}]})(e)}function Fi(e){return Ii({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M446.7 98.6l-67.6 318.8c-5.1 22.5-18.4 28.1-37.3 17.5l-103-75.9-49.7 47.8c-5.5 5.5-10.1 10.1-20.7 10.1l7.4-104.9 190.9-172.5c8.3-7.4-1.8-11.5-12.9-4.1L117.8 284 16.2 252.2c-22.1-6.9-22.5-22.1 4.6-32.7L418.2 66.4c18.4-6.9 34.5 4.1 28.5 32.2z"},child:[]}]})(e)}function Ui(e){return Ii({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"},child:[]}]})(e)}function zi(e){return Ii({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"},child:[]}]})(e)}function Hi(e){return Ii({tag:"svg",attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M800 112.962C800 50.575 749.425 0 687.038 0H112.962C50.575 0 0 50.575 0 112.962v574.076C0 749.426 50.575 800 112.962 800h574.076C749.425 800 800 749.426 800 687.038zM662.759 348.916c-51.615.577-99.71-15.027-141.938-43.927v202.874c0 90.166-61.72 167.62-148.996 187.848-119.068 27.165-219.864-58.954-232.577-161.835-13.294-102.884 52.322-193.051 152.892-213.281 19.651-4.045 49.209-4.045 64.458-.577v108.661c-4.692-1.153-9.086-2.31-13.709-2.888-39.304-6.937-77.371 12.715-92.977 48.55-15.605 35.838-5.16 77.451 26.629 101.73 26.586 20.806 56.085 23.694 86.14 9.822 30.057-13.291 46.21-37.567 49.676-70.512.578-4.622.546-9.826.546-15.028V110.206c0-10.981.086-10.502 11.068-10.502h86.12c6.36 0 8.673.915 9.25 8.433 4.621 67.047 55.526 124.147 120.838 132.818 6.937 1.155 14.369 1.613 22.58 2.19z",transform:"translate(112 112)"},child:[]}]})(e)}const Gi=()=>({TELEGRAM:{displayName:"Telegram",link:"https://t.me/+7PZFnXhMI1gyZWE0",color:"#0088cc",icon:Fi},DISCORD:{displayName:"Discord",link:"https://discord.gg/gDkjMUV2b2",color:"#7289da",icon:Li},REDDIT:{displayName:"Reddit",link:"https://www.reddit.com/r/BLUEBAG",color:"#ff4500",icon:Ni},X:{displayName:"X",link:"https://x.com/BlueBagDotApp",color:"#FFF",icon:zi},YOUTUBE:{displayName:"Youtube",link:"https://www.youtube.com/@bluebagapp",color:"#FF0000",icon:Ui},LINKEDIN:{displayName:"LinkedIn",link:"https://www.linkedin.com/company/bluebagapp/",color:"#0077B5",icon:Oi},INSTAGRAM:{displayName:"Instagram",link:"https://www.instagram.com/tedtoken/",color:"#F56040",icon:ki},TIKTOK:{displayName:"TikTok",link:"https://www.tiktok.com/@BLUEBAG.APP",color:"#ff0050",icon:Hi}}),ji=Qt.input`
  padding: 18px;
  background-color: #e8e6e6;
  border: none;
  border-radius: 5px;

  @media only screen and (max-width: 450px) {
    padding: 14px;
  }

`;function Vi(e){const{placeholder:t,type:n,name:r,value:i,onChange:a}=e;return(0,fi.jsx)(ji,{placeholder:t,type:n,name:r,value:i,onChange:a})}const Wi=Qt.button`
  background-color: ${e=>e.bg||"#05c3e5"};
  color: white;
  font-weight: 500;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: ${e=>e.disabled?"not-allowed":"pointer"};
  opacity: ${e=>e.disabled?.6:1};

  span {
    font-weight: 700;
  }
`,Xi=e=>{let{label:t,onClick:n,disabled:r=!1,type:i="submit",bg:a="#05c3e5"}=e;return(0,fi.jsx)(Wi,{onClick:n,disabled:r,type:i,bg:a,children:(0,fi.jsx)("span",{children:t})})},Ji=Gi(),$i=Qt.footer`
  background-color: #000000;
  /* padding: 20px; */
  padding: 40px 6%; //move this later
   box-sizing: border-box;

  @media only screen and (max-width: 500px) {
    padding: 30px 6%; //move this later
  }
`,Ki=Qt.div`
  display: flex;
  justify-content: space-between;
  align-items: center;

  @media only screen and (max-width: 500px) {
    flex-direction: column;
    gap: 20px;
  }
`,Yi=Qt.div`
  img {
    height: 26px;

    @media only screen and (max-width: 700px) {
      height: 22px;
    }

    @media only screen and (max-width: 500px) {
      /* height: 20px; */
    }
  }
`,qi=Qt.div`
  a {
    margin: 0 10px;
    color: inherit;

    svg {
      width: 26px;

      @media only screen and (max-width: 700px) {
        width: 20px;
      }

      @media only screen and (max-width: 500px) {
        width: 16px;
      }
    }
  }
`,Qi=Qt.div`
  border-top: 1px solid #e0e0e0;
  margin: 20px 0;
  opacity: 0.15;
`,Zi=Qt.div`
  display: flex;
  flex-direction: column;
  align-items: normal;
  padding: 20px;
`,ea=Qt.div`
  display: flex;
  gap: 60px;
  text-align: justify;

  .footer-column-socials {
    @media only screen and (max-width: 600px) {
      display: none;
    }
  }

  @media only screen and (max-width: 600px) {
    justify-content: center;
    text-align: center;
  }
`,ta=Qt.div`
  display: flex;
  flex-direction: column;
  white-space: nowrap;

  h4 {
    margin-bottom: 10px;
    color: #ffffff;

    @media only screen and (max-width: 900px) {
      font-size: 14px;
    }
  }

  ul {
    list-style: none;
    padding: 0;
  }

  li {
    margin-bottom: 5px;
  }

  a {
    text-decoration: none;
    color: #7e7e7e;

    @media only screen and (max-width: 900px) {
      font-size: 12px;

    }
  }
`,na=Qt.div`
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  white-space: nowrap;

  @media only screen and (max-width: 850px) {
    display: none;
  }

  h4 {
    margin-bottom: 16px;
    color: #ffffff;

    @media only screen and (max-width: 900px) {
      font-size: 14px;
    }
  }

  input {
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
  }

  button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;

    &:hover {
      background-color: #0056b3;
    }
  }
`,ra=Qt.div`
  width: 50%;
  height: 1px;
  background-color: #fff;
  margin: 20px;
  align-self: center;
  opacity: 0.15;
`,ia=Qt.div`
  opacity: 0.35;
  p {
    margin: 0;
    color: #ffffff;
    font-size: 12px;
  }

  @media only screen and (max-width: 600px) {
    font-size: 10px;
  }
`,aa=Qt.form`
  width: 160px;
  display: flex;
  flex-direction: column;
  /* gap: 25px; */
  /* 
  @media only screen and (max-width: 768px) {
    width: 300px;
  } */
`;function oa(){const e=t.useRef(null),[n,r]=t.useState(""),[i,a]=t.useState(!0);t.useEffect((()=>{a(!Si.validate(n))}),[n]);return(0,fi.jsxs)($i,{children:[(0,fi.jsxs)(Ki,{children:[(0,fi.jsx)(Yi,{children:(0,fi.jsx)("img",{src:"/assets/images/logo-full.png",alt:"Logo"})}),(0,fi.jsx)(qi,{children:Object.values(Ji).map((e=>(0,fi.jsx)("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",children:(0,fi.jsx)(e.icon,{size:24,color:e.color,textColor:"white"})})))})]}),(0,fi.jsx)(Qi,{}),(0,fi.jsxs)(Zi,{children:[(0,fi.jsxs)(ea,{children:[(0,fi.jsxs)(ta,{className:"footer-column-socials",children:[(0,fi.jsx)("h4",{children:"Social Networks"}),(0,fi.jsx)("ul",{children:Object.values(Ji).slice(0,4).map((e=>(0,fi.jsx)("li",{children:(0,fi.jsx)("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",children:e.displayName})})))})]}),(0,fi.jsxs)(ta,{className:"footer-column-socials",children:[(0,fi.jsx)("h4",{style:{opacity:0},children:"Social Networks"}),(0,fi.jsx)("ul",{children:Object.values(Ji).slice(4,9).map((e=>(0,fi.jsx)("li",{children:(0,fi.jsx)("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",children:e.displayName})})))})]}),(0,fi.jsxs)(ta,{children:[(0,fi.jsx)("h4",{children:"Resources"}),(0,fi.jsxs)("ul",{children:[(0,fi.jsx)("li",{children:(0,fi.jsx)("a",{href:"#",children:"Whitepaper (Coming Soon)"})}),(0,fi.jsx)("li",{children:(0,fi.jsx)("a",{href:"#",children:"Privacy Policy"})}),(0,fi.jsx)("li",{children:(0,fi.jsx)("a",{href:"#",children:"Terms & Conditions"})}),(0,fi.jsx)("li",{children:(0,fi.jsx)("a",{href:"#",children:"Contact Us"})})]})]}),(0,fi.jsxs)(na,{children:[(0,fi.jsx)("h4",{children:"Subscribe to our newsletter"}),(0,fi.jsxs)(aa,{ref:e,onSubmit:async e=>{e.preventDefault();try{const e={access_key:"cb8e130e-6fe7-4718-8874-d770a64aa4c3",email:n},t=await fetch("https://api.web3forms.com/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),i=await t.json();console.log("result"),console.log(i),t.ok?(alert("Form submitted successfully"),r("")):alert("Error sending form")}catch(cO){alert("Error sending form")}},action:"https://api.web3forms.com/submit",method:"POST",children:[(0,fi.jsx)(Vi,{type:"hidden",name:"access_key",value:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}),(0,fi.jsx)(Vi,{placeholder:"add your email",name:"email",type:"Enter your email",onChange:e=>r(e.target.value),value:n}),(0,fi.jsx)(Xi,{type:"submit",disabled:i,label:"Subscribe",onClick:()=>console.log("test")})]})]})]}),(0,fi.jsx)(ra,{}),(0,fi.jsx)(ia,{children:(0,fi.jsx)("p",{children:"\xa9 2024 Inc. All rights reserved."})})]})]})}const sa=(function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=Kt.apply(void 0,s([e],n,!1)),a="sc-global-".concat(Le(JSON.stringify(i))),l=new Zt(i,a),c=function(e){var n=Dt(),r=t.useContext(Vt),i=t.useRef(n.styleSheet.allocateGSInstance(a)).current;return n.styleSheet.server&&u(i,e,n.styleSheet,r,n.stylis),t.useLayoutEffect((function(){if(!n.styleSheet.server)return u(i,e,n.styleSheet,r,n.stylis),function(){return l.removeStyles(i,n.styleSheet)}}),[i,e,n.styleSheet,r,n.stylis]),null};function u(e,t,n,r,i){if(l.isStatic)l.renderStyles(e,ye,n,i);else{var a=o(o({},t),{theme:_e(t,r,c.defaultProps)});l.renderStyles(e,a,n,i)}}return t.memo(c)})`
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    line-height: 1.5;
    background-color: #f4f4f9;
    color: #333;

  }

  #root{
    min-height:100vh;
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  button {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
  }

  h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
  }
`,la=Qt.main`
  margin: 0 auto;
`;function ca(){return(0,fi.jsxs)(fi.Fragment,{children:[(0,fi.jsx)(sa,{}),(0,fi.jsx)(_i,{}),(0,fi.jsx)(la,{children:(0,fi.jsx)(di,{})}),(0,fi.jsx)(oa,{})]})}const ua={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class da{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||ua,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:("string"===typeof e[0]&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new da(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new da(this.logger,e)}}var ha=new da;class pa{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((e=>{let[t,r]=e;for(let i=0;i<r;i++)t(...n)}))}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach((t=>{let[r,i]=t;for(let a=0;a<i;a++)r.apply(r,[e,...n])}))}}}const fa=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n},ma=e=>null==e?"":""+e,ga=/###/g,va=e=>e&&e.indexOf("###")>-1?e.replace(ga,"."):e,ya=e=>!e||"string"===typeof e,ba=(e,t,n)=>{const r="string"!==typeof t?t:t.split(".");let i=0;for(;i<r.length-1;){if(ya(e))return{};const t=va(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return ya(e)?{}:{obj:e,k:va(r[i])}},xa=(e,t,n)=>{const{obj:r,k:i}=ba(e,t,Object);if(void 0!==r||1===t.length)return void(r[i]=n);let a=t[t.length-1],o=t.slice(0,t.length-1),s=ba(e,o,Object);for(;void 0===s.obj&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=ba(e,o,Object),s&&s.obj&&"undefined"!==typeof s.obj[`${s.k}.${a}`]&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},_a=(e,t)=>{const{obj:n,k:r}=ba(e,t);if(n)return n[r]},Sa=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"===typeof e[r]||e[r]instanceof String||"string"===typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):Sa(e[r],t[r],n):e[r]=t[r]);return e},wa=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ea={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Aa=e=>"string"===typeof e?e.replace(/[&<>"'\/]/g,(e=>Ea[e])):e;const Ma=[" ",",","?","!",";"],Ca=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Ta=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let a=0;a<r.length;){if(!i||"object"!==typeof i)return;let e,t="";for(let o=a;o<r.length;++o)if(o!==a&&(t+=n),t+=r[o],e=i[t],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&o<r.length-1)continue;a+=o-a+1;break}i=e}return i},Ra=e=>e&&e.indexOf("_")>0?e.replace("_","-"):e;class Pa extends pa{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):"string"===typeof n&&i?o.push(...n.split(i)):o.push(n)));const s=_a(this.data,o);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),s||!a||"string"!==typeof n?s:Ta(this.data&&this.data[e]&&this.data[e][t],n,i)}addResource(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const a=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(o=e.split("."),r=t,t=o[1]),this.addNamespaces(t),xa(this.data,o,r),i.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const i in n)("string"===typeof n[i]||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=_a(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Sa(s,n,i):s={...s,...n},xa(this.data,o,s),a.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var Ba={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach((e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,i))})),t}};const Ia={};class Da extends pa{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((e,t,n)=>{e.forEach((e=>{t[e]&&(n[e]=t[e])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=ha.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(void 0===e||null===e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";const r=Ma.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const i=Ca.getRegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let a=!i.test(e);if(!a){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a})(e,n,r);if(a&&!o){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:i};const a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return"string"===typeof i&&(i=[i]),{key:e,namespaces:i}}translate(e,t,n){if("object"!==typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"===typeof t&&(t={...t}),t||(t={}),void 0===e||null===e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],t),s=o[o.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${e}${a}`,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:`${s}${e}${a}`}return r?{res:a,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:a}const u=this.resolve(e,t);let d=u&&u.res;const h=u&&u.usedKey||a,p=u&&u.exactUsedKey||a,f=Object.prototype.toString.apply(d),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject;if(g&&d&&("string"!==typeof d&&"boolean"!==typeof d&&"number"!==typeof d)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(f)<0&&("string"!==typeof m||!Array.isArray(d))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,d,{...t,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(u.res=e,u.usedParams=this.getUsedParamsDetails(t),u):e}if(i){const e=Array.isArray(d),n=e?[]:{},r=e?p:h;for(const a in d)if(Object.prototype.hasOwnProperty.call(d,a)){const e=`${r}${i}${a}`;n[a]=this.translate(e,{...t,joinArrays:!1,ns:o}),n[a]===e&&(n[a]=d[a])}d=n}}else if(g&&"string"===typeof m&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,o=!1;const c=void 0!==t.count&&"string"!==typeof t.count,h=Da.hasDefaultValue(t),p=c?this.pluralResolver.getSuffix(l,t.count,t):"",f=t.ordinal&&c?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",m=c&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),g=m&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${p}`]||t[`defaultValue${f}`]||t.defaultValue;!this.isValidLookup(d)&&h&&(r=!0,d=g),this.isValidLookup(d)||(o=!0,d=a);const v=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:d,y=h&&g!==d&&this.options.updateMissing;if(o||r||y){if(this.logger.log(y?"updateKey":"missingKey",l,s,a,y?g:d),i){const e=this.resolve(a,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{const i=h&&r!==d?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,s,n,i,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,s,n,i,y,t),this.emit("missingKey",e,s,n,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach((e=>{const n=this.pluralResolver.getSuffixes(e,t);m&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach((n=>{r([e],a+n,t[`defaultValue${n}`]||g)}))})):r(e,a,g))}d=this.extendTranslation(d,e,t,u,n),o&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${s}:${a}`),(o||r)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${a}`:a,r?d:void 0):this.options.parseMissingKeyHandler(d))}return r?(u.res=d,u.usedParams=this.getUsedParamsDetails(t),u):d}extendTranslation(e,t,n,r,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const o="string"===typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(o){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let l=n.replace&&"string"!==typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||r.usedLng,n),o){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return i&&i[0]===r[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null):a.translate(...r,t)}),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,s="string"===typeof o?[o]:o;return void 0!==e&&null!==e&&s&&s.length&&!1!==n.applyPostProcessor&&(e=Ba.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,r,i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"===typeof e&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const s=this.extractFromKey(e,o),l=s.key;n=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==o.count&&"string"!==typeof o.count,d=u&&!o.ordinal&&0===o.count&&this.pluralResolver.shouldUseIntlApi(),h=void 0!==o.context&&("string"===typeof o.context||"number"===typeof o.context)&&""!==o.context,p=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(a=e,!Ia[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(Ia[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((n=>{if(this.isValidLookup(t))return;i=n;const a=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,n,e,o);else{let e;u&&(e=this.pluralResolver.getSuffix(n,o.count,o));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(a.push(l+e),o.ordinal&&0===e.indexOf(r)&&a.push(l+e.replace(r,this.options.pluralSeparator)),d&&a.push(l+t)),h){const n=`${l}${this.options.contextSeparator}${o.context}`;a.push(n),u&&(a.push(n+e),o.ordinal&&0===e.indexOf(r)&&a.push(n+e.replace(r,this.options.pluralSeparator)),d&&a.push(n+t))}}let s;for(;s=a.pop();)this.isValidLookup(t)||(r=s,t=this.getResource(n,e,s,o))})))}))})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:a}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&"string"!==typeof e.replace;let r=n?e.replace:e;if(n&&"undefined"!==typeof e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}const La=e=>e.charAt(0).toUpperCase()+e.slice(1);class ka{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ha.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Ra(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Ra(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"===typeof e&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map((e=>e.toLowerCase())):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=La(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=La(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=La(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"===typeof e&&(e=e(t)),"string"===typeof e&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"===typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"===typeof e&&i(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))})),r}}let Oa=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Na={1:e=>Number(e>1),2:e=>Number(1!=e),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const Fa=["v1","v2","v3"],Ua=["v4"],za={zero:0,one:1,two:2,few:3,many:4,other:5};class Ha{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=ha.create("pluralResolver"),this.options.compatibilityJSON&&!Ua.includes(this.options.compatibilityJSON)||"undefined"!==typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return Oa.forEach((t=>{t.lngs.forEach((n=>{e[n]={numbers:t.nr,plurals:Na[t.fc]}}))})),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{const n=Ra("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];const a=new Intl.PluralRules(n,{type:r});return this.pluralRulesCache[i]=a,a}catch(n){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(((e,t)=>za[e]-za[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):n.numbers.map((n=>this.getSuffix(e,n,t))):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const i=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"===typeof r?`_plural_${r.toString()}`:i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Fa.includes(this.options.compatibilityJSON)}}const Ga=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=((e,t,n)=>{const r=_a(e,n);return void 0!==r?r:_a(t,n)})(e,t,n);return!a&&i&&"string"===typeof n&&(a=Ta(e,n,r),void 0===a&&(a=Ta(t,n,r))),a},ja=e=>e.replace(/\$/g,"$$$$");class Va{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=ha.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:f,nestingOptionsSeparator:m,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:Aa,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=i?wa(i):a||"{{",this.suffix=o?wa(o):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?wa(d):h||wa("$t("),this.nestingSuffix=p?wa(p):f||wa(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=g||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=Ga(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Ga(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();const c=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>ja(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?ja(this.escape(e)):ja(e)}].forEach((t=>{for(o=0;i=t.regex.exec(e);){const n=i[1].trim();if(a=l(n),void 0===a)if("function"===typeof c){const t=c(e,i,r);a="string"===typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a="";else{if(u){a=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=""}else"string"===typeof a||this.useRawValueToEscape||(a=ma(a));const s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}})),e}nest(e,t){let n,r,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let a=`{${r[1]}`;e=r[0],a=this.interpolate(a,i);const o=a.match(/'/g),s=a.match(/"/g);(o&&o.length%2===0&&!s||s.length%2!==0)&&(a=a.replace(/'/g,'"'));try{i=JSON.parse(a),t&&(i={...t,...i})}catch(l){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,l),`${e}${n}${a}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];i={...a},i=i.replace&&"string"!==typeof i.replace?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),s=e,l=!0}if(r=t(o.call(this,n[1].trim(),i),i),r&&n[0]===e&&"string"!==typeof r)return r;"string"!==typeof r&&(r=ma(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l&&(r=s.reduce(((e,t)=>this.format(e,t,a.lng,{...a,interpolationkey:n[1].trim()})),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const Wa=e=>{const t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=r+JSON.stringify(a);let s=t[o];return s||(s=e(Ra(r),i),t[o]=s),s(n)}};class Xa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=ha.create("formatter"),this.options=e,this.formats={number:Wa(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:Wa(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:Wa(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:Wa(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:Wa(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Wa(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}const a=i.reduce(((e,t)=>{const{formatName:i,formatOptions:a}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((e=>{if(e){const[t,...r]=e.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,""),a=t.trim();n[a]||(n[a]=i),"false"===i&&(n[a]=!1),"true"===i&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const o=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(cO){this.logger.warn(cO)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e);return a}}class Ja extends pa{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=ha.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const i={},a={},o={},s={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===a[o]&&(a[o]=!0):(this.state[o]=1,r=!1,void 0===a[o]&&(a[o]=!0),void 0===i[o]&&(i[o]=!0),void 0===s[t]&&(s[t]=!0)))})),r||(o[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),i=r[0],a=r[1];t&&this.emit("failedLoading",i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:r,k:i}=ba(e,t,Object);r[i]=r[i]||[],r[i].push(n)})(n.loaded,[i],a),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{o[e]||(o[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===o[e][t]&&(o[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});this.readingCalls++;const o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&s&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,r+1,2*i,a)}),i):a(o,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,o);try{const n=s(e,t);n&&"function"===typeof n.then?n.then((e=>o(null,e))).catch(o):o(null,n)}catch(l){o(l)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"===typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"===typeof t&&(t=[t]);const i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,((n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)}))}saveMissing(e,t,n,r,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(void 0!==n&&null!==n&&""!==n){if(this.backend&&this.backend.create){const l={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=5===c.length?c(e,t,n,r,l):c(e,t,n,r),i&&"function"===typeof i.then?i.then((e=>o(null,e))).catch(o):o(null,i)}catch(s){o(s)}else c(e,t,n,r,o,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}const $a=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"===typeof e[1]&&(t=e[1]),"string"===typeof e[1]&&(t.defaultValue=e[1]),"string"===typeof e[2]&&(t.tDescription=e[2]),"object"===typeof e[2]||"object"===typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Ka=e=>("string"===typeof e.ns&&(e.ns=[e.ns]),"string"===typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"===typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Ya=()=>{};class qa extends pa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=Ka(e),this.services={},this.logger=ha,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"===typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"===typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"===typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=$a();this.options={...r,...this.options,...Ka(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=e=>e?"function"===typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?ha.init(i(this.modules.logger),this.options):ha.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!==typeof Intl&&(t=Xa);const n=new ka(this.options);this.store=new Pa(this.options.resources,this.options);const a=this.services;a.logger=ha,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new Ha(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=i(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new Va(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new Ja(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit(t,...r)})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new Da(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit(t,...r)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=Ya),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const a=fa(),o=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?o():setTimeout(o,0),a}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ya;const n="string"===typeof e?e:this.language;if("function"===typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>r(e)))}this.options.preload&&this.options.preload.forEach((e=>r(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const r=fa();return"function"===typeof e&&(n=e,e=void 0),"function"===typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ya),this.services.backendConnector.reload(e,t,(e=>{r.resolve(),n(e)})),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ba.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=fa();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(e,a)=>{a?(i(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,r.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n="string"===typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,(e=>{a(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const i=function(e,t){let a;if("object"!==typeof t){for(var o=arguments.length,s=new Array(o>2?o-2:0),l=2;l<o;l++)s[l-2]=arguments[l];a=r.options.overloadTranslationOptionHandler([e,t].concat(s))}else a={...t};a.lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs,a.ns=a.ns||i.ns,""!==a.keyPrefix&&(a.keyPrefix=a.keyPrefix||n||i.keyPrefix);const c=r.options.keySeparator||".";let u;return u=a.keyPrefix&&Array.isArray(e)?e.map((e=>`${a.keyPrefix}${c}${e}`)):a.keyPrefix?`${a.keyPrefix}${c}${e}`:e,r.t(u,a)};return"string"===typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const a=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,a);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(n,e)||r&&!a(i,e)))}loadNamespaces(e,t){const n=fa();return this.options.ns?("string"===typeof e&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=fa();"string"===typeof e&&(e=[e]);const r=this.options.preload||[],i=e.filter((e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return i.length?(this.options.preload=r.concat(i),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new ka($a());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new qa(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ya;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new qa(r);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));return["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n&&(i.store=new Pa(this.store.data,r),i.services.resourceStore=i.store),i.translator=new Da(i.services,r),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit(e,...n)})),i.init(r,t),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Qa=qa.createInstance();Qa.createInstance=qa.createInstance;Qa.createInstance,Qa.dir,Qa.init,Qa.loadResources,Qa.reloadResources,Qa.use,Qa.changeLanguage,Qa.getFixedT,Qa.t,Qa.exists,Qa.setDefaultNamespace,Qa.hasLoadedNamespace,Qa.loadNamespaces,Qa.loadLanguages;n(1844);Object.create(null);const Za={},eo=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];io(t[0])&&Za[t[0]]||(io(t[0])&&(Za[t[0]]=new Date),function(){if(console?.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];io(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}(...t))},to=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout((()=>{e.off("initialized",n)}),0),t()};e.on("initialized",n)}},no=(e,t,n)=>{e.loadNamespaces(t,to(e,n))},ro=(e,t,n,r)=>{io(n)&&(n=[n]),n.forEach((t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,to(e,r))},io=e=>"string"===typeof e,ao=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,oo={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xa9","&#169;":"\xa9","&reg;":"\xae","&#174;":"\xae","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},so=e=>oo[e];let lo={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(ao,so)};let co;const uo={type:"3rdParty",init(e){!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};lo={...lo,...e}}(e.options.react),(e=>{co=e})(e)}},ho=(0,t.createContext)();class po{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach((e=>{this.usedNamespaces[e]??=!0}))}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const fo=(e,t,n,r)=>e.getFixedT(t,n,r),mo=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{i18n:r}=n,{i18n:i,defaultNS:a}=(0,t.useContext)(ho)||{},o=r||i||co;if(o&&!o.reportNamespaces&&(o.reportNamespaces=new po),!o){eo("You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return io(t)?t:"object"===typeof(n=t)&&null!==n&&io(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var n},t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}o.options.react?.wait&&eo("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...lo,...o.options.react,...n},{useSuspense:l,keyPrefix:c}=s;let u=e||a||o.options?.defaultNS;u=io(u)?[u]:u||["translation"],o.reportNamespaces.addUsedNamespaces?.(u);const d=(o.isInitialized||o.initializedStoreOnce)&&u.every((e=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n?.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):(eo("i18n.languages were undefined or empty",t.languages),!0)}(e,o,s))),h=((e,n,r,i)=>(0,t.useCallback)(fo(e,n,r,i),[e,n,r,i]))(o,n.lng||null,"fallback"===s.nsMode?u:u[0],c),p=()=>h,f=()=>fo(o,n.lng||null,"fallback"===s.nsMode?u:u[0],c),[m,g]=(0,t.useState)(p);let v=u.join();n.lng&&(v=`${n.lng}${v}`);const y=((e,n)=>{const r=(0,t.useRef)();return(0,t.useEffect)((()=>{r.current=n?r.current:e}),[e,n]),r.current})(v),b=(0,t.useRef)(!0);(0,t.useEffect)((()=>{const{bindI18n:e,bindI18nStore:t}=s;b.current=!0,d||l||(n.lng?ro(o,n.lng,u,(()=>{b.current&&g(f)})):no(o,u,(()=>{b.current&&g(f)}))),d&&y&&y!==v&&b.current&&g(f);const r=()=>{b.current&&g(f)};return e&&o?.on(e,r),t&&o?.store.on(t,r),()=>{b.current=!1,o&&e?.split(" ").forEach((e=>o.off(e,r))),t&&o&&t.split(" ").forEach((e=>o.store.off(e,r)))}}),[o,v]),(0,t.useEffect)((()=>{b.current&&d&&g(p)}),[o,c,d]);const x=[m,o,d];if(x.t=m,x.i18n=o,x.ready=d,d)return x;if(!d&&!l)return x;throw new Promise((e=>{n.lng?ro(o,n.lng,u,(()=>e())):no(o,u,(()=>e()))}))};const{slice:go,forEach:vo}=[];const yo=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,bo={create(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*n*1e3)),r&&(i.domain=r),document.cookie=((e,t,n)=>{const r=n||{};r.path=r.path||"/";let i=`${e}=${encodeURIComponent(t)}`;if(r.maxAge>0){const e=r.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(e)}`}if(r.domain){if(!yo.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!yo.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if("function"!==typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"===typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i})(e,encodeURIComponent(t),i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let e=n[r];for(;" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(t))return e.substring(t.length,e.length)}return null},remove(e){this.create(e,"",-1)}};var xo={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!==typeof document)return bo.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&"undefined"!==typeof document&&bo.create(n,e,r,i,a)}},_o={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!==typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const r=e.substring(1).split("&");for(let i=0;i<r.length;i++){const e=r[i].indexOf("=");if(e>0){r[i].substring(0,e)===n&&(t=r[i].substring(e+1))}}}return t}};let So=null;const wo=()=>{if(null!==So)return So;try{So="undefined"!==window&&null!==window.localStorage;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){So=!1}return So};var Eo={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&wo())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&wo()&&window.localStorage.setItem(n,e)}};let Ao=null;const Mo=()=>{if(null!==Ao)return Ao;try{Ao="undefined"!==window&&null!==window.sessionStorage;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Ao=!1}return Ao};var Co={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Mo())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Mo()&&window.sessionStorage.setItem(n,e)}},To={name:"navigator",lookup(e){const t=[];if("undefined"!==typeof navigator){const{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let i=0;i<e.length;i++)t.push(e[i]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Ro={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const r=n||("undefined"!==typeof document?document.documentElement:null);return r&&"function"===typeof r.getAttribute&&(t=r.getAttribute("lang")),t}},Po={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"===typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const r="number"===typeof t?t:0;return n[r]?.replace("/","")}},Bo={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"===typeof t?t+1:1,r="undefined"!==typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};class Io{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=function(e){return vo.call(go.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"===typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(xo),this.addDetector(_o),this.addDetector(Eo),this.addDetector(Co),this.addDetector(To),this.addDetector(Ro),this.addDetector(Po),this.addDetector(Bo)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let t=[];return e.forEach((e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"===typeof n&&(n=[n]),n&&(t=t.concat(n))}})),t=t.map((e=>this.options.convertDetectedLanguage(e))),this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e,t){t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})))}}Io.type="languageDetector",Qa.use(uo).use(Io).init({debug:!0,lng:"en",fallbackLng:"en",ns:["home","common"],defaultNS:"home",resources:{en:{home:n(8799),common:n(8189)},ch:{home:n(2671),common:n(1085)},br:{home:n(3226),common:n(8684)},sp:{home:n(5511),common:n(9989)},pt:{home:n(4362),common:n(9916)},fr:{home:n(270),common:n(6352)},de:{home:n(3879),common:n(4197)},rs:{home:n(5835),common:n(569)},jp:{home:n(5512),common:n(8670)},ar:{home:n(7119),common:n(2829)},hi:{home:n(7807),common:n(6701)},ukr:{home:n(8008),common:n(9806)}},interpolation:{escapeValue:!1}});var Do=n(7950),Lo=n.t(Do,2);function ko(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>t.forEach((t=>function(e,t){"function"===typeof e?e(t):null!==e&&void 0!==e&&(e.current=t)}(t,e)))}function Oo(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.useCallback(ko(...n),n)}var No=t.forwardRef(((e,n)=>{const{children:r,...i}=e,a=t.Children.toArray(r),o=a.find(zo);if(o){const e=o.props.children,r=a.map((n=>n===o?t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null:n));return(0,fi.jsx)(Fo,{...i,ref:n,children:t.isValidElement(e)?t.cloneElement(e,void 0,r):null})}return(0,fi.jsx)(Fo,{...i,ref:n,children:r})}));No.displayName="Slot";var Fo=t.forwardRef(((e,n)=>{const{children:r,...i}=e;if(t.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r);return t.cloneElement(r,{...Ho(i,r.props),ref:n?ko(n,e):e})}return t.Children.count(r)>1?t.Children.only(null):null}));Fo.displayName="SlotClone";var Uo=e=>{let{children:t}=e;return(0,fi.jsx)(fi.Fragment,{children:t})};function zo(e){return t.isValidElement(e)&&e.type===Uo}function Ho(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=function(){a(...arguments),i(...arguments)}:i&&(n[r]=i):"style"===r?n[r]={...i,...a}:"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}var Go=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=t.forwardRef(((e,t)=>{const{asChild:r,...i}=e,a=r?No:n;return"undefined"!==typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,fi.jsx)(a,{...i,ref:t})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{});var jo=Boolean(globalThis?.document)?t.useLayoutEffect:()=>{},Vo=t.forwardRef(((e,n)=>{const{container:r,...i}=e,[a,o]=t.useState(!1);jo((()=>o(!0)),[]);const s=r||a&&globalThis?.document?.body;return s?Do.createPortal((0,fi.jsx)(Go.div,{...i,ref:n}),s):null}));Vo.displayName="Portal";var Wo=Vo,Xo=Object.prototype.hasOwnProperty;function Jo(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Jo(e[r],t[r]););return-1===r}if(!n||"object"===typeof e){for(n in r=0,e){if(Xo.call(e,n)&&++r&&!Xo.call(t,n))return!1;if(!(n in t)||!Jo(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!==e&&t!==t}function $o(e,t){if(Object.is(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Ko=function(e,t,n,r){this.name=e,this.fn=t,this.args=n,this.modifiers=r};function Yo(e,t){return void 0===t&&(t="simple"),"object"===typeof e?e[t]:e}function qo(e,t,n){if(e.length){var r=e.shift(),i=qo(e,t,n);return r.perform(i,n)}return Yo(t)}function Qo(e,t,n){if(e.length){var r=e.shift(),i=Qo(e,t,n);return r.performAsync(i,n)}return function(e){return Promise.resolve(Yo(t,"async")(e))}}Ko.prototype._test=function(e){var t=this.fn;try{qo(this.modifiers.slice(),t,this)(e)}catch(n){t=function(){return!1}}try{return qo(this.modifiers.slice(),t,this)(e)}catch(r){return!1}},Ko.prototype._check=function(e){try{qo(this.modifiers.slice(),this.fn,this)(e)}catch(t){if(qo(this.modifiers.slice(),(function(e){return e}),this)(!1))return}if(!qo(this.modifiers.slice(),this.fn,this)(e))throw null},Ko.prototype._testAsync=function(e){var t=this;return new Promise((function(n,r){Qo(t.modifiers.slice(),t.fn,t)(e).then((function(t){t?n(e):r(null)})).catch((function(e){return r(e)}))}))};var Zo=function(e,t,n){this.name=e,this.perform=t,this.performAsync=n},es=function(e){function t(n,r,i,a){for(var o=[],s=arguments.length-4;s-- >0;)o[s]=arguments[s+4];e.call(this,o),e.captureStackTrace&&e.captureStackTrace(this,t),this.rule=n,this.value=r,this.cause=i,this.target=a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),ts=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]),this.chain=e,this.nextRuleModifiers=t};function ns(e,t,n,r){if(t.length){var i=t.shift();i._testAsync(e).then((function(){ns(e,t,n,r)}),(function(t){r(new es(i,e,t))}))}else n(e)}ts.prototype._applyRule=function(e,t){var n=this;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return n.chain.push(new Ko(t,e.apply(n,r),r,n.nextRuleModifiers)),n.nextRuleModifiers=[],n}},ts.prototype._applyModifier=function(e,t){return this.nextRuleModifiers.push(new Zo(t,e.simple,e.async)),this},ts.prototype._clone=function(){return new ts(this.chain.slice(),this.nextRuleModifiers.slice())},ts.prototype.test=function(e){return this.chain.every((function(t){return t._test(e)}))},ts.prototype.testAll=function(e){var t=[];return this.chain.forEach((function(n){try{n._check(e)}catch(r){t.push(new es(n,e,r))}})),t},ts.prototype.check=function(e){this.chain.forEach((function(t){try{t._check(e)}catch(n){throw new es(t,e,n)}}))},ts.prototype.testAsync=function(e){var t=this;return new Promise((function(n,r){ns(e,t.chain.slice(),n,r)}))};var rs=function(e,t){return!(!t||"string"!==typeof e||0!==e.trim().length)||(void 0===e||null===e)};function is(){return"undefined"!==typeof Proxy?os(new ts):ss(new ts)}var as={};function os(e){return new Proxy(e,{get:function(t,n){if(n in t)return t[n];var r=os(e._clone());return n in ls?r._applyModifier(ls[n],n):n in as?r._applyRule(as[n],n):n in ds?r._applyRule(ds[n],n):void 0}})}function ss(e){var t=function(e,t){return Object.keys(e).forEach((function(n){t[n]=function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return ss(t._clone())._applyRule(e[n],n).apply(void 0,r)}})),t},n=t(ds,e),r=t(as,n);return Object.keys(ls).forEach((function(e){Object.defineProperty(r,e,{get:function(){return ss(r._clone())._applyModifier(ls[e],e)}})})),r}is.extend=function(e){Object.assign(as,e)},is.clearCustomRules=function(){as={}};var ls={not:{simple:function(e){return function(t){return!e(t)}},async:function(e){return function(t){return Promise.resolve(e(t)).then((function(e){return!e})).catch((function(){return!0}))}}},some:{simple:function(e){return function(t){return us(t).some((function(t){try{return e(t)}catch(n){return!1}}))}},async:function(e){return function(t){return Promise.all(us(t).map((function(t){try{return e(t).catch((function(){return!1}))}catch(n){return!1}}))).then((function(e){return e.some(Boolean)}))}}},every:{simple:function(e){return function(t){return!1!==t&&us(t).every(e)}},async:function(e){return function(t){return Promise.all(us(t).map(e)).then((function(e){return e.every(Boolean)}))}}},strict:{simple:function(e,t){return function(n){return cs(t)&&n&&"object"===typeof n?Object.keys(t.args[0]).length===Object.keys(n).length&&e(n):e(n)}},async:function(e,t){return function(n){return Promise.resolve(e(n)).then((function(e){return cs(t)&&n&&"object"===typeof n?Object.keys(t.args[0]).length===Object.keys(n).length&&e:e})).catch((function(){return!1}))}}}};function cs(e){return e&&"schema"===e.name&&e.args.length>0&&"object"===typeof e.args[0]}function us(e){return"string"===typeof e?e.split(""):e}var ds={equal:function(e){return function(t){return t==e}},exact:function(e){return function(t){return t===e}},number:function(e){return void 0===e&&(e=!0),function(t){return"number"===typeof t&&(e||isFinite(t))}},integer:function(){return function(e){return(Number.isInteger||ps)(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return hs("string")},boolean:function(){return hs("boolean")},undefined:function(){return hs("undefined")},null:function(){return hs("null")},array:function(){return hs("array")},object:function(){return hs("object")},instanceOf:function(e){return function(t){return t instanceof e}},pattern:function(e){return function(t){return e.test(t)}},lowercase:function(){return function(e){return"boolean"===typeof e||e===e.toLowerCase()&&""!==e.trim()}},uppercase:function(){return function(e){return e===e.toUpperCase()&&""!==e.trim()}},vowel:function(){return function(e){return/^[aeiou]+$/i.test(e)}},consonant:function(){return function(e){return/^(?=[^aeiou])([a-z]+)$/i.test(e)}},first:function(e){return function(t){return t[0]==e}},last:function(e){return function(t){return t[t.length-1]==e}},empty:function(){return function(e){return 0===e.length}},length:function(e,t){return function(n){return n.length>=e&&n.length<=(t||e)}},minLength:function(e){return function(t){return t.length>=e}},maxLength:function(e){return function(t){return t.length<=e}},negative:function(){return function(e){return e<0}},positive:function(){return function(e){return e>=0}},between:function(e,t){return function(n){return n>=e&&n<=t}},range:function(e,t){return function(n){return n>=e&&n<=t}},lessThan:function(e){return function(t){return t<e}},lessThanOrEqual:function(e){return function(t){return t<=e}},greaterThan:function(e){return function(t){return t>e}},greaterThanOrEqual:function(e){return function(t){return t>=e}},even:function(){return function(e){return e%2===0}},odd:function(){return function(e){return e%2!==0}},includes:function(e){return function(t){return~t.indexOf(e)}},schema:function(e){return function(e){return{simple:function(t){var n=[];if(Object.keys(e).forEach((function(r){var i=e[r];try{i.check((t||{})[r])}catch(a){a.target=r,n.push(a)}})),n.length>0)throw n;return!0},async:function(t){var n=[],r=Object.keys(e).map((function(r){return e[r].testAsync((t||{})[r]).catch((function(e){e.target=r,n.push(e)}))}));return Promise.all(r).then((function(){if(n.length>0)throw n;return!0}))}}}(e)},passesAnyOf:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t){return e.some((function(e){return e.test(t)}))}},optional:function(e,t){return void 0===t&&(t=!1),{simple:function(n){return rs(n,t)||void 0===e.check(n)},async:function(n){return rs(n,t)||e.testAsync(n)}}}};function hs(e){return function(t){return Array.isArray(t)&&"array"===e||null===t&&"null"===e||typeof t===e}}function ps(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e}const fs=is;var ms="colors",gs="sizes",vs="space",ys={gap:vs,gridGap:vs,columnGap:vs,gridColumnGap:vs,rowGap:vs,gridRowGap:vs,inset:vs,insetBlock:vs,insetBlockEnd:vs,insetBlockStart:vs,insetInline:vs,insetInlineEnd:vs,insetInlineStart:vs,margin:vs,marginTop:vs,marginRight:vs,marginBottom:vs,marginLeft:vs,marginBlock:vs,marginBlockEnd:vs,marginBlockStart:vs,marginInline:vs,marginInlineEnd:vs,marginInlineStart:vs,padding:vs,paddingTop:vs,paddingRight:vs,paddingBottom:vs,paddingLeft:vs,paddingBlock:vs,paddingBlockEnd:vs,paddingBlockStart:vs,paddingInline:vs,paddingInlineEnd:vs,paddingInlineStart:vs,top:vs,right:vs,bottom:vs,left:vs,scrollMargin:vs,scrollMarginTop:vs,scrollMarginRight:vs,scrollMarginBottom:vs,scrollMarginLeft:vs,scrollMarginX:vs,scrollMarginY:vs,scrollMarginBlock:vs,scrollMarginBlockEnd:vs,scrollMarginBlockStart:vs,scrollMarginInline:vs,scrollMarginInlineEnd:vs,scrollMarginInlineStart:vs,scrollPadding:vs,scrollPaddingTop:vs,scrollPaddingRight:vs,scrollPaddingBottom:vs,scrollPaddingLeft:vs,scrollPaddingX:vs,scrollPaddingY:vs,scrollPaddingBlock:vs,scrollPaddingBlockEnd:vs,scrollPaddingBlockStart:vs,scrollPaddingInline:vs,scrollPaddingInlineEnd:vs,scrollPaddingInlineStart:vs,fontSize:"fontSizes",background:ms,backgroundColor:ms,backgroundImage:ms,borderImage:ms,border:ms,borderBlock:ms,borderBlockEnd:ms,borderBlockStart:ms,borderBottom:ms,borderBottomColor:ms,borderColor:ms,borderInline:ms,borderInlineEnd:ms,borderInlineStart:ms,borderLeft:ms,borderLeftColor:ms,borderRight:ms,borderRightColor:ms,borderTop:ms,borderTopColor:ms,caretColor:ms,color:ms,columnRuleColor:ms,fill:ms,outline:ms,outlineColor:ms,stroke:ms,textDecorationColor:ms,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:gs,minBlockSize:gs,maxBlockSize:gs,inlineSize:gs,minInlineSize:gs,maxInlineSize:gs,width:gs,minWidth:gs,maxWidth:gs,height:gs,minHeight:gs,maxHeight:gs,flexBasis:gs,gridTemplateColumns:gs,gridTemplateRows:gs,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},bs=(e,t)=>"function"==typeof t?{"()":Function.prototype.toString.call(t)}:t,xs=()=>{const e=Object.create(null);return function(t,n){const r=(e=>JSON.stringify(e,bs))(t);for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];return r in e?e[r]:e[r]=n(t,...a)}},_s=Symbol.for("sxs.internal"),Ss=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),ws=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:Es}=Object.prototype,As=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),Ms=/\s+(?![^()]*\))/,Cs=e=>t=>e(..."string"==typeof t?String(t).split(Ms):[t]),Ts={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:Cs(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:Cs(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:Cs(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:Cs(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:Cs(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:Cs(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},Rs=/([\d.]+)([^]*)/,Ps=(e,t)=>e.length?e.reduce(((e,n)=>(e.push(...t.map((e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(n)&&/&.*&/.test(e)?`:is(${n})`:n):n+" "+e))),e)),[]):t,Bs=(e,t)=>e in Is&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((t,n,r,i)=>n+("stretch"===r?`-moz-available${i};${As(e)}:${n}-webkit-fill-available`:`-moz-fit-content${i};${As(e)}:${n}fit-content`)+i)):String(t),Is={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Ds=e=>e?e+"-":"",Ls=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((e,r,i,a,o)=>"$"==a==!!i?e:(r||"--"==a?"calc(":"")+"var(--"+("$"===a?Ds(t)+(o.includes("$")?"":Ds(n))+o.replace(/\$/g,"-"):o)+")"+(r||"--"==a?"*"+(r||"")+(i||"1")+")":""))),ks=/\s*,\s*(?![^()]*\))/,Os=Object.prototype.toString,Ns=(e,t,n,r,i)=>{let a,o,s;const l=(e,t,n)=>{let c,u;const d=e=>{for(c in e){const f=64===c.charCodeAt(0),m=f&&Array.isArray(e[c])?e[c]:[e[c]];for(u of m){const e=/[A-Z]/.test(p=c)?p:p.replace(/-[^]/g,(e=>e[1].toUpperCase())),m="object"==typeof u&&u&&u.toString===Os&&(!r.utils[e]||!t.length);if(e in r.utils&&!m){const t=r.utils[e];if(t!==o){o=t,d(t(u)),o=null;continue}}else if(e in Ts){const t=Ts[e];if(t!==s){s=t,d(t(u)),s=null;continue}}if(f&&(h=c.slice(1)in r.media?"@media "+r.media[c.slice(1)]:c,c=h.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,n,r,i,a)=>{const o=Rs.test(t),s=.0625*(o?-1:1),[l,c]=o?[r,t]:[t,r];return"("+("="===n[0]?"":">"===n[0]===o?"max-":"min-")+l+":"+("="!==n[0]&&1===n.length?c.replace(Rs,((e,t,r)=>Number(t)+s*(">"===n?1:-1)+r)):c)+(i?") and ("+(">"===i[0]?"min-":"max-")+l+":"+(1===i.length?a.replace(Rs,((e,t,n)=>Number(t)+s*(">"===i?-1:1)+n)):a):"")+")"}))),m){const e=f?n.concat(c):[...n],r=f?[...t]:Ps(t,c.split(ks));void 0!==a&&i(Fs(...a)),a=void 0,l(u,r,e)}else void 0===a&&(a=[[],t,n]),c=f||36!==c.charCodeAt(0)?c:`--${Ds(r.prefix)}${c.slice(1).replace(/\$/g,"-")}`,u=m?u:"number"==typeof u?u&&e in Us?String(u)+"px":String(u):Ls(Bs(e,null==u?"":u),r.prefix,r.themeMap[e]),a[0].push(`${f?`${c} `:`${As(c)}:`}${u}`)}}var h,p};d(e),void 0!==a&&i(Fs(...a)),a=void 0};l(e,t,n)},Fs=(e,t,n)=>`${n.map((e=>`${e}{`)).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,Us={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},zs=e=>String.fromCharCode(e+(e>25?39:97)),Hs=e=>(e=>{let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=zs(t%52)+n;return zs(t%52)+n})(((e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e})(5381,JSON.stringify(e))>>>0),Gs=["themed","global","styled","onevar","resonevar","allvar","inline"],js=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch(e){return!1}},Vs=e=>{let t;const n=()=>{const{cssRules:e}=t.sheet;return[].map.call(e,((n,r)=>{const{cssText:i}=n;let a="";if(i.startsWith("--sxs"))return"";if(e[r-1]&&(a=e[r-1].cssText).startsWith("--sxs")){if(!n.cssRules.length)return"";for(const e in t.rules)if(t.rules[e].group===n)return`--sxs{--sxs:${[...t.rules[e].cache].join(" ")}}${i}`;return n.cssRules.length?`${a}${i}`:""}return i})).join("")},r=()=>{if(t){const{rules:e,sheet:n}=t;if(!n.deleteRule){for(;3===Object(Object(n.cssRules)[0]).type;)n.cssRules.splice(0,1);n.cssRules=[]}for(const t in e)delete e[t]}const i=Object(e).styleSheets||[];for(const e of i)if(js(e)){for(let i=0,a=e.cssRules;a[i];++i){const o=Object(a[i]);if(1!==o.type)continue;const s=Object(a[i+1]);if(4!==s.type)continue;++i;const{cssText:l}=o;if(!l.startsWith("--sxs"))continue;const c=l.slice(14,-3).trim().split(/\s+/),u=Gs[c[0]];u&&(t||(t={sheet:e,reset:r,rules:{},toString:n}),t.rules[u]={group:s,index:i,cache:new Set(c)})}if(t)break}if(!t){const i=(e,t)=>({type:t,cssRules:[],insertRule(e,t){this.cssRules.splice(t,0,i(e,{import:3,undefined:1}[(e.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return"@media{}"===e?`@media{${[].map.call(this.cssRules,(e=>e.cssText)).join("")}}`:e}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:i("","text/css"),rules:{},reset:r,toString:n}}const{sheet:a,rules:o}=t;for(let e=Gs.length-1;e>=0;--e){const t=Gs[e];if(!o[t]){const n=Gs[e+1],r=o[n]?o[n].index:a.cssRules.length;a.insertRule("@media{}",r),a.insertRule(`--sxs{--sxs:${e}}`,r),o[t]={group:a.cssRules[r+1],index:r,cache:new Set([e])}}Ws(o[t])}};return r(),t},Ws=e=>{const t=e.group;let n=t.cssRules.length;e.apply=e=>{try{t.insertRule(e,n),++n}catch(e){}}},Xs=Symbol(),Js=xs(),$s=(e,t)=>Js(e,(()=>function(){let n={type:null,composers:new Set};for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];for(const t of i)if(null!=t)if(t[_s]){null==n.type&&(n.type=t[_s].type);for(const e of t[_s].composers)n.composers.add(e)}else t.constructor!==Object||t.$$typeof?null==n.type&&(n.type=t):n.composers.add(Ks(t,e));return null==n.type&&(n.type="span"),n.composers.size||n.composers.add(["PJLV",{},[],[],{},[]]),Ys(e,n,t)})),Ks=(e,t)=>{let{variants:n,compoundVariants:r,defaultVariants:i,...a}=e;const o=`${Ds(t.prefix)}c-${Hs(a)}`,s=[],l=[],c=Object.create(null),u=[];for(const p in i)c[p]=String(i[p]);if("object"==typeof n&&n)for(const p in n){d=c,h=p,Es.call(d,h)||(c[p]="undefined");const e=n[p];for(const t in e){const n={[p]:String(t)};"undefined"===String(t)&&u.push(p);const r=e[t],i=[n,r,!ws(r)];s.push(i)}}var d,h;if("object"==typeof r&&r)for(const p of r){let{css:e,...t}=p;e="object"==typeof e&&e||{};for(const r in t)t[r]=String(t[r]);const n=[t,e,!ws(e)];l.push(n)}return[o,a,s,l,c,u]},Ys=(e,t,n)=>{const[r,i,a,o]=qs(t.composers),s="function"==typeof t.type||t.type.$$typeof?(e=>{function t(){for(let n=0;n<t[Xs].length;n++){const[r,i]=t[Xs][n];e.rules[r].apply(i)}return t[Xs]=[],null}return t[Xs]=[],t.rules={},Gs.forEach((e=>t.rules[e]={apply:n=>t[Xs].push([e,n])})),t})(n):null,l=(s||n).rules,c=`.${r}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,u=u=>{u="object"==typeof u&&u||Zs;const{css:d,...h}=u,p={};for(const e in a)if(delete h[e],e in u){let t=u[e];"object"==typeof t&&t?p[e]={"@initial":a[e],...t}:(t=String(t),p[e]="undefined"!==t||o.has(e)?t:a[e])}else p[e]=a[e];const f=new Set([...i]);for(const[r,i,a,o]of t.composers){n.rules.styled.cache.has(r)||(n.rules.styled.cache.add(r),Ns(i,[`.${r}`],[],e,(e=>{l.styled.apply(e)})));const t=Qs(a,p,e.media),s=Qs(o,p,e.media,!0);for(const i of t)if(void 0!==i)for(const[t,a,o]of i){const i=`${r}-${Hs(a)}-${t}`;f.add(i);const s=(o?n.rules.resonevar:n.rules.onevar).cache,c=o?l.resonevar:l.onevar;s.has(i)||(s.add(i),Ns(a,[`.${i}`],[],e,(e=>{c.apply(e)})))}for(const i of s)if(void 0!==i)for(const[t,a]of i){const i=`${r}-${Hs(a)}-${t}`;f.add(i),n.rules.allvar.cache.has(i)||(n.rules.allvar.cache.add(i),Ns(a,[`.${i}`],[],e,(e=>{l.allvar.apply(e)})))}}if("object"==typeof d&&d){const t=`${r}-i${Hs(d)}-css`;f.add(t),n.rules.inline.cache.has(t)||(n.rules.inline.cache.add(t),Ns(d,[`.${t}`],[],e,(e=>{l.inline.apply(e)})))}for(const e of String(u.className||"").trim().split(/\s+/))e&&f.add(e);const m=h.className=[...f].join(" ");return{type:t.type,className:m,selector:c,props:h,toString:()=>m,deferredInjector:s}};return Ss(u,{className:r,selector:c,[_s]:t,toString:()=>(n.rules.styled.cache.has(r)||u(),r)})},qs=e=>{let t="";const n=[],r={},i=[];for(const[a,,,,o,s]of e){""===t&&(t=a),n.push(a),i.push(...s);for(const e in o){const t=o[e];(void 0===r[e]||"undefined"!==t||s.includes(t))&&(r[e]=t)}}return[t,n,r,new Set(i)]},Qs=(e,t,n,r)=>{const i=[];e:for(let[a,o,s]of e){if(s)continue;let e,l=0,c=!1;for(e in a){const r=a[e];let i=t[e];if(i!==r){if("object"!=typeof i||!i)continue e;{let e,t,a=0;for(const o in i){if(r===String(i[o])){if("@initial"!==o){const e=o.slice(1);(t=t||[]).push(e in n?n[e]:o.replace(/^@media ?/,"")),c=!0}l+=a,e=!0}++a}if(t&&t.length&&(o={["@media "+t.join(", ")]:o}),!e)continue e}}}(i[l]=i[l]||[]).push([r?"cv":`${e}-${a[e]}`,o,c])}return i},Zs={},el=xs(),tl=(e,t)=>el(e,(()=>function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];const a=()=>{for(let n of r){n="object"==typeof n&&n||{};let r=Hs(n);if(!t.rules.global.cache.has(r)){if(t.rules.global.cache.add(r),"@import"in n){let e=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let r of[].concat(n["@import"]))r=r.includes('"')||r.includes("'")?r:`"${r}"`,t.sheet.insertRule(`@import ${r};`,e++);delete n["@import"]}Ns(n,[],[],e,(e=>{t.rules.global.apply(e)}))}}return""};return Ss(a,{toString:a})})),nl=xs(),rl=(e,t)=>nl(e,(()=>n=>{const r=`${Ds(e.prefix)}k-${Hs(n)}`,i=()=>{if(!t.rules.global.cache.has(r)){t.rules.global.cache.add(r);const i=[];Ns(n,[],[],e,(e=>i.push(e)));const a=`@keyframes ${r}{${i.join("")}}`;t.rules.global.apply(a)}return r};return Ss(i,{get name(){return i()},toString:i})})),il=class{constructor(e,t,n,r){this.token=null==e?"":String(e),this.value=null==t?"":String(t),this.scale=null==n?"":String(n),this.prefix=null==r?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Ds(this.prefix)+Ds(this.scale)+this.token}toString(){return this.computedValue}},al=xs(),ol=(e,t)=>al(e,(()=>(n,r)=>{r="object"==typeof n&&n||Object(r);const i=`.${n=(n="string"==typeof n?n:"")||`${Ds(e.prefix)}t-${Hs(r)}`}`,a={},o=[];for(const t in r){a[t]={};for(const n in r[t]){const i=`--${Ds(e.prefix)}${t}-${n}`,s=Ls(String(r[t][n]),e.prefix,t);a[t][n]=new il(n,s,t,e.prefix),o.push(`${i}:${s}`)}}const s=()=>{if(o.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const i=`${r===e.theme?":root,":""}.${n}{${o.join(";")}}`;t.rules.themed.apply(i)}return n};return{...a,get className(){return s()},selector:i,toString:s}})),sl=xs(),ll=xs(),cl=e=>{const n=(e=>{let t=!1;const n=sl(e,(e=>{t=!0;const n="prefix"in(e="object"==typeof e&&e||{})?String(e.prefix):"",r="object"==typeof e.media&&e.media||{},i="object"==typeof e.root?e.root||null:globalThis.document||null,a="object"==typeof e.theme&&e.theme||{},o={prefix:n,media:r,theme:a,themeMap:"object"==typeof e.themeMap&&e.themeMap||{...ys},utils:"object"==typeof e.utils&&e.utils||{}},s=Vs(i),l={css:$s(o,s),globalCss:tl(o,s),keyframes:rl(o,s),createTheme:ol(o,s),reset(){s.reset(),l.theme.toString()},theme:{},sheet:s,config:o,prefix:n,getCssText:s.toString,toString:s.toString};return String(l.theme=l.createTheme(a)),l}));return t||n.reset(),n})(e);return n.styled=(e=>{let{config:n,sheet:r}=e;return ll(n,(()=>{const e=$s(n,r);return function(){const n=e(...arguments),r=n[_s].type,i=t.forwardRef(((e,i)=>{const a=e&&e.as||r,{props:o,deferredInjector:s}=n(e);return delete o.as,o.ref=i,s?t.createElement(t.Fragment,null,t.createElement(a,o),t.createElement(s,null)):t.createElement(a,o)}));return i.className=n.className,i.displayName=`Styled.${r.displayName||r.name||r}`,i.selector=n.selector,i.toString=()=>n.selector,i[_s]=n[_s],i}}))})(n),n};const ul={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function dl(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function hl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.15;return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-dl(t-e,n-t,r)+t:e>n?+dl(e-n,n-t,r)+n:e}function pl(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}function fl(e,t,n){return(t=pl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ml(Object(n),!0).forEach((function(t){fl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const vl={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function yl(e){return e?e[0].toUpperCase()+e.slice(1):""}const bl=["enter","leave"];function xl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=vl[e],i=r&&r[t]||t;return"on"+yl(e)+yl(i)+(function(){let e=arguments.length>1?arguments[1]:void 0;return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&!bl.includes(e)}(n,i)?"Capture":"")}const _l=["gotpointercapture","lostpointercapture"];function Sl(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=_l.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(r);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:n}}function wl(e){return"touches"in e}function El(e){return wl(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function Al(e){return wl(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function Ml(e){return function(e){return Array.from(e.touches).filter((t=>{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))}))}(e).map((e=>e.identifier))}function Cl(e){const t=Al(e);return wl(e)?t.identifier:t.pointerId}function Tl(e){const t=Al(e);return[t.clientX,t.clientY]}function Rl(e){if("function"===typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e(...n)}return e}function Pl(){}function Bl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?Pl:1===t.length?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function Il(e,t){return Object.assign({},t,e||{})}class Dl{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Rl(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let i=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a})}return t}(e)),r.down=r.pressed=r.buttons%2===1||r.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);ul.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[a,o]=t._movement,[s,l]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(a)>=s&&u[0]),!1===c[1]&&(c[1]=Math.abs(o)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(a)>=s&&Math.sign(a)*s),!1===c[1]&&(c[1]=Math.abs(o)>=l&&Math.sign(o)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?a-c[0]:0,d[1]=!1!==c[1]?o-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const h=t.offset,p=t._active&&!t._blocked||t.active;p&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=Rl(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[f,m]=t.offset,[[g,v],[y,b]]=t._bounds;t.overflow=[f<g?-1:f>v?1:0,m<y?-1:m>b?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const x=t._active&&n.rubberband||[0,0];if(t.offset=function(e,t,n){let[r,i]=t,[a,o]=n;const[[s,l],[c,u]]=e;return[hl(r,s,l,a),hl(i,c,u,o)]}(t._bounds,t.offset,x),t.delta=ul.sub(t.offset,h),this.computeMovement(),p&&(!t.last||i>32)){t.delta=ul.sub(t.offset,h);const e=t.delta.map(Math.abs);ul.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(gl(gl(gl({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Ll extends Dl{constructor(){super(...arguments),fl(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ul.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ul.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"===typeof n.axisThreshold?n.axisThreshold[El(e)]:n.axisThreshold;t.axis=function(e,t){let[n,r]=e;const i=Math.abs(n),a=Math.abs(r);return i>a&&i>t?"x":a>i&&a>t?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const kl=e=>e,Ol={enabled(){return!(arguments.length>0&&void 0!==arguments[0])||arguments[0]},eventOptions:(e,t,n)=>gl(gl({},n.shared.eventOptions),e),preventDefault(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]},triggerAllEvents(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]},rubberband(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return ul.toVector(e)}},from:e=>"function"===typeof e?e:null!=e?ul.toVector(e):void 0,transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||kl},threshold:e=>ul.toVector(e,0)};const Nl=gl(gl({},Ol),{},{axis(e,t,n){let{axis:r}=n;if(this.lockDirection="lock"===r,!this.lockDirection)return r},axisThreshold(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:0},bounds(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("function"===typeof e)return t=>Nl.bounds(e(t));if("current"in e)return()=>e.current;if("function"===typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=e;return[[t,n],[r,i]]}}),Fl={ArrowRight:function(e){return[e*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),0]},ArrowLeft:function(e){return[-1*e*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),0]},ArrowUp:function(e){return[0,-1*e*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)]},ArrowDown:function(e){return[0,e*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)]}};const Ul="undefined"!==typeof window&&window.document&&window.document.createElement;function zl(){return Ul&&"ontouchstart"in window}const Hl={isBrowser:Ul,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:zl(),touchscreen:zl()||Ul&&window.navigator.maxTouchPoints>1,pointer:Ul&&"onpointerdown"in window,pointerLock:Ul&&"exitPointerLock"in window.document},Gl=.5,jl=50,Vl=250,Wl={mouse:0,touch:0,pen:8},Xl=gl(gl({},Nl),{},{device(e,t,n){let{pointer:{touch:r=!1,lock:i=!1,mouse:a=!1}={}}=n;return this.pointerLock=i&&Hl.pointerLock,Hl.touch&&r?"touch":this.pointerLock?"mouse":Hl.pointer&&!a?"pointer":Hl.touch?"touch":"mouse"},preventScrollAxis(e,t,n){let{preventScroll:r}=n;if(this.preventScrollDelay="number"===typeof r?r:r||void 0===r&&e?250:void 0,Hl.touchscreen&&!1!==r)return e||(void 0!==r?"y":void 0)},pointerCapture(e,t,n){let{pointer:{capture:r=!0,buttons:i=1,keys:a=!0}={}}=n;return this.pointerButtons=i,this.keys=a,!this.pointerLock&&"pointer"===this.device&&r},threshold(e,t,n){let{filterTaps:r=!1,tapsThreshold:i=3,axis:a}=n;const o=ul.toVector(e,r?i:a?1:0);return this.filterTaps=r,this.tapsThreshold=i,o},swipe(){let{velocity:e=Gl,distance:t=jl,duration:n=Vl}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{velocity:this.transform(ul.toVector(e)),distance:this.transform(ul.toVector(t)),duration:n}},delay(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?gl(gl({},Wl),e):Wl,keyboardDisplacement(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:10}});gl(gl({},Ol),{},{device(e,t,n){let{shared:r,pointer:{touch:i=!1}={}}=n;if(r.target&&!Hl.touch&&Hl.gesture)return"gesture";if(Hl.touch&&i)return"touch";if(Hl.touchscreen){if(Hl.pointer)return"pointer";if(Hl.touch)return"touch"}},bounds(e,t,n){let{scaleBounds:r={},angleBounds:i={}}=n;const a=e=>{const t=Il(Rl(r,e),{min:-1/0,max:1/0});return[t.min,t.max]},o=e=>{const t=Il(Rl(i,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!==typeof r&&"function"!==typeof i?[a(),o()]:e=>[a(e),o(e)]},threshold(e,t,n){this.lockDirection="lock"===n.axis;return ul.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel(){return!(arguments.length>0&&void 0!==arguments[0])||arguments[0]}});gl(gl({},Nl),{},{mouseOnly:function(){return!(arguments.length>0&&void 0!==arguments[0])||arguments[0]}});gl(gl({},Nl),{},{mouseOnly:function(){return!(arguments.length>0&&void 0!==arguments[0])||arguments[0]}});const Jl=new Map,$l=new Map;const Kl={key:"drag",engine:class extends Ll{constructor(){super(...arguments),fl(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Nl.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=Cl(e),n._pointerActive=!0,this.computeValues(Tl(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==El(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=Cl(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const i=Tl(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=ul.sub(i,t._values),this.computeValues(i)),ul.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(o){0}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=Cl(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[i,a]=t._distance;if(t.tap=i<=n.tapsThreshold&&a<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t._delta,[i,a]=t._movement,[o,s]=n.swipe.velocity,[l,c]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTime<u){const n=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);n>o&&Math.abs(i)>l&&(t.swipe[0]=Math.sign(e)),u>s&&Math.abs(a)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"===typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Fl[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,ul.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Fl&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Xl};function Yl(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const ql={target(e){if(e)return()=>"current"in e?e.current:e},enabled(){return!(arguments.length>0&&void 0!==arguments[0])||arguments[0]},window(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hl.isBrowser?window:void 0},eventOptions(){let{passive:e=!0,capture:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{passive:e,capture:t}},transform:e=>e},Ql=["target","eventOptions","window","enabled","transform"];function Zl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const n={};for(const[r,i]of Object.entries(t))switch(typeof i){case"function":n[r]=i.call(n,e[r],r,e);break;case"object":n[r]=Zl(e[r],i);break;case"boolean":i&&(n[r]=e[r])}return n}class ec{constructor(e,t){fl(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,i){const a=this._listeners,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=vl[e];return e+(n&&n[t]||t)}(t,n),s=gl(gl({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(o,r,s);const l=()=>{e.removeEventListener(o,r,s),a.delete(l)};return a.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class tc{constructor(){fl(this,"_timeouts",new Map)}add(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:140;this.remove(e);for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];this._timeouts.set(e,window.setTimeout(t,n,...i))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class nc{constructor(e){fl(this,"gestures",new Set),fl(this,"_targetEventStore",new ec(this)),fl(this,"gestureEventStores",{}),fl(this,"gestureTimeoutStores",{}),fl(this,"handlers",{}),fl(this,"config",{}),fl(this,"pointerIds",new Set),fl(this,"touchIds",new Set),fl(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&rc(e,"drag");t.wheel&&rc(e,"wheel");t.scroll&&rc(e,"scroll");t.move&&rc(e,"move");t.pinch&&rc(e,"pinch");t.hover&&rc(e,"hover")}(this,e)}setEventIds(e){return wl(e)?(this.touchIds=new Set(Ml(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=e,{target:i,eventOptions:a,window:o,enabled:s,transform:l}=r,c=Yl(r,Ql);if(n.shared=Zl({target:i,eventOptions:a,window:o,enabled:s,transform:l},ql),t){const e=$l.get(t);n[t]=Zl(gl({shared:n.shared},c),e)}else for(const u in c){const e=$l.get(u);e&&(n[u]=Zl(gl({shared:n.shared},c[u]),e))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=this.config.shared,i={};let a;if(!r.target||(a=r.target(),a)){if(r.enabled){for(const n of this.gestures){const e=this.config[n],r=ic(i,e.eventOptions,!!a);if(e.enabled){new(Jl.get(n))(this,t,n).bind(r)}}const e=ic(i,r.eventOptions,!!a);for(const n in this.nativeHandlers)e(n,"",(e=>this.nativeHandlers[n](gl(gl({},this.state.shared),{},{event:e,args:t}))),void 0,!0)}for(const e in i)i[e]=Bl(...i[e]);if(!a)return i;for(const e in i){const{device:t,capture:n,passive:r}=Sl(e);this._targetEventStore.add(a,t,"",i[e],{capture:n,passive:r})}}}}function rc(e,t){e.gestures.add(t),e.gestureEventStores[t]=new ec(e,t),e.gestureTimeoutStores[t]=new tc}const ic=(e,t,n)=>function(r,i,a){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];var l,c;const u=null!==(l=o.capture)&&void 0!==l?l:t.capture,d=null!==(c=o.passive)&&void 0!==c?c:t.passive;let h=s?r:xl(r,i,u);n&&d&&(h+="Passive"),e[h]=e[h]||[],e[h].push(a)};function ac(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const a=t.useMemo((()=>new nc(e)),[]);if(a.applyHandlers(e,i),a.applyConfig(n,r),t.useEffect(a.effect.bind(a)),t.useEffect((()=>a.clean.bind(a)),[]),void 0===n.target)return a.bind.bind(a)}function oc(e,t){var n;return n=Kl,Jl.set(n.key,n.engine),$l.set(n.key,n.resolver),ac({drag:e},t||{},"drag")}function sc(e,t){let{checkForDefaultPrevented:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function lc(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[];const i=()=>{const n=r.map((e=>t.createContext(e)));return function(r){const i=r?.[e]||n;return t.useMemo((()=>({[`__scope${e}`]:{...r,[e]:i}})),[r,i])}};return i.scopeName=e,[function(n,i){const a=t.createContext(i),o=r.length;function s(n){const{scope:r,children:i,...s}=n,l=r?.[e][o]||a,c=t.useMemo((()=>s),Object.values(s));return(0,fi.jsx)(l.Provider,{value:c,children:i})}return r=[...r,i],s.displayName=n+"Provider",[s,function(r,s){const l=s?.[e][o]||a,c=t.useContext(l);if(c)return c;if(void 0!==i)return i;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},cc(i,...n)]}function cc(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];const i=n[0];if(1===n.length)return i;const a=()=>{const e=n.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(n){const r=e.reduce(((e,t)=>{let{useScope:r,scopeName:i}=t;return{...e,...r(n)[`__scope${i}`]}}),{});return t.useMemo((()=>({[`__scope${i.scopeName}`]:r})),[r])}};return a.scopeName=i.scopeName,a}function uc(e){const n=t.useRef(e);return t.useEffect((()=>{n.current=e})),t.useMemo((()=>function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.current?.(...t)}),[])}var dc,hc="dismissableLayer.update",pc="dismissableLayer.pointerDownOutside",fc="dismissableLayer.focusOutside",mc=t.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gc=t.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...c}=e,u=t.useContext(mc),[d,h]=t.useState(null),p=d?.ownerDocument??globalThis?.document,[,f]=t.useState({}),m=Oo(n,(e=>h(e))),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,_=b>=y,S=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:globalThis?.document;const r=uc(e),i=t.useRef(!1),a=t.useRef((()=>{}));return t.useEffect((()=>{const e=e=>{if(e.target&&!i.current){let t=function(){bc(pc,r,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);i.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>i.current=!0}}((e=>{const t=e.target,n=[...u.branches].some((e=>e.contains(t)));_&&!n&&(a?.(e),s?.(e),e.defaultPrevented||l?.())}),p),w=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:globalThis?.document;const r=uc(e),i=t.useRef(!1);return t.useEffect((()=>{const e=e=>{if(e.target&&!i.current){bc(fc,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}((e=>{const t=e.target;[...u.branches].some((e=>e.contains(t)))||(o?.(e),s?.(e),e.defaultPrevented||l?.())}),p);return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:globalThis?.document;const r=uc(e);t.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})}),[r,n])}((e=>{b===u.layers.size-1&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))}),p),t.useEffect((()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(dc=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),yc(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=dc)}}),[d,p,r,u]),t.useEffect((()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),yc())}),[d,u]),t.useEffect((()=>{const e=()=>f({});return document.addEventListener(hc,e),()=>document.removeEventListener(hc,e)}),[]),(0,fi.jsx)(Go.div,{...c,ref:m,style:{pointerEvents:x?_?"auto":"none":void 0,...e.style},onFocusCapture:sc(e.onFocusCapture,w.onFocusCapture),onBlurCapture:sc(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:sc(e.onPointerDownCapture,S.onPointerDownCapture)})}));gc.displayName="DismissableLayer";var vc=t.forwardRef(((e,n)=>{const r=t.useContext(mc),i=t.useRef(null),a=Oo(n,i);return t.useEffect((()=>{const e=i.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),(0,fi.jsx)(Go.div,{...e,ref:a})}));function yc(){const e=new CustomEvent(hc);document.dispatchEvent(e)}function bc(e,t,n,r){let{discrete:i}=r;const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),i?function(e,t){e&&Do.flushSync((()=>e.dispatchEvent(t)))}(a,o):a.dispatchEvent(o)}vc.displayName="DismissableLayerBranch";var xc=r["useId".toString()]||(()=>{}),_c=0;const Sc=["top","right","bottom","left"],wc=Math.min,Ec=Math.max,Ac=Math.round,Mc=Math.floor,Cc=e=>({x:e,y:e}),Tc={left:"right",right:"left",bottom:"top",top:"bottom"},Rc={start:"end",end:"start"};function Pc(e,t,n){return Ec(e,wc(t,n))}function Bc(e,t){return"function"===typeof e?e(t):e}function Ic(e){return e.split("-")[0]}function Dc(e){return e.split("-")[1]}function Lc(e){return"x"===e?"y":"x"}function kc(e){return"y"===e?"height":"width"}function Oc(e){return["top","bottom"].includes(Ic(e))?"y":"x"}function Nc(e){return Lc(Oc(e))}function Fc(e){return e.replace(/start|end/g,(e=>Rc[e]))}function Uc(e){return e.replace(/left|right|bottom|top/g,(e=>Tc[e]))}function zc(e){return"number"!==typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Hc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Gc(e,t,n){let{reference:r,floating:i}=e;const a=Oc(t),o=Nc(t),s=kc(o),l=Ic(t),c="y"===a,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Dc(t)){case"start":p[o]-=h*(n&&c?-1:1);break;case"end":p[o]+=h*(n&&c?-1:1)}return p}async function jc(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Bc(t,e),f=zc(p),m=s[h?"floating"===d?"reference":"floating":d],g=Hc(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(y))&&await(null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},x=Hc(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+f.top)/b.y,bottom:(x.bottom-g.bottom+f.bottom)/b.y,left:(g.left-x.left+f.left)/b.x,right:(x.right-g.right+f.right)/b.x}}function Vc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Wc(e){return Sc.some((t=>e[t]>=0))}function Xc(){return"undefined"!==typeof window}function Jc(e){return Yc(e)?(e.nodeName||"").toLowerCase():"#document"}function $c(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Kc(e){var t;return null==(t=(Yc(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Yc(e){return!!Xc()&&(e instanceof Node||e instanceof $c(e).Node)}function qc(e){return!!Xc()&&(e instanceof Element||e instanceof $c(e).Element)}function Qc(e){return!!Xc()&&(e instanceof HTMLElement||e instanceof $c(e).HTMLElement)}function Zc(e){return!(!Xc()||"undefined"===typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof $c(e).ShadowRoot)}function eu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ou(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function tu(e){return["table","td","th"].includes(Jc(e))}function nu(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(n){return!1}}))}function ru(e){const t=iu(),n=qc(e)?ou(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function iu(){return!("undefined"===typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function au(e){return["html","body","#document"].includes(Jc(e))}function ou(e){return $c(e).getComputedStyle(e)}function su(e){return qc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lu(e){if("html"===Jc(e))return e;const t=e.assignedSlot||e.parentNode||Zc(e)&&e.host||Kc(e);return Zc(t)?t.host:t}function cu(e){const t=lu(e);return au(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qc(t)&&eu(t)?t:cu(t)}function uu(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=cu(e),a=i===(null==(r=e.ownerDocument)?void 0:r.body),o=$c(i);if(a){const e=du(o);return t.concat(o,o.visualViewport||[],eu(i)?i:[],e&&n?uu(e):[])}return t.concat(i,uu(i,[],n))}function du(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hu(e){const t=ou(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Qc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ac(n)!==a||Ac(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function pu(e){return qc(e)?e:e.contextElement}function fu(e){const t=pu(e);if(!Qc(t))return Cc(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=hu(t);let o=(a?Ac(n.width):n.width)/r,s=(a?Ac(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}const mu=Cc(0);function gu(e){const t=$c(e);return iu()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:mu}function vu(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),a=pu(e);let o=Cc(1);t&&(r?qc(r)&&(o=fu(r)):o=fu(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==$c(e))&&t}(a,n,r)?gu(a):Cc(0);let l=(i.left+s.x)/o.x,c=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){const e=$c(a),t=r&&qc(r)?$c(r):r;let n=e,i=du(n);for(;i&&r&&t!==n;){const e=fu(i),t=i.getBoundingClientRect(),r=ou(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=o,n=$c(i),i=du(n)}}return Hc({width:u,height:d,x:l,y:c})}function yu(e,t){const n=su(e).scrollLeft;return t?t.left+n:vu(Kc(e)).left+n}function bu(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=$c(e),r=Kc(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const e=iu();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Kc(e),n=su(e),r=e.ownerDocument.body,i=Ec(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ec(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+yu(e);const s=-n.scrollTop;return"rtl"===ou(r).direction&&(o+=Ec(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(Kc(e));else if(qc(t))r=function(e,t){const n=vu(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qc(e)?fu(e):Cc(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n);else{const n=gu(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Hc(r)}function xu(e,t){const n=lu(e);return!(n===t||!qc(n)||au(n))&&("fixed"===ou(n).position||xu(n,t))}function _u(e,t,n){const r=Qc(t),i=Kc(t),a="fixed"===n,o=vu(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Cc(0);if(r||!r&&!a)if(("body"!==Jc(t)||eu(i))&&(s=su(t)),r){const e=vu(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=yu(i));let c=0,u=0;if(i&&!r&&!a){const e=i.getBoundingClientRect();u=e.top+s.scrollTop,c=e.left+s.scrollLeft-yu(i,e)}return{x:o.left+s.scrollLeft-l.x-c,y:o.top+s.scrollTop-l.y-u,width:o.width,height:o.height}}function Su(e){return"static"===ou(e).position}function wu(e,t){if(!Qc(e)||"fixed"===ou(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Kc(e)===n&&(n=n.ownerDocument.body),n}function Eu(e,t){const n=$c(e);if(nu(e))return n;if(!Qc(e)){let t=lu(e);for(;t&&!au(t);){if(qc(t)&&!Su(t))return t;t=lu(t)}return n}let r=wu(e,t);for(;r&&tu(r)&&Su(r);)r=wu(r,t);return r&&au(r)&&Su(r)&&!ru(r)?n:r||function(e){let t=lu(e);for(;Qc(t)&&!au(t);){if(ru(t))return t;if(nu(t))return null;t=lu(t)}return null}(e)||n}const Au={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a="fixed"===i,o=Kc(r),s=!!t&&nu(t.floating);if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Cc(1);const u=Cc(0),d=Qc(r);if((d||!d&&!a)&&(("body"!==Jc(r)||eu(o))&&(l=su(r)),Qc(r))){const e=vu(r);c=fu(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:Kc,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[..."clippingAncestors"===n?nu(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=uu(e,[],!1).filter((e=>qc(e)&&"body"!==Jc(e))),i=null;const a="fixed"===ou(e).position;let o=a?lu(e):e;for(;qc(o)&&!au(o);){const t=ou(o),n=ru(o);n||"fixed"!==t.position||(i=null),(a?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||eu(o)&&!n&&xu(e,o))?r=r.filter((e=>e!==o)):i=t,o=lu(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=a[0],s=a.reduce(((e,n)=>{const r=bu(t,n,i);return e.top=Ec(r.top,e.top),e.right=wc(r.right,e.right),e.bottom=wc(r.bottom,e.bottom),e.left=Ec(r.left,e.left),e}),bu(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Eu,getElementRects:async function(e){const t=this.getOffsetParent||Eu,n=this.getDimensions,r=await n(e.floating);return{reference:_u(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=hu(e);return{width:t,height:n}},getScale:fu,isElement:qc,isRTL:function(e){return"rtl"===ou(e).direction}};function Mu(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o="function"===typeof ResizeObserver,layoutShift:s="function"===typeof IntersectionObserver,animationFrame:l=!1}=r,c=pu(e),u=i||a?[...c?uu(c):[],...uu(t)]:[];u.forEach((e=>{i&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const i=Kc(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const p={rootMargin:-Mc(u)+"px "+-Mc(i.clientWidth-(c+d))+"px "+-Mc(i.clientHeight-(u+h))+"px "+-Mc(c)+"px",threshold:Ec(0,wc(1,l))||1};let f=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!f)return o();t?o(!1,t):n=setTimeout((()=>{o(!1,1e-7)}),1e3)}f=!1}try{r=new IntersectionObserver(m,{...p,root:i.ownerDocument})}catch(g){r=new IntersectionObserver(m,p)}r.observe(e)}(!0),a}(c,n):null;let h,p=-1,f=null;o&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let m=l?vu(e):null;return l&&function t(){const r=vu(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{i&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const Cu=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:i}=e,a=await(null==r.isRTL?void 0:r.isRTL(i.floating)),o=Ic(n),s=Dc(n),l="y"===Oc(n),c=["left","top"].includes(o)?-1:1,u=a&&l?-1:1,d=Bc(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"===typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"===typeof f&&(p="end"===s?-1*f:f),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}(t,e);return o===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},Tu=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Bc(e,t),c={x:n,y:r},u=await jc(t,l),d=Oc(Ic(i)),h=Lc(d);let p=c[h],f=c[d];if(a){const e="y"===h?"bottom":"right";p=Pc(p+u["y"===h?"top":"left"],p,p-u[e])}if(o){const e="y"===d?"bottom":"right";f=Pc(f+u["y"===d?"top":"left"],f,f-u[e])}const m=s.fn({...t,[h]:p,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[d]:o}}}}}},Ru=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Bc(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const v=Ic(i),y=Oc(s),b=Ic(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=h||(b||!m?[Uc(s)]:function(e){const t=Uc(e);return[Fc(e),t,Fc(t)]}(s)),S="none"!==f;!h&&S&&_.push(...function(e,t,n,r){const i=Dc(e);let a=function(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}(Ic(e),"start"===n,r);return i&&(a=a.map((e=>e+"-"+i)),t&&(a=a.concat(a.map(Fc)))),a}(s,m,f,x));const w=[s,..._],E=await jc(t,g),A=[];let M=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&A.push(E[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Dc(e),i=Nc(e),a=kc(i);let o="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Uc(o)),[o,Uc(o)]}(i,o,x);A.push(E[e[0]],E[e[1]])}if(M=[...M,{placement:i,overflows:A}],!A.every((e=>e<=0))){var C,T;const e=((null==(C=a.flip)?void 0:C.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:M},reset:{placement:t}};let n=null==(T=M.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var R;const e=null==(R=M.filter((e=>{if(S){const t=Oc(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},Pu=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...c}=Bc(e,t),u=await jc(t,c),d=Ic(i),h=Dc(i),p="y"===Oc(i),{width:f,height:m}=a.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=h===(await(null==o.isRTL?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===h?"top":"bottom");const y=m-u.top-u.bottom,b=f-u.left-u.right,x=wc(m-u[g],y),_=wc(f-u[v],b),S=!t.middlewareData.shift;let w=x,E=_;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(E=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(w=y),S&&!h){const e=Ec(u.left,0),t=Ec(u.right,0),n=Ec(u.top,0),r=Ec(u.bottom,0);p?E=f-2*(0!==e||0!==t?e+t:Ec(u.left,u.right)):w=m-2*(0!==n||0!==r?n+r:Ec(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:w});const A=await o.getDimensions(s.floating);return f!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}},Bu=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Bc(e,t);switch(r){case"referenceHidden":{const e=Vc(await jc(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Wc(e)}}}case"escaped":{const e=Vc(await jc(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Wc(e)}}}default:return{}}}}},Iu=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Bc(e,t)||{};if(null==c)return{};const d=zc(u),h={x:n,y:r},p=Nc(i),f=kc(p),m=await o.getDimensions(c),g="y"===p,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=a.reference[f]+a.reference[p]-h[p]-a.floating[f],_=h[p]-a.reference[p],S=await(null==o.getOffsetParent?void 0:o.getOffsetParent(c));let w=S?S[b]:0;w&&await(null==o.isElement?void 0:o.isElement(S))||(w=s.floating[b]||a.floating[f]);const E=x/2-_/2,A=w/2-m[f]/2-1,M=wc(d[v],A),C=wc(d[y],A),T=M,R=w-m[f]-C,P=w/2-m[f]/2+E,B=Pc(T,P,R),I=!l.arrow&&null!=Dc(i)&&P!==B&&a.reference[f]/2-(P<T?M:C)-m[f]/2<0,D=I?P<T?P-T:P-R:0;return{[p]:h[p]+D,data:{[p]:B,centerOffset:P-B-D,...I&&{alignmentOffset:D}},reset:I}}}),Du=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Bc(e,t),u={x:n,y:r},d=Oc(i),h=Lc(d);let p=u[h],f=u[d];const m=Bc(s,t),g="number"===typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===h?"height":"width",t=a.reference[h]-a.floating[e]+g.mainAxis,n=a.reference[h]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var v,y;const e="y"===h?"width":"height",t=["top","left"].includes(Ic(i)),n=a.reference[d]-a.floating[e]+(t&&(null==(v=o.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:(null==(y=o.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[h]:p,[d]:f}}}},Lu=(e,t,n)=>{const r=new Map,i={platform:Au,...n},a={...i.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(null==o.isRTL?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Gc(c,r,l),h=r,p={},f=0;for(let m=0;m<s.length;m++){const{name:n,fn:a}=s[m],{x:g,y:v,data:y,reset:b}=await a({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:c,platform:o,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,p={...p,[n]:{...p[n],...y}},b&&f<=50&&(f++,"object"===typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:u,y:d}=Gc(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:p}})(e,t,{...i,platform:a})};var ku="undefined"!==typeof document?t.useLayoutEffect:t.useEffect;function Ou(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if("function"===typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"===typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Ou(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!==r--;){const n=i[r];if(("_owner"!==n||!e.$$typeof)&&!Ou(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Nu(e){if("undefined"===typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fu(e,t){const n=Nu(e);return Math.round(t*n)/n}function Uu(e){const n=t.useRef(e);return ku((()=>{n.current=e})),n}const zu=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"===typeof e?e(t):e;return n&&(i=n,{}.hasOwnProperty.call(i,"current"))?null!=n.current?Iu({element:n.current,padding:r}).fn(t):{}:n?Iu({element:n,padding:r}).fn(t):{};var i}}),Hu=(e,t)=>({...Tu(e),options:[e,t]}),Gu=(e,t)=>({...Du(e),options:[e,t]}),ju=(e,t)=>({...Ru(e),options:[e,t]}),Vu=(e,t)=>({...Pu(e),options:[e,t]}),Wu=(e,t)=>({...Bu(e),options:[e,t]}),Xu=(e,t)=>({...zu(e),options:[e,t]});var Ju=t.forwardRef(((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return(0,fi.jsx)(Go.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,fi.jsx)("polygon",{points:"0,0 30,0 15,10"})})}));Ju.displayName="Arrow";var $u=Ju;var Ku="Popper",[Yu,qu]=lc(Ku),[Qu,Zu]=Yu(Ku),ed=e=>{const{__scopePopper:n,children:r}=e,[i,a]=t.useState(null);return(0,fi.jsx)(Qu,{scope:n,anchor:i,onAnchorChange:a,children:r})};ed.displayName=Ku;var td="PopperAnchor",nd=t.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:i,...a}=e,o=Zu(td,r),s=t.useRef(null),l=Oo(n,s);return t.useEffect((()=>{o.onAnchorChange(i?.current||s.current)})),i?null:(0,fi.jsx)(Go.div,{...a,ref:l})}));nd.displayName=td;var rd="PopperContent",[id,ad]=Yu(rd),od=t.forwardRef(((e,n)=>{const{__scopePopper:r,side:i="bottom",sideOffset:a=0,align:o="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:m,...g}=e,v=Zu(rd,r),[y,b]=t.useState(null),x=Oo(n,(e=>b(e))),[_,S]=t.useState(null),w=function(e){const[n,r]=t.useState(void 0);return jo((()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let i,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)}),[e]),n}(_),E=w?.width??0,A=w?.height??0,M=i+("center"!==o?"-"+o:""),C="number"===typeof d?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(u)?u:[u],R=T.length>0,P={padding:C,boundary:T.filter(ud),altBoundary:R},{refs:B,floatingStyles:I,placement:D,isPositioned:L,middlewareData:k}=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=t.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,f]=t.useState(i);Ou(p,i)||f(i);const[m,g]=t.useState(null),[v,y]=t.useState(null),b=t.useCallback((e=>{e!==w.current&&(w.current=e,g(e))}),[]),x=t.useCallback((e=>{e!==E.current&&(E.current=e,y(e))}),[]),_=o||m,S=s||v,w=t.useRef(null),E=t.useRef(null),A=t.useRef(d),M=null!=c,C=Uu(c),T=Uu(a),R=Uu(u),P=t.useCallback((()=>{if(!w.current||!E.current)return;const e={placement:n,strategy:r,middleware:p};T.current&&(e.platform=T.current),Lu(w.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==R.current};B.current&&!Ou(A.current,t)&&(A.current=t,Do.flushSync((()=>{h(t)})))}))}),[p,n,r,T,R]);ku((()=>{!1===u&&A.current.isPositioned&&(A.current.isPositioned=!1,h((e=>({...e,isPositioned:!1}))))}),[u]);const B=t.useRef(!1);ku((()=>(B.current=!0,()=>{B.current=!1})),[]),ku((()=>{if(_&&(w.current=_),S&&(E.current=S),_&&S){if(C.current)return C.current(_,S,P);P()}}),[_,S,P,C,M]);const I=t.useMemo((()=>({reference:w,floating:E,setReference:b,setFloating:x})),[b,x]),D=t.useMemo((()=>({reference:_,floating:S})),[_,S]),L=t.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=Fu(D.floating,d.x),n=Fu(D.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...Nu(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,l,D.floating,d.x,d.y]);return t.useMemo((()=>({...d,update:P,refs:I,elements:D,floatingStyles:L})),[d,P,I,D,L])}({strategy:"fixed",placement:M,whileElementsMounted:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Mu(...t,{animationFrame:"always"===f})},elements:{reference:v.anchor},middleware:[(O={mainAxis:a+A,alignmentAxis:s},{...Cu(O),options:[O,N]}),c&&Hu({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?Gu():void 0,...P}),c&&ju({...P}),Vu({...P,apply:e=>{let{elements:t,rects:n,availableWidth:r,availableHeight:i}=e;const{width:a,height:o}=n.reference,s=t.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${i}px`),s.setProperty("--radix-popper-anchor-width",`${a}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}}),_&&Xu({element:_,padding:l}),dd({arrowWidth:E,arrowHeight:A}),p&&Wu({strategy:"referenceHidden",...P})]});var O,N;const[F,U]=hd(D),z=uc(m);jo((()=>{L&&z?.()}),[L,z]);const H=k.arrow?.x,G=k.arrow?.y,j=0!==k.arrow?.centerOffset,[V,W]=t.useState();return jo((()=>{y&&W(window.getComputedStyle(y).zIndex)}),[y]),(0,fi.jsx)("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:L?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(" "),...k.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,fi.jsx)(id,{scope:r,placedSide:F,onArrowChange:S,arrowX:H,arrowY:G,shouldHideArrow:j,children:(0,fi.jsx)(Go.div,{"data-side":F,"data-align":U,...g,ref:x,style:{...g.style,animation:L?void 0:"none"}})})})}));od.displayName=rd;var sd="PopperArrow",ld={top:"bottom",right:"left",bottom:"top",left:"right"},cd=t.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,i=ad(sd,n),a=ld[i.placedSide];return(0,fi.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,fi.jsx)($u,{...r,ref:t,style:{...r.style,display:"block"}})})}));function ud(e){return null!==e}cd.displayName=sd;var dd=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=0!==i.arrow?.centerOffset,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=hd(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(i.arrow?.x??0)+o/2,h=(i.arrow?.y??0)+s/2;let p="",f="";return"bottom"===l?(p=a?u:`${d}px`,f=-s+"px"):"top"===l?(p=a?u:`${d}px`,f=`${r.floating.height+s}px`):"right"===l?(p=-s+"px",f=a?u:`${h}px`):"left"===l&&(p=`${r.floating.width+s}px`,f=a?u:`${h}px`),{data:{x:p,y:f}}}});function hd(e){const[t,n="center"]=e.split("-");return[t,n]}var pd=ed,fd=nd,md=od,gd=cd;var vd=e=>{const{present:n,children:r}=e,i=function(e){const[n,r]=t.useState(),i=t.useRef({}),a=t.useRef(e),o=t.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,n){return t.useReducer(((e,t)=>n[e][t]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return t.useEffect((()=>{const e=yd(i.current);o.current="mounted"===l?e:"none"}),[l]),jo((()=>{const t=i.current,n=a.current;if(n!==e){const r=o.current,i=yd(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}a.current=e}}),[e,c]),jo((()=>{if(n){const e=e=>{const t=yd(i.current).includes(e.animationName);e.target===n&&t&&Do.flushSync((()=>c("ANIMATION_END")))},t=e=>{e.target===n&&(o.current=yd(i.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),()=>{n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:t.useCallback((e=>{e&&(i.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"===typeof r?r({present:i.isPresent}):t.Children.only(r),o=Oo(i.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"===typeof r||i.isPresent?t.cloneElement(a,{ref:o}):null};function yd(e){return e?.animationName||"none"}function bd(e){let{prop:n,defaultProp:r,onChange:i=()=>{}}=e;const[a,o]=function(e){let{defaultProp:n,onChange:r}=e;const i=t.useState(n),[a]=i,o=t.useRef(a),s=uc(r);return t.useEffect((()=>{o.current!==a&&(s(a),o.current=a)}),[a,o,s]),i}({defaultProp:r,onChange:i}),s=void 0!==n,l=s?n:a,c=uc(i);return[l,t.useCallback((e=>{if(s){const t="function"===typeof e?e(n):e;t!==n&&c(t)}else o(e)}),[s,n,o,c])]}vd.displayName="Presence";var xd=t.forwardRef(((e,t)=>(0,fi.jsx)(Go.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));xd.displayName="VisuallyHidden";var _d=xd,[Sd,wd]=lc("Tooltip",[qu]),Ed=qu(),Ad="TooltipProvider",Md=700,Cd="tooltip.open",[Td,Rd]=Sd(Ad),Pd=e=>{const{__scopeTooltip:n,delayDuration:r=Md,skipDelayDuration:i=300,disableHoverableContent:a=!1,children:o}=e,[s,l]=t.useState(!0),c=t.useRef(!1),u=t.useRef(0);return t.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),(0,fi.jsx)(Td,{scope:n,isOpenDelayed:s,delayDuration:r,onOpen:t.useCallback((()=>{window.clearTimeout(u.current),l(!1)}),[]),onClose:t.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>l(!0)),i)}),[i]),isPointerInTransitRef:c,onPointerInTransitChange:t.useCallback((e=>{c.current=e}),[]),disableHoverableContent:a,children:o})};Pd.displayName=Ad;var Bd="Tooltip",[Id,Dd]=Sd(Bd),Ld=e=>{const{__scopeTooltip:n,children:r,open:i,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:l}=e,c=Rd(Bd,e.__scopeTooltip),u=Ed(n),[d,h]=t.useState(null),p=function(e){const[n,r]=t.useState(xc());return jo((()=>{e||r((e=>e??String(_c++)))}),[e]),e||(n?`radix-${n}`:"")}(),f=t.useRef(0),m=s??c.disableHoverableContent,g=l??c.delayDuration,v=t.useRef(!1),[y=!1,b]=bd({prop:i,defaultProp:a,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Cd))):c.onClose(),o?.(e)}}),x=t.useMemo((()=>y?v.current?"delayed-open":"instant-open":"closed"),[y]),_=t.useCallback((()=>{window.clearTimeout(f.current),v.current=!1,b(!0)}),[b]),S=t.useCallback((()=>{window.clearTimeout(f.current),b(!1)}),[b]),w=t.useCallback((()=>{window.clearTimeout(f.current),f.current=window.setTimeout((()=>{v.current=!0,b(!0)}),g)}),[g,b]);return t.useEffect((()=>()=>window.clearTimeout(f.current)),[]),(0,fi.jsx)(pd,{...u,children:(0,fi.jsx)(Id,{scope:n,contentId:p,open:y,stateAttribute:x,trigger:d,onTriggerChange:h,onTriggerEnter:t.useCallback((()=>{c.isOpenDelayed?w():_()}),[c.isOpenDelayed,w,_]),onTriggerLeave:t.useCallback((()=>{m?S():window.clearTimeout(f.current)}),[S,m]),onOpen:_,onClose:S,disableHoverableContent:m,children:r})})};Ld.displayName=Bd;var kd="TooltipTrigger",Od=t.forwardRef(((e,n)=>{const{__scopeTooltip:r,...i}=e,a=Dd(kd,r),o=Rd(kd,r),s=Ed(r),l=Oo(n,t.useRef(null),a.onTriggerChange),c=t.useRef(!1),u=t.useRef(!1),d=t.useCallback((()=>c.current=!1),[]);return t.useEffect((()=>()=>document.removeEventListener("pointerup",d)),[d]),(0,fi.jsx)(fd,{asChild:!0,...s,children:(0,fi.jsx)(Go.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:sc(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(u.current||o.isPointerInTransitRef.current||(a.onTriggerEnter(),u.current=!0))})),onPointerLeave:sc(e.onPointerLeave,(()=>{a.onTriggerLeave(),u.current=!1})),onPointerDown:sc(e.onPointerDown,(()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})})),onFocus:sc(e.onFocus,(()=>{c.current||a.onOpen()})),onBlur:sc(e.onBlur,a.onClose),onClick:sc(e.onClick,a.onClose)})})}));Od.displayName=kd;var Nd="TooltipPortal",[Fd,Ud]=Sd(Nd,{forceMount:void 0}),zd=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Dd(Nd,t);return(0,fi.jsx)(Fd,{scope:t,forceMount:n,children:(0,fi.jsx)(vd,{present:n||a.open,children:(0,fi.jsx)(Vo,{asChild:!0,container:i,children:r})})})};zd.displayName=Nd;var Hd="TooltipContent",Gd=t.forwardRef(((e,t)=>{const n=Ud(Hd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Dd(Hd,e.__scopeTooltip);return(0,fi.jsx)(vd,{present:r||o.open,children:o.disableHoverableContent?(0,fi.jsx)(Xd,{side:i,...a,ref:t}):(0,fi.jsx)(jd,{side:i,...a,ref:t})})})),jd=t.forwardRef(((e,n)=>{const r=Dd(Hd,e.__scopeTooltip),i=Rd(Hd,e.__scopeTooltip),a=t.useRef(null),o=Oo(n,a),[s,l]=t.useState(null),{trigger:c,onClose:u}=r,d=a.current,{onPointerInTransitChange:h}=i,p=t.useCallback((()=>{l(null),h(!1)}),[h]),f=t.useCallback(((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),a=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...i,...function(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect())]);l(a),h(!0)}),[h]);return t.useEffect((()=>()=>p()),[p]),t.useEffect((()=>{if(c&&d){const e=e=>f(e,d),t=e=>f(e,c);return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}}),[c,d,f,p]),t.useEffect((()=>{if(s){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!function(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const e=t[a].x,s=t[a].y,l=t[o].x,c=t[o].y;s>r!==c>r&&n<(l-e)*(r-s)/(c-s)+e&&(i=!i)}return i}(n,s);r?p():i&&(p(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[c,d,s,u,p]),(0,fi.jsx)(Xd,{...e,ref:o})})),[Vd,Wd]=Sd(Bd,{isInside:!1}),Xd=t.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:i,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:s,...l}=e,c=Dd(Hd,r),u=Ed(r),{onClose:d}=c;return t.useEffect((()=>(document.addEventListener(Cd,d),()=>document.removeEventListener(Cd,d))),[d]),t.useEffect((()=>{if(c.trigger){const e=e=>{const t=e.target;t?.contains(c.trigger)&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[c.trigger,d]),(0,fi.jsx)(gc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,fi.jsxs)(md,{"data-state":c.stateAttribute,...u,...l,ref:n,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,fi.jsx)(Uo,{children:i}),(0,fi.jsx)(Vd,{scope:r,isInside:!0,children:(0,fi.jsx)(_d,{id:c.contentId,role:"tooltip",children:a||i})})]})})}));Gd.displayName=Hd;var Jd="TooltipArrow",$d=t.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Ed(n);return Wd(Jd,n).isInside?null:(0,fi.jsx)(gd,{...i,...r,ref:t})}));$d.displayName=Jd;var Kd=Ld,Yd=Od,qd=Gd,Qd=$d;function Zd(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}let eh;!function(e){e[e.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",e[e.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",e[e.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",e[e.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",e[e.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",e[e.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",e[e.THEME_ERROR=6]="THEME_ERROR",e[e.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",e[e.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",e[e.EMPTY_KEY=9]="EMPTY_KEY"}(eh||(eh={}));const th={[eh.UNSUPPORTED_INPUT]:(e,t)=>[`An input with type \`${e}\` input was found at path \`${t}\` but it's not supported yet.`],[eh.NO_COMPONENT_FOR_TYPE]:(e,t)=>[`Type \`${e}\` found at path \`${t}\` can't be displayed in panel because no component supports it yet.`],[eh.UNKNOWN_INPUT]:(e,t)=>[`input at path \`${e}\` is not recognized.`,t],[eh.DUPLICATE_KEYS]:(e,t,n)=>[`Key \`${e}\` of path \`${t}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[eh.ALREADY_REGISTERED_TYPE]:e=>[`Type ${e} has already been registered. You can't register a component with the same type.`],[eh.CLIPBOARD_ERROR]:e=>["Error copying the value",e],[eh.THEME_ERROR]:(e,t)=>[`Error accessing the theme \`${e}.${t}\` value.`],[eh.PATH_DOESNT_EXIST]:e=>[`Error getting the value at path \`${e}\`. There is probably an error in your \`render\` function.`],[eh.PATH_DOESNT_EXIST]:e=>[`Error accessing the value at path \`${e}\``],[eh.INPUT_TYPE_OVERRIDE]:(e,t,n)=>[`Input at path \`${e}\` already exists with type: \`${t}\`. Its type cannot be overridden with type \`${n}\`.`],[eh.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function nh(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];const[a,...o]=th[t](...r);console[e]("LEVA: "+a,...o)}const rh=nh.bind(null,"warn"),ih=nh.bind(null,"log"),ah=["value"],oh=["schema"],sh=["value"],lh=[],ch={};function uh(e){let{value:t}=e,n=Zd(e,ah);for(let r of lh){const e=r(t,n);if(e)return e}}function dh(e,t){let{schema:n}=t,r=Zd(t,oh);e in ch?rh(eh.ALREADY_REGISTERED_TYPE,e):(lh.push(((t,r)=>n(t,r)&&e)),ch[e]=r)}function hh(e,t,n,r){const{normalize:i}=ch[e];if(i)return i(t,n,r);if("object"!==typeof t||!("value"in t))return{value:t};const{value:a}=t;return{value:a,settings:Zd(t,sh)}}function ph(e,t,n){const{format:r}=ch[e];return r?r(t,n):t}function fh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mh(Object(n),!0).forEach((function(t){fh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const vh=(e,t,n)=>e>n?n:e<t?t:e,yh=e=>{if(""===e||"number"===typeof e)return e;try{const t=Rh(e);if(!isNaN(t))return t}catch(t){}return parseFloat(e)},bh=Math.log(10);function xh(e){let t=Math.abs(+String(e).replace(".",""));if(0===t)return.01;for(;0!==t&&t%10===0;)t/=10;const n=Math.floor(Math.log(t)/bh)+1,r=Math.floor(Math.log10(Math.abs(e))),i=Math.pow(10,r-n);return Math.max(i,.001)}const _h=(e,t,n)=>{if(n===t)return 0;return(vh(e,t,n)-t)/(n-t)},Sh=(e,t,n)=>e*(n-t)+t,wh=/\(([0-9+\-*/^ .]+)\)/,Eh=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,Ah=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,Mh=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,Ch=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,Th=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function Rh(e){if(isNaN(Number(e))){if(wh.test(e)){const t=e.replace(wh,((e,t)=>String(Rh(t))));return Rh(t)}if(Eh.test(e)){return Rh(e.replace(Eh,((e,t,n)=>String(Math.pow(Number(t),Number(n))))))}if(Ah.test(e)){const t=e.replace(Ah,((e,t,n)=>String(Number(t)*Number(n))));return Rh(t)}if(Mh.test(e)){const t=e.replace(Mh,((e,t,n)=>{if(0!=n)return String(Number(t)/Number(n));throw new Error("Division by zero")}));return Rh(t)}if(Ch.test(e)){const t=e.replace(Ch,((e,t,n)=>String(Number(t)+Number(n))));return Rh(t)}if(Th.test(e)){const t=e.replace(Th,((e,t,n)=>String(Number(t)-Number(n))));return Rh(t)}return Number(e)}return Number(e)}function Ph(e){return"[object Object]"===Object.prototype.toString.call(e)}const Bh=e=>Ph(e)&&0===Object.keys(e).length;let Ih,Dh;!function(e){e.BUTTON="BUTTON",e.BUTTON_GROUP="BUTTON_GROUP",e.MONITOR="MONITOR",e.FOLDER="FOLDER"}(Ih||(Ih={})),function(e){e.SELECT="SELECT",e.IMAGE="IMAGE",e.NUMBER="NUMBER",e.COLOR="COLOR",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.INTERVAL="INTERVAL",e.VECTOR3D="VECTOR3D",e.VECTOR2D="VECTOR2D"}(Dh||(Dh={}));const Lh=["type","__customInput"],kh=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],Oh=["type"];function Nh(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;var i,a;if("object"!==typeof e||Array.isArray(e))return{type:r,input:e,options:gh({key:t,label:t,optional:!1,disabled:!1,order:0},n)};if("__customInput"in e){const{type:n,__customInput:r}=e;return Nh(r,t,Zd(e,Lh),n)}const{render:o,label:s,optional:l,order:c=0,disabled:u,hint:d,onChange:h,onEditStart:p,onEditEnd:f,transient:m}=e,g=Zd(e,kh),v=gh({render:o,key:t,label:null!==s&&void 0!==s?s:t,hint:d,transient:null!==m&&void 0!==m?m:!!h,onEditStart:p,onEditEnd:f,disabled:u,optional:l,order:c},n);let y,{type:b}=g,x=Zd(g,Oh);return b=null!==r&&void 0!==r?r:b,b in Ih?{type:b,input:x,options:v}:(y=r&&Ph(x)&&"value"in x?x.value:Bh(x)?void 0:x,{type:b,input:y,options:gh(gh({},v),{},{onChange:h,optional:null!==(i=v.optional)&&void 0!==i&&i,disabled:null!==(a=v.disabled)&&void 0!==a&&a})})}function Fh(e,t,n,r){const i=Nh(e,t),{type:a,input:o,options:s}=i;if(a)return a in Ih?i:{type:a,input:hh(a,o,n,r),options:s};let l=uh(o);return l?{type:l,input:hh(l,o,n,r),options:s}:(l=uh({value:o}),!!l&&{type:l,input:hh(l,{value:o},n,r),options:s})}function Uh(e,t,n,r,i){const{value:a,type:o,settings:s}=e;e.value=Hh({type:o,value:a,settings:s},t,n,r),e.fromPanel=i}const zh=function(e,t,n){this.type="LEVA_ERROR",this.message="LEVA: "+e,this.previousValue=t,this.error=n};function Hh(e,t,n,r){let{type:i,value:a,settings:o}=e;const s="SELECT"!==i&&"function"===typeof t?t(a):t;let l;try{l=function(e,t,n,r,i,a){const{sanitize:o}=ch[e];return o?o(t,n,r,i,a):t}(i,s,o,a,n,r)}catch(c){throw new zh(`The value \`${t}\` did not result in a correct value.`,a,c)}return Jo(l,a)?a:l}const Gh=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=0;return function(){const i=arguments,a=n&&!r,o=()=>e.apply(this,i);window.clearTimeout(r),r=window.setTimeout(o,t),a&&o()}},jh=e=>e.shiftKey?5:e.altKey?.2:1;const Vh=["value"],Wh=["min","max"],Xh=(e,t)=>{let{min:n=-1/0,max:r=1/0,suffix:i}=t;const a=parseFloat(e);if(""===e||isNaN(a))throw Error("Invalid number");const o=vh(a,n,r);return i?o+i:o},Jh=e=>{let{value:t}=e,n=Zd(e,Vh);const{min:r=-1/0,max:i=1/0}=n,a=Zd(n,Wh);let o=parseFloat(t);const s="string"===typeof t?t.substring((""+o).length):void 0;o=vh(o,r,i);let l=n.step;l||(Number.isFinite(r)?l=Number.isFinite(i)?+(Math.abs(i-r)/100).toPrecision(1):+(Math.abs(o-r)/100).toPrecision(1):Number.isFinite(i)&&(l=+(Math.abs(i-o)/100).toPrecision(1)));const c=l?10*xh(l):xh(o);l=l||c/10;return{value:s?o+s:o,settings:gh({initialValue:o,step:l,pad:Math.round(vh(Math.log10(1/c),0,2)),min:r,max:i,suffix:s},a)}},$h=(e,t)=>{let{step:n,initialValue:r}=t;return r+Math.round((e-r)/n)*n};var Kh=Object.freeze({__proto__:null,schema:e=>{if("number"===typeof e)return!0;if("string"===typeof e){const t=parseFloat(e);if(isNaN(t))return!1;return e.substring((""+t).length).trim().length<4}return!1},sanitize:Xh,format:(e,t)=>{let{pad:n=0,suffix:r}=t;const i=parseFloat(e).toFixed(n);return r?i+r:i},normalize:Jh,sanitizeStep:$h});function Yh(){return Yh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yh.apply(this,arguments)}const qh=(0,t.createContext)({});function Qh(){return(0,t.useContext)(qh)}const Zh=(0,t.createContext)(null),ep=(0,t.createContext)(null),tp=(0,t.createContext)(null);function np(){return(0,t.useContext)(ep)}const rp=()=>({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function ip(e,t){const[n,r]=e.split(" "),i={};return"none"!==n&&(i.boxShadow=`${t.inset?"inset ":""}0 0 0 $borderWidths${[t.key]} $colors${"default"!==n&&n||t.borderColor}`),r&&(i.backgroundColor=r),i}const ap={$inputStyle:()=>e=>ip(e,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>e=>ip(e,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>e=>ip(e,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>e=>ip(e,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:op,css:sp,createTheme:lp,globalCss:cp,keyframes:up}=cl({prefix:"leva",theme:rp(),utils:gh(gh({},ap),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:e=>({"&:focus":ap.$focusStyle()(e)}),$focusWithin:e=>({"&:focus-within":ap.$focusStyle()(e)}),$hover:e=>({"&:hover":ap.$hoverStyle()(e)}),$active:e=>({"&:active":ap.$activeStyle()(e)})})}),dp=cp({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function hp(e,n){const{theme:r}=(0,t.useContext)(Zh);if(!(e in r)||!(n in r[e]))return rh(eh.THEME_ERROR,e,n),"";let i=n;for(;;){let t=r[e][i];if("string"!==typeof t||"$"!==t.charAt(0))return t;i=t.substr(1)}}const pp=op("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),fp=op("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${pp}`]:{paddingLeft:0}}),mp=op(fp,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),gp=op("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),vp=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],yp=["onUpdate"];function bp(e){let{innerLabel:n,value:r,onUpdate:i,onChange:a,onKeyDown:o,type:s,id:l,inputType:c="text",rows:u=0}=e,d=Zd(e,vp);const{id:h,emitOnEditStart:p,emitOnEditEnd:f,disabled:m}=Qh(),g=l||h,v=(0,t.useRef)(null),y=u>0,b=y?"textarea":"input",x=(0,t.useCallback)((e=>t=>{const n=t.currentTarget.value;e(n)}),[]);t.useEffect((()=>{const e=v.current,t=x((e=>{i(e),f()}));return null===e||void 0===e||e.addEventListener("blur",t),()=>null===e||void 0===e?void 0:e.removeEventListener("blur",t)}),[x,i,f]);const _=(0,t.useCallback)((e=>{"Enter"===e.key&&x(i)(e)}),[x,i]),S=Object.assign({as:b},y?{rows:u}:{},d);return t.createElement(gp,{textArea:y},n&&"string"===typeof n?t.createElement(fp,null,n):n,t.createElement(pp,Yh({levaType:s,ref:v,id:g,type:c,autoComplete:"off",spellCheck:"false",value:r,onChange:x(a),onFocus:()=>p(),onKeyPress:_,onKeyDown:o,disabled:m},S)))}function xp(e){let{onUpdate:n}=e,r=Zd(e,yp);const i=(0,t.useCallback)((e=>n(yh(e))),[n]),a=(0,t.useCallback)((e=>{const t="ArrowUp"===e.key?1:"ArrowDown"===e.key?-1:0;if(t){e.preventDefault();const r=e.altKey?.1:e.shiftKey?10:1;n((e=>parseFloat(e)+t*r))}}),[n]);return t.createElement(bp,Yh({},r,{onUpdate:i,onKeyDown:a,type:"number"}))}const _p=op("div",{}),Sp=op("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),wp=op("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${Sp}::after`]:{opacity:.6},[`${_p}:hover > & + ${Sp}::after`]:{opacity:.6},[`${_p}:hover > & > svg`]:{opacity:1}}),Ep=op("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${_p}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),Ap=op("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${Ep} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),Mp=op(Ap,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),Cp=op("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),Tp=op("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),Rp=op("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),Pp=op("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${Rp}`]:{pointerEvents:"auto"}}}}}),Bp=op("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),Ip=op("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),Dp=op(Qd,{fill:"$toolTipBackground"});function Lp(e){let{children:n}=e;const{className:r}=(0,t.useContext)(Zh);return t.createElement(Wo,{className:r},n)}const kp=["align"];function Op(){const{id:e,disable:n,disabled:r}=Qh();return t.createElement(t.Fragment,null,t.createElement(Tp,{id:e+"__disable",type:"checkbox",checked:!r,onChange:()=>n(!r)}),t.createElement("label",{htmlFor:e+"__disable"}))}function Np(e){const{id:n,optional:r,hint:i}=Qh(),a=e.htmlFor||(n?{htmlFor:n}:null),o=i||"string"!==typeof e.children?null:{title:e.children};return t.createElement(t.Fragment,null,r&&t.createElement(Op,null),void 0!==i?t.createElement(Kd,null,t.createElement(Yd,{asChild:!0},t.createElement(Rp,Yh({},a,e))),t.createElement(qd,{side:"top",sideOffset:2},t.createElement(Ip,null,i,t.createElement(Dp,null)))):t.createElement(Rp,Yh({},a,o,e)))}function Fp(e){let{align:n}=e,r=Zd(e,kp);const{value:i,label:a,key:o,disabled:s}=Qh(),{hideCopyButton:l}=(0,t.useContext)(tp),c=!l&&void 0!==o,[u,d]=(0,t.useState)(!1);return t.createElement(Cp,{align:n,onPointerLeave:()=>d(!1)},t.createElement(Np,r),c&&!s&&t.createElement("div",{title:`Click to copy ${"string"===typeof a?a:o} value`},u?t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},t.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),t.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):t.createElement("svg",{onClick:async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[o]:null!==i&&void 0!==i?i:""})),d(!0)}catch(e){rh(eh.CLIPBOARD_ERROR,{[o]:i})}},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},t.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),t.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const Up=["toggled"],zp=op("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Hp(e){let{toggled:n}=e,r=Zd(e,Up);return t.createElement(zp,Yh({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${n?0:-90}deg)`}},r),t.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const Gp=["input"];function jp(e){let{input:n}=e,r=Zd(e,Gp);return n?t.createElement(Mp,r):t.createElement(Ap,r)}function Vp(e){let{value:n,type:r,settings:i,setValue:a}=e;const[o,s]=(0,t.useState)(ph(r,n,i)),l=(0,t.useRef)(n),c=(0,t.useRef)(i);c.current=i;const u=(0,t.useCallback)((e=>s(ph(r,e,c.current))),[r]),d=(0,t.useCallback)((e=>{try{a(e)}catch(cO){const{type:t,previousValue:n}=cO;if("LEVA_ERROR"!==t)throw cO;u(n)}}),[u,a]);return(0,t.useEffect)((()=>{Jo(n,l.current)||u(n),l.current=n}),[n,u]),{displayValue:o,onChange:s,onUpdate:d}}function Wp(e,t){const{emitOnEditStart:n,emitOnEditEnd:r}=Qh();return oc((t=>{t.first&&(document.body.classList.add("leva__panel__dragged"),null===n||void 0===n||n());const i=e(t);return t.last&&(document.body.classList.remove("leva__panel__dragged"),null===r||void 0===r||r()),i}),t)}function Xp(){const e=(0,t.useRef)(null),n=(0,t.useRef)({x:0,y:0}),r=(0,t.useCallback)((t=>{Object.assign(n.current,t),e.current&&(e.current.style.transform=`translate3d(${n.current.x}px, ${n.current.y}px, 0)`)}),[]);return[e,r]}const Jp=["__refCount"],$p=(e,t)=>{if(!e[t])return null;return Zd(e[t],Jp)};const Kp=op("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),Yp=op("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),qp=op("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),Qp=op("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),Zp=op("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function ef(e){let{value:n,min:r,max:i,onDrag:a,step:o,initialValue:s}=e;const l=(0,t.useRef)(null),c=(0,t.useRef)(null),u=(0,t.useRef)(0),d=hp("sizes","scrubberWidth"),h=Wp((e=>{let{event:t,first:h,xy:[p],movement:[f],memo:m}=e;if(h){const{width:e,left:a}=l.current.getBoundingClientRect();u.current=e-parseFloat(d);m=(null===t||void 0===t?void 0:t.target)===c.current?n:Sh((p-a)/e,r,i)}const g=m+Sh(f/u.current,0,i-r);return a($h(g,{step:o,initialValue:s})),m})),p=_h(n,r,i);return t.createElement(Qp,Yh({ref:l},h()),t.createElement(Yp,null,t.createElement(Zp,{style:{left:0,right:100*(1-p)+"%"}})),t.createElement(qp,{ref:c,style:{left:`calc(${p} * (100% - ${d}))`}}))}const tf=t.memo((e=>{let{label:n,onUpdate:r,step:i,innerLabelTrim:a}=e;const[o,s]=(0,t.useState)(!1),l=Wp((e=>{let{active:t,delta:[n],event:a,memo:o=0}=e;return s(t),o+=n/2,Math.abs(o)>=1&&(r((e=>parseFloat(e)+Math.floor(o)*i*jh(a))),o=0),o}));return t.createElement(mp,Yh({dragging:o,title:n.length>1?n:""},l()),n.slice(0,a))}));function nf(e){let{label:n,id:r,displayValue:i,onUpdate:a,onChange:o,settings:s,innerLabelTrim:l=1}=e;const c=l>0&&t.createElement(tf,{label:n,step:s.step,onUpdate:a,innerLabelTrim:l});return t.createElement(xp,{id:r,value:String(i),onUpdate:a,onChange:o,innerLabel:c})}const{sanitizeStep:rf}=Kh;var af=gh({component:function(){const e=Qh(),{label:n,value:r,onUpdate:i,settings:a,id:o}=e,{min:s,max:l}=a,c=l!==1/0&&s!==-1/0;return t.createElement(jp,{input:!0},t.createElement(Fp,null,n),t.createElement(Kp,{hasRange:c},c&&t.createElement(ef,Yh({value:parseFloat(r),onDrag:i},a)),t.createElement(nf,Yh({},e,{id:o,label:"value",innerLabelTrim:c?0:1}))))}},Zd(Kh,["sanitizeStep"]));var of=Object.freeze({__proto__:null,schema:(e,t)=>fs().schema({options:fs().passesAnyOf(fs().object(),fs().array())}).test(t),sanitize:(e,t)=>{let{values:n}=t;if(n.indexOf(e)<0)throw Error("Selected value doesn't match Select options");return e},format:(e,t)=>{let{values:n}=t;return n.indexOf(e)},normalize:e=>{let t,n,{value:r,options:i}=e;return Array.isArray(i)?(n=i,t=i.map((e=>String(e)))):(n=Object.values(i),t=Object.keys(i)),"value"in e?n.includes(r)||(t.unshift(String(r)),n.unshift(r)):r=n[0],Object.values(i).includes(r)||(i[String(r)]=r),{value:r,settings:{keys:t,values:n}}}});const sf=op("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),lf=op("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),cf=op("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${lf}:focus + &`]:{$focusStyle:""},[`${lf}:hover + &`]:{$hoverStyle:""}});function uf(e){let{displayValue:n,value:r,onUpdate:i,id:a,settings:o,disabled:s}=e;const{keys:l,values:c}=o,u=(0,t.useRef)();return r===c[n]&&(u.current=l[n]),t.createElement(sf,null,t.createElement(lf,{id:a,value:n,onChange:e=>i(c[Number(e.currentTarget.value)]),disabled:s},l.map(((e,n)=>t.createElement("option",{key:e,value:n},e)))),t.createElement(cf,null,u.current),t.createElement(Hp,{toggled:!0}))}var df=gh({component:function(){const{label:e,value:n,displayValue:r,onUpdate:i,id:a,disabled:o,settings:s}=Qh();return t.createElement(jp,{input:!0},t.createElement(Fp,null,e),t.createElement(uf,{id:a,value:n,displayValue:r,onUpdate:i,settings:s,disabled:o}))}},of);var hf=Object.freeze({__proto__:null,schema:e=>fs().string().test(e),sanitize:e=>{if("string"!==typeof e)throw Error("Invalid string");return e},normalize:e=>{let{value:t,editable:n=!0,rows:r=!1}=e;return{value:t,settings:{editable:n,rows:"number"===typeof r?r:r?5:0}}}});const pf=["displayValue","onUpdate","onChange","editable"],ff=op("div",{whiteSpace:"pre-wrap"});function mf(e){let{displayValue:n,onUpdate:r,onChange:i,editable:a=!0}=e,o=Zd(e,pf);return a?t.createElement(bp,Yh({value:n,onUpdate:r,onChange:i},o)):t.createElement(ff,null,n)}var gf=gh({component:function(){const{label:e,settings:n,displayValue:r,onUpdate:i,onChange:a}=Qh();return t.createElement(jp,{input:!0},t.createElement(Fp,null,e),t.createElement(mf,Yh({displayValue:r,onUpdate:i,onChange:a},n)))}},hf);var vf=Object.freeze({__proto__:null,schema:e=>fs().boolean().test(e),sanitize:e=>{if("boolean"!==typeof e)throw Error("Invalid boolean");return e}});const yf=op("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function bf(e){let{value:n,onUpdate:r,id:i,disabled:a}=e;return t.createElement(yf,null,t.createElement("input",{id:i,type:"checkbox",checked:n,onChange:e=>r(e.currentTarget.checked),disabled:a}),t.createElement("label",{htmlFor:i},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}var xf=gh({component:function(){const{label:e,value:n,onUpdate:r,disabled:i,id:a}=Qh();return t.createElement(jp,{input:!0},t.createElement(Fp,null,e),t.createElement(bf,{value:n,onUpdate:r,id:a,disabled:i}))}},vf);const _f=["locked"];function Sf(e){let{value:n,id:r,valueKey:i,settings:a,onUpdate:o,innerLabelTrim:s}=e;const l=(0,t.useRef)(n[i]);l.current=n[i];const c=(0,t.useCallback)((e=>o({[i]:Hh({type:"NUMBER",value:l.current,settings:a},e)})),[o,a,i]),u=Vp({type:"NUMBER",value:n[i],settings:a,setValue:c});return t.createElement(nf,{id:r,label:i,value:n[i],displayValue:u.displayValue,onUpdate:u.onUpdate,onChange:u.onChange,settings:a,innerLabelTrim:s})}const wf=op("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function Ef(e){let{locked:n}=e,r=Zd(e,_f);return t.createElement("svg",Yh({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),n?t.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):t.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Af(e){let{value:n,onUpdate:r,settings:i,innerLabelTrim:a}=e;const{id:o,setSettings:s}=Qh(),{lock:l,locked:c}=i;return t.createElement(wf,{withLock:l},l&&t.createElement(Ef,{locked:c,onClick:()=>s({locked:!c})}),Object.keys(n).map(((e,s)=>t.createElement(Sf,{id:0===s?o:`${o}.${e}`,key:e,valueKey:e,value:n,settings:i[e],onUpdate:r,innerLabelTrim:a}))))}const Mf=(e,t)=>{const n={};let r=0,i=1/0;Object.entries(e).forEach((e=>{let[a,o]=e;n[a]=Jh(gh({value:o},t[a])).settings,r=Math.max(r,n[a].step),i=Math.min(i,n[a].pad)}));for(let a in n){const{step:e,min:o,max:s}=t[a]||{};isFinite(e)||isFinite(o)&&isFinite(s)||(n[a].step=r,n[a].pad=i)}return n},Cf=["lock"],Tf=["value"];function Rf(e){const t=fs().array().length(e).every.number();return n=>t.test(n)||(t=>{if(!t||"object"!==typeof t)return!1;const n=Object.values(t);return n.length===e&&n.every((e=>isFinite(e)))})(n)}function Pf(e,t,n){return function(e){return Array.isArray(e)?"array":"object"}(e)===t?e:"array"===t?Object.values(e):function(e,t){return e.reduce(((e,n,r)=>Object.assign(e,{[t[r]]:n})),{})}(e,n)}const Bf=e=>!!e&&("step"in e||"min"in e||"max"in e);function If(e){return{schema:Rf(e.length),normalize:t=>{let{value:n}=t;return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const{lock:r=!1}=t,i=Zd(t,Cf),a=Array.isArray(e)?"array":"object",o="object"===a?Object.keys(e):n,s=Pf(e,"object",o),l=Bf(i)?o.reduce(((e,t)=>Object.assign(e,{[t]:i})),{}):i;return{value:"array"===a?e:s,settings:gh(gh({},Mf(s,l)),{},{format:a,keys:o,lock:r,locked:!1})}}(n,Zd(t,Tf),e)},format:(e,t)=>((e,t)=>Pf(e,"object",t.keys))(e,t),sanitize:(e,t,n)=>((e,t,n)=>{const r=Pf(e,"object",t.keys);for(let o in r)r[o]=Xh(r[o],t[o]);const i=Object.keys(r);let a={};if(i.length===t.keys.length)a=r;else{const e=Pf(n,"object",t.keys);if(1===i.length&&t.locked){const t=i[0],n=r[t],o=e[t],s=0!==o?n/o:1;for(let r in e)r===t?a[t]=n:a[r]=e[r]*s}else a=gh(gh({},e),r)}return Pf(a,t.format,t.keys)})(e,t,n)}}var Df={grad:.9,turn:360,rad:360/(2*Math.PI)},Lf=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},kf=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Of=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Nf=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Ff=function(e){return{r:Of(e.r,0,255),g:Of(e.g,0,255),b:Of(e.b,0,255),a:Of(e.a)}},Uf=function(e){return{r:kf(e.r),g:kf(e.g),b:kf(e.b),a:kf(e.a,3)}},zf=/^#([0-9a-f]{3,8})$/i,Hf=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Gf=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:60*(s<0?s+6:s),s:a?o/a*100:0,v:a/255*100,a:i}},jf=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),l=r*(1-(1-t+a)*n),c=a%6;return{r:255*[r,s,o,o,l,r][c],g:255*[l,r,r,s,o,o][c],b:255*[o,o,l,r,r,s][c],a:i}},Vf=function(e){return{h:Nf(e.h),s:Of(e.s,0,100),l:Of(e.l,0,100),a:Of(e.a)}},Wf=function(e){return{h:kf(e.h),s:kf(e.s),l:kf(e.l),a:kf(e.a,3)}},Xf=function(e){return jf((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},Jf=function(e){return{h:(t=Gf(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,r,i},$f=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Kf=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yf=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qf=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qf={string:[[function(e){var t=zf.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?kf(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?kf(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Yf.exec(e)||qf.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Ff({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=$f.exec(e)||Kf.exec(e);if(!t)return null;var n,r,i=Vf({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(Df[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Xf(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=void 0===i?1:i;return Lf(t)&&Lf(n)&&Lf(r)?Ff({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,a=void 0===i?1:i;if(!Lf(t)||!Lf(n)||!Lf(r))return null;var o=Vf({h:Number(t),s:Number(n),l:Number(r),a:Number(a)});return Xf(o)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,a=void 0===i?1:i;if(!Lf(t)||!Lf(n)||!Lf(r))return null;var o=function(e){return{h:Nf(e.h),s:Of(e.s,0,100),v:Of(e.v,0,100),a:Of(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)});return jf(o)},"hsv"]]},Zf=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},em=function(e){return"string"==typeof e?Zf(e.trim(),Qf.string):"object"==typeof e&&null!==e?Zf(e,Qf.object):[null,void 0]},tm=function(e,t){var n=Jf(e);return{h:n.h,s:Of(n.s+100*t,0,100),l:n.l,a:n.a}},nm=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},rm=function(e,t){var n=Jf(e);return{h:n.h,s:n.s,l:Of(n.l+100*t,0,100),a:n.a}},im=function(){function e(e){this.parsed=em(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return kf(nm(this.rgba),2)},e.prototype.isDark=function(){return nm(this.rgba)<.5},e.prototype.isLight=function(){return nm(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Uf(this.rgba)).r,n=e.g,r=e.b,a=(i=e.a)<1?Hf(kf(255*i)):"","#"+Hf(t)+Hf(n)+Hf(r)+a;var e,t,n,r,i,a},e.prototype.toRgb=function(){return Uf(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Uf(this.rgba)).r,n=e.g,r=e.b,(i=e.a)<1?"rgba("+t+", "+n+", "+r+", "+i+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,i},e.prototype.toHsl=function(){return Wf(Jf(this.rgba))},e.prototype.toHslString=function(){return t=(e=Wf(Jf(this.rgba))).h,n=e.s,r=e.l,(i=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+i+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,i},e.prototype.toHsv=function(){return e=Gf(this.rgba),{h:kf(e.h),s:kf(e.s),v:kf(e.v),a:kf(e.a,3)};var e},e.prototype.invert=function(){return am({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),am(tm(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),am(tm(this.rgba,-e))},e.prototype.grayscale=function(){return am(tm(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),am(rm(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),am(rm(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?am({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):kf(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Jf(this.rgba);return"number"==typeof e?am({h:e,s:t.s,l:t.l,a:t.a}):kf(t.h)},e.prototype.isEqual=function(e){return this.toHex()===am(e).toHex()},e}(),am=function(e){return e instanceof im?e:new im(e)},om=[];function sm(){return(sm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function lm(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function cm(e){var n=(0,t.useRef)(e),r=(0,t.useRef)((function(e){n.current&&n.current(e)}));return n.current=e,r.current}var um=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},dm=function(e){return"touches"in e},hm=function(e){return e&&e.ownerDocument.defaultView||self},pm=function(e,t,n){var r=e.getBoundingClientRect(),i=dm(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:um((i.pageX-(r.left+hm(e).pageXOffset))/r.width),top:um((i.pageY-(r.top+hm(e).pageYOffset))/r.height)}},fm=function(e){!dm(e)&&e.preventDefault()},mm=t.memo((function(e){var n=e.onMove,r=e.onKey,i=lm(e,["onMove","onKey"]),a=(0,t.useRef)(null),o=cm(n),s=cm(r),l=(0,t.useRef)(null),c=(0,t.useRef)(!1),u=(0,t.useMemo)((function(){var e=function(e){fm(e),(dm(e)?e.touches.length>0:e.buttons>0)&&a.current?o(pm(a.current,e,l.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=c.current,i=hm(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?"touchmove":"mousemove",e),o(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(fm(t),!function(e,t){return t&&!dm(e)}(t,c.current)&&r)){if(dm(t)){c.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),o(pm(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,o]),d=u[0],h=u[1],p=u[2];return(0,t.useEffect)((function(){return p}),[p]),t.createElement("div",sm({},i,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:a,onKeyDown:h,tabIndex:0,role:"slider"}))})),gm=function(e){return e.filter(Boolean).join(" ")},vm=function(e){var n=e.color,r=e.left,i=e.top,a=void 0===i?.5:i,o=gm(["react-colorful__pointer",e.className]);return t.createElement("div",{className:o,style:{top:100*a+"%",left:100*r+"%"}},t.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:n}}))},ym=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},bm=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:ym(e.h),s:ym(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:ym(i/2),a:ym(r,2)}}),xm=function(e){var t=bm(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},_m=function(e){var t=bm(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Sm=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),l=r*(1-(1-t+a)*n),c=a%6;return{r:ym(255*[r,s,o,o,l,r][c]),g:ym(255*[l,r,r,s,o,o][c]),b:ym(255*[o,o,l,r,r,s][c]),a:ym(i,2)}},wm=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:ym(60*(s<0?s+6:s)),s:ym(a?o/a*100:0),v:ym(a/255*100),a:i}},Em=t.memo((function(e){var n=e.hue,r=e.onChange,i=gm(["react-colorful__hue",e.className]);return t.createElement("div",{className:i},t.createElement(mm,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:um(n+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":ym(n),"aria-valuemax":"360","aria-valuemin":"0"},t.createElement(vm,{className:"react-colorful__hue-pointer",left:n/360,color:xm({h:n,s:100,v:100,a:1})})))})),Am=t.memo((function(e){var n=e.hsva,r=e.onChange,i={backgroundColor:xm({h:n.h,s:100,v:100,a:1})};return t.createElement("div",{className:"react-colorful__saturation",style:i},t.createElement(mm,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:um(n.s+100*e.left,0,100),v:um(n.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ym(n.s)+"%, Brightness "+ym(n.v)+"%"},t.createElement(vm,{className:"react-colorful__saturation-pointer",top:1-n.v/100,left:n.s/100,color:xm(n)})))})),Mm=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Cm(e,n,r){var i=cm(r),a=(0,t.useState)((function(){return e.toHsva(n)})),o=a[0],s=a[1],l=(0,t.useRef)({color:n,hsva:o});(0,t.useEffect)((function(){if(!e.equal(n,l.current.color)){var t=e.toHsva(n);l.current={hsva:t,color:n},s(t)}}),[n,e]),(0,t.useEffect)((function(){var t;Mm(o,l.current.hsva)||e.equal(t=e.fromHsva(o),l.current.color)||(l.current={hsva:o,color:t},i(t))}),[o,e,i]);var c=(0,t.useCallback)((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[o,c]}var Tm,Rm="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,Pm=new Map,Bm=function(e){Rm((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!Pm.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',Pm.set(t,r);var i=Tm||n.nc;i&&r.setAttribute("nonce",i),t.head.appendChild(r)}}),[])},Im=function(e){var n=e.className,r=e.colorModel,i=e.color,a=void 0===i?r.defaultColor:i,o=e.onChange,s=lm(e,["className","colorModel","color","onChange"]),l=(0,t.useRef)(null);Bm(l);var c=Cm(r,a,o),u=c[0],d=c[1],h=gm(["react-colorful",n]);return t.createElement("div",sm({},s,{ref:l,className:h}),t.createElement(Am,{hsva:u,onChange:d}),t.createElement(Em,{hue:u.h,onChange:d,className:"react-colorful__last-control"}))},Dm=function(e){var n=e.className,r=e.hsva,i=e.onChange,a={backgroundImage:"linear-gradient(90deg, "+_m(Object.assign({},r,{a:0}))+", "+_m(Object.assign({},r,{a:1}))+")"},o=gm(["react-colorful__alpha",n]),s=ym(100*r.a);return t.createElement("div",{className:o},t.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),t.createElement(mm,{onMove:function(e){i({a:e.left})},onKey:function(e){i({a:um(r.a+e.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},t.createElement(vm,{className:"react-colorful__alpha-pointer",left:r.a,color:_m(r)})))},Lm=function(e){var n=e.className,r=e.colorModel,i=e.color,a=void 0===i?r.defaultColor:i,o=e.onChange,s=lm(e,["className","colorModel","color","onChange"]),l=(0,t.useRef)(null);Bm(l);var c=Cm(r,a,o),u=c[0],d=c[1],h=gm(["react-colorful",n]);return t.createElement("div",sm({},s,{ref:l,className:h}),t.createElement(Am,{hsva:u,onChange:d}),t.createElement(Em,{hue:u.h,onChange:d}),t.createElement(Dm,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},km={defaultColor:{r:0,g:0,b:0,a:1},toHsva:wm,fromHsva:Sm,equal:Mm},Om=function(e){return t.createElement(Lm,sm({},e,{colorModel:km}))},Nm={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return wm({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(t=Sm(e)).r,g:t.g,b:t.b};var t},equal:Mm},Fm=function(e){return t.createElement(Im,sm({},e,{colorModel:Nm}))},Um=n(5173),zm=n.n(Um);function Hm(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(t){a(t)}}function s(e){try{l(r.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function Gm(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(l){s=[6,l],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}Object.create;function jm(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(cO){i={error:cO}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function Vm(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(jm(arguments[t]));return e}Object.create;"function"===typeof SuppressedError&&SuppressedError;var Wm=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Xm(e,t){var n=function(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=Wm.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!==typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"===typeof t?t:"string"===typeof r&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var Jm=[".DS_Store","Thumbs.db"];function $m(e){return"object"===typeof e&&null!==e}function Km(e){return Zm(e.target.files).map((function(e){return Xm(e)}))}function Ym(e){return Hm(this,void 0,void 0,(function(){return Gm(this,(function(t){switch(t.label){case 0:return[4,Promise.all(e.map((function(e){return e.getFile()})))];case 1:return[2,t.sent().map((function(e){return Xm(e)}))]}}))}))}function qm(e,t){return Hm(this,void 0,void 0,(function(){var n;return Gm(this,(function(r){switch(r.label){case 0:return null===e?[2,[]]:e.items?(n=Zm(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(eg))]):[3,2];case 1:return[2,Qm(tg(r.sent()))];case 2:return[2,Qm(Zm(e.files).map((function(e){return Xm(e)})))]}}))}))}function Qm(e){return e.filter((function(e){return-1===Jm.indexOf(e.name)}))}function Zm(e){if(null===e)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function eg(e){if("function"!==typeof e.webkitGetAsEntry)return ng(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?ig(t):ng(e)}function tg(e){return e.reduce((function(e,t){return Vm(e,Array.isArray(t)?tg(t):[t])}),[])}function ng(e){var t=e.getAsFile();if(!t)return Promise.reject(e+" is not a File");var n=Xm(t);return Promise.resolve(n)}function rg(e){return Hm(this,void 0,void 0,(function(){return Gm(this,(function(t){return[2,e.isDirectory?ig(e):ag(e)]}))}))}function ig(e){var t=e.createReader();return new Promise((function(e,n){var r=[];!function i(){var a=this;t.readEntries((function(t){return Hm(a,void 0,void 0,(function(){var a,o,s;return Gm(this,(function(l){switch(l.label){case 0:if(t.length)return[3,5];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Promise.all(r)];case 2:return a=l.sent(),e(a),[3,4];case 3:return o=l.sent(),n(o),[3,4];case 4:return[3,6];case 5:s=Promise.all(t.map(rg)),r.push(s),i(),l.label=6;case 6:return[2]}}))}))}),(function(e){n(e)}))}()}))}function ag(e){return Hm(this,void 0,void 0,(function(){return Gm(this,(function(t){return[2,new Promise((function(t,n){e.file((function(n){var r=Xm(n,e.fullPath);t(r)}),(function(e){n(e)}))}))]}))}))}var og=n(8628);function sg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sg(Object(n),!0).forEach((function(t){cg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ug(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(l){s=!0,i=l}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return dg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hg="file-invalid-type",pg="file-too-large",fg="file-too-small",mg="too-many-files",gg=function(e){e=Array.isArray(e)&&1===e.length?e[0]:e;var t=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:hg,message:"File type must be ".concat(t)}},vg=function(e){return{code:pg,message:"File is larger than ".concat(e," ").concat(1===e?"byte":"bytes")}},yg=function(e){return{code:fg,message:"File is smaller than ".concat(e," ").concat(1===e?"byte":"bytes")}},bg={code:mg,message:"Too many files"};function xg(e,t){var n="application/x-moz-file"===e.type||(0,og.A)(e,t);return[n,n?null:gg(t)]}function _g(e,t,n){if(Sg(e.size))if(Sg(t)&&Sg(n)){if(e.size>n)return[!1,vg(n)];if(e.size<t)return[!1,yg(t)]}else{if(Sg(t)&&e.size<t)return[!1,yg(t)];if(Sg(n)&&e.size>n)return[!1,vg(n)]}return[!0,null]}function Sg(e){return void 0!==e&&null!==e}function wg(e){return"function"===typeof e.isPropagationStopped?e.isPropagationStopped():"undefined"!==typeof e.cancelBubble&&e.cancelBubble}function Eg(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,(function(e){return"Files"===e||"application/x-moz-file"===e})):!!e.target&&!!e.target.files}function Ag(e){e.preventDefault()}function Mg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some((function(t){return!wg(e)&&t&&t.apply(void 0,[e].concat(r)),wg(e)}))}}function Cg(e){return e="string"===typeof e?e.split(","):e,[{description:"everything",accept:Array.isArray(e)?e.filter((function(e){return"audio/*"===e||"video/*"===e||"image/*"===e||"text/*"===e||/\w+\/[-+.\w]+/g.test(e)})).reduce((function(e,t){return lg(lg({},e),{},cg({},t,[]))}),{}):{}}]}var Tg=["children"],Rg=["open"],Pg=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Bg=["refKey","onChange","onClick"];function Ig(e){return function(e){if(Array.isArray(e))return kg(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Lg(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(l){s=!0,i=l}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return a}(e,t)||Lg(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lg(e,t){if(e){if("string"===typeof e)return kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kg(e,t):void 0}}function kg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Og(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ng(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Og(Object(n),!0).forEach((function(t){Fg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Og(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ug(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var zg=(0,t.forwardRef)((function(e,n){var r=e.children,i=jg(Ug(e,Tg)),a=i.open,o=Ug(i,Rg);return(0,t.useImperativeHandle)(n,(function(){return{open:a}}),[a]),t.createElement(t.Fragment,null,r(Ng(Ng({},o),{},{open:a})))}));zg.displayName="Dropzone";var Hg={disabled:!1,getFilesFromEvent:function(e){return Hm(this,void 0,void 0,(function(){return Gm(this,(function(t){return $m(e)&&$m(e.dataTransfer)?[2,qm(e.dataTransfer,e.type)]:function(e){return $m(e)&&$m(e.target)}(e)?[2,Km(e)]:Array.isArray(e)&&e.every((function(e){return"getFile"in e&&"function"===typeof e.getFile}))?[2,Ym(e)]:[2,[]]}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};zg.defaultProps=Hg,zg.propTypes={children:zm().func,accept:zm().oneOfType([zm().string,zm().arrayOf(zm().string)]),multiple:zm().bool,preventDropOnDocument:zm().bool,noClick:zm().bool,noKeyboard:zm().bool,noDrag:zm().bool,noDragEventsBubbling:zm().bool,minSize:zm().number,maxSize:zm().number,maxFiles:zm().number,disabled:zm().bool,getFilesFromEvent:zm().func,onFileDialogCancel:zm().func,onFileDialogOpen:zm().func,useFsAccessApi:zm().bool,onDragEnter:zm().func,onDragLeave:zm().func,onDragOver:zm().func,onDrop:zm().func,onDropAccepted:zm().func,onDropRejected:zm().func,validator:zm().func};var Gg={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function jg(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Ng(Ng({},Hg),e),r=n.accept,i=n.disabled,a=n.getFilesFromEvent,o=n.maxSize,s=n.minSize,l=n.multiple,c=n.maxFiles,u=n.onDragEnter,d=n.onDragLeave,h=n.onDragOver,p=n.onDrop,f=n.onDropAccepted,m=n.onDropRejected,g=n.onFileDialogCancel,v=n.onFileDialogOpen,y=n.useFsAccessApi,b=n.preventDropOnDocument,x=n.noClick,_=n.noKeyboard,S=n.noDrag,w=n.noDragEventsBubbling,E=n.validator,A=(0,t.useMemo)((function(){return"function"===typeof v?v:Wg}),[v]),M=(0,t.useMemo)((function(){return"function"===typeof g?g:Wg}),[g]),C=(0,t.useRef)(null),T=(0,t.useRef)(null),R=Dg((0,t.useReducer)(Vg,Gg),2),P=R[0],B=R[1],I=P.isFocused,D=P.isFileDialogActive,L=P.draggedFiles,k=(0,t.useRef)("undefined"!==typeof window&&window.isSecureContext&&y&&"showOpenFilePicker"in window),O=function(){!k.current&&D&&setTimeout((function(){T.current&&(T.current.files.length||(B({type:"closeDialog"}),M()))}),300)};(0,t.useEffect)((function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}}),[T,D,M,k]);var N=(0,t.useRef)([]),F=function(e){C.current&&C.current.contains(e.target)||(e.preventDefault(),N.current=[])};(0,t.useEffect)((function(){return b&&(document.addEventListener("dragover",Ag,!1),document.addEventListener("drop",F,!1)),function(){b&&(document.removeEventListener("dragover",Ag),document.removeEventListener("drop",F))}}),[C,b]);var U=(0,t.useCallback)((function(e){e.preventDefault(),e.persist(),Q(e),N.current=[].concat(Ig(N.current),[e.target]),Eg(e)&&Promise.resolve(a(e)).then((function(t){wg(e)&&!w||(B({draggedFiles:t,isDragActive:!0,type:"setDraggedFiles"}),u&&u(e))}))}),[a,u,w]),z=(0,t.useCallback)((function(e){e.preventDefault(),e.persist(),Q(e);var t=Eg(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(n){}return t&&h&&h(e),!1}),[h,w]),H=(0,t.useCallback)((function(e){e.preventDefault(),e.persist(),Q(e);var t=N.current.filter((function(e){return C.current&&C.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),N.current=t,t.length>0||(B({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),Eg(e)&&d&&d(e))}),[C,d,w]),G=(0,t.useCallback)((function(e,t){var n=[],i=[];e.forEach((function(e){var t=Dg(xg(e,r),2),a=t[0],l=t[1],c=Dg(_g(e,s,o),2),u=c[0],d=c[1],h=E?E(e):null;if(a&&u&&!h)n.push(e);else{var p=[l,d];h&&(p=p.concat(h)),i.push({file:e,errors:p.filter((function(e){return e}))})}})),(!l&&n.length>1||l&&c>=1&&n.length>c)&&(n.forEach((function(e){i.push({file:e,errors:[bg]})})),n.splice(0)),B({acceptedFiles:n,fileRejections:i,type:"setFiles"}),p&&p(n,i,t),i.length>0&&m&&m(i,t),n.length>0&&f&&f(n,t)}),[B,l,r,s,o,c,p,f,m,E]),j=(0,t.useCallback)((function(e){e.preventDefault(),e.persist(),Q(e),N.current=[],Eg(e)&&Promise.resolve(a(e)).then((function(t){wg(e)&&!w||G(t,e)})),B({type:"reset"})}),[a,G,w]),V=(0,t.useCallback)((function(){if(k.current){B({type:"openDialog"}),A();var e={multiple:l,types:Cg(r)};window.showOpenFilePicker(e).then((function(e){return a(e)})).then((function(e){G(e,null),B({type:"closeDialog"})})).catch((function(e){!function(e){return e instanceof DOMException&&("AbortError"===e.name||e.code===e.ABORT_ERR)}(e)?function(e){return e instanceof DOMException&&("SecurityError"===e.name||e.code===e.SECURITY_ERR)}(e)&&(k.current=!1,T.current&&(T.current.value=null,T.current.click())):(M(e),B({type:"closeDialog"}))}))}else T.current&&(B({type:"openDialog"}),A(),T.current.value=null,T.current.click())}),[B,A,M,y,G,r,l]),W=(0,t.useCallback)((function(e){C.current&&C.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),V()))}),[C,V]),X=(0,t.useCallback)((function(){B({type:"focus"})}),[]),J=(0,t.useCallback)((function(){B({type:"blur"})}),[]),$=(0,t.useCallback)((function(){x||(!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return function(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}(e)||function(e){return-1!==e.indexOf("Edge/")}(e)}()?V():setTimeout(V,0))}),[x,V]),K=function(e){return i?null:e},Y=function(e){return _?null:K(e)},q=function(e){return S?null:K(e)},Q=function(e){w&&e.stopPropagation()},Z=(0,t.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.role,a=e.onKeyDown,o=e.onFocus,s=e.onBlur,l=e.onClick,c=e.onDragEnter,u=e.onDragOver,d=e.onDragLeave,h=e.onDrop,p=Ug(e,Pg);return Ng(Ng(Fg({onKeyDown:Y(Mg(a,W)),onFocus:Y(Mg(o,X)),onBlur:Y(Mg(s,J)),onClick:K(Mg(l,$)),onDragEnter:q(Mg(c,U)),onDragOver:q(Mg(u,z)),onDragLeave:q(Mg(d,H)),onDrop:q(Mg(h,j)),role:"string"===typeof r&&""!==r?r:"button"},n,C),i||_?{}:{tabIndex:0}),p)}}),[C,W,X,J,$,U,z,H,j,_,S,i]),ee=(0,t.useCallback)((function(e){e.stopPropagation()}),[]),te=(0,t.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,i=e.onChange,a=e.onClick,o=Ug(e,Bg);return Ng(Ng({},Fg({accept:r,multiple:l,type:"file",style:{display:"none"},onChange:K(Mg(i,j)),onClick:K(Mg(a,ee)),tabIndex:-1},n,T)),o)}}),[T,r,l,j,i]),ne=L.length,re=ne>0&&function(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,a=e.multiple,o=e.maxFiles;return!(!a&&t.length>1||a&&o>=1&&t.length>o)&&t.every((function(e){var t=ug(xg(e,n),1)[0],a=ug(_g(e,r,i),1)[0];return t&&a}))}({files:L,accept:r,minSize:s,maxSize:o,multiple:l,maxFiles:c}),ie=ne>0&&!re;return Ng(Ng({},P),{},{isDragAccept:re,isDragReject:ie,isFocused:I&&!i,getRootProps:Z,getInputProps:te,rootRef:C,inputRef:T,open:K(V)})}function Vg(e,t){switch(t.type){case"focus":return Ng(Ng({},e),{},{isFocused:!0});case"blur":return Ng(Ng({},e),{},{isFocused:!1});case"openDialog":return Ng(Ng({},Gg),{},{isFileDialogActive:!0});case"closeDialog":return Ng(Ng({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return Ng(Ng({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return Ng(Ng({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Ng({},Gg);default:return e}}function Wg(){}function Xg(e){let t;const n=new Set,r=(e,r)=>{const i="function"===typeof e?e(t):e;if(i!==t){const e=t;t=r?i:Object.assign({},t,i),n.forEach((n=>n(t,e)))}},i=()=>t,a={setState:r,getState:i,subscribe:(e,r,a)=>r||a?function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.is;console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let o=r(t);function s(){const n=r(t);if(!a(o,n)){const t=o;e(o=n,t)}}return n.add(s),()=>n.delete(s)}(e,r,a):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,i,a),a}const Jg="undefined"===typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?t.useEffect:t.useLayoutEffect;function $g(e){const n="function"===typeof e?Xg(e):e,r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.getState,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.is;const[,i]=(0,t.useReducer)((e=>e+1),0),a=n.getState(),o=(0,t.useRef)(a),s=(0,t.useRef)(e),l=(0,t.useRef)(r),c=(0,t.useRef)(!1),u=(0,t.useRef)();let d;void 0===u.current&&(u.current=e(a));let h=!1;(o.current!==a||s.current!==e||l.current!==r||c.current)&&(d=e(a),h=!r(u.current,d)),Jg((()=>{h&&(u.current=d),o.current=a,s.current=e,l.current=r,c.current=!1}));const p=(0,t.useRef)(a);Jg((()=>{const e=()=>{try{const e=n.getState(),t=s.current(e);l.current(u.current,t)||(o.current=e,u.current=t,i())}catch(cO){c.current=!0,i()}},t=n.subscribe(e);return n.getState()!==p.current&&e(),t}),[]);const f=h?d:u.current;return(0,t.useDebugValue)(f),f};return Object.assign(r,n),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const e=[r,n];return{next(){const t=e.length<=0;return{value:e.shift(),done:t}}}},r}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Kg=n(7248),Yg=n.n(Kg);const qg=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(".")};function Qg(e,n){return(0,t.useMemo)(e,function(e,n){const r=(0,t.useRef)();return(n?Jo:$o)(e,r.current)||(r.current=e),r.current}(n,!0))}function Zg(e,t,n){const r=e.useStore((e=>function(e,t){return Object.entries(function(e,t){return t.reduce(((t,n)=>(e&&e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}(e,t)).reduce(((e,t)=>{let[,{value:n,disabled:r,key:i}]=t;return e[i]=r?void 0:n,e}),{})}(gh(gh({},n),e.data),t)),$o);return r}function ev(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;const n=(0,t.useRef)(null),r=(0,t.useRef)(null),[i,a]=(0,t.useState)(!1),o=(0,t.useCallback)((()=>a(!0)),[]),s=(0,t.useCallback)((()=>a(!1)),[]);return(0,t.useLayoutEffect)((()=>{if(i){const{bottom:t,top:i,left:a}=n.current.getBoundingClientRect(),{height:o}=r.current.getBoundingClientRect(),s=t+o>window.innerHeight-40?"up":"down";r.current.style.position="fixed",r.current.style.zIndex="10000",r.current.style.left=a+"px","down"===s?r.current.style.top=t+e+"px":r.current.style.bottom=window.innerHeight-i+e+"px"}}),[e,i]),{popinRef:n,wrapperRef:r,shown:i,show:o,hide:s}}!function(e){e.forEach((function(e){om.indexOf(e)<0&&(e(im,Qf),om.push(e))}))}([function(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var i in n)r[n[i]]=i;var a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,o,s=r[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!a.length)for(var d in n)a[d]=new e(n[d]).toRgb();for(var h in n){var p=(i=l,o=a[h],Math.pow(i.r-o.r,2)+Math.pow(i.g-o.g,2)+Math.pow(i.b-o.b,2));p<c&&(c=p,u=h)}return u}},t.string.push([function(t){var r=t.toLowerCase(),i="transparent"===r?"#0000":n[r];return i?new e(i).toRgb():null},"name"])}]);const tv={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};fs.extend({color:()=>e=>am(e).isValid()});function nv(e,t){let{format:n,hasAlpha:r,isString:i}=t;const a=e[tv[n]+(i&&"hex"!==n?"String":"")]();return"object"!==typeof a||r?a:function(e,t){const n=gh({},e);return t.forEach((t=>t in e&&delete n[t])),n}(a,["a"])}const rv=(e,t)=>{const n=am(e);if(!n.isValid())throw Error("Invalid color");return nv(n,t)};var iv=Object.freeze({__proto__:null,schema:e=>fs().color().test(e),sanitize:rv,format:(e,t)=>nv(am(e),gh(gh({},t),{},{isString:!0,format:"hex"})),normalize:e=>{let{value:t}=e;const n=function(e){return em(e)[1]}(t),r={format:"name"===n?"hex":n,hasAlpha:"object"===typeof t?"a"in t:"hex"===n&&8===t.length||/^(rgba)|(hsla)|(hsva)/.test(t),isString:"string"===typeof t};return{value:rv(t,r),settings:r}}});const av=op("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:'url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')',$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),ov=op("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),sv=op("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function lv(e,t){return"rgb"!==t?am(e).toRgb():e}function cv(e){let{value:n,displayValue:r,settings:i,onUpdate:a}=e;const{emitOnEditStart:o,emitOnEditEnd:s}=Qh(),{format:l,hasAlpha:c}=i,{popinRef:u,wrapperRef:d,shown:h,show:p,hide:f}=ev(),m=(0,t.useRef)(0),[g,v]=(0,t.useState)((()=>lv(n,l))),y=c?Om:Fm,b=()=>{f(),s(),window.clearTimeout(m.current)};return(0,t.useEffect)((()=>()=>window.clearTimeout(m.current)),[]),t.createElement(t.Fragment,null,t.createElement(av,{ref:u,active:h,onClick:()=>(v(lv(n,l)),p(),void o()),style:{color:r}}),h&&t.createElement(Lp,null,t.createElement(Bp,{onPointerUp:b}),t.createElement(sv,{ref:d,onMouseEnter:()=>window.clearTimeout(m.current),onMouseLeave:e=>0===e.buttons&&void(m.current=window.setTimeout(b,500))},t.createElement(y,{color:g,onChange:a}))))}var uv=gh({component:function(){const{value:e,displayValue:n,label:r,onChange:i,onUpdate:a,settings:o}=Qh();return t.createElement(jp,{input:!0},t.createElement(Fp,null,r),t.createElement(ov,null,t.createElement(cv,{value:e,displayValue:n,onChange:i,onUpdate:a,settings:o}),t.createElement(bp,{value:n,onChange:i,onUpdate:a})))}},iv);var dv=gh({component:function(){const{label:e,displayValue:n,onUpdate:r,settings:i}=Qh();return t.createElement(jp,{input:!0},t.createElement(Fp,null,e),t.createElement(Af,{value:n,settings:i,onUpdate:r}))}},If(["x","y","z"]));const hv=op("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),pv=op("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function fv(e){let{value:n,settings:r,onUpdate:i}=e;const a=(0,t.useRef)(),o=(0,t.useRef)(0),s=(0,t.useRef)(0),l=(0,t.useRef)(1),[c,u]=(0,t.useState)(!1),[d,h]=(0,t.useState)(!1),[p,f]=Xp(),m=(0,t.useRef)(null),g=(0,t.useRef)(null);(0,t.useLayoutEffect)((()=>{if(c){const{top:e,left:t,width:n,height:r}=m.current.getBoundingClientRect();g.current.style.left=t+n/2+"px",g.current.style.top=e+r/2+"px"}}),[c]);const{keys:[v,y],joystick:b}=r,x="invertY"===b?1:-1,{[v]:{step:_},[y]:{step:S}}=r,w=hp("sizes","joystickWidth"),E=hp("sizes","joystickHeight"),A=.8*parseFloat(w)/2,M=.8*parseFloat(E)/2,C=(0,t.useCallback)((()=>{a.current||(h(!0),o.current&&f({x:o.current*A}),s.current&&f({y:s.current*-M}),a.current=window.setInterval((()=>{i((e=>{const t=_*o.current*l.current,n=x*S*s.current*l.current;return Array.isArray(e)?{[v]:e[0]+t,[y]:e[1]+n}:{[v]:e[v]+t,[y]:e[y]+n}}))}),16))}),[A,M,i,f,_,S,v,y,x]),T=(0,t.useCallback)((()=>{window.clearTimeout(a.current),a.current=void 0,h(!1)}),[]);(0,t.useEffect)((()=>{function e(e){l.current=jh(e)}return window.addEventListener("keydown",e),window.addEventListener("keyup",e),()=>{window.clearTimeout(a.current),window.removeEventListener("keydown",e),window.removeEventListener("keyup",e)}}),[]);const R=Wp((e=>{let{first:t,active:r,delta:[a,c],movement:[d,h]}=e;t&&u(!0);const p=vh(d,-A,A),m=vh(h,-M,M);o.current=Math.abs(d)>Math.abs(p)?Math.sign(d-p):0,s.current=Math.abs(h)>Math.abs(m)?Math.sign(m-h):0;let g=n[v],b=n[y];r?(o.current||(g+=a*_*l.current,f({x:p})),s.current||(b-=x*c*S*l.current,f({y:m})),o.current||s.current?C():T(),i({[v]:g,[y]:b})):(u(!1),o.current=0,s.current=0,f({x:0,y:0}),T())}));return t.createElement(hv,Yh({ref:m},R()),c&&t.createElement(Lp,null,t.createElement(pv,{ref:g,isOutOfBounds:d},t.createElement("div",null),t.createElement("span",{ref:p}))))}const mv=op("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});const gv=["joystick"],vv=If(["x","y"]);var yv=gh(gh({component:function(){const{label:e,displayValue:n,onUpdate:r,settings:i}=Qh();return t.createElement(jp,{input:!0},t.createElement(Fp,null,e),t.createElement(mv,{withJoystick:!!i.joystick},i.joystick&&t.createElement(fv,{value:n,settings:i,onUpdate:r}),t.createElement(Af,{value:n,settings:i,onUpdate:r})))}},vv),{},{normalize:e=>{let{joystick:t=!0}=e,n=Zd(e,gv);const{value:r,settings:i}=vv.normalize(n);return{value:r,settings:gh(gh({},i),{},{joystick:t})}}});var bv=Object.freeze({__proto__:null,sanitize:e=>{if(void 0!==e){if(e instanceof File)try{return URL.createObjectURL(e)}catch(t){return}if("string"===typeof e&&0===e.indexOf("blob:"))return e;throw Error("Invalid image format [undefined | blob |\xa0File].")}},schema:(e,t)=>"object"===typeof t&&"image"in t,normalize:e=>{let{image:t}=e;return{value:t}}});const xv=op("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),_v=op("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),Sv=op("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),wv=op("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),Ev=op("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),Av=op("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});var Mv=gh({component:function(){const{label:e,value:n,onUpdate:r,disabled:i}=Qh(),{popinRef:a,wrapperRef:o,shown:s,show:l,hide:c}=ev(),u=(0,t.useCallback)((e=>{e.length&&r(e[0])}),[r]),d=(0,t.useCallback)((e=>{e.stopPropagation(),r(void 0)}),[r]),{getRootProps:h,getInputProps:p,isDragAccept:f}=jg({maxFiles:1,accept:"image/*",onDrop:u,disabled:i});return t.createElement(jp,{input:!0},t.createElement(Fp,null,e),t.createElement(xv,null,t.createElement(Sv,{ref:a,hasImage:!!n,onPointerDown:()=>!!n&&l(),onPointerUp:c,style:{backgroundImage:n?`url(${n})`:"none"}}),s&&!!n&&t.createElement(Lp,null,t.createElement(Bp,{onPointerUp:c,style:{cursor:"pointer"}}),t.createElement(wv,{ref:o,style:{backgroundImage:`url(${n})`}})),t.createElement(_v,h({isDragAccept:f}),t.createElement("input",p()),t.createElement(Ev,null,f?"drop image":"click or drop")),t.createElement(Av,{onClick:d,disabled:!n})))}},bv);const Cv=fs().number(),Tv=e=>({min:e[0],max:e[1]}),Rv=(e,t,n)=>{let{bounds:[r,i]}=t;const a=Array.isArray(e)?Tv(e):e,o={min:n[0],max:n[1]},{min:s,max:l}=gh(gh({},o),a);return[vh(Number(s),r,Math.max(r,l)),vh(Number(l),Math.min(i,s),i)]};var Pv=Object.freeze({__proto__:null,schema:(e,t)=>fs().array().length(2).every.number().test(e)&&fs().schema({min:Cv,max:Cv}).test(t),format:Tv,sanitize:Rv,normalize:e=>{let{value:t,min:n,max:r}=e;const i={min:n,max:r},a=[n,r],o=gh(gh({},Mf(Tv(t),{min:i,max:i})),{},{bounds:a});return{value:Rv(Tv(t),o,t),settings:o}}});const Bv=["value","bounds","onDrag"],Iv=["bounds"],Dv=op("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function Lv(e){let{value:n,bounds:[r,i],onDrag:a}=e,o=Zd(e,Bv);const s=(0,t.useRef)(null),l=(0,t.useRef)(null),c=(0,t.useRef)(null),u=(0,t.useRef)(0),d=hp("sizes","scrubberWidth"),h=Wp((e=>{let{event:t,first:h,xy:[p],movement:[f],memo:m={}}=e;if(h){const{width:e,left:a}=s.current.getBoundingClientRect();u.current=e-parseFloat(d);const o=(null===t||void 0===t?void 0:t.target)===l.current||(null===t||void 0===t?void 0:t.target)===c.current;m.pos=Sh((p-a)/e,r,i);const h=Math.abs(m.pos-n.min)-Math.abs(m.pos-n.max);m.key=h<0||0===h&&m.pos<=n.min?"min":"max",o&&(m.pos=n[m.key])}const g=m.pos+Sh(f/u.current,0,i-r);return a({[m.key]:rf(g,o[m.key])}),m})),p=`calc(${_h(n.min,r,i)} * (100% - ${d} - 8px) + 4px)`,f=`calc(${1-_h(n.max,r,i)} * (100% - ${d} - 8px) + 4px)`;return t.createElement(Qp,Yh({ref:s},h()),t.createElement(Yp,null,t.createElement(Zp,{style:{left:p,right:f}})),t.createElement(qp,{position:"left",ref:l,style:{left:p}}),t.createElement(qp,{position:"right",ref:c,style:{right:f}}))}var kv=gh({component:function(){const{label:e,displayValue:n,onUpdate:r,settings:i}=Qh(),a=Zd(i,Iv);return t.createElement(t.Fragment,null,t.createElement(jp,{input:!0},t.createElement(Fp,null,e),t.createElement(Dv,null,t.createElement(Lv,Yh({value:n},i,{onDrag:r})),t.createElement(Af,{value:n,settings:a,onUpdate:r,innerLabelTrim:0}))))}},Pv);const Ov=["type","value"],Nv=["onChange","transient","onEditStart","onEditEnd"],Fv=function(){const e=$g((t=()=>({data:{}}),(e,n,r)=>{const i=r.subscribe;return r.subscribe=(e,t,n)=>{let a=e;if(t){const i=(null==n?void 0:n.equalityFn)||Object.is;let o=e(r.getState());a=n=>{const r=e(n);if(!i(o,r)){const e=o;t(o=r,e)}},(null==n?void 0:n.fireImmediately)&&t(o,o)}return i(a)},t(e,n,r)}));var t;const n=(()=>{const e=new Map;return{on:(t,n)=>{let r=e.get(t);void 0===r&&(r=new Set,e.set(t,r)),r.add(n)},off:(t,n)=>{const r=e.get(t);void 0!==r&&(r.delete(n),0===r.size&&e.delete(t))},emit:function(t){const n=e.get(t);if(void 0!==n){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];for(const e of n)e(...i)}}}})();this.storeId="_"+Math.random().toString(36).substr(2,9),this.useStore=e;const r={},i=new Set;this.getVisiblePaths=()=>{const e=this.getData(),t=Object.keys(e),n=[];Object.entries(r).forEach((e=>{let[r,i]=e;i.render&&t.some((e=>0===e.indexOf(r)))&&!i.render(this.get)&&n.push(r+".")}));const a=[];return i.forEach((t=>{t in e&&e[t].__refCount>0&&n.every((e=>-1===t.indexOf(e)))&&(!e[t].render||e[t].render(this.get))&&a.push(t)})),a},this.setOrderedPaths=e=>{e.forEach((e=>i.add(e)))},this.orderPaths=e=>(this.setOrderedPaths(e),e),this.disposePaths=t=>{e.setState((e=>{const n=e.data;return t.forEach((e=>{if(e in n){const t=n[e];t.__refCount--,0===t.__refCount&&t.type in Ih&&delete n[e]}})),{data:n}}))},this.dispose=()=>{e.setState((()=>({data:{}})))},this.getFolderSettings=e=>r[e]||{},this.getData=()=>e.getState().data,this.addData=(t,n)=>{e.setState((e=>{const r=e.data;return Object.entries(t).forEach((e=>{let[t,i]=e,a=r[t];if(a){const{type:e,value:t}=i,r=Zd(i,Ov);e!==a.type?rh(eh.INPUT_TYPE_OVERRIDE,e):((0===a.__refCount||n)&&Object.assign(a,r),a.__refCount++)}else r[t]=gh(gh({},i),{},{__refCount:1})})),{data:r}}))},this.setValueAtPath=(t,n,r)=>{e.setState((e=>{const i=e.data;return Uh(i[t],n,t,this,r),{data:i}}))},this.setSettingsAtPath=(t,n)=>{e.setState((e=>{const r=e.data;return r[t].settings=gh(gh({},r[t].settings),n),{data:r}}))},this.disableInputAtPath=(t,n)=>{e.setState((e=>{const r=e.data;return r[t].disabled=n,{data:r}}))},this.set=(t,n)=>{e.setState((e=>{const r=e.data;return Object.entries(t).forEach((e=>{let[t,i]=e;try{Uh(r[t],i,void 0,void 0,n)}catch(a){0}})),{data:r}}))},this.getInput=e=>{try{return this.getData()[e]}catch(t){rh(eh.PATH_DOESNT_EXIST,e)}},this.get=e=>{var t;return null===(t=this.getInput(e))||void 0===t?void 0:t.value},this.emitOnEditStart=e=>{n.emit(`onEditStart:${e}`,this.get(e),e,gh(gh({},this.getInput(e)),{},{get:this.get}))},this.emitOnEditEnd=e=>{n.emit(`onEditEnd:${e}`,this.get(e),e,gh(gh({},this.getInput(e)),{},{get:this.get}))},this.subscribeToEditStart=(e,t)=>{const r=`onEditStart:${e}`;return n.on(r,t),()=>n.off(r,t)},this.subscribeToEditEnd=(e,t)=>{const r=`onEditEnd:${e}`;return n.on(r,t),()=>n.off(r,t)};const a=(e,t,n)=>{const i={};return Object.entries(e).forEach((e=>{let[o,s]=e;if(""===o)return rh(eh.EMPTY_KEY);let l=qg(t,o);if(s.type===Ih.FOLDER){const e=a(s.schema,l,n);Object.assign(i,e),l in r||(r[l]=s.settings)}else if(o in n)rh(eh.DUPLICATE_KEYS,o,l,n[o].path);else{const e=Fh(s,o,l,i);if(e){const{type:t,options:r,input:a}=e,{onChange:s,transient:c,onEditStart:u,onEditEnd:d}=r,h=Zd(r,Nv);i[l]=gh(gh(gh({type:t},h),a),{},{fromPanel:!0}),n[o]={path:l,onChange:s,transient:c,onEditStart:u,onEditEnd:d}}else rh(eh.UNKNOWN_INPUT,l,s)}})),i};this.getDataFromSchema=e=>{const t={};return[a(e,"",t),t]}},Uv=new Fv;const zv={collapsed:!1};function Hv(e,t){return{type:Ih.FOLDER,schema:e,settings:gh(gh({},zv),t)}}const Gv=e=>"__levaInput"in e,jv=["type","label","path","valueKey","value","settings","setValue","disabled"];function Vv(e){let{type:n,label:r,path:i,valueKey:a,value:o,settings:s,setValue:l,disabled:c}=e,u=Zd(e,jv);const{displayValue:d,onChange:h,onUpdate:p}=Vp({type:n,value:o,settings:s,setValue:l}),f=ch[n].component;return f?t.createElement(qh.Provider,{value:gh({key:a,path:i,id:""+i,label:r,displayValue:d,value:o,onChange:h,onUpdate:p,settings:s,setValue:l,disabled:c},u)},t.createElement(Pp,{disabled:c},t.createElement(f,null))):(rh(eh.NO_COMPONENT_FOR_TYPE,n,i),null)}const Wv=op("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});const Xv=op("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),Jv=op("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}});const $v=op("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"});const Kv=(0,t.forwardRef)((function(e,n){let{initialValue:r}=e;const i=hp("colors","highlight3"),a=hp("colors","elevation2"),o=hp("colors","highlight1"),[s,l]=(0,t.useMemo)((()=>[am(o).alpha(.4).toRgbString(),am(o).alpha(.1).toRgbString()]),[o]),c=(0,t.useRef)([r]),u=(0,t.useRef)(r),d=(0,t.useRef)(r),h=(0,t.useRef)(),p=(0,t.useCallback)(((e,t)=>{if(!e)return;const{width:n,height:r}=e,o=new Path2D,h=n/100,p=.05*r;for(let i=0;i<c.current.length;i++){const e=h*i,t=r-_h(c.current[i],u.current,d.current)*(r-2*p)-p;o.lineTo(e,t)}t.clearRect(0,0,n,r);const f=new Path2D(o);f.lineTo(h*(c.current.length+1),r),f.lineTo(0,r),f.lineTo(0,0);const m=t.createLinearGradient(0,0,0,r);m.addColorStop(0,s),m.addColorStop(1,l),t.fillStyle=m,t.fill(f),t.strokeStyle=a,t.lineJoin="round",t.lineWidth=14,t.stroke(o),t.strokeStyle=i,t.lineWidth=2,t.stroke(o)}),[i,a,s,l]),[f,m]=function(e){const n=(0,t.useRef)(null),r=(0,t.useRef)(null),i=(0,t.useRef)(!1);return(0,t.useEffect)((()=>{const t=Gh((()=>{n.current.width=n.current.offsetWidth*window.devicePixelRatio,n.current.height=n.current.offsetHeight*window.devicePixelRatio,e(n.current,r.current)}),250);return window.addEventListener("resize",t),i.current||(t(),i.current=!0),()=>window.removeEventListener("resize",t)}),[e]),(0,t.useEffect)((()=>{r.current=n.current.getContext("2d")}),[]),[n,r]}(p);return(0,t.useImperativeHandle)(n,(()=>({frame:e=>{(void 0===u.current||e<u.current)&&(u.current=e),(void 0===d.current||e>d.current)&&(d.current=e),function(e,t){e.push(t),e.length>100&&e.shift()}(c.current,e),h.current=requestAnimationFrame((()=>p(f.current,m.current)))}})),[f,m,p]),(0,t.useEffect)((()=>()=>cancelAnimationFrame(h.current)),[]),t.createElement($v,{ref:f})})),Yv=e=>Number.isFinite(e)?e.toPrecision(2):e.toString(),qv=(0,t.forwardRef)((function(e,n){let{initialValue:r}=e;const[i,a]=(0,t.useState)(Yv(r));return(0,t.useImperativeHandle)(n,(()=>({frame:e=>a(Yv(e))})),[]),t.createElement("div",null,i)}));function Qv(e){return"function"===typeof e?e():e.current}const Zv=["type","label","key"],ey={[Ih.BUTTON]:function(e){let{onClick:n,settings:r,label:i}=e;const a=np();return t.createElement(jp,null,t.createElement(Wv,{disabled:r.disabled,onClick:()=>n(a.get)},i))},[Ih.BUTTON_GROUP]:function(e){const{label:n,opts:r}=(e=>{let{label:t,opts:n}=e,r="string"===typeof t&&""===t.trim()?null:t,i=n;return"object"===typeof n.opts&&(void 0!==i.label&&(r=n.label),i=n.opts),{label:r,opts:i}})(e),i=np();return t.createElement(jp,{input:!!n},n&&t.createElement(Fp,null,n),t.createElement(Xv,null,Object.entries(r).map((e=>{let[n,r]=e;return t.createElement(Jv,{key:n,onClick:()=>r(i.get)},n)}))))},[Ih.MONITOR]:function(e){let{label:n,objectOrFn:r,settings:i}=e;const a=(0,t.useRef)(),o=(0,t.useRef)(Qv(r));return(0,t.useEffect)((()=>{const e=window.setInterval((()=>{var e;document.hidden||null===(e=a.current)||void 0===e||e.frame(Qv(r))}),i.interval);return()=>window.clearInterval(e)}),[r,i.interval]),t.createElement(jp,{input:!0},t.createElement(Fp,{align:"top"},n),i.graph?t.createElement(Kv,{ref:a,initialValue:o.current}):t.createElement(qv,{ref:a,initialValue:o.current}))}},ty=t.memo((e=>{let{path:n}=e;const[r,{set:i,setSettings:a,disable:o,storeId:s,emitOnEditStart:l,emitOnEditEnd:c}]=function(e){const n=np(),[r,i]=(0,t.useState)($p(n.getData(),e)),a=(0,t.useCallback)((t=>n.setValueAtPath(e,t,!0)),[e,n]),o=(0,t.useCallback)((t=>n.setSettingsAtPath(e,t)),[e,n]),s=(0,t.useCallback)((t=>n.disableInputAtPath(e,t)),[e,n]),l=(0,t.useCallback)((()=>n.emitOnEditStart(e)),[e,n]),c=(0,t.useCallback)((()=>n.emitOnEditEnd(e)),[e,n]);return(0,t.useEffect)((()=>{i($p(n.getData(),e));const t=n.useStore.subscribe((t=>$p(t.data,e)),i,{equalityFn:$o});return()=>t()}),[n,e]),[r,{set:a,setSettings:o,disable:s,storeId:n.storeId,emitOnEditStart:l,emitOnEditEnd:c}]}(n);if(!r)return null;const{type:u,label:d,key:h}=r,p=Zd(r,Zv);if(u in Ih){const e=ey[u];return t.createElement(e,Yh({label:d,path:n},p))}return u in ch?t.createElement(Vv,Yh({key:s+n,type:u,label:d,storeId:s,path:n,valueKey:h,setValue:i,setSettings:a,disable:o,emitOnEditStart:l,emitOnEditEnd:c},p)):(ih(eh.UNSUPPORTED_INPUT,u,n),null)}));function ny(e){let{toggle:n,toggled:r,name:i}=e;return t.createElement(wp,{onClick:()=>n()},t.createElement(Hp,{toggled:r}),t.createElement("div",null,i))}const ry=e=>{let{name:n,path:r,tree:i}=e;const a=np(),o=qg(r,n),{collapsed:s,color:l}=a.getFolderSettings(o),[c,u]=(0,t.useState)(!s),d=(0,t.useRef)(null),h=hp("colors","folderWidgetColor"),p=hp("colors","folderTextColor");return(0,t.useLayoutEffect)((()=>{d.current.style.setProperty("--leva-colors-folderWidgetColor",l||h),d.current.style.setProperty("--leva-colors-folderTextColor",l||p)}),[l,h,p]),t.createElement(_p,{ref:d},t.createElement(ny,{name:n,toggled:c,toggle:()=>u((e=>!e))}),t.createElement(iy,{parent:o,tree:i,toggled:c}))},iy=t.memo((e=>{let{isRoot:n=!1,fill:r=!1,flat:i=!1,parent:a,tree:o,toggled:s}=e;const{wrapperRef:l,contentRef:c}=function(e){const n=(0,t.useRef)(null),r=(0,t.useRef)(null),i=(0,t.useRef)(!0);return(0,t.useLayoutEffect)((()=>{e||(n.current.style.height="0px",n.current.style.overflow="hidden")}),[]),(0,t.useEffect)((()=>{if(i.current)return void(i.current=!1);let t;const a=n.current,o=()=>{e&&(a.style.removeProperty("height"),a.style.removeProperty("overflow"),r.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};a.addEventListener("transitionend",o,{once:!0});const{height:s}=r.current.getBoundingClientRect();return a.style.height=s+"px",e||(a.style.overflow="hidden",t=window.setTimeout((()=>a.style.height="0px"),50)),()=>{a.removeEventListener("transitionend",o),clearTimeout(t)}}),[e]),{wrapperRef:n,contentRef:r}}(s),u=np(),d=e=>{let[t,n]=e;var r;return(Gv(n)?null===(r=u.getInput(n.path))||void 0===r?void 0:r.order:u.getFolderSettings(qg(a,t)).order)||0},h=Object.entries(o).sort(((e,t)=>d(e)-d(t)));return t.createElement(Sp,{ref:l,isRoot:n,fill:r,flat:i},t.createElement(Ep,{ref:c,isRoot:n,toggled:s},h.map((e=>{let[n,r]=e;return Gv(r)?t.createElement(ty,{key:r.path,valueKey:r.valueKey,path:r.path}):t.createElement(ry,{key:n,name:n,path:a,tree:r})}))))})),ay=op("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${Mp}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),oy=op("i",{$flexCenter:"",width:40,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),sy=op("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),ly=op("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${oy}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),cy=op("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),uy=op("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:40}}}}),dy=t.forwardRef(((e,n)=>{let{setFilter:r,toggle:i}=e;const[a,o]=(0,t.useState)(""),s=(0,t.useMemo)((()=>Gh(r,250)),[r]);return(0,t.useEffect)((()=>{s(a)}),[a,s]),t.createElement(t.Fragment,null,t.createElement(cy,{ref:n,value:a,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:e=>e.stopPropagation(),onChange:e=>{const t=e.currentTarget.value;i(!0),o(t)}}),t.createElement(oy,{onClick:()=>(r(""),void o("")),style:{visibility:a?"visible":"hidden"}},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))}));function hy(e){let{setFilter:n,onDrag:r,onDragStart:i,onDragEnd:a,toggle:o,toggled:s,title:l,drag:c,filterEnabled:u,from:d}=e;const[h,p]=(0,t.useState)(!1),f=(0,t.useRef)(null);(0,t.useEffect)((()=>{var e,t;h?null===(e=f.current)||void 0===e||e.focus():null===(t=f.current)||void 0===t||t.blur()}),[h]);const m=Wp((e=>{let{offset:[t,n],first:o,last:s}=e;r({x:t,y:n}),o&&i({x:t,y:n}),s&&a({x:t,y:n})}),{filterTaps:!0,from:e=>{let{offset:[t,n]}=e;return[(null===d||void 0===d?void 0:d.x)||t,(null===d||void 0===d?void 0:d.y)||n]}});return(0,t.useEffect)((()=>{const e=e=>{"L"===e.key&&e.shiftKey&&e.metaKey&&p((e=>!e))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[]),t.createElement(t.Fragment,null,t.createElement(sy,{mode:c?"drag":void 0},t.createElement(oy,{active:!s,onClick:()=>o()},t.createElement(Hp,{toggled:s,width:12,height:8})),t.createElement(uy,Yh({},c?m():{},{drag:c,filterEnabled:u}),void 0===l&&c?t.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},t.createElement("circle",{cx:"2",cy:"2",r:"2"}),t.createElement("circle",{cx:"14",cy:"2",r:"2"}),t.createElement("circle",{cx:"26",cy:"2",r:"2"}),t.createElement("circle",{cx:"2",cy:"12",r:"2"}),t.createElement("circle",{cx:"14",cy:"12",r:"2"}),t.createElement("circle",{cx:"26",cy:"12",r:"2"})):l),u&&t.createElement(oy,{active:h,onClick:()=>p((e=>!e))},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},t.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),t.createElement(ly,{toggled:h},t.createElement(dy,{ref:f,setFilter:n,toggle:o})))}const py=["store","hidden","theme","collapsed"];function fy(e){let{store:n,hidden:r=!1,theme:i,collapsed:a=!1}=e,o=Zd(e,py);const s=Qg((()=>function(e){const t=rp();if(!e)return{theme:t,className:""};Object.keys(e).forEach((n=>{Object.assign(t[n],e[n])}));const n=lp(t);return{theme:t,className:n.className}}(i)),[i]),[l,c]=(0,t.useState)(!a),u="object"===typeof a?!a.collapsed:l,d=(0,t.useMemo)((()=>"object"===typeof a?e=>{"function"===typeof e?a.onChange(!e(!a.collapsed)):a.onChange(!e)}:c),[a]);return!n||r?null:t.createElement(Zh.Provider,{value:s},t.createElement(my,Yh({store:n},o,{toggled:u,setToggle:d,rootClass:s.className})))}const my=t.memo((e=>{let{store:n,rootClass:r,fill:i=!1,flat:a=!1,neverHide:o=!1,oneLineLabels:s=!1,titleBar:l={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:c=!1,toggled:u,setToggle:d}=e;var h,p;const f=(e=>{const[n,r]=(0,t.useState)(e.getVisiblePaths());return(0,t.useEffect)((()=>{r(e.getVisiblePaths());const t=e.useStore.subscribe(e.getVisiblePaths,r,{equalityFn:$o});return()=>t()}),[e]),n})(n),[m,g]=(0,t.useState)(""),v=(0,t.useMemo)((()=>((e,t)=>{const n={},r=t?t.toLowerCase():null;return e.forEach((e=>{const[t,i]=function(e){const t=e.split(".");return[t.pop(),t.join(".")||void 0]}(e);(!r||t.toLowerCase().indexOf(r)>-1)&&Yg()(n,i,{[t]:{__levaInput:!0,path:e}})})),n})(f,m)),[f,m]),[y,b]=Xp(),x=o||f.length>0,_="object"===typeof l&&l.title||void 0,S="object"!==typeof l||(null===(h=l.drag)||void 0===h||h),w="object"!==typeof l||(null===(p=l.filter)||void 0===p||p),E="object"===typeof l&&l.position||void 0,A="object"===typeof l&&l.onDrag||void 0,M="object"===typeof l&&l.onDragStart||void 0,C="object"===typeof l&&l.onDragEnd||void 0;return t.useEffect((()=>{b({x:null===E||void 0===E?void 0:E.x,y:null===E||void 0===E?void 0:E.y})}),[E,b]),dp(),t.createElement(tp.Provider,{value:{hideCopyButton:c}},t.createElement(ay,{ref:y,className:r,fill:i,flat:a,oneLineLabels:s,hideTitleBar:!l,style:{display:x?"block":"none"}},l&&t.createElement(hy,{onDrag:e=>{b(e),null===A||void 0===A||A(e)},onDragStart:e=>null===M||void 0===M?void 0:M(e),onDragEnd:e=>null===C||void 0===C?void 0:C(e),setFilter:g,toggle:e=>d((t=>null!==e&&void 0!==e?e:!t)),toggled:u,title:_,drag:S,filterEnabled:w,from:E}),x&&t.createElement(ep.Provider,{value:n},t.createElement(iy,{isRoot:!0,fill:i,flat:a,tree:v,toggled:u}))))})),gy=["isRoot"];let vy=!1,yy=null;function by(e){let{isRoot:n=!1}=e,r=Zd(e,gy);return(0,t.useEffect)((()=>(vy=!0,!n&&yy&&(yy.remove(),yy=null),()=>{n||(vy=!1)})),[n]),t.createElement(fy,Yh({store:Uv},r))}function xy(e){(0,t.useEffect)((()=>{e&&!vy&&(yy||(yy=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(yy),function(e,t){const n=console.error;console.error=()=>{},Do.render(e,t),console.error=n}(t.createElement(by,{isRoot:!0}),yy))),vy=!0)}),[e])}function _y(e,n,r,i,a){const{folderName:o,schema:s,folderSettings:l,hookSettings:c,deps:u}=function(e,t,n,r,i){let a,o,s,l,c;return"string"===typeof e?(o=e,a=t,Array.isArray(n)?c=n:n&&("store"in n?(l=n,c=r):(s=n,Array.isArray(r)?c=r:(l=r,c=i)))):(a=e,Array.isArray(t)?c=t:(l=t,c=n)),{schema:a,folderName:o,folderSettings:s,hookSettings:l,deps:c||[]}}(e,n,r,i,a),d="function"===typeof s,h=(0,t.useRef)(!1),p=(0,t.useRef)(!0),f=Qg((()=>{h.current=!0;const e="function"===typeof s?s():s;return o?{[o]:Hv(e,l)}:e}),u);xy(!(null!==c&&void 0!==c&&c.store));const[m]=(0,t.useState)((()=>(null===c||void 0===c?void 0:c.store)||Uv)),[g,v]=(0,t.useMemo)((()=>m.getDataFromSchema(f)),[m,f]),[y,b,x,_,S]=(0,t.useMemo)((()=>{const e=[],t=[],n={},r={},i={};return Object.values(v).forEach((a=>{let{path:o,onChange:s,onEditStart:l,onEditEnd:c,transient:u}=a;e.push(o),s?(n[o]=s,u||t.push(o)):t.push(o),l&&(r[o]=l),c&&(i[o]=c)})),[e,t,n,r,i]}),[v]),w=(0,t.useMemo)((()=>m.orderPaths(y)),[y,m]),E=Zg(m,b,g),A=(0,t.useCallback)((e=>{const t=Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return Object.assign(e,{[v[n].path]:r})}),{});m.set(t,!1)}),[m,v]),M=(0,t.useCallback)((e=>m.get(v[e].path)),[m,v]);return(0,t.useEffect)((()=>{const e=!p.current&&h.current;return m.addData(g,e),p.current=!1,h.current=!1,()=>m.disposePaths(w)}),[m,w,g]),(0,t.useEffect)((()=>{const e=[];return Object.entries(x).forEach((t=>{let[n,r]=t;r(m.get(n),n,gh({initial:!0,get:m.get},m.getInput(n)));const i=m.useStore.subscribe((e=>{const t=e.data[n];return[t.disabled?void 0:t.value,t]}),(e=>{let[t,i]=e;return r(t,n,gh({initial:!1,get:m.get},i))}),{equalityFn:$o});e.push(i)})),()=>e.forEach((e=>e()))}),[m,x]),(0,t.useEffect)((()=>{const e=[];return Object.entries(_).forEach((t=>{let[n,r]=t;return e.push(m.subscribeToEditStart(n,r))})),Object.entries(S).forEach((t=>{let[n,r]=t;return e.push(m.subscribeToEditEnd(n,r))})),()=>e.forEach((e=>e()))}),[_,S,m]),d?[E,A,M]:E}dh(Dh.SELECT,df),dh(Dh.IMAGE,Mv),dh(Dh.NUMBER,af),dh(Dh.COLOR,uv),dh(Dh.STRING,gf),dh(Dh.BOOLEAN,xf),dh(Dh.INTERVAL,kv),dh(Dh.VECTOR3D,dv),dh(Dh.VECTOR2D,yv);const Sy="168",wy={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Ey={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ay=0,My=1,Cy=2,Ty=3,Ry=0,Py=1,By=2,Iy=3,Dy=0,Ly=1,ky=2,Oy=0,Ny=1,Fy=2,Uy=3,zy=4,Hy=5,Gy=100,jy=101,Vy=102,Wy=103,Xy=104,Jy=200,$y=201,Ky=202,Yy=203,qy=204,Qy=205,Zy=206,eb=207,tb=208,nb=209,rb=210,ib=211,ab=212,ob=213,sb=214,lb=0,cb=1,ub=2,db=3,hb=4,pb=5,fb=6,mb=7,gb=0,vb=1,yb=2,bb=0,xb=1,_b=2,Sb=3,wb=4,Eb=5,Ab=6,Mb=7,Cb="attached",Tb="detached",Rb=300,Pb=301,Bb=302,Ib=303,Db=304,Lb=306,kb=1e3,Ob=1001,Nb=1002,Fb=1003,Ub=1004,zb=1004,Hb=1005,Gb=1005,jb=1006,Vb=1007,Wb=1007,Xb=1008,Jb=1008,$b=1009,Kb=1010,Yb=1011,qb=1012,Qb=1013,Zb=1014,ex=1015,tx=1016,nx=1017,rx=1018,ix=1020,ax=35902,ox=1021,sx=1022,lx=1023,cx=1024,ux=1025,dx=1026,hx=1027,px=1028,fx=1029,mx=1030,gx=1031,vx=1032,yx=1033,bx=33776,xx=33777,_x=33778,Sx=33779,wx=35840,Ex=35841,Ax=35842,Mx=35843,Cx=36196,Tx=37492,Rx=37496,Px=37808,Bx=37809,Ix=37810,Dx=37811,Lx=37812,kx=37813,Ox=37814,Nx=37815,Fx=37816,Ux=37817,zx=37818,Hx=37819,Gx=37820,jx=37821,Vx=36492,Wx=36494,Xx=36495,Jx=36283,$x=36284,Kx=36285,Yx=36286,qx=2200,Qx=2201,Zx=2202,e_=2300,t_=2301,n_=2302,r_=2400,i_=2401,a_=2402,o_=2500,s_=2501,l_=0,c_=1,u_=2,d_=3200,h_=3201,p_=3202,f_=3203,m_=0,g_=1,v_="",y_="srgb",b_="srgb-linear",x_="display-p3",__="display-p3-linear",S_="linear",w_="srgb",E_="rec709",A_="p3",M_=0,C_=7680,T_=7681,R_=7682,P_=7683,B_=34055,I_=34056,D_=5386,L_=512,k_=513,O_=514,N_=515,F_=516,U_=517,z_=518,H_=519,G_=512,j_=513,V_=514,W_=515,X_=516,J_=517,$_=518,K_=519,Y_=35044,q_=35048,Q_=35040,Z_=35045,eS=35049,tS=35041,nS=35046,rS=35050,iS=35042,aS="100",oS="300 es",sS=2e3,lS=2001;class cS{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}const uS=["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 dS=1234567;const hS=Math.PI/180,pS=180/Math.PI;function fS(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(uS[255&e]+uS[e>>8&255]+uS[e>>16&255]+uS[e>>24&255]+"-"+uS[255&t]+uS[t>>8&255]+"-"+uS[t>>16&15|64]+uS[t>>24&255]+"-"+uS[63&n|128]+uS[n>>8&255]+"-"+uS[n>>16&255]+uS[n>>24&255]+uS[255&r]+uS[r>>8&255]+uS[r>>16&255]+uS[r>>24&255]).toLowerCase()}function mS(e,t,n){return Math.max(t,Math.min(n,e))}function gS(e,t){return(e%t+t)%t}function vS(e,t,n){return(1-n)*e+n*t}function yS(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function bS(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const xS={DEG2RAD:hS,RAD2DEG:pS,generateUUID:fS,clamp:mS,euclideanModulo:gS,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:vS,damp:function(e,t,n,r){return vS(e,t,1-Math.exp(-n*r))},pingpong:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(gS(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(dS=e);let t=dS+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*hS},radToDeg:function(e){return e*pS},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),c=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),h=o((t-r)/2),p=a((r-t)/2),f=o((r-t)/2);switch(i){case"XYX":e.set(s*u,l*d,l*h,s*c);break;case"YZY":e.set(l*h,s*u,l*d,s*c);break;case"ZXZ":e.set(l*d,l*h,s*u,s*c);break;case"XZX":e.set(s*u,l*f,l*p,s*c);break;case"YXY":e.set(l*p,s*u,l*f,s*c);break;case"ZYZ":e.set(l*f,l*p,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:bS,denormalize:yS};class _S{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_S.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(mS(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class SS{constructor(e,t,n,r,i,a,o,s,l){SS.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,o,s,l)}set(e,t,n,r,i,a,o,s,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],d=n[2],h=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],b=r[7],x=r[2],_=r[5],S=r[8];return i[0]=a*f+o*v+s*x,i[3]=a*m+o*y+s*_,i[6]=a*g+o*b+s*S,i[1]=l*f+c*v+u*x,i[4]=l*m+c*y+u*_,i[7]=l*g+c*b+u*S,i[2]=d*f+h*v+p*x,i[5]=d*m+h*y+p*_,i[8]=d*g+h*b+p*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-n*i*c+n*o*s+r*i*l-r*a*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=c*a-o*l,d=o*s-c*i,h=l*i-a*s,p=t*u+n*d+r*h;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=u*f,e[1]=(r*l-c*n)*f,e[2]=(o*n-r*a)*f,e[3]=d*f,e[4]=(c*t-r*s)*f,e[5]=(r*i-o*t)*f,e[6]=h*f,e[7]=(n*s-l*t)*f,e[8]=(a*t-n*i)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){const s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(wS.makeScale(e,t)),this}rotate(e){return this.premultiply(wS.makeRotation(-e)),this}translate(e,t){return this.premultiply(wS.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const wS=new SS;function ES(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}const AS={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function MS(e,t){return new AS[e](t)}function CS(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function TS(){const e=CS("canvas");return e.style.display="block",e}const RS={};function PS(e){e in RS||(RS[e]=!0,console.warn(e))}const BS=(new SS).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),IS=(new SS).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),DS={[b_]:{transfer:S_,primaries:E_,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e,fromReference:e=>e},[y_]:{transfer:w_,primaries:E_,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[__]:{transfer:S_,primaries:A_,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.applyMatrix3(IS),fromReference:e=>e.applyMatrix3(BS)},[x_]:{transfer:w_,primaries:A_,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.convertSRGBToLinear().applyMatrix3(IS),fromReference:e=>e.applyMatrix3(BS).convertLinearToSRGB()}},LS=new Set([b_,__]),kS={enabled:!0,_workingColorSpace:b_,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!LS.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,n){if(!1===this.enabled||t===n||!t||!n)return e;const r=DS[t].toReference;return(0,DS[n].fromReference)(r(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return DS[e].primaries},getTransfer:function(e){return e===v_?S_:DS[e].transfer},getLuminanceCoefficients:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._workingColorSpace;return e.fromArray(DS[t].luminanceCoefficients)}};function OS(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function NS(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let FS;class US{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"===typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===FS&&(FS=CS("canvas")),FS.width=e.width,FS.height=e.height;const n=FS.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=FS}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap){const t=CS("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*OS(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*OS(t[e]/255)):t[e]=OS(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let zS=0;class HS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.isSource=!0,Object.defineProperty(this,"id",{value:zS++}),this.uuid=fS(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(GS(r[t].image)):e.push(GS(r[t]))}else e=GS(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function GS(e){return"undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap?US.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let jS=0;class VS extends cS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:VS.DEFAULT_IMAGE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:VS.DEFAULT_MAPPING,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ob,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ob,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:jb,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Xb,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:lx,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:$b,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:VS.DEFAULT_ANISOTROPY,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:v_;super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:jS++}),this.uuid=fS(),this.name="",this.source=new HS(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new _S(0,0),this.repeat=new _S(1,1),this.center=new _S(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new SS,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e){void 0===e&&(e=null),this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Rb)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case kb:e.x=e.x-Math.floor(e.x);break;case Ob:e.x=e.x<0?0:1;break;case Nb:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case kb:e.y=e.y-Math.floor(e.y);break;case Ob:e.y=e.y<0?0:1;break;case Nb:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}VS.DEFAULT_IMAGE=null,VS.DEFAULT_MAPPING=Rb,VS.DEFAULT_ANISOTROPY=1;class WS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;WS.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const a=.01,o=.1,s=e.elements,l=s[0],c=s[4],u=s[8],d=s[1],h=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(c-d)<a&&Math.abs(u-f)<a&&Math.abs(p-m)<a){if(Math.abs(c+d)<o&&Math.abs(u+f)<o&&Math.abs(p+m)<o&&Math.abs(l+h+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,s=(h+1)/2,v=(g+1)/2,y=(c+d)/4,b=(u+f)/4,x=(p+m)/4;return e>s&&e>v?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=y/n,i=b/n):s>v?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=y/r,i=x/r):v<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(v),n=b/i,r=x/i),this.set(n,r,i,t),this}let v=Math.sqrt((m-p)*(m-p)+(u-f)*(u-f)+(d-c)*(d-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(u-f)/v,this.z=(d-c)/v,this.w=Math.acos((l+h+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class XS extends cS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new WS(0,0,e,t),this.scissorTest=!1,this.viewport=new WS(0,0,e,t);const r={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jb,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const i=new VS(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);i.flipY=!1,i.generateMipmaps=n.generateMipmaps,i.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=i.clone(),this.textures[o].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,r=e.textures.length;n<r;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new HS(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class JS extends XS{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this.isWebGLRenderTarget=!0}}class $S extends VS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Fb,this.minFilter=Fb,this.wrapR=Ob,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class KS extends JS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(e,t,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new $S(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class YS extends VS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Fb,this.minFilter=Fb,this.wrapR=Ob,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class qS extends JS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(e,t,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new YS(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class QS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3];const d=i[a+0],h=i[a+1],p=i[a+2],f=i[a+3];if(0===o)return e[t+0]=s,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===o)return e[t+0]=d,e[t+1]=h,e[t+2]=p,void(e[t+3]=f);if(u!==f||s!==d||l!==h||c!==p){let e=1-o;const t=s*d+l*h+c*p+u*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,o=Math.sin(o*a)/i}const i=o*n;if(s=s*e+d*i,l=l*e+h*i,c=c*e+p*i,u=u*e+f*i,e===1-o){const e=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=e,l*=e,c*=e,u*=e}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){const o=n[r],s=n[r+1],l=n[r+2],c=n[r+3],u=i[a],d=i[a+1],h=i[a+2],p=i[a+3];return e[t]=o*p+c*u+s*h-l*d,e[t+1]=s*p+c*d+l*u-o*h,e[t+2]=l*p+c*h+o*d-s*u,e[t+3]=c*p-o*u-s*d-l*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(r/2),u=o(i/2),d=s(n/2),h=s(r/2),p=s(i/2);switch(a){case"XYZ":this._x=d*c*u+l*h*p,this._y=l*h*u-d*c*p,this._z=l*c*p+d*h*u,this._w=l*c*u-d*h*p;break;case"YXZ":this._x=d*c*u+l*h*p,this._y=l*h*u-d*c*p,this._z=l*c*p-d*h*u,this._w=l*c*u+d*h*p;break;case"ZXY":this._x=d*c*u-l*h*p,this._y=l*h*u+d*c*p,this._z=l*c*p+d*h*u,this._w=l*c*u-d*h*p;break;case"ZYX":this._x=d*c*u-l*h*p,this._y=l*h*u+d*c*p,this._z=l*c*p-d*h*u,this._w=l*c*u+d*h*p;break;case"YZX":this._x=d*c*u+l*h*p,this._y=l*h*u+d*c*p,this._z=l*c*p-d*h*u,this._w=l*c*u-d*h*p;break;case"XZY":this._x=d*c*u-l*h*p,this._y=l*h*u-d*c*p,this._z=l*c*p+d*h*u,this._w=l*c*u+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],c=t[6],u=t[10],d=n+o+u;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-s)*e,this._y=(i-l)*e,this._z=(a-r)*e}else if(n>o&&n>u){const e=2*Math.sqrt(1+n-o-u);this._w=(c-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-n-u);this._w=(i-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+c)/e}else{const e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+l)/e,this._y=(s+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(mS(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+r*l-i*s,this._y=r*c+a*s+i*o-n*l,this._z=i*c+a*l+n*s-r*o,this._w=a*c-n*o-r*s-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}const l=Math.sqrt(s),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=r*u+this._y*d,this._z=i*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ZS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;ZS.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(tw.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(tw.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=2*(a*r-o*n),c=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*l+a*u-o*c,this.y=n+s*c+o*l-i*u,this.z=r+s*u+i*c-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return ew.copy(this).projectOnVector(e),this.sub(ew)}reflect(e){return this.sub(ew.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(mS(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ew=new ZS,tw=new QS;class nw{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS(1/0,1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS(-1/0,-1/0,-1/0);this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(iw.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(iw.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=iw.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(let t=0,n=r.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,iw):iw.fromBufferAttribute(r,t),iw.applyMatrix4(e.matrixWorld),this.expandByPoint(iw);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),aw.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),aw.copy(n.boundingBox)),aw.applyMatrix4(e.matrixWorld),this.union(aw)}const r=e.children;for(let i=0,a=r.length;i<a;i++)this.expandByObject(r[i],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,iw),iw.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(hw),pw.subVectors(this.max,hw),ow.subVectors(e.a,hw),sw.subVectors(e.b,hw),lw.subVectors(e.c,hw),cw.subVectors(sw,ow),uw.subVectors(lw,sw),dw.subVectors(ow,lw);let t=[0,-cw.z,cw.y,0,-uw.z,uw.y,0,-dw.z,dw.y,cw.z,0,-cw.x,uw.z,0,-uw.x,dw.z,0,-dw.x,-cw.y,cw.x,0,-uw.y,uw.x,0,-dw.y,dw.x,0];return!!gw(t,ow,sw,lw,pw)&&(t=[1,0,0,0,1,0,0,0,1],!!gw(t,ow,sw,lw,pw)&&(fw.crossVectors(cw,uw),t=[fw.x,fw.y,fw.z],gw(t,ow,sw,lw,pw)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,iw).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(iw).length()),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()||(rw[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),rw[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),rw[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),rw[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),rw[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),rw[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),rw[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),rw[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(rw)),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 rw=[new ZS,new ZS,new ZS,new ZS,new ZS,new ZS,new ZS,new ZS],iw=new ZS,aw=new nw,ow=new ZS,sw=new ZS,lw=new ZS,cw=new ZS,uw=new ZS,dw=new ZS,hw=new ZS,pw=new ZS,fw=new ZS,mw=new ZS;function gw(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){mw.fromArray(e,a);const o=i.x*Math.abs(mw.x)+i.y*Math.abs(mw.y)+i.z*Math.abs(mw.z),s=t.dot(mw),l=n.dot(mw),c=r.dot(mw);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>o)return!1}return!0}const vw=new nw,yw=new ZS,bw=new ZS;class xw{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):vw.setFromPoints(e).getCenter(n);let r=0;for(let i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;yw.subVectors(e,this.center);const t=yw.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(yw,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(bw.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(yw.copy(e.center).add(bw)),this.expandByPoint(yw.copy(e.center).sub(bw))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const _w=new ZS,Sw=new ZS,ww=new ZS,Ew=new ZS,Aw=new ZS,Mw=new ZS,Cw=new ZS;class Tw{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS(0,0,-1);this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,_w)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=_w.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(_w.copy(this.origin).addScaledVector(this.direction,t),_w.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Sw.copy(e).add(t).multiplyScalar(.5),ww.copy(t).sub(e).normalize(),Ew.copy(this.origin).sub(Sw);const i=.5*e.distanceTo(t),a=-this.direction.dot(ww),o=Ew.dot(this.direction),s=-Ew.dot(ww),l=Ew.lengthSq(),c=Math.abs(1-a*a);let u,d,h,p;if(c>0)if(u=a*s-o,d=a*o-s,p=i*c,u>=0)if(d>=-p)if(d<=p){const e=1/c;u*=e,d*=e,h=u*(u+a*d+2*o)+d*(a*u+d+2*s)+l}else d=i,u=Math.max(0,-(a*d+o)),h=-u*u+d*(d+2*s)+l;else d=-i,u=Math.max(0,-(a*d+o)),h=-u*u+d*(d+2*s)+l;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),h=-u*u+d*(d+2*s)+l):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),h=d*(d+2*s)+l):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),h=-u*u+d*(d+2*s)+l);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),h=-u*u+d*(d+2*s)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Sw).addScaledVector(ww,d),h}intersectSphere(e,t){_w.subVectors(e.center,this.origin);const n=_w.dot(this.direction),r=_w.dot(_w)-n*n,i=e.radius*e.radius;if(r>i)return null;const a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,r=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,r=(e.min.x-d.x)*l),c>=0?(i=(e.min.y-d.y)*c,a=(e.max.y-d.y)*c):(i=(e.max.y-d.y)*c,a=(e.min.y-d.y)*c),n>a||i>r?null:((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r?null:((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,_w)}intersectTriangle(e,t,n,r,i){Aw.subVectors(t,e),Mw.subVectors(n,e),Cw.crossVectors(Aw,Mw);let a,o=this.direction.dot(Cw);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Ew.subVectors(this.origin,e);const s=a*this.direction.dot(Mw.crossVectors(Ew,Mw));if(s<0)return null;const l=a*this.direction.dot(Aw.cross(Ew));if(l<0)return null;if(s+l>o)return null;const c=-a*Ew.dot(Cw);return c<0?null:this.at(c/o,i)}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 Rw{constructor(e,t,n,r,i,a,o,s,l,c,u,d,h,p,f,m){Rw.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,o,s,l,c,u,d,h,p,f,m)}set(e,t,n,r,i,a,o,s,l,c,u,d,h,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=d,g[3]=h,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Rw).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Pw.setFromMatrixColumn(e,0).length(),i=1/Pw.setFromMatrixColumn(e,1).length(),a=1/Pw.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-o*s,t[2]=i-e*l,t[6]=r+n*l,t[10]=a*s}else if("YXZ"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if("ZXY"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*c,t[9]=i-e*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=s*u,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*u+r,t[10]=e-i*u}else if("XZY"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=a*c,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Iw,e,Dw)}lookAt(e,t,n){const r=this.elements;return Ow.subVectors(e,t),0===Ow.lengthSq()&&(Ow.z=1),Ow.normalize(),Lw.crossVectors(n,Ow),0===Lw.lengthSq()&&(1===Math.abs(n.z)?Ow.x+=1e-4:Ow.z+=1e-4,Ow.normalize(),Lw.crossVectors(n,Ow)),Lw.normalize(),kw.crossVectors(Ow,Lw),r[0]=Lw.x,r[4]=kw.x,r[8]=Ow.x,r[1]=Lw.y,r[5]=kw.y,r[9]=Ow.y,r[2]=Lw.z,r[6]=kw.z,r[10]=Ow.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],d=n[9],h=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],b=n[11],x=n[15],_=r[0],S=r[4],w=r[8],E=r[12],A=r[1],M=r[5],C=r[9],T=r[13],R=r[2],P=r[6],B=r[10],I=r[14],D=r[3],L=r[7],k=r[11],O=r[15];return i[0]=a*_+o*A+s*R+l*D,i[4]=a*S+o*M+s*P+l*L,i[8]=a*w+o*C+s*B+l*k,i[12]=a*E+o*T+s*I+l*O,i[1]=c*_+u*A+d*R+h*D,i[5]=c*S+u*M+d*P+h*L,i[9]=c*w+u*C+d*B+h*k,i[13]=c*E+u*T+d*I+h*O,i[2]=p*_+f*A+m*R+g*D,i[6]=p*S+f*M+m*P+g*L,i[10]=p*w+f*C+m*B+g*k,i[14]=p*E+f*T+m*I+g*O,i[3]=v*_+y*A+b*R+x*D,i[7]=v*S+y*M+b*P+x*L,i[11]=v*w+y*C+b*B+x*k,i[15]=v*E+y*T+b*I+x*O,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],u=e[6],d=e[10],h=e[14];return e[3]*(+i*s*u-r*l*u-i*o*d+n*l*d+r*o*h-n*s*h)+e[7]*(+t*s*h-t*l*d+i*a*d-r*a*h+r*l*c-i*s*c)+e[11]*(+t*l*u-t*o*h-i*a*u+n*a*h+i*o*c-n*l*c)+e[15]*(-r*o*c-t*s*u+t*o*d+r*a*u-n*a*d+n*s*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=u*m*l-f*d*l+f*s*h-o*m*h-u*s*g+o*d*g,y=p*d*l-c*m*l-p*s*h+a*m*h+c*s*g-a*d*g,b=c*f*l-p*u*l+p*o*h-a*f*h-c*o*g+a*u*g,x=p*u*s-c*f*s-p*o*d+a*f*d+c*o*m-a*u*m,_=t*v+n*y+r*b+i*x;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/_;return e[0]=v*S,e[1]=(f*d*i-u*m*i-f*r*h+n*m*h+u*r*g-n*d*g)*S,e[2]=(o*m*i-f*s*i+f*r*l-n*m*l-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*l+n*d*l+o*r*h-n*s*h)*S,e[4]=y*S,e[5]=(c*m*i-p*d*i+p*r*h-t*m*h-c*r*g+t*d*g)*S,e[6]=(p*s*i-a*m*i-p*r*l+t*m*l+a*r*g-t*s*g)*S,e[7]=(a*d*i-c*s*i+c*r*l-t*d*l-a*r*h+t*s*h)*S,e[8]=b*S,e[9]=(p*u*i-c*f*i-p*n*h+t*f*h+c*n*g-t*u*g)*S,e[10]=(a*f*i-p*o*i+p*n*l-t*f*l-a*n*g+t*o*g)*S,e[11]=(c*o*i-a*u*i-c*n*l+t*u*l+a*n*h-t*o*h)*S,e[12]=x*S,e[13]=(c*f*r-p*u*r+p*n*d-t*f*d-c*n*m+t*u*m)*S,e[14]=(p*o*r-a*f*r-p*n*s+t*f*s+a*n*m-t*o*m)*S,e[15]=(a*u*r-c*o*r+c*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,c=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,c*o+n,c*s-r*a,0,l*s-r*o,c*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,c=a+a,u=o+o,d=i*l,h=i*c,p=i*u,f=a*c,m=a*u,g=o*u,v=s*l,y=s*c,b=s*u,x=n.x,_=n.y,S=n.z;return r[0]=(1-(f+g))*x,r[1]=(h+b)*x,r[2]=(p-y)*x,r[3]=0,r[4]=(h-b)*_,r[5]=(1-(d+g))*_,r[6]=(m+v)*_,r[7]=0,r[8]=(p+y)*S,r[9]=(m-v)*S,r[10]=(1-(d+f))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=Pw.set(r[0],r[1],r[2]).length();const a=Pw.set(r[4],r[5],r[6]).length(),o=Pw.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Bw.copy(this);const s=1/i,l=1/a,c=1/o;return Bw.elements[0]*=s,Bw.elements[1]*=s,Bw.elements[2]*=s,Bw.elements[4]*=l,Bw.elements[5]*=l,Bw.elements[6]*=l,Bw.elements[8]*=c,Bw.elements[9]*=c,Bw.elements[10]*=c,t.setFromRotationMatrix(Bw),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a){let o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:sS;const s=this.elements,l=2*i/(t-e),c=2*i/(n-r),u=(t+e)/(t-e),d=(n+r)/(n-r);let h,p;if(o===sS)h=-(a+i)/(a-i),p=-2*a*i/(a-i);else{if(o!==lS)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);h=-a/(a-i),p=-a*i/(a-i)}return s[0]=l,s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=c,s[9]=d,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=p,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,n,r,i,a){let o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:sS;const s=this.elements,l=1/(t-e),c=1/(n-r),u=1/(a-i),d=(t+e)*l,h=(n+r)*c;let p,f;if(o===sS)p=(a+i)*u,f=-2*u;else{if(o!==lS)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);p=i*u,f=-1*u}return s[0]=2*l,s[4]=0,s[8]=0,s[12]=-d,s[1]=0,s[5]=2*c,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=f,s[14]=-p,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Pw=new ZS,Bw=new Rw,Iw=new ZS(0,0,0),Dw=new ZS(1,1,1),Lw=new ZS,kw=new ZS,Ow=new ZS,Nw=new Rw,Fw=new QS;class Uw{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Uw.DEFAULT_ORDER;this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],l=r[5],c=r[9],u=r[2],d=r[6],h=r[10];switch(t){case"XYZ":this._y=Math.asin(mS(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,h),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-mS(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,h),this._z=Math.atan2(s,l)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(mS(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,h),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-mS(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(mS(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,h));break;case"XZY":this._z=Math.asin(-mS(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-c,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Nw.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Nw,t,n)}setFromVector3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}reorder(e){return Fw.setFromEuler(this),this.setFromQuaternion(Fw,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],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Uw.DEFAULT_ORDER="XYZ";class zw{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return 0!==(this.mask&e.mask)}isEnabled(e){return 0!==(this.mask&1<<e)}}let Hw=0;const Gw=new ZS,jw=new QS,Vw=new Rw,Ww=new ZS,Xw=new ZS,Jw=new ZS,$w=new QS,Kw=new ZS(1,0,0),Yw=new ZS(0,1,0),qw=new ZS(0,0,1),Qw={type:"added"},Zw={type:"removed"},eE={type:"childadded",child:null},tE={type:"childremoved",child:null};class nE extends cS{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Hw++}),this.uuid=fS(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=nE.DEFAULT_UP.clone();const e=new ZS,t=new Uw,n=new QS,r=new ZS(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Rw},normalMatrix:{value:new SS}}),this.matrix=new Rw,this.matrixWorld=new Rw,this.matrixAutoUpdate=nE.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=nE.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new zw,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return jw.setFromAxisAngle(e,t),this.quaternion.multiply(jw),this}rotateOnWorldAxis(e,t){return jw.setFromAxisAngle(e,t),this.quaternion.premultiply(jw),this}rotateX(e){return this.rotateOnAxis(Kw,e)}rotateY(e){return this.rotateOnAxis(Yw,e)}rotateZ(e){return this.rotateOnAxis(qw,e)}translateOnAxis(e,t){return Gw.copy(e).applyQuaternion(this.quaternion),this.position.add(Gw.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Kw,e)}translateY(e){return this.translateOnAxis(Yw,e)}translateZ(e){return this.translateOnAxis(qw,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Vw.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ww.copy(e):Ww.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Xw.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Vw.lookAt(Xw,Ww,this.up):Vw.lookAt(Ww,Xw,this.up),this.quaternion.setFromRotationMatrix(Vw),r&&(Vw.extractRotation(r.matrixWorld),jw.setFromRotationMatrix(Vw),this.quaternion.premultiply(jw.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Qw),eE.child=e,this.dispatchEvent(eE),eE.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Zw),tE.child=e,this.dispatchEvent(tE),tE.child=null),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Vw.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Vw.multiply(e.parent.matrixWorld)),e.applyMatrix4(Vw),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Qw),eE.child=e,this.dispatchEvent(eE),eE.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getObjectsByProperty(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&n.push(this);const r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xw,e,Jw),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xw,$w,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++){t[n].updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){e[t].updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"===typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map((e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}))),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),l=a(e.skeletons),c=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let n=0;n<e.children.length;n++){const t=e.children[n];this.add(t.clone())}return this}}nE.DEFAULT_UP=new ZS(0,1,0),nE.DEFAULT_MATRIX_AUTO_UPDATE=!0,nE.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const rE=new ZS,iE=new ZS,aE=new ZS,oE=new ZS,sE=new ZS,lE=new ZS,cE=new ZS,uE=new ZS,dE=new ZS,hE=new ZS;class pE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ZS;this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),rE.subVectors(e,t),r.cross(rE);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){rE.subVectors(r,t),iE.subVectors(n,t),aE.subVectors(e,t);const a=rE.dot(rE),o=rE.dot(iE),s=rE.dot(aE),l=iE.dot(iE),c=iE.dot(aE),u=a*l-o*o;if(0===u)return i.set(0,0,0),null;const d=1/u,h=(l*s-o*c)*d,p=(a*c-o*s)*d;return i.set(1-h-p,p,h)}static containsPoint(e,t,n,r){return null!==this.getBarycoord(e,t,n,r,oE)&&(oE.x>=0&&oE.y>=0&&oE.x+oE.y<=1)}static getInterpolation(e,t,n,r,i,a,o,s){return null===this.getBarycoord(e,t,n,r,oE)?(s.x=0,s.y=0,"z"in s&&(s.z=0),"w"in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,oE.x),s.addScaledVector(a,oE.y),s.addScaledVector(o,oE.z),s)}static isFrontFacing(e,t,n,r){return rE.subVectors(n,t),iE.subVectors(e,t),rE.cross(iE).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return rE.subVectors(this.c,this.b),iE.subVectors(this.a,this.b),.5*rE.cross(iE).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return pE.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return pE.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,i){return pE.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return pE.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return pE.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let a,o;sE.subVectors(r,n),lE.subVectors(i,n),uE.subVectors(e,n);const s=sE.dot(uE),l=lE.dot(uE);if(s<=0&&l<=0)return t.copy(n);dE.subVectors(e,r);const c=sE.dot(dE),u=lE.dot(dE);if(c>=0&&u<=c)return t.copy(r);const d=s*u-c*l;if(d<=0&&s>=0&&c<=0)return a=s/(s-c),t.copy(n).addScaledVector(sE,a);hE.subVectors(e,i);const h=sE.dot(hE),p=lE.dot(hE);if(p>=0&&h<=p)return t.copy(i);const f=h*l-s*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),t.copy(n).addScaledVector(lE,o);const m=c*p-h*u;if(m<=0&&u-c>=0&&h-p>=0)return cE.subVectors(i,r),o=(u-c)/(u-c+(h-p)),t.copy(r).addScaledVector(cE,o);const g=1/(m+f+d);return a=f*g,o=d*g,t.copy(n).addScaledVector(sE,a).addScaledVector(lE,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const fE={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},mE={h:0,s:0,l:0},gE={h:0,s:0,l:0};function vE(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}class yE{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const t=e;t&&t.isColor?this.copy(t):"number"===typeof t?this.setHex(t):"string"===typeof t&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y_;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,kS.toWorkingColorSpace(this,t),this}setRGB(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:kS.workingColorSpace;return this.r=e,this.g=t,this.b=n,kS.toWorkingColorSpace(this,r),this}setHSL(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:kS.workingColorSpace;if(e=gS(e,1),t=mS(t,0,1),n=mS(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=vE(i,r,e+1/3),this.g=vE(i,r,e),this.b=vE(i,r,e-1/3)}return kS.toWorkingColorSpace(this,r),this}setStyle(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y_;function r(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const a=t[1],o=t[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,n);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,n);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=t[1],i=r.length;if(3===i)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,n);if(6===i)return this.setHex(parseInt(r,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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y_;const n=fE[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=OS(e.r),this.g=OS(e.g),this.b=OS(e.b),this}copyLinearToSRGB(e){return this.r=NS(e.r),this.g=NS(e.g),this.b=NS(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y_;return kS.fromWorkingColorSpace(bE.copy(this),e),65536*Math.round(mS(255*bE.r,0,255))+256*Math.round(mS(255*bE.g,0,255))+Math.round(mS(255*bE.b,0,255))}getHexString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y_;return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kS.workingColorSpace;kS.fromWorkingColorSpace(bE.copy(this),t);const n=bE.r,r=bE.g,i=bE.b,a=Math.max(n,r,i),o=Math.min(n,r,i);let s,l;const c=(o+a)/2;if(o===a)s=0,l=0;else{const e=a-o;switch(l=c<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4}s/=6}return e.h=s,e.s=l,e.l=c,e}getRGB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kS.workingColorSpace;return kS.fromWorkingColorSpace(bE.copy(this),t),e.r=bE.r,e.g=bE.g,e.b=bE.b,e}getStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y_;kS.fromWorkingColorSpace(bE.copy(this),e);const t=bE.r,n=bE.g,r=bE.b;return e!==y_?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(e,t,n){return this.getHSL(mE),this.setHSL(mE.h+e,mE.s+t,mE.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(mE),e.getHSL(gE);const n=vS(mE.h,gE.h,t),r=vS(mE.s,gE.s,t),i=vS(mE.l,gE.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const bE=new yE;yE.NAMES=fE;let xE=0;class _E extends cS{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:xE++}),this.uuid=fS(),this.name="",this.type="Material",this.blending=Ny,this.side=Dy,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=qy,this.blendDst=Qy,this.blendEquation=Gy,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new yE(0,0,0),this.blendAlpha=0,this.depthFunc=db,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=H_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=C_,this.stencilZFail=C_,this.stencilZPass=C_,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!==e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"===typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Ny&&(n.blending=this.blending),this.side!==Dy&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==qy&&(n.blendSrc=this.blendSrc),this.blendDst!==Qy&&(n.blendDst=this.blendDst),this.blendEquation!==Gy&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==db&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==H_&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==C_&&(n.stencilFail=this.stencilFail),this.stencilZFail!==C_&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==C_&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class SE extends _E{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new yE(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Uw,this.combine=gb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const wE=EE();function EE(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const e=l-127;e<-27?(r[l]=0,r[256|l]=32768,i[l]=24,i[256|l]=24):e<-14?(r[l]=1024>>-e-14,r[256|l]=1024>>-e-14|32768,i[l]=-e-1,i[256|l]=-e-1):e<=15?(r[l]=e+15<<10,r[256|l]=e+15<<10|32768,i[l]=13,i[256|l]=13):e<128?(r[l]=31744,r[256|l]=64512,i[l]=24,i[256|l]=24):(r[l]=31744,r[256|l]=64512,i[l]=13,i[256|l]=13)}const a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let l=1;l<1024;++l){let e=l<<13,t=0;for(;0===(8388608&e);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,a[l]=e|t}for(let l=1024;l<2048;++l)a[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)32!==l&&(s[l]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function AE(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=mS(e,-65504,65504),wE.floatView[0]=e;const t=wE.uint32View[0],n=t>>23&511;return wE.baseTable[n]+((8388607&t)>>wE.shiftTable[n])}function ME(e){const t=e>>10;return wE.uint32View[0]=wE.mantissaTable[wE.offsetTable[t]+(1023&e)]+wE.exponentTable[t],wE.floatView[0]}const CE={toHalfFloat:AE,fromHalfFloat:ME},TE=new ZS,RE=new _S;class PE{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=Y_,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ex,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return PS("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)RE.fromBufferAttribute(this,t),RE.applyMatrix3(e),this.setXY(t,RE.x,RE.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)TE.fromBufferAttribute(this,t),TE.applyMatrix3(e),this.setXYZ(t,TE.x,TE.y,TE.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)TE.fromBufferAttribute(this,t),TE.applyMatrix4(e),this.setXYZ(t,TE.x,TE.y,TE.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)TE.fromBufferAttribute(this,t),TE.applyNormalMatrix(e),this.setXYZ(t,TE.x,TE.y,TE.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)TE.fromBufferAttribute(this,t),TE.transformDirection(e),this.setXYZ(t,TE.x,TE.y,TE.z);return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=yS(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=bS(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=yS(t,this.array)),t}setX(e,t){return this.normalized&&(t=bS(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=yS(t,this.array)),t}setY(e,t){return this.normalized&&(t=bS(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=yS(t,this.array)),t}setZ(e,t){return this.normalized&&(t=bS(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=yS(t,this.array)),t}setW(e,t){return this.normalized&&(t=bS(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=bS(t,this.array),n=bS(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=bS(t,this.array),n=bS(n,this.array),r=bS(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=bS(t,this.array),n=bS(n,this.array),r=bS(r,this.array),i=bS(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Y_&&(e.usage=this.usage),e}}class BE extends PE{constructor(e,t,n){super(new Int8Array(e),t,n)}}class IE extends PE{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class DE extends PE{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class LE extends PE{constructor(e,t,n){super(new Int16Array(e),t,n)}}class kE extends PE{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class OE extends PE{constructor(e,t,n){super(new Int32Array(e),t,n)}}class NE extends PE{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class FE extends PE{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=ME(this.array[e*this.itemSize]);return this.normalized&&(t=yS(t,this.array)),t}setX(e,t){return this.normalized&&(t=bS(t,this.array)),this.array[e*this.itemSize]=AE(t),this}getY(e){let t=ME(this.array[e*this.itemSize+1]);return this.normalized&&(t=yS(t,this.array)),t}setY(e,t){return this.normalized&&(t=bS(t,this.array)),this.array[e*this.itemSize+1]=AE(t),this}getZ(e){let t=ME(this.array[e*this.itemSize+2]);return this.normalized&&(t=yS(t,this.array)),t}setZ(e,t){return this.normalized&&(t=bS(t,this.array)),this.array[e*this.itemSize+2]=AE(t),this}getW(e){let t=ME(this.array[e*this.itemSize+3]);return this.normalized&&(t=yS(t,this.array)),t}setW(e,t){return this.normalized&&(t=bS(t,this.array)),this.array[e*this.itemSize+3]=AE(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=bS(t,this.array),n=bS(n,this.array)),this.array[e+0]=AE(t),this.array[e+1]=AE(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=bS(t,this.array),n=bS(n,this.array),r=bS(r,this.array)),this.array[e+0]=AE(t),this.array[e+1]=AE(n),this.array[e+2]=AE(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=bS(t,this.array),n=bS(n,this.array),r=bS(r,this.array),i=bS(i,this.array)),this.array[e+0]=AE(t),this.array[e+1]=AE(n),this.array[e+2]=AE(r),this.array[e+3]=AE(i),this}}class UE extends PE{constructor(e,t,n){super(new Float32Array(e),t,n)}}let zE=0;const HE=new Rw,GE=new nE,jE=new ZS,VE=new nw,WE=new nw,XE=new ZS;class JE extends cS{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:zE++}),this.uuid=fS(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(ES(e)?NE:kE)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new SS).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return HE.makeRotationFromQuaternion(e),this.applyMatrix4(HE),this}rotateX(e){return HE.makeRotationX(e),this.applyMatrix4(HE),this}rotateY(e){return HE.makeRotationY(e),this.applyMatrix4(HE),this}rotateZ(e){return HE.makeRotationZ(e),this.applyMatrix4(HE),this}translate(e,t,n){return HE.makeTranslation(e,t,n),this.applyMatrix4(HE),this}scale(e,t,n){return HE.makeScale(e,t,n),this.applyMatrix4(HE),this}lookAt(e){return GE.lookAt(e),GE.updateMatrix(),this.applyMatrix4(GE.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(jE).negate(),this.translate(jE.x,jE.y,jE.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new UE(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new nw);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new ZS(-1/0,-1/0,-1/0),new ZS(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const e=t[n];VE.setFromBufferAttribute(e),this.morphTargetsRelative?(XE.addVectors(this.boundingBox.min,VE.min),this.boundingBox.expandByPoint(XE),XE.addVectors(this.boundingBox.max,VE.max),this.boundingBox.expandByPoint(XE)):(this.boundingBox.expandByPoint(VE.min),this.boundingBox.expandByPoint(VE.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new xw);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new ZS,1/0);if(e){const n=this.boundingSphere.center;if(VE.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const n=t[e];WE.setFromBufferAttribute(n),this.morphTargetsRelative?(XE.addVectors(VE.min,WE.min),VE.expandByPoint(XE),XE.addVectors(VE.max,WE.max),VE.expandByPoint(XE)):(VE.expandByPoint(WE.min),VE.expandByPoint(WE.max))}VE.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)XE.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(XE));if(t)for(let i=0,a=t.length;i<a;i++){const a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)XE.fromBufferAttribute(a,t),o&&(jE.fromBufferAttribute(e,t),XE.add(jE)),r=Math.max(r,n.distanceToSquared(XE))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.position,r=t.normal,i=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new PE(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],s=[];for(let w=0;w<n.count;w++)o[w]=new ZS,s[w]=new ZS;const l=new ZS,c=new ZS,u=new ZS,d=new _S,h=new _S,p=new _S,f=new ZS,m=new ZS;function g(e,t,r){l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),h.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),c.sub(l),u.sub(l),h.sub(d),p.sub(d);const a=1/(h.x*p.y-p.x*h.y);isFinite(a)&&(f.copy(c).multiplyScalar(p.y).addScaledVector(u,-h.y).multiplyScalar(a),m.copy(u).multiplyScalar(h.x).addScaledVector(c,-p.x).multiplyScalar(a),o[e].add(f),o[t].add(f),o[r].add(f),s[e].add(m),s[t].add(m),s[r].add(m))}let v=this.groups;0===v.length&&(v=[{start:0,count:e.count}]);for(let w=0,E=v.length;w<E;++w){const t=v[w],n=t.start;for(let r=n,i=n+t.count;r<i;r+=3)g(e.getX(r+0),e.getX(r+1),e.getX(r+2))}const y=new ZS,b=new ZS,x=new ZS,_=new ZS;function S(e){x.fromBufferAttribute(r,e),_.copy(x);const t=o[e];y.copy(t),y.sub(x.multiplyScalar(x.dot(t))).normalize(),b.crossVectors(_,t);const n=b.dot(s[e])<0?-1:1;a.setXYZW(e,y.x,y.y,y.z,n)}for(let w=0,E=v.length;w<E;++w){const t=v[w],n=t.start;for(let r=n,i=n+t.count;r<i;r+=3)S(e.getX(r+0)),S(e.getX(r+1)),S(e.getX(r+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new PE(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new ZS,i=new ZS,a=new ZS,o=new ZS,s=new ZS,l=new ZS,c=new ZS,u=new ZS;if(e)for(let d=0,h=e.count;d<h;d+=3){const h=e.getX(d+0),p=e.getX(d+1),f=e.getX(d+2);r.fromBufferAttribute(t,h),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),c.subVectors(a,i),u.subVectors(r,i),c.cross(u),o.fromBufferAttribute(n,h),s.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),o.add(c),s.add(c),l.add(c),n.setXYZ(h,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,d=t.count;e<d;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,i),u.subVectors(r,i),c.cross(u),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)XE.fromBufferAttribute(e,t),XE.normalize(),e.setXYZ(t,XE.x,XE.y,XE.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r);let o=0,s=0;for(let l=0,c=t.length;l<c;l++){o=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new PE(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new JE,n=this.index.array,r=this.attributes;for(const o in r){const i=e(r[o],n);t.setAttribute(o,i)}const i=this.morphAttributes;for(const o in i){const r=[],a=i[o];for(let t=0,i=a.length;t<i;t++){const i=e(a[t],n);r.push(i)}t.morphAttributes[o]=r}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,s=a.length;o<s;o++){const e=a[o];t.addGroup(e.start,e.count,e.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const s in n){const t=n[s];e.data.attributes[s]=t.toJSON(e.data)}const r={};let i=!1;for(const s in this.morphAttributes){const t=this.morphAttributes[s],n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];n.push(i.toJSON(e.data))}n.length>0&&(r[s]=n,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const l in r){const e=r[l];this.setAttribute(l,e.clone(t))}const i=e.morphAttributes;for(const l in i){const e=[],n=i[l];for(let r=0,i=n.length;r<i;r++)e.push(n[r].clone(t));this.morphAttributes[l]=e}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let l=0,c=a.length;l<c;l++){const e=a[l];this.addGroup(e.start,e.count,e.materialIndex)}const o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());const s=e.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const $E=new Rw,KE=new Tw,YE=new xw,qE=new ZS,QE=new ZS,ZE=new ZS,eA=new ZS,tA=new ZS,nA=new ZS,rA=new _S,iA=new _S,aA=new _S,oA=new ZS,sA=new ZS,lA=new ZS,cA=new ZS,uA=new ZS;class dA extends nE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new JE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new SE;super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(i&&o){nA.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=o[n],s=i[n];0!==r&&(tA.fromBufferAttribute(s,e),a?nA.addScaledVector(tA,r):nA.addScaledVector(tA.sub(t),r))}t.add(nA)}return t}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),YE.copy(n.boundingSphere),YE.applyMatrix4(i),KE.copy(e.ray).recast(e.near),!1===YE.containsPoint(KE.origin)){if(null===KE.intersectSphere(YE,qE))return;if(KE.origin.distanceToSquared(qE)>(e.far-e.near)**2)return}$E.copy(i).invert(),KE.copy(e.ray).applyMatrix4($E),null!==n.boundingBox&&!1===KE.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,KE)}}_computeIntersections(e,t,n){let r;const i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,l=i.attributes.uv,c=i.attributes.uv1,u=i.attributes.normal,d=i.groups,h=i.drawRange;if(null!==o)if(Array.isArray(a))for(let p=0,f=d.length;p<f;p++){const i=d[p],s=a[i.materialIndex];for(let a=Math.max(i.start,h.start),d=Math.min(o.count,Math.min(i.start+i.count,h.start+h.count));a<d;a+=3){r=hA(this,s,e,n,l,c,u,o.getX(a),o.getX(a+1),o.getX(a+2)),r&&(r.faceIndex=Math.floor(a/3),r.face.materialIndex=i.materialIndex,t.push(r))}}else{for(let i=Math.max(0,h.start),s=Math.min(o.count,h.start+h.count);i<s;i+=3){r=hA(this,a,e,n,l,c,u,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),t.push(r))}}else if(void 0!==s)if(Array.isArray(a))for(let p=0,f=d.length;p<f;p++){const i=d[p],o=a[i.materialIndex];for(let a=Math.max(i.start,h.start),d=Math.min(s.count,Math.min(i.start+i.count,h.start+h.count));a<d;a+=3){r=hA(this,o,e,n,l,c,u,a,a+1,a+2),r&&(r.faceIndex=Math.floor(a/3),r.face.materialIndex=i.materialIndex,t.push(r))}}else{for(let i=Math.max(0,h.start),o=Math.min(s.count,h.start+h.count);i<o;i+=3){r=hA(this,a,e,n,l,c,u,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),t.push(r))}}}}function hA(e,t,n,r,i,a,o,s,l,c){e.getVertexPosition(s,QE),e.getVertexPosition(l,ZE),e.getVertexPosition(c,eA);const u=function(e,t,n,r,i,a,o,s){let l;if(l=t.side===Ly?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===Dy,s),null===l)return null;uA.copy(s),uA.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(uA);return c<n.near||c>n.far?null:{distance:c,point:uA.clone(),object:e}}(e,t,n,r,QE,ZE,eA,cA);if(u){i&&(rA.fromBufferAttribute(i,s),iA.fromBufferAttribute(i,l),aA.fromBufferAttribute(i,c),u.uv=pE.getInterpolation(cA,QE,ZE,eA,rA,iA,aA,new _S)),a&&(rA.fromBufferAttribute(a,s),iA.fromBufferAttribute(a,l),aA.fromBufferAttribute(a,c),u.uv1=pE.getInterpolation(cA,QE,ZE,eA,rA,iA,aA,new _S)),o&&(oA.fromBufferAttribute(o,s),sA.fromBufferAttribute(o,l),lA.fromBufferAttribute(o,c),u.normal=pE.getInterpolation(cA,QE,ZE,eA,oA,sA,lA,new ZS),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const e={a:s,b:l,c:c,normal:new ZS,materialIndex:0};pE.getNormal(QE,ZE,eA,e.normal),u.face=e}return u}class pA extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};const o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);const s=[],l=[],c=[],u=[];let d=0,h=0;function p(e,t,n,r,i,a,p,f,m,g,v){const y=a/m,b=p/g,x=a/2,_=p/2,S=f/2,w=m+1,E=g+1;let A=0,M=0;const C=new ZS;for(let o=0;o<E;o++){const a=o*b-_;for(let s=0;s<w;s++){const d=s*y-x;C[e]=d*r,C[t]=a*i,C[n]=S,l.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[n]=f>0?1:-1,c.push(C.x,C.y,C.z),u.push(s/m),u.push(1-o/g),A+=1}}for(let o=0;o<g;o++)for(let e=0;e<m;e++){const t=d+e+w*o,n=d+e+w*(o+1),r=d+(e+1)+w*(o+1),i=d+(e+1)+w*o;s.push(t,n,i),s.push(n,r,i),M+=6}o.addGroup(h,M,v),h+=M,d+=A}p("z","y","x",-1,-1,n,t,e,a,i,0),p("z","y","x",1,-1,n,t,-e,a,i,1),p("x","z","y",1,1,e,n,t,r,a,2),p("x","z","y",1,-1,e,n,-t,r,a,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new UE(l,3)),this.setAttribute("normal",new UE(c,3)),this.setAttribute("uv",new UE(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new pA(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function fA(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][r]=null):t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function mA(e){const t={};for(let n=0;n<e.length;n++){const r=fA(e[n]);for(const e in r)t[e]=r[e]}return t}function gA(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:kS.workingColorSpace}const vA={clone:fA,merge:mA};class yA extends _E{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=fA(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)!0===this.extensions[r]&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class bA extends nE{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Rw,this.projectionMatrix=new Rw,this.projectionMatrixInverse=new Rw,this.coordinateSystem=sS}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const xA=new ZS,_A=new _S,SA=new _S;class wA extends bA{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*pS*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*hS*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*pS*Math.atan(Math.tan(.5*hS*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){xA.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(xA.x,xA.y).multiplyScalar(-e/xA.z),xA.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(xA.x,xA.y).multiplyScalar(-e/xA.z)}getViewSize(e,t){return this.getViewBounds(e,_A,SA),t.subVectors(SA,_A)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*hS*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}const o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const EA=-90;class AA extends nE{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new wA(EA,1,e,t);r.layers=this.layers,this.add(r);const i=new wA(EA,1,e,t);i.layers=this.layers,this.add(i);const a=new wA(EA,1,e,t);a.layers=this.layers,this.add(a);const o=new wA(EA,1,e,t);o.layers=this.layers,this.add(o);const s=new wA(EA,1,e,t);s.layers=this.layers,this.add(s);const l=new wA(EA,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(const l of t)this.remove(l);if(e===sS)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else{if(e!==lS)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1)}for(const l of t)this.add(l),l.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,a,o,s,l,c]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,o),e.setRenderTarget(n,3,r),e.render(t,s),e.setRenderTarget(n,4,r),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,r),e.render(t,c),e.setRenderTarget(u,d,h),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class MA extends VS{constructor(e,t,n,r,i,a,o,s,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:Pb,n,r,i,a,o,s,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class CA extends JS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new MA(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:jb}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new pA(5,5,5),i=new yA({name:"CubemapFromEquirect",uniforms:fA(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Ly,blending:Oy});i.uniforms.tEquirect.value=t;const a=new dA(r,i),o=t.minFilter;t.minFilter===Xb&&(t.minFilter=jb);return new AA(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(i)}}const TA=new ZS,RA=new ZS,PA=new SS;class BA{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS(1,0,0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=TA.subVectors(n,t).cross(RA.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(TA),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||PA.getNormalMatrix(e),r=this.coplanarPoint(TA).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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 IA=new xw,DA=new ZS;class LA{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new BA,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new BA,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new BA,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new BA,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new BA,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new BA;this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sS;const n=this.planes,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],c=r[5],u=r[6],d=r[7],h=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],b=r[15];if(n[0].setComponents(s-i,d-l,m-h,b-g).normalize(),n[1].setComponents(s+i,d+l,m+h,b+g).normalize(),n[2].setComponents(s+a,d+c,m+p,b+v).normalize(),n[3].setComponents(s-a,d-c,m-p,b-v).normalize(),n[4].setComponents(s-o,d-u,m-f,b-y).normalize(),t===sS)n[5].setComponents(s+o,d+u,m+f,b+y).normalize();else{if(t!==lS)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(o,u,f,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),IA.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),IA.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(IA)}intersectsSprite(e){return IA.center.set(0,0,0),IA.radius=.7071067811865476,IA.applyMatrix4(e.matrixWorld),this.intersectsSphere(IA)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(DA.x=r.normal.x>0?e.max.x:e.min.x,DA.y=r.normal.y>0?e.max.y:e.min.y,DA.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(DA)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function kA(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function OA(e){const t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))},update:function(n,r){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){const e=t.get(n);return void((!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}const i=t.get(n);if(void 0===i)t.set(n,function(t,n){const r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();let s;if(e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback(),r instanceof Float32Array)s=e.FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);s=e.UNSIGNED_BYTE}return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}(n,r));else if(i.version<n.version){if(i.size!==n.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,n,r){const i=n.array,a=n._updateRange,o=n.updateRanges;if(e.bindBuffer(r,t),-1===a.count&&0===o.length&&e.bufferSubData(r,0,i),0!==o.length){for(let t=0,n=o.length;t<n;t++){const n=o[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}-1!==a.count&&(e.bufferSubData(r,a.offset*i.BYTES_PER_ELEMENT,i,a.offset,a.count),a.count=-1),n.onUploadCallback()}(i.buffer,n,r),i.version=n.version}}}}class NA extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),l=o+1,c=s+1,u=e/o,d=t/s,h=[],p=[],f=[],m=[];for(let g=0;g<c;g++){const e=g*d-a;for(let t=0;t<l;t++){const n=t*u-i;p.push(n,-e,0),f.push(0,0,1),m.push(t/o),m.push(1-g/s)}}for(let g=0;g<s;g++)for(let e=0;e<o;e++){const t=e+l*g,n=e+l*(g+1),r=e+1+l*(g+1),i=e+1+l*g;h.push(t,n,i),h.push(n,r,i)}this.setIndex(h),this.setAttribute("position",new UE(p,3)),this.setAttribute("normal",new UE(f,3)),this.setAttribute("uv",new UE(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new NA(e.width,e.height,e.widthSegments,e.heightSegments)}}const FA={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,  0.0556434,\n\t\t-1.5371385,  1.8760108, -0.2040259,\n\t\t-0.4985314,  0.0415560,  1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn 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 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid 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 ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid 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 ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid 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 ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n    float x2 = x * x;\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat 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 ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid 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 ) {\n#else\nvoid 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 ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid 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 ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid 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 ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = 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 );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = 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 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},UA={common:{diffuse:{value:new yE(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new SS},alphaMap:{value:null},alphaMapTransform:{value:new SS},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new SS}},envmap:{envMap:{value:null},envMapRotation:{value:new SS},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new SS}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new SS}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new SS},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new SS},normalScale:{value:new _S(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new SS},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new SS}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new SS}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new SS}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new yE(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new yE(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new SS},alphaTest:{value:0},uvTransform:{value:new SS}},sprite:{diffuse:{value:new yE(16777215)},opacity:{value:1},center:{value:new _S(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new SS},alphaMap:{value:null},alphaMapTransform:{value:new SS},alphaTest:{value:0}}},zA={basic:{uniforms:mA([UA.common,UA.specularmap,UA.envmap,UA.aomap,UA.lightmap,UA.fog]),vertexShader:FA.meshbasic_vert,fragmentShader:FA.meshbasic_frag},lambert:{uniforms:mA([UA.common,UA.specularmap,UA.envmap,UA.aomap,UA.lightmap,UA.emissivemap,UA.bumpmap,UA.normalmap,UA.displacementmap,UA.fog,UA.lights,{emissive:{value:new yE(0)}}]),vertexShader:FA.meshlambert_vert,fragmentShader:FA.meshlambert_frag},phong:{uniforms:mA([UA.common,UA.specularmap,UA.envmap,UA.aomap,UA.lightmap,UA.emissivemap,UA.bumpmap,UA.normalmap,UA.displacementmap,UA.fog,UA.lights,{emissive:{value:new yE(0)},specular:{value:new yE(1118481)},shininess:{value:30}}]),vertexShader:FA.meshphong_vert,fragmentShader:FA.meshphong_frag},standard:{uniforms:mA([UA.common,UA.envmap,UA.aomap,UA.lightmap,UA.emissivemap,UA.bumpmap,UA.normalmap,UA.displacementmap,UA.roughnessmap,UA.metalnessmap,UA.fog,UA.lights,{emissive:{value:new yE(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:FA.meshphysical_vert,fragmentShader:FA.meshphysical_frag},toon:{uniforms:mA([UA.common,UA.aomap,UA.lightmap,UA.emissivemap,UA.bumpmap,UA.normalmap,UA.displacementmap,UA.gradientmap,UA.fog,UA.lights,{emissive:{value:new yE(0)}}]),vertexShader:FA.meshtoon_vert,fragmentShader:FA.meshtoon_frag},matcap:{uniforms:mA([UA.common,UA.bumpmap,UA.normalmap,UA.displacementmap,UA.fog,{matcap:{value:null}}]),vertexShader:FA.meshmatcap_vert,fragmentShader:FA.meshmatcap_frag},points:{uniforms:mA([UA.points,UA.fog]),vertexShader:FA.points_vert,fragmentShader:FA.points_frag},dashed:{uniforms:mA([UA.common,UA.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:FA.linedashed_vert,fragmentShader:FA.linedashed_frag},depth:{uniforms:mA([UA.common,UA.displacementmap]),vertexShader:FA.depth_vert,fragmentShader:FA.depth_frag},normal:{uniforms:mA([UA.common,UA.bumpmap,UA.normalmap,UA.displacementmap,{opacity:{value:1}}]),vertexShader:FA.meshnormal_vert,fragmentShader:FA.meshnormal_frag},sprite:{uniforms:mA([UA.sprite,UA.fog]),vertexShader:FA.sprite_vert,fragmentShader:FA.sprite_frag},background:{uniforms:{uvTransform:{value:new SS},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:FA.background_vert,fragmentShader:FA.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new SS}},vertexShader:FA.backgroundCube_vert,fragmentShader:FA.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:FA.cube_vert,fragmentShader:FA.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:FA.equirect_vert,fragmentShader:FA.equirect_frag},distanceRGBA:{uniforms:mA([UA.common,UA.displacementmap,{referencePosition:{value:new ZS},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:FA.distanceRGBA_vert,fragmentShader:FA.distanceRGBA_frag},shadow:{uniforms:mA([UA.lights,UA.fog,{color:{value:new yE(0)},opacity:{value:1}}]),vertexShader:FA.shadow_vert,fragmentShader:FA.shadow_frag}};zA.physical={uniforms:mA([zA.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new SS},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new SS},clearcoatNormalScale:{value:new _S(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new SS},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new SS},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new SS},sheen:{value:0},sheenColor:{value:new yE(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new SS},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new SS},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new SS},transmissionSamplerSize:{value:new _S},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new SS},attenuationDistance:{value:0},attenuationColor:{value:new yE(0)},specularColor:{value:new yE(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new SS},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new SS},anisotropyVector:{value:new _S},anisotropyMap:{value:null},anisotropyMapTransform:{value:new SS}}]),vertexShader:FA.meshphysical_vert,fragmentShader:FA.meshphysical_frag};const HA={r:0,b:0,g:0},GA=new Uw,jA=new Rw;function VA(e,t,n,r,i,a,o){const s=new yE(0);let l,c,u=!0===a?0:1,d=null,h=0,p=null;function f(e){let r=!0===e.isScene?e.background:null;if(r&&r.isTexture){r=(e.backgroundBlurriness>0?n:t).get(r)}return r}function m(t,n){t.getRGB(HA,gA(e)),r.buffers.color.setClear(HA.r,HA.g,HA.b,n,o)}return{getClearColor:function(){return s},setClearColor:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;s.set(e),u=t,m(s,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,m(s,u)},render:function(t){let n=!1;const i=f(t);null===i?m(s,u):i&&i.isColor&&(m(i,1),n=!0);const a=e.xr.getEnvironmentBlendMode();"additive"===a?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===a&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){const r=f(n);r&&(r.isCubeTexture||r.mapping===Lb)?(void 0===c&&(c=new dA(new pA(1,1,1),new yA({name:"BackgroundCubeMaterial",uniforms:fA(zA.backgroundCube.uniforms),vertexShader:zA.backgroundCube.vertexShader,fragmentShader:zA.backgroundCube.fragmentShader,side:Ly,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),GA.copy(n.backgroundRotation),GA.x*=-1,GA.y*=-1,GA.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(GA.y*=-1,GA.z*=-1),c.material.uniforms.envMap.value=r,c.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(jA.makeRotationFromEuler(GA)),c.material.toneMapped=kS.getTransfer(r.colorSpace)!==w_,d===r&&h===r.version&&p===e.toneMapping||(c.material.needsUpdate=!0,d=r,h=r.version,p=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null)):r&&r.isTexture&&(void 0===l&&(l=new dA(new NA(2,2),new yA({name:"BackgroundMaterial",uniforms:fA(zA.background.uniforms),vertexShader:zA.background.vertexShader,fragmentShader:zA.background.fragmentShader,side:Dy,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=r,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=kS.getTransfer(r.colorSpace)!==w_,!0===r.matrixAutoUpdate&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),d===r&&h===r.version&&p===e.toneMapping||(l.material.needsUpdate=!0,d=r,h=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}}}function WA(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=c(null);let a=i,o=!1;function s(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function c(e){const t=[],r=[],i=[];for(let a=0;a<n;a++)t[a]=0,r[a]=0,i[a]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function u(){const e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function d(e){h(e,0)}function h(t,n){const r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,0===i[t]&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function p(){const t=a.newAttributes,n=a.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function f(t,n,r,i,a,o,s){!0===s?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function m(){g(),o=!0,a!==i&&(a=i,s(a.object))}function g(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:function(n,i,l,m,g){let v=!1;const y=function(t,n,i){const a=!0===i.wireframe;let o=r[t.id];void 0===o&&(o={},r[t.id]=o);let s=o[n.id];void 0===s&&(s={},o[n.id]=s);let l=s[a];void 0===l&&(l=c(e.createVertexArray()),s[a]=l);return l}(m,l,i);a!==y&&(a=y,s(a.object)),v=function(e,t,n,r){const i=a.attributes,o=t.attributes;let s=0;const l=n.getAttributes();for(const a in l){if(l[a].location>=0){const t=i[a];let n=o[a];if(void 0===n&&("instanceMatrix"===a&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===a&&e.instanceColor&&(n=e.instanceColor)),void 0===t)return!0;if(t.attribute!==n)return!0;if(n&&t.data!==n.data)return!0;s++}}return a.attributesNum!==s||a.index!==r}(n,m,l,g),v&&function(e,t,n,r){const i={},o=t.attributes;let s=0;const l=n.getAttributes();for(const a in l){if(l[a].location>=0){let t=o[a];void 0===t&&("instanceMatrix"===a&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===a&&e.instanceColor&&(t=e.instanceColor));const n={};n.attribute=t,t&&t.data&&(n.data=t.data),i[a]=n,s++}}a.attributes=i,a.attributesNum=s,a.index=r}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(v||o)&&(o=!1,function(n,r,i,a){u();const o=a.attributes,s=i.getAttributes(),l=r.defaultAttributeValues;for(const c in s){const r=s[c];if(r.location>=0){let i=o[c];if(void 0===i&&("instanceMatrix"===c&&n.instanceMatrix&&(i=n.instanceMatrix),"instanceColor"===c&&n.instanceColor&&(i=n.instanceColor)),void 0!==i){const o=i.normalized,s=i.itemSize,l=t.get(i);if(void 0===l)continue;const c=l.buffer,u=l.type,p=l.bytesPerElement,m=u===e.INT||u===e.UNSIGNED_INT||i.gpuType===Qb;if(i.isInterleavedBufferAttribute){const t=i.data,l=t.stride,g=i.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)h(r.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<r.locationSize;e++)d(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)f(r.location+e,s/r.locationSize,u,o,l*p,(g+s/r.locationSize*e)*p,m)}else{if(i.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)h(r.location+e,i.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let e=0;e<r.locationSize;e++)d(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)f(r.location+e,s/r.locationSize,u,o,s*p,s/r.locationSize*e*p,m)}}else if(void 0!==l){const t=l[c];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(r.location,t);break;case 3:e.vertexAttrib3fv(r.location,t);break;case 4:e.vertexAttrib4fv(r.location,t);break;default:e.vertexAttrib1fv(r.location,t)}}}}p()}(n,i,l,m),null!==g&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(g).buffer))},reset:m,resetDefaultState:g,dispose:function(){m();for(const e in r){const t=r[e];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete r[e]}},releaseStatesOfGeometry:function(e){if(void 0===r[e.id])return;const t=r[e.id];for(const n in t){const e=t[n];for(const t in e)l(e[t].object),delete e[t];delete t[n]}delete r[e.id]},releaseStatesOfProgram:function(e){for(const t in r){const n=r[t];if(void 0===n[e.id])continue;const i=n[e.id];for(const e in i)l(i[e].object),delete i[e];delete n[e.id]}},initAttributes:u,enableAttribute:d,disableUnusedAttributes:p}}function XA(e,t,n){let r;function i(t,i,a){0!==a&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r,1)},this.renderInstances=i,this.renderMultiDraw=function(e,i,a){if(0===a)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,e,0,i,0,a);let o=0;for(let t=0;t<a;t++)o+=i[t];n.update(o,r,1)},this.renderMultiDrawInstances=function(e,a,o,s){if(0===o)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)i(e[t],a[t],s[t]);else{l.multiDrawArraysInstancedWEBGL(r,e,0,a,0,s,0,o);let t=0;for(let e=0;e<o;e++)t+=a[e];for(let e=0;e<s.length;e++)n.update(t,r,s[e])}}}function JA(e,t,n,r){let i;function a(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=void 0!==n.precision?n.precision:"highp";const s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:a,textureFormatReadable:function(t){return t===lx||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const i=n===tx&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(n!==$b&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==ex&&!i)},precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:u>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function $A(e){const t=this;let n=null,r=0,i=!1,a=!1;const o=new BA,s=new SS,l={value:null,needsUpdate:!1};function c(e,n,r,i){const a=null!==e?e.length:0;let c=null;if(0!==a){if(c=l.value,!0!==i||null===c){const t=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let n=0,l=r;n!==a;++n,l+=4)o.copy(e[n]).applyMatrix4(i,s),o.normal.toArray(c,l),c[l+3]=o.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const n=0!==e.length||t||0!==r||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=c(e,t,0)},this.setState=function(o,s,u){const d=o.clippingPlanes,h=o.clipIntersection,p=o.clipShadows,f=e.get(o);if(!i||null===d||0===d.length||a&&!p)a?c(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=r>0);t.numPlanes=r,t.numIntersection=0}();else{const e=a?0:r,t=4*e;let i=f.clippingState||null;l.value=i,i=c(d,s,t,u);for(let r=0;r!==t;++r)i[r]=n[r];f.clippingState=i,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=e}}}function KA(e){let t=new WeakMap;function n(e,t){return t===Ib?e.mapping=Pb:t===Db&&(e.mapping=Bb),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping;if(a===Ib||a===Db){if(t.has(i)){return n(t.get(i).texture,i.mapping)}{const a=i.image;if(a&&a.height>0){const o=new CA(a.height);return o.fromEquirectangularTexture(e,i),t.set(i,o),i.addEventListener("dispose",r),n(o.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}class YA extends bA{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const qA=[.125,.215,.35,.446,.526,.582],QA=20,ZA=new YA,eM=new yE;let tM=null,nM=0,rM=0,iM=!1;const aM=(1+Math.sqrt(5))/2,oM=1/aM,sM=[new ZS(-aM,oM,0),new ZS(aM,oM,0),new ZS(-oM,0,aM),new ZS(oM,0,aM),new ZS(0,aM,-oM),new ZS(0,aM,oM),new ZS(-1,1,-1),new ZS(1,1,-1),new ZS(-1,1,1),new ZS(1,1,1)];class lM{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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;tM=this._renderer.getRenderTarget(),nM=this._renderer.getActiveCubeFace(),rM=this._renderer.getActiveMipmapLevel(),iM=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}fromCubemap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=hM(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=dM(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(tM,nM,rM),this._renderer.xr.enabled=iM,e.scissorTest=!1,uM(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Pb||e.mapping===Bb?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),tM=this._renderer.getRenderTarget(),nM=this._renderer.getActiveCubeFace(),rM=this._renderer.getActiveMipmapLevel(),iM=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:jb,minFilter:jb,generateMipmaps:!1,type:tx,format:lx,colorSpace:b_,depthBuffer:!1},r=cM(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=cM(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const a=e-4+1+qA.length;for(let o=0;o<a;o++){const a=Math.pow(2,i);n.push(a);let s=1/a;o>e-4?s=qA[o-e+4-1]:0===o&&(s=0),r.push(s);const l=1/(a-2),c=-l,u=1+l,d=[c,c,u,c,u,u,c,c,u,u,c,u],h=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*h),y=new Float32Array(m*p*h),b=new Float32Array(g*p*h);for(let e=0;e<h;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];v.set(r,f*p*e),y.set(d,m*p*e);const i=[e,e,e,e,e,e];b.set(i,g*p*e)}const x=new JE;x.setAttribute("position",new PE(v,f)),x.setAttribute("uv",new PE(y,m)),x.setAttribute("faceIndex",new PE(b,g)),t.push(x),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array(QA),i=new ZS(0,1,0),a=new yA({name:"SphericalGaussianBlur",defines:{n:QA,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:pM(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:Oy,depthTest:!1,depthWrite:!1});return a}(r,e,t)}return r}_compileMaterial(e){const t=new dA(this._lodPlanes[0],e);this._renderer.compile(t,ZA)}_sceneToCubeUV(e,t,n,r){const i=new wA(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,l=s.autoClear,c=s.toneMapping;s.getClearColor(eM),s.toneMapping=bb,s.autoClear=!1;const u=new SE({name:"PMREM.Background",side:Ly,depthWrite:!1,depthTest:!1}),d=new dA(new pA,u);let h=!1;const p=e.background;p?p.isColor&&(u.color.copy(p),e.background=null,h=!0):(u.color.copy(eM),h=!0);for(let f=0;f<6;f++){const t=f%3;0===t?(i.up.set(0,a[f],0),i.lookAt(o[f],0,0)):1===t?(i.up.set(0,0,a[f]),i.lookAt(0,o[f],0)):(i.up.set(0,a[f],0),i.lookAt(0,0,o[f]));const n=this._cubeSize;uM(r,t*n,f>2?n:0,n,n),s.setRenderTarget(r),h&&s.render(d,i),s.render(e,i)}d.geometry.dispose(),d.material.dispose(),s.toneMapping=c,s.autoClear=l,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===Pb||e.mapping===Bb;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=hM()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=dM());const i=r?this._cubemapMaterial:this._equirectMaterial,a=new dA(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const o=this._cubeSize;uM(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(a,ZA)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let i=1;i<r;i++){const t=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),n=sM[(r-i-1)%sM.length];this._blur(e,i-1,i,t,n)}t.autoClear=n}_blur(e,t,n,r,i){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",i),this._halfBlur(a,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,a,o){const s=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new dA(this._lodPlanes[r],l),u=l.uniforms,d=this._sizeLods[n]-1,h=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/h,f=isFinite(i)?1+Math.floor(3*p):QA;f>QA&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let b=0;b<QA;++b){const e=b/p,t=Math.exp(-e*e/2);m.push(t),0===b?g+=t:b<f&&(g+=2*t)}for(let b=0;b<m.length;b++)m[b]=m[b]/g;u.envMap.value=e.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value="latitudinal"===a,o&&(u.poleAxis.value=o);const{_lodMax:v}=this;u.dTheta.value=h,u.mipInt.value=v-n;const y=this._sizeLods[r];uM(t,3*y*(r>v-4?r-v+4:0),4*(this._cubeSize-y),3*y,2*y),s.setRenderTarget(t),s.render(c,ZA)}}function cM(e,t,n){const r=new JS(e,t,n);return r.texture.mapping=Lb,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function uM(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function dM(){return new yA({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:pM(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:Oy,depthTest:!1,depthWrite:!1})}function hM(){return new yA({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:pM(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:Oy,depthTest:!1,depthWrite:!1})}function pM(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function fM(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping,o=a===Ib||a===Db,s=a===Pb||a===Bb;if(o||s){let a=t.get(i);const l=void 0!==a?a.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==l)return null===n&&(n=new lM(e)),a=o?n.fromEquirectangular(i,a):n.fromCubemap(i,a),a.texture.pmremVersion=i.pmremVersion,t.set(i,a),a.texture;if(void 0!==a)return a.texture;{const l=i.image;return o&&l&&l.height>0||s&&l&&function(e){let t=0;const n=6;for(let r=0;r<n;r++)void 0!==e[r]&&t++;return t===n}(l)?(null===n&&(n=new lM(e)),a=o?n.fromEquirectangular(i):n.fromCubemap(i),a.texture.pmremVersion=i.pmremVersion,t.set(i,a),i.addEventListener("dispose",r),a.texture):null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function mM(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){const t=n(e);return null===t&&PS("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function gM(e,t,n,r){const i={},a=new WeakMap;function o(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const n in s.attributes)t.remove(s.attributes[n]);for(const n in s.morphAttributes){const e=s.morphAttributes[n];for(let n=0,r=e.length;n<r;n++)t.remove(e[n])}s.removeEventListener("dispose",o),delete i[s.id];const l=a.get(s);l&&(t.remove(l),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],r=e.index,i=e.attributes.position;let o=0;if(null!==r){const e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],a=e[t+2];n.push(r,i,i,a,a,r)}}else{if(void 0===i)return;{const e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}}const s=new(ES(n)?NE:kE)(n,1);s.version=o;const l=a.get(e);l&&t.remove(l),a.set(e,s)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(n){const r=n.attributes;for(const a in r)t.update(r[a],e.ARRAY_BUFFER);const i=n.morphAttributes;for(const a in i){const n=i[a];for(let r=0,i=n.length;r<i;r++)t.update(n[r],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){const t=a.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return a.get(e)}}}function vM(e,t,n){let r,i,a;function o(t,o,s){0!==s&&(e.drawElementsInstanced(r,o,i,t*a,s),n.update(o,r,s))}this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(r,o,i,t*a),n.update(o,r,1)},this.renderInstances=o,this.renderMultiDraw=function(e,a,o){if(0===o)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,a,0,i,e,0,o);let s=0;for(let t=0;t<o;t++)s+=a[t];n.update(s,r,1)},this.renderMultiDrawInstances=function(e,s,l,c){if(0===l)return;const u=t.get("WEBGL_multi_draw");if(null===u)for(let t=0;t<e.length;t++)o(e[t]/a,s[t],c[t]);else{u.multiDrawElementsInstancedWEBGL(r,s,0,i,e,0,c,0,l);let t=0;for(let e=0;e<l;e++)t+=s[e];for(let e=0;e<c.length;e++)n.update(t,r,c[e])}}}function yM(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,i){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=i*(n/3);break;case e.LINES:t.lines+=i*(n/2);break;case e.LINE_STRIP:t.lines+=i*(n-1);break;case e.LINE_LOOP:t.lines+=i*n;break;case e.POINTS:t.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function bM(e,t,n){const r=new WeakMap,i=new WS;return{update:function(a,o,s){const l=a.morphTargetInfluences,c=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=void 0!==c?c.length:0;let d=r.get(o);if(void 0===d||d.count!==u){void 0!==d&&d.texture.dispose();const h=void 0!==o.morphAttributes.position,p=void 0!==o.morphAttributes.normal,f=void 0!==o.morphAttributes.color,m=o.morphAttributes.position||[],g=o.morphAttributes.normal||[],v=o.morphAttributes.color||[];let y=0;!0===h&&(y=1),!0===p&&(y=2),!0===f&&(y=3);let b=o.attributes.position.count*y,x=1;b>t.maxTextureSize&&(x=Math.ceil(b/t.maxTextureSize),b=t.maxTextureSize);const _=new Float32Array(b*x*4*u),S=new $S(_,b,x,u);S.type=ex,S.needsUpdate=!0;const w=4*y;for(let A=0;A<u;A++){const M=m[A],C=g[A],T=v[A],R=b*x*4*A;for(let P=0;P<M.count;P++){const B=P*w;!0===h&&(i.fromBufferAttribute(M,P),_[R+B+0]=i.x,_[R+B+1]=i.y,_[R+B+2]=i.z,_[R+B+3]=0),!0===p&&(i.fromBufferAttribute(C,P),_[R+B+4]=i.x,_[R+B+5]=i.y,_[R+B+6]=i.z,_[R+B+7]=0),!0===f&&(i.fromBufferAttribute(T,P),_[R+B+8]=i.x,_[R+B+9]=i.y,_[R+B+10]=i.z,_[R+B+11]=4===T.itemSize?i.w:1)}}function E(){S.dispose(),r.delete(o),o.removeEventListener("dispose",E)}d={count:u,texture:S,size:new _S(b,x)},r.set(o,d),o.addEventListener("dispose",E)}if(!0===a.isInstancedMesh&&null!==a.morphTexture)s.getUniforms().setValue(e,"morphTexture",a.morphTexture,n);else{let I=0;for(let L=0;L<l.length;L++)I+=l[L];const D=o.morphTargetsRelative?1:1-I;s.getUniforms().setValue(e,"morphTargetBaseInfluence",D),s.getUniforms().setValue(e,"morphTargetInfluences",l)}s.getUniforms().setValue(e,"morphTargetsTexture",d.texture,n),s.getUniforms().setValue(e,"morphTargetsTextureSize",d.size)}}}function xM(e,t,n,r){let i=new WeakMap;function a(e){const t=e.target;t.removeEventListener("dispose",a),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(o){const s=r.render.frame,l=o.geometry,c=t.get(o,l);if(i.get(c)!==s&&(t.update(c),i.set(c,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),i.get(o)!==s&&(n.update(o.instanceMatrix,e.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,e.ARRAY_BUFFER),i.set(o,s))),o.isSkinnedMesh){const e=o.skeleton;i.get(e)!==s&&(e.update(),i.set(e,s))}return c},dispose:function(){i=new WeakMap}}}class _M extends VS{constructor(e,t,n,r,i,a,o,s,l){let c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:dx;if(c!==dx&&c!==hx)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===dx&&(n=Zb),void 0===n&&c===hx&&(n=ix),super(null,r,i,a,o,s,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==o?o:Fb,this.minFilter=void 0!==s?s:Fb,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}const SM=new VS,wM=new _M(1,1),EM=new $S,AM=new YS,MM=new MA,CM=[],TM=[],RM=new Float32Array(16),PM=new Float32Array(9),BM=new Float32Array(4);function IM(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let a=CM[i];if(void 0===a&&(a=new Float32Array(i),CM[i]=a),0!==t){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function DM(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function LM(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function kM(e,t){let n=TM[t];void 0===n&&(n=new Int32Array(t),TM[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function OM(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function NM(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(DM(n,t))return;e.uniform2fv(this.addr,t),LM(n,t)}}function FM(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(DM(n,t))return;e.uniform3fv(this.addr,t),LM(n,t)}}function UM(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(DM(n,t))return;e.uniform4fv(this.addr,t),LM(n,t)}}function zM(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(DM(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),LM(n,t)}else{if(DM(n,r))return;BM.set(r),e.uniformMatrix2fv(this.addr,!1,BM),LM(n,r)}}function HM(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(DM(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),LM(n,t)}else{if(DM(n,r))return;PM.set(r),e.uniformMatrix3fv(this.addr,!1,PM),LM(n,r)}}function GM(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(DM(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),LM(n,t)}else{if(DM(n,r))return;RM.set(r),e.uniformMatrix4fv(this.addr,!1,RM),LM(n,r)}}function jM(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function VM(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(DM(n,t))return;e.uniform2iv(this.addr,t),LM(n,t)}}function WM(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(DM(n,t))return;e.uniform3iv(this.addr,t),LM(n,t)}}function XM(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(DM(n,t))return;e.uniform4iv(this.addr,t),LM(n,t)}}function JM(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function $M(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(DM(n,t))return;e.uniform2uiv(this.addr,t),LM(n,t)}}function KM(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(DM(n,t))return;e.uniform3uiv(this.addr,t),LM(n,t)}}function YM(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(DM(n,t))return;e.uniform4uiv(this.addr,t),LM(n,t)}}function qM(e,t,n){const r=this.cache,i=n.allocateTextureUnit();let a;r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),this.type===e.SAMPLER_2D_SHADOW?(wM.compareFunction=W_,a=wM):a=SM,n.setTexture2D(t||a,i)}function QM(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||AM,i)}function ZM(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||MM,i)}function eC(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||EM,i)}function tC(e,t){e.uniform1fv(this.addr,t)}function nC(e,t){const n=IM(t,this.size,2);e.uniform2fv(this.addr,n)}function rC(e,t){const n=IM(t,this.size,3);e.uniform3fv(this.addr,n)}function iC(e,t){const n=IM(t,this.size,4);e.uniform4fv(this.addr,n)}function aC(e,t){const n=IM(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function oC(e,t){const n=IM(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function sC(e,t){const n=IM(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function lC(e,t){e.uniform1iv(this.addr,t)}function cC(e,t){e.uniform2iv(this.addr,t)}function uC(e,t){e.uniform3iv(this.addr,t)}function dC(e,t){e.uniform4iv(this.addr,t)}function hC(e,t){e.uniform1uiv(this.addr,t)}function pC(e,t){e.uniform2uiv(this.addr,t)}function fC(e,t){e.uniform3uiv(this.addr,t)}function mC(e,t){e.uniform4uiv(this.addr,t)}function gC(e,t,n){const r=this.cache,i=t.length,a=kM(n,i);DM(r,a)||(e.uniform1iv(this.addr,a),LM(r,a));for(let o=0;o!==i;++o)n.setTexture2D(t[o]||SM,a[o])}function vC(e,t,n){const r=this.cache,i=t.length,a=kM(n,i);DM(r,a)||(e.uniform1iv(this.addr,a),LM(r,a));for(let o=0;o!==i;++o)n.setTexture3D(t[o]||AM,a[o])}function yC(e,t,n){const r=this.cache,i=t.length,a=kM(n,i);DM(r,a)||(e.uniform1iv(this.addr,a),LM(r,a));for(let o=0;o!==i;++o)n.setTextureCube(t[o]||MM,a[o])}function bC(e,t,n){const r=this.cache,i=t.length,a=kM(n,i);DM(r,a)||(e.uniform1iv(this.addr,a),LM(r,a));for(let o=0;o!==i;++o)n.setTexture2DArray(t[o]||EM,a[o])}class xC{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return OM;case 35664:return NM;case 35665:return FM;case 35666:return UM;case 35674:return zM;case 35675:return HM;case 35676:return GM;case 5124:case 35670:return jM;case 35667:case 35671:return VM;case 35668:case 35672:return WM;case 35669:case 35673:return XM;case 5125:return JM;case 36294:return $M;case 36295:return KM;case 36296:return YM;case 35678:case 36198:case 36298:case 36306:case 35682:return qM;case 35679:case 36299:case 36307:return QM;case 35680:case 36300:case 36308:case 36293:return ZM;case 36289:case 36303:case 36311:case 36292:return eC}}(t.type)}}class _C{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return tC;case 35664:return nC;case 35665:return rC;case 35666:return iC;case 35674:return aC;case 35675:return oC;case 35676:return sC;case 5124:case 35670:return lC;case 35667:case 35671:return cC;case 35668:case 35672:return uC;case 35669:case 35673:return dC;case 5125:return hC;case 36294:return pC;case 36295:return fC;case 36296:return mC;case 35678:case 36198:case 36298:case 36306:case 35682:return gC;case 35679:case 36299:case 36307:return vC;case 35680:case 36300:case 36308:case 36293:return yC;case 36289:case 36303:case 36311:case 36292:return bC}}(t.type)}}class SC{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let i=0,a=r.length;i!==a;++i){const a=r[i];a.setValue(e,t[a.id],n)}}}const wC=/(\w+)(\])?(\[|\.)?/g;function EC(e,t){e.seq.push(t),e.map[t.id]=t}function AC(e,t,n){const r=e.name,i=r.length;for(wC.lastIndex=0;;){const a=wC.exec(r),o=wC.lastIndex;let s=a[1];const l="]"===a[2],c=a[3];if(l&&(s|=0),void 0===c||"["===c&&o+2===i){EC(n,void 0===c?new xC(s,e,t):new _C(s,e,t));break}{let e=n.map[s];void 0===e&&(e=new SC(s),EC(n,e)),n=e}}}class MC{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);AC(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){const a=t[i],o=n[a.id];!1!==o.needsUpdate&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n}}function CC(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}const TC=37297;let RC=0;function PC(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const r=parseInt(a[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let o=i;o<a;o++){const e=o+1;r.push(`${e===t?">":" "} ${e}: ${n[o]}`)}return r.join("\n")}(e.getShaderSource(t),r)}return i}function BC(e,t){const n=function(e){const t=kS.getPrimaries(kS.workingColorSpace),n=kS.getPrimaries(e);let r;switch(t===n?r="":t===A_&&n===E_?r="LinearDisplayP3ToLinearSRGB":t===E_&&n===A_&&(r="LinearSRGBToLinearDisplayP3"),e){case b_:case __:return[r,"LinearTransferOETF"];case y_:case x_:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[r,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function IC(e,t){let n;switch(t){case xb:n="Linear";break;case _b:n="Reinhard";break;case Sb:n="Cineon";break;case wb:n="ACESFilmic";break;case Ab:n="AgX";break;case Mb:n="Neutral";break;case Eb:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const DC=new ZS;function LC(){kS.getLuminanceCoefficients(DC);return["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${DC.x.toFixed(4)}, ${DC.y.toFixed(4)}, ${DC.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")}function kC(e){return""!==e}function OC(e,t){const n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function NC(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const FC=/^[ \t]*#include +<([\w\d./]+)>/gm;function UC(e){return e.replace(FC,HC)}const zC=new Map;function HC(e,t){let n=FA[t];if(void 0===n){const e=zC.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=FA[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return UC(n)}const GC=/#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 jC(e){return e.replace(GC,VC)}function VC(e,t,n,r){let i="";for(let a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function WC(e){let t=`precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function XC(e,t,n,r){const i=e.getContext(),a=n.defines;let o=n.vertexShader,s=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===Py?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===By?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===Iy&&(t="SHADOWMAP_TYPE_VSM"),t}(n),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case Pb:case Bb:t="ENVMAP_TYPE_CUBE";break;case Lb:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),u=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===Bb&&(t="ENVMAP_MODE_REFRACTION");return t}(n),d=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case gb:t="ENVMAP_BLENDING_MULTIPLY";break;case vb:t="ENVMAP_BLENDING_MIX";break;case yb:t="ENVMAP_BLENDING_ADD"}return t}(n),h=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),p=function(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(kC).join("\n")}(n),f=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(a),m=i.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,f].filter(kC).join("\n"),g.length>0&&(g+="\n"),v=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,f].filter(kC).join("\n"),v.length>0&&(v+="\n")):(g=[WC(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,f,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#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&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(kC).join("\n"),v=[WC(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,f,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==bb?"#define TONE_MAPPING":"",n.toneMapping!==bb?FA.tonemapping_pars_fragment:"",n.toneMapping!==bb?IC("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",FA.colorspace_pars_fragment,BC("linearToOutputTexel",n.outputColorSpace),LC(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(kC).join("\n")),o=UC(o),o=OC(o,n),o=NC(o,n),s=UC(s),s=OC(s,n),s=NC(s,n),o=jC(o),s=jC(s),!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=[p,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",n.glslVersion===oS?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===oS?"":"#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("\n")+"\n"+v);const b=y+g+o,x=y+v+s,_=CC(i,i.VERTEX_SHADER,b),S=CC(i,i.FRAGMENT_SHADER,x);function w(t){if(e.debug.checkShaderErrors){const n=i.getProgramInfoLog(m).trim(),r=i.getShaderInfoLog(_).trim(),a=i.getShaderInfoLog(S).trim();let o=!0,s=!0;if(!1===i.getProgramParameter(m,i.LINK_STATUS))if(o=!1,"function"===typeof e.debug.onShaderError)e.debug.onShaderError(i,m,_,S);else{const e=PC(i,_,"vertex"),r=PC(i,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(m,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+r)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==r&&""!==a||(s=!1);s&&(t.diagnostics={runnable:o,programLog:n,vertexShader:{log:r,prefix:g},fragmentShader:{log:a,prefix:v}})}i.deleteShader(_),i.deleteShader(S),E=new MC(i,m),A=function(e,t){const n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),a=r.name;let o=1;r.type===e.FLOAT_MAT2&&(o=2),r.type===e.FLOAT_MAT3&&(o=3),r.type===e.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}(i,m)}let E,A;i.attachShader(m,_),i.attachShader(m,S),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),this.getUniforms=function(){return void 0===E&&w(this),E},this.getAttributes=function(){return void 0===A&&w(this),A};let M=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===M&&(M=i.getProgramParameter(m,TC)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=RC++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=_,this.fragmentShader=S,this}let JC=0;class $C{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(r)&&(a.add(r),r.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,0===n.usedTimes&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new KC(e),t.set(e,n)),n}}class KC{constructor(e){this.id=JC++,this.code=e,this.usedTimes=0}}function YC(e,t,n,r,i,a,o){const s=new zw,l=new $C,c=new Set,u=[],d=i.logarithmicDepthBuffer,h=i.vertexTextures;let p=i.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(e){return c.add(e),0===e?"uv":`uv${e}`}return{getParameters:function(a,s,u,g,v){const y=g.fog,b=v.geometry,x=a.isMeshStandardMaterial?g.environment:null,_=(a.isMeshStandardMaterial?n:t).get(a.envMap||x),S=_&&_.mapping===Lb?_.image.height:null,w=f[a.type];null!==a.precision&&(p=i.getMaxPrecision(a.precision),p!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",p,"instead."));const E=b.morphAttributes.position||b.morphAttributes.normal||b.morphAttributes.color,A=void 0!==E?E.length:0;let M,C,T,R,P=0;if(void 0!==b.morphAttributes.position&&(P=1),void 0!==b.morphAttributes.normal&&(P=2),void 0!==b.morphAttributes.color&&(P=3),w){const e=zA[w];M=e.vertexShader,C=e.fragmentShader}else M=a.vertexShader,C=a.fragmentShader,l.update(a),T=l.getVertexShaderID(a),R=l.getFragmentShaderID(a);const B=e.getRenderTarget(),I=!0===v.isInstancedMesh,D=!0===v.isBatchedMesh,L=!!a.map,k=!!a.matcap,O=!!_,N=!!a.aoMap,F=!!a.lightMap,U=!!a.bumpMap,z=!!a.normalMap,H=!!a.displacementMap,G=!!a.emissiveMap,j=!!a.metalnessMap,V=!!a.roughnessMap,W=a.anisotropy>0,X=a.clearcoat>0,J=a.dispersion>0,$=a.iridescence>0,K=a.sheen>0,Y=a.transmission>0,q=W&&!!a.anisotropyMap,Q=X&&!!a.clearcoatMap,Z=X&&!!a.clearcoatNormalMap,ee=X&&!!a.clearcoatRoughnessMap,te=$&&!!a.iridescenceMap,ne=$&&!!a.iridescenceThicknessMap,re=K&&!!a.sheenColorMap,ie=K&&!!a.sheenRoughnessMap,ae=!!a.specularMap,oe=!!a.specularColorMap,se=!!a.specularIntensityMap,le=Y&&!!a.transmissionMap,ce=Y&&!!a.thicknessMap,ue=!!a.gradientMap,de=!!a.alphaMap,he=a.alphaTest>0,pe=!!a.alphaHash,fe=!!a.extensions;let me=bb;a.toneMapped&&(null!==B&&!0!==B.isXRRenderTarget||(me=e.toneMapping));const ge={shaderID:w,shaderType:a.type,shaderName:a.name,vertexShader:M,fragmentShader:C,defines:a.defines,customVertexShaderID:T,customFragmentShaderID:R,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,batching:D,batchingColor:D&&null!==v._colorsTexture,instancing:I,instancingColor:I&&null!==v.instanceColor,instancingMorph:I&&null!==v.morphTexture,supportsVertexTextures:h,outputColorSpace:null===B?e.outputColorSpace:!0===B.isXRRenderTarget?B.texture.colorSpace:b_,alphaToCoverage:!!a.alphaToCoverage,map:L,matcap:k,envMap:O,envMapMode:O&&_.mapping,envMapCubeUVHeight:S,aoMap:N,lightMap:F,bumpMap:U,normalMap:z,displacementMap:h&&H,emissiveMap:G,normalMapObjectSpace:z&&a.normalMapType===g_,normalMapTangentSpace:z&&a.normalMapType===m_,metalnessMap:j,roughnessMap:V,anisotropy:W,anisotropyMap:q,clearcoat:X,clearcoatMap:Q,clearcoatNormalMap:Z,clearcoatRoughnessMap:ee,dispersion:J,iridescence:$,iridescenceMap:te,iridescenceThicknessMap:ne,sheen:K,sheenColorMap:re,sheenRoughnessMap:ie,specularMap:ae,specularColorMap:oe,specularIntensityMap:se,transmission:Y,transmissionMap:le,thicknessMap:ce,gradientMap:ue,opaque:!1===a.transparent&&a.blending===Ny&&!1===a.alphaToCoverage,alphaMap:de,alphaTest:he,alphaHash:pe,combine:a.combine,mapUv:L&&m(a.map.channel),aoMapUv:N&&m(a.aoMap.channel),lightMapUv:F&&m(a.lightMap.channel),bumpMapUv:U&&m(a.bumpMap.channel),normalMapUv:z&&m(a.normalMap.channel),displacementMapUv:H&&m(a.displacementMap.channel),emissiveMapUv:G&&m(a.emissiveMap.channel),metalnessMapUv:j&&m(a.metalnessMap.channel),roughnessMapUv:V&&m(a.roughnessMap.channel),anisotropyMapUv:q&&m(a.anisotropyMap.channel),clearcoatMapUv:Q&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:Z&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ee&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:te&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ne&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:re&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:ie&&m(a.sheenRoughnessMap.channel),specularMapUv:ae&&m(a.specularMap.channel),specularColorMapUv:oe&&m(a.specularColorMap.channel),specularIntensityMapUv:se&&m(a.specularIntensityMap.channel),transmissionMapUv:le&&m(a.transmissionMap.channel),thicknessMapUv:ce&&m(a.thicknessMap.channel),alphaMapUv:de&&m(a.alphaMap.channel),vertexTangents:!!b.attributes.tangent&&(z||W),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!b.attributes.uv&&(L||de),fog:!!y,useFog:!0===a.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:d,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:A,morphTextureStride:P,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:me,decodeVideoTexture:L&&!0===a.map.isVideoTexture&&kS.getTransfer(a.map.colorSpace)===w_,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===ky,flipSided:a.side===Ly,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:fe&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(fe&&!0===a.extensions.multiDraw||D)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return ge.vertexUv1s=c.has(1),ge.vertexUv2s=c.has(2),ge.vertexUv3s=c.has(3),c.clear(),ge},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){s.disableAll(),t.supportsVertexTextures&&s.enable(0);t.instancing&&s.enable(1);t.instancingColor&&s.enable(2);t.instancingMorph&&s.enable(3);t.matcap&&s.enable(4);t.envMap&&s.enable(5);t.normalMapObjectSpace&&s.enable(6);t.normalMapTangentSpace&&s.enable(7);t.clearcoat&&s.enable(8);t.iridescence&&s.enable(9);t.alphaTest&&s.enable(10);t.vertexColors&&s.enable(11);t.vertexAlphas&&s.enable(12);t.vertexUv1s&&s.enable(13);t.vertexUv2s&&s.enable(14);t.vertexUv3s&&s.enable(15);t.vertexTangents&&s.enable(16);t.anisotropy&&s.enable(17);t.alphaHash&&s.enable(18);t.batching&&s.enable(19);t.dispersion&&s.enable(20);t.batchingColor&&s.enable(21);e.push(s.mask),s.disableAll(),t.fog&&s.enable(0);t.useFog&&s.enable(1);t.flatShading&&s.enable(2);t.logarithmicDepthBuffer&&s.enable(3);t.skinning&&s.enable(4);t.morphTargets&&s.enable(5);t.morphNormals&&s.enable(6);t.morphColors&&s.enable(7);t.premultipliedAlpha&&s.enable(8);t.shadowMapEnabled&&s.enable(9);t.doubleSided&&s.enable(10);t.flipSided&&s.enable(11);t.useDepthPacking&&s.enable(12);t.dithering&&s.enable(13);t.transmission&&s.enable(14);t.sheen&&s.enable(15);t.opaque&&s.enable(16);t.pointsUvs&&s.enable(17);t.decodeVideoTexture&&s.enable(18);t.alphaToCoverage&&s.enable(19);e.push(s.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=f[e.type];let n;if(t){const e=zA[t];n=vA.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,i=u.length;e<i;e++){const t=u[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new XC(e,n,t,a),u.push(r)),r},releaseProgram:function(e){if(0===--e.usedTimes){const t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:u,dispose:function(){l.dispose()}}}function qC(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function QC(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function ZC(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function eT(){const e=[];let t=0;const n=[],r=[],i=[];function a(n,r,i,a,o,s){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=o,l.group=s),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,o,s,l,c){const u=a(e,t,o,s,l,c);o.transmission>0?r.push(u):!0===o.transparent?i.push(u):n.push(u)},unshift:function(e,t,o,s,l,c){const u=a(e,t,o,s,l,c);o.transmission>0?r.unshift(u):!0===o.transparent?i.unshift(u):n.unshift(u)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||QC),r.length>1&&r.sort(t||ZC),i.length>1&&i.sort(t||ZC)}}}function tT(){let e=new WeakMap;return{get:function(t,n){const r=e.get(t);let i;return void 0===r?(i=new eT,e.set(t,[i])):n>=r.length?(i=new eT,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function nT(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new ZS,color:new yE};break;case"SpotLight":n={position:new ZS,direction:new ZS,color:new yE,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ZS,color:new yE,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ZS,skyColor:new yE,groundColor:new yE};break;case"RectAreaLight":n={color:new yE,position:new ZS,halfWidth:new ZS,halfHeight:new ZS}}return e[t.id]=n,n}}}let rT=0;function iT(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function aT(e){const t=new nT,n=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _S};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _S,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let s=0;s<9;s++)r.probe.push(new ZS);const i=new ZS,a=new Rw,o=new Rw;return{setup:function(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,c=0,u=0,d=0,h=0,p=0,f=0,m=0,g=0,v=0,y=0;i.sort(iT);for(let e=0,x=i.length;e<x;e++){const b=i[e],x=b.color,_=b.intensity,S=b.distance,w=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)a+=x.r*_,o+=x.g*_,s+=x.b*_;else if(b.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(b.sh.coefficients[e],_);y++}else if(b.isDirectionalLight){const e=t.get(b);if(e.color.copy(b.color).multiplyScalar(b.intensity),b.castShadow){const e=b.shadow,t=n.get(b);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[l]=t,r.directionalShadowMap[l]=w,r.directionalShadowMatrix[l]=b.shadow.matrix,p++}r.directional[l]=e,l++}else if(b.isSpotLight){const e=t.get(b);e.position.setFromMatrixPosition(b.matrixWorld),e.color.copy(x).multiplyScalar(_),e.distance=S,e.coneCos=Math.cos(b.angle),e.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),e.decay=b.decay,r.spot[u]=e;const i=b.shadow;if(b.map&&(r.spotLightMap[g]=b.map,g++,i.updateMatrices(b),b.castShadow&&v++),r.spotLightMatrix[u]=i.matrix,b.castShadow){const e=n.get(b);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=w,m++}u++}else if(b.isRectAreaLight){const e=t.get(b);e.color.copy(x).multiplyScalar(_),e.halfWidth.set(.5*b.width,0,0),e.halfHeight.set(0,.5*b.height,0),r.rectArea[d]=e,d++}else if(b.isPointLight){const e=t.get(b);if(e.color.copy(b.color).multiplyScalar(b.intensity),e.distance=b.distance,e.decay=b.decay,b.castShadow){const e=b.shadow,t=n.get(b);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[c]=t,r.pointShadowMap[c]=w,r.pointShadowMatrix[c]=b.shadow.matrix,f++}r.point[c]=e,c++}else if(b.isHemisphereLight){const e=t.get(b);e.skyColor.copy(b.color).multiplyScalar(_),e.groundColor.copy(b.groundColor).multiplyScalar(_),r.hemi[h]=e,h++}}d>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=UA.LTC_FLOAT_1,r.rectAreaLTC2=UA.LTC_FLOAT_2):(r.rectAreaLTC1=UA.LTC_HALF_1,r.rectAreaLTC2=UA.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;const b=r.hash;b.directionalLength===l&&b.pointLength===c&&b.spotLength===u&&b.rectAreaLength===d&&b.hemiLength===h&&b.numDirectionalShadows===p&&b.numPointShadows===f&&b.numSpotShadows===m&&b.numSpotMaps===g&&b.numLightProbes===y||(r.directional.length=l,r.spot.length=u,r.rectArea.length=d,r.point.length=c,r.hemi.length=h,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=f,r.pointShadowMap.length=f,r.spotShadow.length=m,r.spotShadowMap.length=m,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=f,r.spotLightMatrix.length=m+g-v,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=v,r.numLightProbes=y,b.directionalLength=l,b.pointLength=c,b.spotLength=u,b.rectAreaLength=d,b.hemiLength=h,b.numDirectionalShadows=p,b.numPointShadows=f,b.numSpotShadows=m,b.numSpotMaps=g,b.numLightProbes=y,r.version=rT++)},setupView:function(e,t){let n=0,s=0,l=0,c=0,u=0;const d=t.matrixWorldInverse;for(let h=0,p=e.length;h<p;h++){const t=e[h];if(t.isDirectionalLight){const e=r.directional[n];e.direction.setFromMatrixPosition(t.matrixWorld),i.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),n++}else if(t.isSpotLight){const e=r.spot[l];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(t.matrixWorld),i.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),l++}else if(t.isRectAreaLight){const e=r.rectArea[c];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(t.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(t.isPointLight){const e=r.point[s];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(d),s++}else if(t.isHemisphereLight){const e=r.hemi[u];e.direction.setFromMatrixPosition(t.matrixWorld),e.direction.transformDirection(d),u++}}},state:r}}function oT(e){const t=new aT(e),n=[],r=[];const i={lightsArray:n,shadowsArray:r,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){i.camera=e,n.length=0,r.length=0},state:i,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function sT(e){let t=new WeakMap;return{get:function(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=t.get(n);let a;return void 0===i?(a=new oT(e),t.set(n,[a])):r>=i.length?(a=new oT(e),i.push(a)):a=i[r],a},dispose:function(){t=new WeakMap}}}class lT extends _E{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=d_,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 cT extends _E{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}}function uT(e,t,n){let r=new LA;const i=new _S,a=new _S,o=new WS,s=new lT({depthPacking:h_}),l=new cT,c={},u=n.maxTextureSize,d={[Dy]:Ly,[Ly]:Dy,[ky]:ky},h=new yA({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _S},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=h.clone();p.defines.HORIZONTAL_PASS=1;const f=new JE;f.setAttribute("position",new PE(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new dA(f,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Py;let v=this.type;function y(n,r){const a=t.update(m);h.defines.VSM_SAMPLES!==n.blurSamples&&(h.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,h.needsUpdate=!0,p.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new JS(i.x,i.y)),h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,h,m,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,p,m,null)}function b(t,n,r,i){let a=null;const o=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?l:s,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const e=a.uuid,t=n.uuid;let r=c[e];void 0===r&&(r={},c[e]=r);let i=r[t];void 0===i&&(i=a.clone(),r[t]=i,n.addEventListener("dispose",_)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=i===Iy?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial){e.properties.get(a).light=r}return a}function x(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===Iy)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=t.update(n),l=n.material;if(Array.isArray(l)){const t=r.groups;for(let c=0,u=t.length;c<u;c++){const u=t[c],d=l[u.materialIndex];if(d&&d.visible){const t=b(n,d,o,s);n.onBeforeShadow(e,n,i,a,r,t,u),e.renderBufferDirect(a,null,r,t,n,u),n.onAfterShadow(e,n,i,a,r,t,u)}}}else if(l.visible){const t=b(n,l,o,s);n.onBeforeShadow(e,n,i,a,r,t,null),e.renderBufferDirect(a,null,r,t,n,null),n.onAfterShadow(e,n,i,a,r,t,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)x(l[e],i,a,o,s)}function _(e){e.target.removeEventListener("dispose",_);for(const t in c){const n=c[t],r=e.target.uuid;if(r in n){n[r].dispose(),delete n[r]}}}this.render=function(t,n,s){if(!1===g.enabled)return;if(!1===g.autoUpdate&&!1===g.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),h=e.state;h.setBlending(Oy),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const p=v!==Iy&&this.type===Iy,f=v===Iy&&this.type!==Iy;for(let m=0,g=t.length;m<g;m++){const l=t[m],c=l.shadow;if(void 0===c){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===c.autoUpdate&&!1===c.needsUpdate)continue;i.copy(c.mapSize);const d=c.getFrameExtents();if(i.multiply(d),a.copy(c.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/d.x),i.x=a.x*d.x,c.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/d.y),i.y=a.y*d.y,c.mapSize.y=a.y)),null===c.map||!0===p||!0===f){const e=this.type!==Iy?{minFilter:Fb,magFilter:Fb}:{};null!==c.map&&c.map.dispose(),c.map=new JS(i.x,i.y,e),c.map.texture.name=l.name+".shadowMap",c.camera.updateProjectionMatrix()}e.setRenderTarget(c.map),e.clear();const g=c.getViewportCount();for(let e=0;e<g;e++){const t=c.getViewport(e);o.set(a.x*t.x,a.y*t.y,a.x*t.z,a.y*t.w),h.viewport(o),c.updateMatrices(l,e),r=c.getFrustum(),x(n,s,c.camera,l,this.type)}!0!==c.isPointLightShadow&&this.type===Iy&&y(c,s),c.needsUpdate=!1}v=this.type,g.needsUpdate=!1,e.setRenderTarget(l,c,d)}}function dT(e){const t=new function(){let t=!1;const n=new WS;let r=null;const i=new WS(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},n=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(t){t?U(e.DEPTH_TEST):z(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){switch(t){case lb:e.depthFunc(e.NEVER);break;case cb:e.depthFunc(e.ALWAYS);break;case ub:e.depthFunc(e.LESS);break;case db:e.depthFunc(e.LEQUAL);break;case hb:e.depthFunc(e.EQUAL);break;case pb:e.depthFunc(e.GEQUAL);break;case fb:e.depthFunc(e.GREATER);break;case mb:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},r=new function(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,c=null;return{setTest:function(n){t||(n?U(e.STENCIL_TEST):z(e.STENCIL_TEST))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&a===o||(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){o===t&&s===n&&l===r||(e.stencilOp(t,n,r),o=t,s=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,c=null}}},i=new WeakMap,a=new WeakMap;let o={},s={},l=new WeakMap,c=[],u=null,d=!1,h=null,p=null,f=null,m=null,g=null,v=null,y=null,b=new yE(0,0,0),x=0,_=!1,S=null,w=null,E=null,A=null,M=null;const C=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let T=!1,R=0;const P=e.getParameter(e.VERSION);-1!==P.indexOf("WebGL")?(R=parseFloat(/^WebGL (\d)/.exec(P)[1]),T=R>=1):-1!==P.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL ES (\d)/.exec(P)[1]),T=R>=2);let B=null,I={};const D=e.getParameter(e.SCISSOR_BOX),L=e.getParameter(e.VIEWPORT),k=(new WS).fromArray(D),O=(new WS).fromArray(L);function N(t,n,r,i){const a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let s=0;s<r;s++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}const F={};function U(t){!0!==o[t]&&(e.enable(t),o[t]=!0)}function z(t){!1!==o[t]&&(e.disable(t),o[t]=!1)}F[e.TEXTURE_2D]=N(e.TEXTURE_2D,e.TEXTURE_2D,1),F[e.TEXTURE_CUBE_MAP]=N(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),F[e.TEXTURE_2D_ARRAY]=N(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),F[e.TEXTURE_3D]=N(e.TEXTURE_3D,e.TEXTURE_3D,1,1),t.setClear(0,0,0,1),n.setClear(1),r.setClear(0),U(e.DEPTH_TEST),n.setFunc(db),V(!1),W(My),U(e.CULL_FACE),j(Oy);const H={[Gy]:e.FUNC_ADD,[jy]:e.FUNC_SUBTRACT,[Vy]:e.FUNC_REVERSE_SUBTRACT};H[Wy]=e.MIN,H[Xy]=e.MAX;const G={[Jy]:e.ZERO,[$y]:e.ONE,[Ky]:e.SRC_COLOR,[qy]:e.SRC_ALPHA,[rb]:e.SRC_ALPHA_SATURATE,[tb]:e.DST_COLOR,[Zy]:e.DST_ALPHA,[Yy]:e.ONE_MINUS_SRC_COLOR,[Qy]:e.ONE_MINUS_SRC_ALPHA,[nb]:e.ONE_MINUS_DST_COLOR,[eb]:e.ONE_MINUS_DST_ALPHA,[ib]:e.CONSTANT_COLOR,[ab]:e.ONE_MINUS_CONSTANT_COLOR,[ob]:e.CONSTANT_ALPHA,[sb]:e.ONE_MINUS_CONSTANT_ALPHA};function j(t,n,r,i,a,o,s,l,c,u){if(t!==Oy){if(!1===d&&(U(e.BLEND),d=!0),t===Hy)a=a||n,o=o||r,s=s||i,n===p&&a===g||(e.blendEquationSeparate(H[n],H[a]),p=n,g=a),r===f&&i===m&&o===v&&s===y||(e.blendFuncSeparate(G[r],G[i],G[o],G[s]),f=r,m=i,v=o,y=s),!1!==l.equals(b)&&c===x||(e.blendColor(l.r,l.g,l.b,c),b.copy(l),x=c),h=t,_=!1;else if(t!==h||u!==_){if(p===Gy&&g===Gy||(e.blendEquation(e.FUNC_ADD),p=Gy,g=Gy),u)switch(t){case Ny:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case Fy:e.blendFunc(e.ONE,e.ONE);break;case Uy:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case zy:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case Ny:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case Fy:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case Uy:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case zy:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}f=null,m=null,v=null,y=null,b.set(0,0,0),x=0,h=t,_=u}}else!0===d&&(z(e.BLEND),d=!1)}function V(t){S!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),S=t)}function W(t){t!==Ay?(U(e.CULL_FACE),t!==w&&(t===My?e.cullFace(e.BACK):t===Cy?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):z(e.CULL_FACE),w=t}function X(t,n,r){t?(U(e.POLYGON_OFFSET_FILL),A===n&&M===r||(e.polygonOffset(n,r),A=n,M=r)):z(e.POLYGON_OFFSET_FILL)}return{buffers:{color:t,depth:n,stencil:r},enable:U,disable:z,bindFramebuffer:function(t,n){return s[t]!==n&&(e.bindFramebuffer(t,n),s[t]=n,t===e.DRAW_FRAMEBUFFER&&(s[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(s[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let r=c,i=!1;if(t){r=l.get(n),void 0===r&&(r=[],l.set(n,r));const a=t.textures;if(r.length!==a.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=a.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)},useProgram:function(t){return u!==t&&(e.useProgram(t),u=t,!0)},setBlending:j,setMaterial:function(i,a){i.side===ky?z(e.CULL_FACE):U(e.CULL_FACE);let o=i.side===Ly;a&&(o=!o),V(o),i.blending===Ny&&!1===i.transparent?j(Oy):j(i.blending,i.blendEquation,i.blendSrc,i.blendDst,i.blendEquationAlpha,i.blendSrcAlpha,i.blendDstAlpha,i.blendColor,i.blendAlpha,i.premultipliedAlpha),n.setFunc(i.depthFunc),n.setTest(i.depthTest),n.setMask(i.depthWrite),t.setMask(i.colorWrite);const s=i.stencilWrite;r.setTest(s),s&&(r.setMask(i.stencilWriteMask),r.setFunc(i.stencilFunc,i.stencilRef,i.stencilFuncMask),r.setOp(i.stencilFail,i.stencilZFail,i.stencilZPass)),X(i.polygonOffset,i.polygonOffsetFactor,i.polygonOffsetUnits),!0===i.alphaToCoverage?U(e.SAMPLE_ALPHA_TO_COVERAGE):z(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:V,setCullFace:W,setLineWidth:function(t){t!==E&&(T&&e.lineWidth(t),E=t)},setPolygonOffset:X,setScissorTest:function(t){t?U(e.SCISSOR_TEST):z(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+C-1),B!==t&&(e.activeTexture(t),B=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===B?e.TEXTURE0+C-1:B);let i=I[r];void 0===i&&(i={type:void 0,texture:void 0},I[r]=i),i.type===t&&i.texture===n||(B!==r&&(e.activeTexture(r),B=r),e.bindTexture(t,n||F[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=I[B];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},updateUBOMapping:function(t,n){let r=a.get(n);void 0===r&&(r=new WeakMap,a.set(n,r));let i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){const r=a.get(n).get(t);i.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),i.set(n,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(cO){console.error("THREE.WebGLState:",cO)}},scissor:function(t){!1===k.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),k.copy(t))},viewport:function(t){!1===O.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),O.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),o={},B=null,I={},s={},l=new WeakMap,c=[],u=null,d=!1,h=null,p=null,f=null,m=null,g=null,v=null,y=null,b=new yE(0,0,0),x=0,_=!1,S=null,w=null,E=null,A=null,M=null,k.set(0,0,e.canvas.width,e.canvas.height),O.set(0,0,e.canvas.width,e.canvas.height),t.reset(),n.reset(),r.reset()}}}function hT(e,t,n,r){const i=function(e){switch(e){case $b:case Kb:return{byteLength:1,components:1};case qb:case Yb:case tx:return{byteLength:2,components:1};case nx:case rx:return{byteLength:2,components:4};case Zb:case Qb:case ex:return{byteLength:4,components:1};case ax:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${e}.`)}(r);switch(n){case ox:case cx:return e*t;case ux:return e*t*2;case px:case fx:return e*t/i.components*i.byteLength;case mx:case gx:return e*t*2/i.components*i.byteLength;case sx:return e*t*3/i.components*i.byteLength;case lx:case yx:return e*t*4/i.components*i.byteLength;case bx:case xx:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case _x:case Sx:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Ex:case Mx:return Math.max(e,16)*Math.max(t,8)/4;case wx:case Ax:return Math.max(e,8)*Math.max(t,8)/2;case Cx:case Tx:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Rx:case Px:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Bx:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case Ix:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case Dx:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case Lx:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case kx:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case Ox:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case Nx:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case Fx:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case Ux:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case zx:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case Hx:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case Gx:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case jx:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case Vx:case Wx:case Xx:return Math.ceil(e/4)*Math.ceil(t/4)*16;case Jx:case $x:return Math.ceil(e/4)*Math.ceil(t/4)*8;case Kx:case Yx:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}const pT={contain:function(e,t){const n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e},cover:function(e,t){const n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e},fill:function(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e},getByteLength:hT};function fT(e,t,n,r,i,a,o){const s=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!==typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new _S,u=new WeakMap;let d;const h=new WeakMap;let p=!1;try{p="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(H){}function f(e,t){return p?new OffscreenCanvas(e,t):CS("canvas")}function m(e,t,n){let r=1;const i=z(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!==typeof VideoFrame&&e instanceof VideoFrame){const n=Math.floor(r*i.width),a=Math.floor(r*i.height);void 0===d&&(d=f(n,a));const o=t?f(n,a):d;o.width=n,o.height=a;return o.getContext("2d").drawImage(e,0,0,n,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+i.width+"x"+i.height+") to ("+n+"x"+a+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+i.width+"x"+i.height+")."),e}return e}function g(e){return e.generateMipmaps&&e.minFilter!==Fb&&e.minFilter!==jb}function v(t){e.generateMipmap(t)}function y(n,r,i,a){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let s=r;if(r===e.RED&&(i===e.FLOAT&&(s=e.R32F),i===e.HALF_FLOAT&&(s=e.R16F),i===e.UNSIGNED_BYTE&&(s=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.R8UI),i===e.UNSIGNED_SHORT&&(s=e.R16UI),i===e.UNSIGNED_INT&&(s=e.R32UI),i===e.BYTE&&(s=e.R8I),i===e.SHORT&&(s=e.R16I),i===e.INT&&(s=e.R32I)),r===e.RG&&(i===e.FLOAT&&(s=e.RG32F),i===e.HALF_FLOAT&&(s=e.RG16F),i===e.UNSIGNED_BYTE&&(s=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RG8UI),i===e.UNSIGNED_SHORT&&(s=e.RG16UI),i===e.UNSIGNED_INT&&(s=e.RG32UI),i===e.BYTE&&(s=e.RG8I),i===e.SHORT&&(s=e.RG16I),i===e.INT&&(s=e.RG32I)),r===e.RGB&&i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),r===e.RGBA){const t=o?S_:kS.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=t===w_?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return s!==e.R16F&&s!==e.R32F&&s!==e.RG16F&&s!==e.RG32F&&s!==e.RGBA16F&&s!==e.RGBA32F||t.get("EXT_color_buffer_float"),s}function b(t,n){let r;return t?null===n||n===Zb||n===ix?r=e.DEPTH24_STENCIL8:n===ex?r=e.DEPTH32F_STENCIL8:n===qb&&(r=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===Zb||n===ix?r=e.DEPTH_COMPONENT24:n===ex?r=e.DEPTH_COMPONENT32F:n===qb&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==Fb&&e.minFilter!==jb?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function _(e){const t=e.target;t.removeEventListener("dispose",_),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=h.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&w(e),0===Object.keys(i).length&&h.delete(n)}r.remove(e)}(t),t.isVideoTexture&&u.delete(t)}function S(t){const n=t.target;n.removeEventListener("dispose",S),function(t){const n=r.get(t);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let r=0;r<6;r++){if(Array.isArray(n.__webglFramebuffer[r]))for(let t=0;t<n.__webglFramebuffer[r].length;t++)e.deleteFramebuffer(n.__webglFramebuffer[r][t]);else e.deleteFramebuffer(n.__webglFramebuffer[r]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[r])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const i=t.textures;for(let a=0,s=i.length;a<s;a++){const t=r.get(i[a]);t.__webglTexture&&(e.deleteTexture(t.__webglTexture),o.memory.textures--),r.remove(i[a])}r.remove(t)}(n)}function w(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete h.get(i)[n.__cacheKey],o.memory.textures--}let E=0;function A(t,i){const a=r.get(t);if(t.isVideoTexture&&function(e){const t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void B(a,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}const M={[kb]:e.REPEAT,[Ob]:e.CLAMP_TO_EDGE,[Nb]:e.MIRRORED_REPEAT},C={[Fb]:e.NEAREST,[Ub]:e.NEAREST_MIPMAP_NEAREST,[Hb]:e.NEAREST_MIPMAP_LINEAR,[jb]:e.LINEAR,[Vb]:e.LINEAR_MIPMAP_NEAREST,[Xb]:e.LINEAR_MIPMAP_LINEAR},T={[G_]:e.NEVER,[K_]:e.ALWAYS,[j_]:e.LESS,[W_]:e.LEQUAL,[V_]:e.EQUAL,[$_]:e.GEQUAL,[X_]:e.GREATER,[J_]:e.NOTEQUAL};function R(n,a){if(a.type!==ex||!1!==t.has("OES_texture_float_linear")||a.magFilter!==jb&&a.magFilter!==Vb&&a.magFilter!==Hb&&a.magFilter!==Xb&&a.minFilter!==jb&&a.minFilter!==Vb&&a.minFilter!==Hb&&a.minFilter!==Xb||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,M[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,M[a.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,M[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,C[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,C[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,T[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(a.magFilter===Fb)return;if(a.minFilter!==Hb&&a.minFilter!==Xb)return;if(a.type===ex&&!1===t.has("OES_texture_float_linear"))return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){const o=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function P(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",_));const i=n.source;let a=h.get(i);void 0===a&&(a={},h.set(i,a));const s=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(s!==t.__cacheKey){void 0===a[s]&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;const i=a[t.__cacheKey];void 0!==i&&(a[t.__cacheKey].usedTimes--,0===i.usedTimes&&w(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function B(t,o,s){let l=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=e.TEXTURE_3D);const c=P(t,o),u=o.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+s);const d=r.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(e.TEXTURE0+s);const t=kS.getPrimaries(kS.workingColorSpace),r=o.colorSpace===v_?null:kS.getPrimaries(o.colorSpace),h=o.colorSpace===v_||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);let p=m(o.image,!1,i.maxTextureSize);p=U(o,p);const f=a.convert(o.format,o.colorSpace),_=a.convert(o.type);let S,w=y(o.internalFormat,f,_,o.colorSpace,o.isVideoTexture);R(l,o);const E=o.mipmaps,A=!0!==o.isVideoTexture,M=void 0===d.__version||!0===c,C=u.dataReady,T=x(o,p);if(o.isDepthTexture)w=b(o.format===hx,o.type),M&&(A?n.texStorage2D(e.TEXTURE_2D,1,w,p.width,p.height):n.texImage2D(e.TEXTURE_2D,0,w,p.width,p.height,0,f,_,null));else if(o.isDataTexture)if(E.length>0){A&&M&&n.texStorage2D(e.TEXTURE_2D,T,w,E[0].width,E[0].height);for(let t=0,r=E.length;t<r;t++)S=E[t],A?C&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,f,_,S.data):n.texImage2D(e.TEXTURE_2D,t,w,S.width,S.height,0,f,_,S.data);o.generateMipmaps=!1}else A?(M&&n.texStorage2D(e.TEXTURE_2D,T,w,p.width,p.height),C&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,p.width,p.height,f,_,p.data)):n.texImage2D(e.TEXTURE_2D,0,w,p.width,p.height,0,f,_,p.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){A&&M&&n.texStorage3D(e.TEXTURE_2D_ARRAY,T,w,E[0].width,E[0].height,p.depth);for(let t=0,r=E.length;t<r;t++)if(S=E[t],o.format!==lx)if(null!==f)if(A){if(C)if(o.layerUpdates.size>0){const r=hT(S.width,S.height,o.format,o.type);for(const i of o.layerUpdates){const a=S.data.subarray(i*r/S.data.BYTES_PER_ELEMENT,(i+1)*r/S.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,S.width,S.height,1,f,a,0,0)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,p.depth,f,S.data,0,0)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,w,S.width,S.height,p.depth,0,S.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else A?C&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,p.depth,f,_,S.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,w,S.width,S.height,p.depth,0,f,_,S.data)}else{A&&M&&n.texStorage2D(e.TEXTURE_2D,T,w,E[0].width,E[0].height);for(let t=0,r=E.length;t<r;t++)S=E[t],o.format!==lx?null!==f?A?C&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,f,S.data):n.compressedTexImage2D(e.TEXTURE_2D,t,w,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):A?C&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,f,_,S.data):n.texImage2D(e.TEXTURE_2D,t,w,S.width,S.height,0,f,_,S.data)}else if(o.isDataArrayTexture)if(A){if(M&&n.texStorage3D(e.TEXTURE_2D_ARRAY,T,w,p.width,p.height,p.depth),C)if(o.layerUpdates.size>0){const t=hT(p.width,p.height,o.format,o.type);for(const r of o.layerUpdates){const i=p.data.subarray(r*t/p.data.BYTES_PER_ELEMENT,(r+1)*t/p.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,p.width,p.height,1,f,_,i)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,f,_,p.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,w,p.width,p.height,p.depth,0,f,_,p.data);else if(o.isData3DTexture)A?(M&&n.texStorage3D(e.TEXTURE_3D,T,w,p.width,p.height,p.depth),C&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,f,_,p.data)):n.texImage3D(e.TEXTURE_3D,0,w,p.width,p.height,p.depth,0,f,_,p.data);else if(o.isFramebufferTexture){if(M)if(A)n.texStorage2D(e.TEXTURE_2D,T,w,p.width,p.height);else{let t=p.width,r=p.height;for(let i=0;i<T;i++)n.texImage2D(e.TEXTURE_2D,i,w,t,r,0,f,_,null),t>>=1,r>>=1}}else if(E.length>0){if(A&&M){const t=z(E[0]);n.texStorage2D(e.TEXTURE_2D,T,w,t.width,t.height)}for(let t=0,r=E.length;t<r;t++)S=E[t],A?C&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,f,_,S):n.texImage2D(e.TEXTURE_2D,t,w,f,_,S);o.generateMipmaps=!1}else if(A){if(M){const t=z(p);n.texStorage2D(e.TEXTURE_2D,T,w,t.width,t.height)}C&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,f,_,p)}else n.texImage2D(e.TEXTURE_2D,0,w,f,_,p);g(o)&&v(l),d.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function I(t,i,o,l,c,u){const d=a.convert(o.format,o.colorSpace),h=a.convert(o.type),p=y(o.internalFormat,d,h,o.colorSpace);if(!r.get(i).__hasExternalTextures){const t=Math.max(1,i.width>>u),r=Math.max(1,i.height>>u);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?n.texImage3D(c,u,p,t,r,i.depth,0,d,h,null):n.texImage2D(c,u,p,t,r,0,d,h,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),F(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,l,c,r.get(o).__webglTexture,0,N(i)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,c,r.get(o).__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function D(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){const i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=b(n.stencilBuffer,a),l=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=N(n);F(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,c,o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,c,o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,t)}else{const t=n.textures;for(let i=0;i<t.length;i++){const o=t[i],l=a.convert(o.format,o.colorSpace),c=a.convert(o.type),u=y(o.internalFormat,l,c,o.colorSpace),d=N(n);r&&!1===F(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,d,u,n.width,n.height):F(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,d,u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function L(t){const i=r.get(t),a=!0===t.isWebGLCubeRenderTarget;if(i.__boundDepthTexture!==t.depthTexture){const e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){const t=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),A(i.depthTexture,0);const a=r.get(i.depthTexture).__webglTexture,o=N(i);if(i.depthTexture.format===dx)F(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0);else{if(i.depthTexture.format!==hx)throw new Error("Unknown depthTexture format");F(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0)}}(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),void 0===i.__webglDepthbuffer[r])i.__webglDepthbuffer[r]=e.createRenderbuffer(),D(i.__webglDepthbuffer[r],t,!1);else{const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),void 0===i.__webglDepthbuffer)i.__webglDepthbuffer=e.createRenderbuffer(),D(i.__webglDepthbuffer,t,!1);else{const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}n.bindFramebuffer(e.FRAMEBUFFER,null)}const k=[],O=[];function N(e){return Math.min(i.maxSamples,e.samples)}function F(e){const n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function U(e,t){const n=e.colorSpace,r=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==b_&&n!==v_&&(kS.getTransfer(n)===w_?r===lx&&i===$b||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function z(e){return"undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"undefined"!==typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){const e=E;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),E+=1,e},this.resetTextureUnits=function(){E=0},this.setTexture2D=A,this.setTexture2DArray=function(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?B(a,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?B(a,t,i):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,o){const s=r.get(t);t.version>0&&s.__version!==t.version?function(t,o,s){if(6!==o.image.length)return;const l=P(t,o),c=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);const u=r.get(c);if(c.version!==u.__version||!0===l){n.activeTexture(e.TEXTURE0+s);const t=kS.getPrimaries(kS.workingColorSpace),r=o.colorSpace===v_?null:kS.getPrimaries(o.colorSpace),d=o.colorSpace===v_||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const h=o.isCompressedTexture||o.image[0].isCompressedTexture,p=o.image[0]&&o.image[0].isDataTexture,f=[];for(let e=0;e<6;e++)f[e]=h||p?p?o.image[e].image:o.image[e]:m(o.image[e],!0,i.maxCubemapSize),f[e]=U(o,f[e]);const b=f[0],_=a.convert(o.format,o.colorSpace),S=a.convert(o.type),w=y(o.internalFormat,_,S,o.colorSpace),E=!0!==o.isVideoTexture,A=void 0===u.__version||!0===l,M=c.dataReady;let C,T=x(o,b);if(R(e.TEXTURE_CUBE_MAP,o),h){E&&A&&n.texStorage2D(e.TEXTURE_CUBE_MAP,T,w,b.width,b.height);for(let t=0;t<6;t++){C=f[t].mipmaps;for(let r=0;r<C.length;r++){const i=C[r];o.format!==lx?null!==_?E?M&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,_,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,w,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):E?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,_,S,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,w,i.width,i.height,0,_,S,i.data)}}}else{if(C=o.mipmaps,E&&A){C.length>0&&T++;const t=z(f[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,T,w,t.width,t.height)}for(let t=0;t<6;t++)if(p){E?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,f[t].width,f[t].height,_,S,f[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,f[t].width,f[t].height,0,_,S,f[t].data);for(let r=0;r<C.length;r++){const i=C[r].image[t].image;E?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,_,S,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,w,i.width,i.height,0,_,S,i.data)}}else{E?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,_,S,f[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,_,S,f[t]);for(let r=0;r<C.length;r++){const i=C[r];E?M&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,_,S,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,w,_,S,i.image[t])}}}g(o)&&v(e.TEXTURE_CUBE_MAP),u.__version=c.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(s,t,o):n.bindTexture(e.TEXTURE_CUBE_MAP,s.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,n,i){const a=r.get(t);void 0!==n&&I(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&L(t)},this.setupRenderTarget=function(t){const i=t.texture,s=r.get(t),l=r.get(i);t.addEventListener("dispose",S);const c=t.textures,u=!0===t.isWebGLCubeRenderTarget,d=c.length>1;if(d||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(d)for(let t=0,n=c.length;t<n;t++){const n=r.get(c[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===F(t)){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<c.length;n++){const r=c[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);const i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),l=y(r.internalFormat,i,o,r.colorSpace,!0===t.isXRRenderTarget),u=N(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),D(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),R(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)I(s.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else I(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);g(i)&&v(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){for(let i=0,a=c.length;i<a;i++){const a=c[i],o=r.get(a);n.bindTexture(e.TEXTURE_2D,o.__webglTexture),R(e.TEXTURE_2D,a),I(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+i,e.TEXTURE_2D,0),g(a)&&v(e.TEXTURE_2D)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,l.__webglTexture),R(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)I(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else I(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);g(i)&&v(r),n.unbindTexture()}t.depthBuffer&&L(t)},this.updateRenderTargetMipmap=function(t){const i=t.textures;for(let a=0,o=i.length;a<o;a++){const o=i[a];if(g(o)){const i=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=r.get(o).__webglTexture;n.bindTexture(i,a),v(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0)if(!1===F(t)){const i=t.textures,a=t.width,o=t.height;let s=e.COLOR_BUFFER_BIT;const c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),d){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]);const t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),!0===l&&(k.length=0,O.length=0,k.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(k.push(c),O.push(c),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,O)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,k))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);const a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&l){const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=L,this.setupFrameBufferTexture=I,this.useMultisampledRTT=F}function mT(e,t){return{convert:function(n){let r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v_;const a=kS.getTransfer(i);if(n===$b)return e.UNSIGNED_BYTE;if(n===nx)return e.UNSIGNED_SHORT_4_4_4_4;if(n===rx)return e.UNSIGNED_SHORT_5_5_5_1;if(n===ax)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===Kb)return e.BYTE;if(n===Yb)return e.SHORT;if(n===qb)return e.UNSIGNED_SHORT;if(n===Qb)return e.INT;if(n===Zb)return e.UNSIGNED_INT;if(n===ex)return e.FLOAT;if(n===tx)return e.HALF_FLOAT;if(n===ox)return e.ALPHA;if(n===sx)return e.RGB;if(n===lx)return e.RGBA;if(n===cx)return e.LUMINANCE;if(n===ux)return e.LUMINANCE_ALPHA;if(n===dx)return e.DEPTH_COMPONENT;if(n===hx)return e.DEPTH_STENCIL;if(n===px)return e.RED;if(n===fx)return e.RED_INTEGER;if(n===mx)return e.RG;if(n===gx)return e.RG_INTEGER;if(n===yx)return e.RGBA_INTEGER;if(n===bx||n===xx||n===_x||n===Sx)if(a===w_){if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(n===bx)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===xx)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===_x)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Sx)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=t.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(n===bx)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===xx)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===_x)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Sx)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===wx||n===Ex||n===Ax||n===Mx){if(r=t.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(n===wx)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Ex)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ax)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Mx)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===Cx||n===Tx||n===Rx){if(r=t.get("WEBGL_compressed_texture_etc"),null===r)return null;if(n===Cx||n===Tx)return a===w_?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Rx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(n===Px||n===Bx||n===Ix||n===Dx||n===Lx||n===kx||n===Ox||n===Nx||n===Fx||n===Ux||n===zx||n===Hx||n===Gx||n===jx){if(r=t.get("WEBGL_compressed_texture_astc"),null===r)return null;if(n===Px)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Bx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Ix)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Dx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Lx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===kx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ox)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Nx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Fx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ux)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===zx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Hx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Gx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===jx)return a===w_?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===Vx||n===Wx||n===Xx){if(r=t.get("EXT_texture_compression_bptc"),null===r)return null;if(n===Vx)return a===w_?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Wx)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Xx)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===Jx||n===$x||n===Kx||n===Yx){if(r=t.get("EXT_texture_compression_rgtc"),null===r)return null;if(n===Vx)return r.COMPRESSED_RED_RGTC1_EXT;if(n===$x)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Kx)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Yx)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===ix?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class gT extends wA{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isArrayCamera=!0,this.cameras=e}}class vT extends nE{constructor(){super(),this.isGroup=!0,this.type="Group"}}const yT={type:"move"};class bT{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new vT,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new vT,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ZS,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ZS),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new vT,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ZS,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ZS),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){a=!0;for(const a of e.hand.values()){const e=t.getJointPose(a,n),r=this._getHandJoint(l,a);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,c=.005;l.inputState.pinching&&o>s+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=s-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(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));null!==o&&(r=t.getPose(e.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(yT)))}return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new vT;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class xT{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){const r=new VS;e.properties.get(r).__webglTexture=t.texture,t.depthNear==n.depthNear&&t.depthFar==n.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,n=new yA({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new dA(new NA(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class _T extends cS{constructor(e,t){super();const n=this;let r=null,i=1,a=null,o="local-floor",s=1,l=null,c=null,u=null,d=null,h=null,p=null;const f=new xT,m=t.getContextAttributes();let g=null,v=null;const y=[],b=[],x=new _S;let _=null;const S=new wA;S.layers.enable(1),S.viewport=new WS;const w=new wA;w.layers.enable(2),w.viewport=new WS;const E=[S,w],A=new gT;A.layers.enable(1),A.layers.enable(2);let M=null,C=null;function T(e){const t=b.indexOf(e.inputSource);if(-1===t)return;const n=y[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function R(){r.removeEventListener("select",T),r.removeEventListener("selectstart",T),r.removeEventListener("selectend",T),r.removeEventListener("squeeze",T),r.removeEventListener("squeezestart",T),r.removeEventListener("squeezeend",T),r.removeEventListener("end",R),r.removeEventListener("inputsourceschange",P);for(let e=0;e<y.length;e++){const t=b[e];null!==t&&(b[e]=null,y[e].disconnect(t))}M=null,C=null,f.reset(),e.setRenderTarget(g),h=null,d=null,u=null,r=null,v=null,k.stop(),n.isPresenting=!1,e.setPixelRatio(_),e.setSize(x.width,x.height,!1),n.dispatchEvent({type:"sessionend"})}function P(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=b.indexOf(n);r>=0&&(b[r]=null,y[r].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let r=b.indexOf(n);if(-1===r){for(let e=0;e<y.length;e++){if(e>=b.length){b.push(n),r=e;break}if(null===b[e]){b[e]=n,r=e;break}}if(-1===r)break}const i=y[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=y[e];return void 0===t&&(t=new bT,y[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=y[e];return void 0===t&&(t=new bT,y[e]=t),t.getGripSpace()},this.getHand=function(e){let t=y[e];return void 0===t&&(t=new bT,y[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==d?d:h},this.getBinding=function(){return u},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(c){if(r=c,null!==r){if(g=e.getRenderTarget(),r.addEventListener("select",T),r.addEventListener("selectstart",T),r.addEventListener("selectend",T),r.addEventListener("squeeze",T),r.addEventListener("squeezestart",T),r.addEventListener("squeezeend",T),r.addEventListener("end",R),r.addEventListener("inputsourceschange",P),!0!==m.xrCompatible&&await t.makeXRCompatible(),_=e.getPixelRatio(),e.getSize(x),void 0===r.renderState.layers){const n={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:i};h=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),v=new JS(h.framebufferWidth,h.framebufferHeight,{format:lx,type:$b,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,a=null,o=null;m.depth&&(o=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=m.stencil?hx:dx,a=m.stencil?ix:Zb);const s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=new XRWebGLBinding(r,t),d=u.createProjectionLayer(s),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),v=new JS(d.textureWidth,d.textureHeight,{format:lx,type:$b,depthTexture:new _M(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:!1===d.ignoreDepthValues})}v.isXRRenderTarget=!0,this.setFoveation(s),l=null,a=await r.requestReferenceSpace(o),k.setContext(r),k.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode},this.getDepthTexture=function(){return f.getDepthTexture()};const B=new ZS,I=new ZS;function D(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;let t=e.near,n=e.far;null!==f.texture&&(f.depthNear>0&&(t=f.depthNear),f.depthFar>0&&(n=f.depthFar)),A.near=w.near=S.near=t,A.far=w.far=S.far=n,M===A.near&&C===A.far||(r.updateRenderState({depthNear:A.near,depthFar:A.far}),M=A.near,C=A.far);const i=e.parent,a=A.cameras;D(A,i);for(let r=0;r<a.length;r++)D(a[r],i);2===a.length?function(e,t,n){B.setFromMatrixPosition(t.matrixWorld),I.setFromMatrixPosition(n.matrixWorld);const r=B.distanceTo(I),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],h=o*u,p=o*d,f=r/(-u+d),m=f*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),-1===i[10])e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{const t=o+f,n=s+f,i=h-m,a=p+(r-m),u=l*s/n*t,d=c*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(A,S,w):A.projectionMatrix.copy(S.projectionMatrix),function(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld));e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*pS*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,A,i)},this.getCamera=function(){return A},this.getFoveation=function(){if(null!==d||null!==h)return s},this.setFoveation=function(e){s=e,null!==d&&(d.fixedFoveation=e),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==f.texture},this.getDepthSensingMesh=function(){return f.getMesh(A)};let L=null;const k=new kA;k.setAnimationLoop((function(t,i){if(c=i.getViewerPose(l||a),p=i,null!==c){const t=c.views;null!==h&&(e.setRenderTargetFramebuffer(v,h.framebuffer),e.setRenderTarget(v));let n=!1;t.length!==A.cameras.length&&(A.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let a=null;if(null!==h)a=h.getViewport(i);else{const t=u.getViewSubImage(d,i);a=t.viewport,0===r&&(e.setRenderTargetTextures(v,t.colorTexture,d.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(v))}let o=E[r];void 0===o&&(o=new wA,o.layers.enable(r),o.viewport=new WS,E[r]=o),o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(i.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),0===r&&(A.matrix.copy(o.matrix),A.matrix.decompose(A.position,A.quaternion,A.scale)),!0===n&&A.cameras.push(o)}const i=r.enabledFeatures;if(i&&i.includes("depth-sensing")){const n=u.getDepthInformation(t[0]);n&&n.isValid&&n.texture&&f.init(e,n,r.renderState)}}for(let e=0;e<y.length;e++){const t=b[e],n=y[e];null!==t&&void 0!==n&&n.update(t,i,l||a)}L&&L(t,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),p=null})),this.setAnimationLoop=function(e){L=e},this.dispose=function(){}}}const ST=new Uw,wT=new Rw;function ET(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,r.side===Ly&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),r.side===Ly&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);const i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,ST.copy(o),ST.x*=-1,ST.y*=-1,ST.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(ST.y*=-1,ST.z*=-1),e.envMapRotation.value.setFromMatrix4(wT.makeRotationFromEuler(ST)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,gA(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,a,o,s){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(r(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(r(e,i),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform));e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform));t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===Ly&&e.clearcoatNormalScale.value.negate()));t.dispersion>0&&(e.dispersion.value=t.dispersion);t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform)));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,i,s)):i.isMeshMatcapMaterial?(r(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,n){const r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*i,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,a,o):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function AT(e,t,n,r){let i={},a={},o=[];const s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e,t,n,r){const i=e.value,a=t+"_"+n;if(void 0===r[a])return r[a]="number"===typeof i||"boolean"===typeof i?i:i.clone(),!0;{const e=r[a];if("number"===typeof i||"boolean"===typeof i){if(e!==i)return r[a]=i,!0}else if(!1===e.equals(i))return e.copy(i),!0}return!1}function c(e){const t={boundary:0,storage:0};return"number"===typeof e||"boolean"===typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){const n=t.target;n.removeEventListener("dispose",u);const r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function(n,d){let h=i[n.id];void 0===h&&(!function(e){const t=e.uniforms;let n=0;const r=16;for(let a=0,o=t.length;a<o;a++){const e=Array.isArray(t[a])?t[a]:[t[a]];for(let t=0,i=e.length;t<i;t++){const i=e[t],a=Array.isArray(i.value)?i.value:[i.value];for(let e=0,t=a.length;e<t;e++){const t=c(a[e]),o=n%r,s=o%t.boundary,l=o+s;n+=s,0!==l&&r-l<t.storage&&(n+=r-l),i.__data=new Float32Array(t.storage/Float32Array.BYTES_PER_ELEMENT),i.__offset=n,n+=t.storage}}}const i=n%r;i>0&&(n+=r-i);e.__size=n,e.__cache={}}(n),h=function(t){const n=function(){for(let e=0;e<s;e++)if(-1===o.indexOf(e))return o.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=h,n.addEventListener("dispose",u));const p=d.program;r.updateUBOMapping(n,p);const f=t.render.frame;a[n.id]!==f&&(!function(t){const n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let i=0,o=r.length;i<o;i++){const t=Array.isArray(r[i])?r[i]:[r[i]];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!0===l(r,i,n,a)){const t=r.__offset,n=Array.isArray(r.value)?r.value:[r.value];let i=0;for(let a=0;a<n.length;a++){const o=n[a],s=c(o);"number"===typeof o||"boolean"===typeof o?(r.__data[0]=o,e.bufferSubData(e.UNIFORM_BUFFER,t+i,r.__data)):o.isMatrix3?(r.__data[0]=o.elements[0],r.__data[1]=o.elements[1],r.__data[2]=o.elements[2],r.__data[3]=0,r.__data[4]=o.elements[3],r.__data[5]=o.elements[4],r.__data[6]=o.elements[5],r.__data[7]=0,r.__data[8]=o.elements[6],r.__data[9]=o.elements[7],r.__data[10]=o.elements[8],r.__data[11]=0):(o.toArray(r.__data,i),i+=s.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,r.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),a[n.id]=f)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}}}class MT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{canvas:t=TS(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=e;let d;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!==typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=a;const h=new Uint32Array(4),p=new Int32Array(4);let f=null,m=null;const g=[],v=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=y_,this.toneMapping=bb,this.toneMappingExposure=1;const y=this;let b=!1,x=0,_=0,S=null,w=-1,E=null;const A=new WS,M=new WS;let C=null;const T=new yE(0);let R=0,P=t.width,B=t.height,I=1,D=null,L=null;const k=new WS(0,0,P,B),O=new WS(0,0,P,B);let N=!1;const F=new LA;let U=!1,z=!1;const H=new Rw,G=new ZS,j=new WS,V={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let W=!1;function X(){return null===S?I:1}let J,$,K,Y,q,Q,Z,ee,te,ne,re,ie,ae,oe,se,le,ce,ue,de,he,pe,fe,me,ge,ve=n;function ye(e,n){return t.getContext(e,n)}try{const e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Sy}`),t.addEventListener("webglcontextlost",_e,!1),t.addEventListener("webglcontextrestored",Se,!1),t.addEventListener("webglcontextcreationerror",we,!1),null===ve){const t="webgl2";if(ve=ye(t,e),null===ve)throw ye(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(cO){throw console.error("THREE.WebGLRenderer: "+cO.message),cO}function be(){J=new mM(ve),J.init(),fe=new mT(ve,J),$=new JA(ve,J,e,fe),K=new dT(ve),Y=new yM(ve),q=new qC,Q=new fT(ve,J,K,q,$,fe,Y),Z=new KA(y),ee=new fM(y),te=new OA(ve),me=new WA(ve,te),ne=new gM(ve,te,Y,me),re=new xM(ve,ne,te,Y),de=new bM(ve,$,Q),le=new $A(q),ie=new YC(y,Z,ee,J,$,me,le),ae=new ET(y,q),oe=new tT,se=new sT(J),ue=new VA(y,Z,ee,K,re,d,s),ce=new uT(y,re,$),ge=new AT(ve,Y,$,K),he=new XA(ve,J,Y),pe=new vM(ve,J,Y),Y.programs=ie.programs,y.capabilities=$,y.extensions=J,y.properties=q,y.renderLists=oe,y.shadowMap=ce,y.state=K,y.info=Y}be();const xe=new _T(y,ve);function _e(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Se(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const e=Y.autoReset,t=ce.enabled,n=ce.autoUpdate,r=ce.needsUpdate,i=ce.type;be(),Y.autoReset=e,ce.enabled=t,ce.autoUpdate=n,ce.needsUpdate=r,ce.type=i}function we(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function Ee(e){const t=e.target;t.removeEventListener("dispose",Ee),function(e){(function(e){const t=q.get(e).programs;void 0!==t&&(t.forEach((function(e){ie.releaseProgram(e)})),e.isShaderMaterial&&ie.releaseShaderCache(e))})(e),q.remove(e)}(t)}function Ae(e,t,n){!0===e.transparent&&e.side===ky&&!1===e.forceSinglePass?(e.side=Ly,e.needsUpdate=!0,ke(e,t,n),e.side=Dy,e.needsUpdate=!0,ke(e,t,n),e.side=ky):ke(e,t,n)}this.xr=xe,this.getContext=function(){return ve},this.getContextAttributes=function(){return ve.getContextAttributes()},this.forceContextLoss=function(){const e=J.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=J.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(e){void 0!==e&&(I=e,this.setSize(P,B,!1))},this.getSize=function(e){return e.set(P,B)},this.setSize=function(e,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];xe.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(P=e,B=n,t.width=Math.floor(e*I),t.height=Math.floor(n*I),!0===r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(P*I,B*I).floor()},this.setDrawingBufferSize=function(e,n,r){P=e,B=n,I=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(A)},this.getViewport=function(e){return e.copy(k)},this.setViewport=function(e,t,n,r){e.isVector4?k.set(e.x,e.y,e.z,e.w):k.set(e,t,n,r),K.viewport(A.copy(k).multiplyScalar(I).round())},this.getScissor=function(e){return e.copy(O)},this.setScissor=function(e,t,n,r){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,n,r),K.scissor(M.copy(O).multiplyScalar(I).round())},this.getScissorTest=function(){return N},this.setScissorTest=function(e){K.setScissorTest(N=e)},this.setOpaqueSort=function(e){D=e},this.setTransparentSort=function(e){L=e},this.getClearColor=function(e){return e.copy(ue.getClearColor())},this.setClearColor=function(){ue.setClearColor.apply(ue,arguments)},this.getClearAlpha=function(){return ue.getClearAlpha()},this.setClearAlpha=function(){ue.setClearAlpha.apply(ue,arguments)},this.clear=function(){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=0;if(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]){let e=!1;if(null!==S){const t=S.texture.format;e=t===yx||t===gx||t===fx}if(e){const e=S.texture.type,t=e===$b||e===Zb||e===qb||e===ix||e===nx||e===rx,n=ue.getClearColor(),r=ue.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(h[0]=i,h[1]=a,h[2]=o,h[3]=r,ve.clearBufferuiv(ve.COLOR,0,h)):(p[0]=i,p[1]=a,p[2]=o,p[3]=r,ve.clearBufferiv(ve.COLOR,0,p))}else n|=ve.COLOR_BUFFER_BIT}e&&(n|=ve.DEPTH_BUFFER_BIT),t&&(n|=ve.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ve.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",_e,!1),t.removeEventListener("webglcontextrestored",Se,!1),t.removeEventListener("webglcontextcreationerror",we,!1),oe.dispose(),se.dispose(),q.dispose(),Z.dispose(),ee.dispose(),re.dispose(),me.dispose(),ge.dispose(),ie.dispose(),xe.dispose(),xe.removeEventListener("sessionstart",Ce),xe.removeEventListener("sessionend",Te),Re.stop()},this.renderBufferDirect=function(e,t,n,r,i,a){null===t&&(t=V);const o=i.isMesh&&i.matrixWorld.determinant()<0,s=function(e,t,n,r,i){!0!==t.isScene&&(t=V);Q.resetTextureUnits();const a=t.fog,o=r.isMeshStandardMaterial?t.environment:null,s=null===S?y.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:b_,l=(r.isMeshStandardMaterial?ee:Z).get(r.envMap||o),c=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,u=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),d=!!n.morphAttributes.position,h=!!n.morphAttributes.normal,p=!!n.morphAttributes.color;let f=bb;r.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=y.toneMapping));const g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==g?g.length:0,b=q.get(r),x=m.state.lights;if(!0===U&&(!0===z||e!==E)){const t=e===E&&r.id===w;le.setState(r,e,t)}let _=!1;r.version===b.__version?b.needsLights&&b.lightsStateVersion!==x.state.version||b.outputColorSpace!==s||i.isBatchedMesh&&!1===b.batching?_=!0:i.isBatchedMesh||!0!==b.batching?i.isBatchedMesh&&!0===b.batchingColor&&null===i.colorTexture||i.isBatchedMesh&&!1===b.batchingColor&&null!==i.colorTexture||i.isInstancedMesh&&!1===b.instancing?_=!0:i.isInstancedMesh||!0!==b.instancing?i.isSkinnedMesh&&!1===b.skinning?_=!0:i.isSkinnedMesh||!0!==b.skinning?i.isInstancedMesh&&!0===b.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===b.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===b.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===b.instancingMorph&&null!==i.morphTexture||b.envMap!==l||!0===r.fog&&b.fog!==a?_=!0:void 0===b.numClippingPlanes||b.numClippingPlanes===le.numPlanes&&b.numIntersection===le.numIntersection?(b.vertexAlphas!==c||b.vertexTangents!==u||b.morphTargets!==d||b.morphNormals!==h||b.morphColors!==p||b.toneMapping!==f||b.morphTargetsCount!==v)&&(_=!0):_=!0:_=!0:_=!0:_=!0:(_=!0,b.__version=r.version);let A=b.currentProgram;!0===_&&(A=ke(r,t,i));let M=!1,C=!1,T=!1;const R=A.getUniforms(),P=b.uniforms;K.useProgram(A.program)&&(M=!0,C=!0,T=!0);r.id!==w&&(w=r.id,C=!0);if(M||E!==e){R.setValue(ve,"projectionMatrix",e.projectionMatrix),R.setValue(ve,"viewMatrix",e.matrixWorldInverse);const t=R.map.cameraPosition;void 0!==t&&t.setValue(ve,G.setFromMatrixPosition(e.matrixWorld)),$.logarithmicDepthBuffer&&R.setValue(ve,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&R.setValue(ve,"isOrthographic",!0===e.isOrthographicCamera),E!==e&&(E=e,C=!0,T=!0)}if(i.isSkinnedMesh){R.setOptional(ve,i,"bindMatrix"),R.setOptional(ve,i,"bindMatrixInverse");const e=i.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),R.setValue(ve,"boneTexture",e.boneTexture,Q))}i.isBatchedMesh&&(R.setOptional(ve,i,"batchingTexture"),R.setValue(ve,"batchingTexture",i._matricesTexture,Q),R.setOptional(ve,i,"batchingIdTexture"),R.setValue(ve,"batchingIdTexture",i._indirectTexture,Q),R.setOptional(ve,i,"batchingColorTexture"),null!==i._colorsTexture&&R.setValue(ve,"batchingColorTexture",i._colorsTexture,Q));const D=n.morphAttributes;void 0===D.position&&void 0===D.normal&&void 0===D.color||de.update(i,n,A);(C||b.receiveShadow!==i.receiveShadow)&&(b.receiveShadow=i.receiveShadow,R.setValue(ve,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(P.envMap.value=l,P.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);r.isMeshStandardMaterial&&null===r.envMap&&null!==t.environment&&(P.envMapIntensity.value=t.environmentIntensity);C&&(R.setValue(ve,"toneMappingExposure",y.toneMappingExposure),b.needsLights&&(k=T,(L=P).ambientLightColor.needsUpdate=k,L.lightProbe.needsUpdate=k,L.directionalLights.needsUpdate=k,L.directionalLightShadows.needsUpdate=k,L.pointLights.needsUpdate=k,L.pointLightShadows.needsUpdate=k,L.spotLights.needsUpdate=k,L.spotLightShadows.needsUpdate=k,L.rectAreaLights.needsUpdate=k,L.hemisphereLights.needsUpdate=k),a&&!0===r.fog&&ae.refreshFogUniforms(P,a),ae.refreshMaterialUniforms(P,r,I,B,m.state.transmissionRenderTarget[e.id]),MC.upload(ve,Oe(b),P,Q));var L,k;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(MC.upload(ve,Oe(b),P,Q),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&R.setValue(ve,"center",i.center);if(R.setValue(ve,"modelViewMatrix",i.modelViewMatrix),R.setValue(ve,"normalMatrix",i.normalMatrix),R.setValue(ve,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){const n=e[t];ge.update(n,A),ge.bind(n,A)}}return A}(e,t,n,r,i);K.setMaterial(r,o);let l=n.index,c=1;if(!0===r.wireframe){if(l=ne.getWireframeAttribute(n),void 0===l)return;c=2}const u=n.drawRange,d=n.attributes.position;let h=u.start*c,p=(u.start+u.count)*c;null!==a&&(h=Math.max(h,a.start*c),p=Math.min(p,(a.start+a.count)*c)),null!==l?(h=Math.max(h,0),p=Math.min(p,l.count)):void 0!==d&&null!==d&&(h=Math.max(h,0),p=Math.min(p,d.count));const f=p-h;if(f<0||f===1/0)return;let g;me.setup(i,r,s,n,l);let v=he;if(null!==l&&(g=te.get(l),v=pe,v.setIndex(g)),i.isMesh)!0===r.wireframe?(K.setLineWidth(r.wireframeLinewidth*X()),v.setMode(ve.LINES)):v.setMode(ve.TRIANGLES);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),K.setLineWidth(e*X()),i.isLineSegments?v.setMode(ve.LINES):i.isLineLoop?v.setMode(ve.LINE_LOOP):v.setMode(ve.LINE_STRIP)}else i.isPoints?v.setMode(ve.POINTS):i.isSprite&&v.setMode(ve.TRIANGLES);if(i.isBatchedMesh)if(null!==i._multiDrawInstances)v.renderMultiDrawInstances(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount,i._multiDrawInstances);else if(J.get("WEBGL_multi_draw"))v.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{const e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,a=l?te.get(l).bytesPerElement:1,o=q.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)o.setValue(ve,"_gl_DrawID",r),v.render(e[r]/a,t[r])}else if(i.isInstancedMesh)v.renderInstances(h,f,i.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);v.renderInstances(h,f,t)}else v.render(h,f)},this.compile=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=e),m=se.get(n),m.init(t),v.push(m),n.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(m.pushLight(e),e.castShadow&&m.pushShadow(e))})),e!==n&&e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(m.pushLight(e),e.castShadow&&m.pushShadow(e))})),m.setupLights();const r=new Set;return e.traverse((function(e){const t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){const a=t[i];Ae(a,n,e),r.add(a)}else Ae(t,n,e),r.add(t)})),v.pop(),m=null,r},this.compileAsync=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=this.compile(e,t,n);return new Promise((t=>{function n(){r.forEach((function(e){q.get(e).currentProgram.isReady()&&r.delete(e)})),0!==r.size?setTimeout(n,10):t(e)}null!==J.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let Me=null;function Ce(){Re.stop()}function Te(){Re.start()}const Re=new kA;function Pe(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)m.pushLight(e),e.castShadow&&m.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||F.intersectsSprite(e)){r&&j.setFromMatrixPosition(e.matrixWorld).applyMatrix4(H);const t=re.update(e),i=e.material;i.visible&&f.push(e,t,i,n,j.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||F.intersectsObject(e))){const t=re.update(e),i=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),j.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),j.copy(t.boundingSphere.center)),j.applyMatrix4(e.matrixWorld).applyMatrix4(H)),Array.isArray(i)){const r=t.groups;for(let a=0,o=r.length;a<o;a++){const o=r[a],s=i[o.materialIndex];s&&s.visible&&f.push(e,t,s,n,j.z,o)}}else i.visible&&f.push(e,t,i,n,j.z,null)}const i=e.children;for(let a=0,o=i.length;a<o;a++)Pe(i[a],t,n,r)}function Be(e,t,n,r){const i=e.opaque,a=e.transmissive,o=e.transparent;m.setupLightsView(n),!0===U&&le.setGlobalState(y.clippingPlanes,n),r&&K.viewport(A.copy(r)),i.length>0&&De(i,t,n),a.length>0&&De(a,t,n),o.length>0&&De(o,t,n),K.buffers.depth.setTest(!0),K.buffers.depth.setMask(!0),K.buffers.color.setMask(!0),K.setPolygonOffset(!1)}function Ie(e,t,n,r){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;void 0===m.state.transmissionRenderTarget[r.id]&&(m.state.transmissionRenderTarget[r.id]=new JS(1,1,{generateMipmaps:!0,type:J.has("EXT_color_buffer_half_float")||J.has("EXT_color_buffer_float")?tx:$b,minFilter:Xb,samples:4,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:kS.workingColorSpace}));const a=m.state.transmissionRenderTarget[r.id],o=r.viewport||A;a.setSize(o.z,o.w);const s=y.getRenderTarget();y.setRenderTarget(a),y.getClearColor(T),R=y.getClearAlpha(),R<1&&y.setClearColor(16777215,.5),y.clear(),W&&ue.render(n);const l=y.toneMapping;y.toneMapping=bb;const c=r.viewport;if(void 0!==r.viewport&&(r.viewport=void 0),m.setupLightsView(r),!0===U&&le.setGlobalState(y.clippingPlanes,r),De(e,n,r),Q.updateMultisampleRenderTarget(a),Q.updateRenderTargetMipmap(a),!1===J.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let i=0,a=t.length;i<a;i++){const a=t[i],o=a.object,s=a.geometry,l=a.material,c=a.group;if(l.side===ky&&o.layers.test(r.layers)){const t=l.side;l.side=Ly,l.needsUpdate=!0,Le(o,n,r,s,l,c),l.side=t,l.needsUpdate=!0,e=!0}}!0===e&&(Q.updateMultisampleRenderTarget(a),Q.updateRenderTargetMipmap(a))}y.setRenderTarget(s),y.setClearColor(T,R),void 0!==c&&(r.viewport=c),y.toneMapping=l}function De(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){const a=e[i],o=a.object,s=a.geometry,l=null===r?a.material:r,c=a.group;o.layers.test(n.layers)&&Le(o,t,n,s,l,c)}}function Le(e,t,n,r,i,a){e.onBeforeRender(y,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(y,t,n,r,e,a),!0===i.transparent&&i.side===ky&&!1===i.forceSinglePass?(i.side=Ly,i.needsUpdate=!0,y.renderBufferDirect(n,t,r,i,e,a),i.side=Dy,i.needsUpdate=!0,y.renderBufferDirect(n,t,r,i,e,a),i.side=ky):y.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(y,t,n,r,i,a)}function ke(e,t,n){!0!==t.isScene&&(t=V);const r=q.get(e),i=m.state.lights,a=m.state.shadowsArray,o=i.state.version,s=ie.getParameters(e,i.state,a,t,n),l=ie.getProgramCacheKey(s);let c=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?ee:Z).get(e.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===c&&(e.addEventListener("dispose",Ee),c=new Map,r.programs=c);let u=c.get(l);if(void 0!==u){if(r.currentProgram===u&&r.lightsStateVersion===o)return Ne(e,s),u}else s.uniforms=ie.getUniforms(e),e.onBeforeCompile(s,y),u=ie.acquireProgram(s,l),c.set(l,u),r.uniforms=s.uniforms;const d=r.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(d.clippingPlanes=le.uniform),Ne(e,s),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=o,r.needsLights&&(d.ambientLightColor.value=i.state.ambient,d.lightProbe.value=i.state.probe,d.directionalLights.value=i.state.directional,d.directionalLightShadows.value=i.state.directionalShadow,d.spotLights.value=i.state.spot,d.spotLightShadows.value=i.state.spotShadow,d.rectAreaLights.value=i.state.rectArea,d.ltc_1.value=i.state.rectAreaLTC1,d.ltc_2.value=i.state.rectAreaLTC2,d.pointLights.value=i.state.point,d.pointLightShadows.value=i.state.pointShadow,d.hemisphereLights.value=i.state.hemi,d.directionalShadowMap.value=i.state.directionalShadowMap,d.directionalShadowMatrix.value=i.state.directionalShadowMatrix,d.spotShadowMap.value=i.state.spotShadowMap,d.spotLightMatrix.value=i.state.spotLightMatrix,d.spotLightMap.value=i.state.spotLightMap,d.pointShadowMap.value=i.state.pointShadowMap,d.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=u,r.uniformsList=null,u}function Oe(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=MC.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function Ne(e,t){const n=q.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}Re.setAnimationLoop((function(e){Me&&Me(e)})),"undefined"!==typeof self&&Re.setContext(self),this.setAnimationLoop=function(e){Me=e,xe.setAnimationLoop(e),null===e?Re.stop():Re.start()},xe.addEventListener("sessionstart",Ce),xe.addEventListener("sessionend",Te),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===b)return;if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===xe.enabled&&!0===xe.isPresenting&&(!0===xe.cameraAutoUpdate&&xe.updateCamera(t),t=xe.getCamera()),!0===e.isScene&&e.onBeforeRender(y,e,t,S),m=se.get(e,v.length),m.init(t),v.push(m),H.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),F.setFromProjectionMatrix(H),z=this.localClippingEnabled,U=le.init(this.clippingPlanes,z),f=oe.get(e,g.length),f.init(),g.push(f),!0===xe.enabled&&!0===xe.isPresenting){const e=y.xr.getDepthSensingMesh();null!==e&&Pe(e,t,-1/0,y.sortObjects)}Pe(e,t,0,y.sortObjects),f.finish(),!0===y.sortObjects&&f.sort(D,L),W=!1===xe.enabled||!1===xe.isPresenting||!1===xe.hasDepthSensing(),W&&ue.addToRenderList(f,e),this.info.render.frame++,!0===U&&le.beginShadows();const n=m.state.shadowsArray;ce.render(n,e,t),!0===U&&le.endShadows(),!0===this.info.autoReset&&this.info.reset();const r=f.opaque,i=f.transmissive;if(m.setupLights(),t.isArrayCamera){const n=t.cameras;if(i.length>0)for(let t=0,a=n.length;t<a;t++){Ie(r,i,e,n[t])}W&&ue.render(e);for(let t=0,r=n.length;t<r;t++){const r=n[t];Be(f,e,r,r.viewport)}}else i.length>0&&Ie(r,i,e,t),W&&ue.render(e),Be(f,e,t);null!==S&&(Q.updateMultisampleRenderTarget(S),Q.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(y,e,t),me.resetDefaultState(),w=-1,E=null,v.pop(),v.length>0?(m=v[v.length-1],!0===U&&le.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,g.pop(),f=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return _},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,n){q.get(e.texture).__webglTexture=t,q.get(e.depthTexture).__webglTexture=n;const r=q.get(e);r.__hasExternalTextures=!0,r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===J.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){const n=q.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;S=e,x=t,_=n;let r=!0,i=null,a=!1,o=!1;if(e){const s=q.get(e);if(void 0!==s.__useDefaultFramebuffer)K.bindFramebuffer(ve.FRAMEBUFFER,null),r=!1;else if(void 0===s.__webglFramebuffer)Q.setupRenderTarget(e);else if(s.__hasExternalTextures)Q.rebindTextures(e,q.get(e.texture).__webglTexture,q.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){const t=e.depthTexture;if(s.__boundDepthTexture!==t){if(null!==t&&q.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Q.setupDepthRenderbuffer(e)}}const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=q.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(c[t])?c[t][n]:c[t],a=!0):i=e.samples>0&&!1===Q.useMultisampledRTT(e)?q.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,A.copy(e.viewport),M.copy(e.scissor),C=e.scissorTest}else A.copy(k).multiplyScalar(I).floor(),M.copy(O).multiplyScalar(I).floor(),C=N;if(K.bindFramebuffer(ve.FRAMEBUFFER,i)&&r&&K.drawBuffers(e,i),K.viewport(A),K.scissor(M),K.setScissorTest(C),a){const r=q.get(e.texture);ve.framebufferTexture2D(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(o){const r=q.get(e.texture),i=t||0;ve.framebufferTextureLayer(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i)}w=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=q.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){K.bindFramebuffer(ve.FRAMEBUFFER,s);try{const o=e.texture,s=o.format,l=o.type;if(!$.textureFormatReadable(s))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!$.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ve.readPixels(t,n,r,i,fe.convert(s),fe.convert(l),a)}finally{const e=null!==S?q.get(S).__webglFramebuffer:null;K.bindFramebuffer(ve.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o){if(!e||!e.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=q.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){K.bindFramebuffer(ve.FRAMEBUFFER,s);try{const o=e.texture,s=o.format,l=o.type;if(!$.textureFormatReadable(s))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!$.textureTypeReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){const e=ve.createBuffer();ve.bindBuffer(ve.PIXEL_PACK_BUFFER,e),ve.bufferData(ve.PIXEL_PACK_BUFFER,a.byteLength,ve.STREAM_READ),ve.readPixels(t,n,r,i,fe.convert(s),fe.convert(l),0),ve.flush();const o=ve.fenceSync(ve.SYNC_GPU_COMMANDS_COMPLETE,0);await function(e,t,n){return new Promise((function(r,i){setTimeout((function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}),n)}))}(ve,o,4);try{ve.bindBuffer(ve.PIXEL_PACK_BUFFER,e),ve.getBufferSubData(ve.PIXEL_PACK_BUFFER,0,a)}finally{ve.deleteBuffer(e),ve.deleteSync(o)}return a}}finally{const e=null!==S?q.get(S).__webglFramebuffer:null;K.bindFramebuffer(ve.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;!0!==e.isTexture&&(PS("WebGLRenderer: copyFramebufferToTexture function signature has changed."),t=arguments[0]||null,e=arguments[1]);const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=null!==t?t.x:0,s=null!==t?t.y:0;Q.setTexture2D(e,0),ve.copyTexSubImage2D(ve.TEXTURE_2D,n,0,0,o,s,i,a),K.unbindTexture()},this.copyTextureToTexture=function(e,t){let n,r,i,a,o,s,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;!0!==e.isTexture&&(PS("WebGLRenderer: copyTextureToTexture function signature has changed."),c=arguments[0]||null,e=arguments[1],t=arguments[2],u=arguments[3]||0,l=null),null!==l?(n=l.max.x-l.min.x,r=l.max.y-l.min.y,i=l.min.x,a=l.min.y):(n=e.image.width,r=e.image.height,i=0,a=0),null!==c?(o=c.x,s=c.y):(o=0,s=0);const d=fe.convert(t.format),h=fe.convert(t.type);Q.setTexture2D(t,0),ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,t.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,t.unpackAlignment);const p=ve.getParameter(ve.UNPACK_ROW_LENGTH),f=ve.getParameter(ve.UNPACK_IMAGE_HEIGHT),m=ve.getParameter(ve.UNPACK_SKIP_PIXELS),g=ve.getParameter(ve.UNPACK_SKIP_ROWS),v=ve.getParameter(ve.UNPACK_SKIP_IMAGES),y=e.isCompressedTexture?e.mipmaps[u]:e.image;ve.pixelStorei(ve.UNPACK_ROW_LENGTH,y.width),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,y.height),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,i),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,a),e.isDataTexture?ve.texSubImage2D(ve.TEXTURE_2D,u,o,s,n,r,d,h,y.data):e.isCompressedTexture?ve.compressedTexSubImage2D(ve.TEXTURE_2D,u,o,s,y.width,y.height,d,y.data):ve.texSubImage2D(ve.TEXTURE_2D,u,o,s,n,r,d,h,y),ve.pixelStorei(ve.UNPACK_ROW_LENGTH,p),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,f),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,m),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,g),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,v),0===u&&t.generateMipmaps&&ve.generateMipmap(ve.TEXTURE_2D),K.unbindTexture()},this.copyTextureToTexture3D=function(e,t){let n,r,i,a,o,s,l,c,u,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;!0!==e.isTexture&&(PS("WebGLRenderer: copyTextureToTexture3D function signature has changed."),d=arguments[0]||null,h=arguments[1]||null,e=arguments[2],t=arguments[3],p=arguments[4]||0);const f=e.isCompressedTexture?e.mipmaps[p]:e.image;null!==d?(n=d.max.x-d.min.x,r=d.max.y-d.min.y,i=d.max.z-d.min.z,a=d.min.x,o=d.min.y,s=d.min.z):(n=f.width,r=f.height,i=f.depth,a=0,o=0,s=0),null!==h?(l=h.x,c=h.y,u=h.z):(l=0,c=0,u=0);const m=fe.convert(t.format),g=fe.convert(t.type);let v;if(t.isData3DTexture)Q.setTexture3D(t,0),v=ve.TEXTURE_3D;else{if(!t.isDataArrayTexture&&!t.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Q.setTexture2DArray(t,0),v=ve.TEXTURE_2D_ARRAY}ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,t.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,t.unpackAlignment);const y=ve.getParameter(ve.UNPACK_ROW_LENGTH),b=ve.getParameter(ve.UNPACK_IMAGE_HEIGHT),x=ve.getParameter(ve.UNPACK_SKIP_PIXELS),_=ve.getParameter(ve.UNPACK_SKIP_ROWS),S=ve.getParameter(ve.UNPACK_SKIP_IMAGES);ve.pixelStorei(ve.UNPACK_ROW_LENGTH,f.width),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,f.height),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,a),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,o),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,s),e.isDataTexture||e.isData3DTexture?ve.texSubImage3D(v,p,l,c,u,n,r,i,m,g,f.data):t.isCompressedArrayTexture?ve.compressedTexSubImage3D(v,p,l,c,u,n,r,i,m,f.data):ve.texSubImage3D(v,p,l,c,u,n,r,i,m,g,f),ve.pixelStorei(ve.UNPACK_ROW_LENGTH,y),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,b),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,x),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,_),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,S),0===p&&t.generateMipmaps&&ve.generateMipmap(v),K.unbindTexture()},this.initRenderTarget=function(e){void 0===q.get(e).__webglFramebuffer&&Q.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?Q.setTextureCube(e,0):e.isData3DTexture?Q.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Q.setTexture2DArray(e,0):Q.setTexture2D(e,0),K.unbindTexture()},this.resetState=function(){x=0,_=0,S=null,K.reset(),me.reset()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return sS}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===x_?"display-p3":"srgb",t.unpackColorSpace=kS.workingColorSpace===__?"display-p3":"srgb"}}class CT{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25e-5;this.isFogExp2=!0,this.name="",this.color=new yE(e),this.density=t}clone(){return new CT(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class TT{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;this.isFog=!0,this.name="",this.color=new yE(e),this.near=t,this.far=n}clone(){return new TT(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class RT extends nE{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Uw,this.environmentIntensity=1,this.environmentRotation=new Uw,this.overrideMaterial=null,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class PT{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Y_,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=fS()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return PS("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=fS()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=fS()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const BT=new ZS;class IT{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)BT.fromBufferAttribute(this,t),BT.applyMatrix4(e),this.setXYZ(t,BT.x,BT.y,BT.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)BT.fromBufferAttribute(this,t),BT.applyNormalMatrix(e),this.setXYZ(t,BT.x,BT.y,BT.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)BT.fromBufferAttribute(this,t),BT.transformDirection(e),this.setXYZ(t,BT.x,BT.y,BT.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=yS(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=bS(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=bS(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=bS(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=bS(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=bS(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=yS(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=yS(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=yS(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=yS(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=bS(t,this.array),n=bS(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=bS(t,this.array),n=bS(n,this.array),r=bS(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=bS(t,this.array),n=bS(n,this.array),r=bS(r,this.array),i=bS(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new PE(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new IT(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class DT extends _E{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new yE(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let LT;const kT=new ZS,OT=new ZS,NT=new ZS,FT=new _S,UT=new _S,zT=new Rw,HT=new ZS,GT=new ZS,jT=new ZS,VT=new _S,WT=new _S,XT=new _S;class JT extends nE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new DT;if(super(),this.isSprite=!0,this.type="Sprite",void 0===LT){LT=new JE;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new PT(e,5);LT.setIndex([0,1,2,0,2,3]),LT.setAttribute("position",new IT(t,3,0,!1)),LT.setAttribute("uv",new IT(t,2,3,!1))}this.geometry=LT,this.material=e,this.center=new _S(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),OT.setFromMatrixScale(this.matrixWorld),zT.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),NT.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&OT.multiplyScalar(-NT.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const a=this.center;$T(HT.set(-.5,-.5,0),NT,a,OT,r,i),$T(GT.set(.5,-.5,0),NT,a,OT,r,i),$T(jT.set(.5,.5,0),NT,a,OT,r,i),VT.set(0,0),WT.set(1,0),XT.set(1,1);let o=e.ray.intersectTriangle(HT,GT,jT,!1,kT);if(null===o&&($T(GT.set(-.5,.5,0),NT,a,OT,r,i),WT.set(0,1),o=e.ray.intersectTriangle(HT,jT,GT,!1,kT),null===o))return;const s=e.ray.origin.distanceTo(kT);s<e.near||s>e.far||t.push({distance:s,point:kT.clone(),uv:pE.getInterpolation(kT,HT,GT,jT,VT,WT,XT,new _S),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function $T(e,t,n,r,i,a){FT.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(UT.x=a*FT.x-i*FT.y,UT.y=i*FT.x+a*FT.y):UT.copy(FT),e.copy(t),e.x+=UT.x,e.y+=UT.y,e.applyMatrix4(zT)}const KT=new ZS,YT=new ZS;class qT extends nE{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,r=t.length;n<r;n++){const e=t[n];this.addLevel(e.object.clone(),e.distance,e.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t=Math.abs(t);const r=this.levels;let i;for(i=0;i<r.length&&!(t<r[i].distance);i++);return r.splice(i,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){KT.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(KT);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){KT.setFromMatrixPosition(e.matrixWorld),YT.setFromMatrixPosition(this.matrixWorld);const n=KT.distanceTo(YT)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r<i;r++){let e=t[r].distance;if(t[r].object.visible&&(e-=e*t[r].hysteresis),!(n>=e))break;t[r-1].object.visible=!1,t[r].object.visible=!0}for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let r=0,i=n.length;r<i;r++){const e=n[r];t.object.levels.push({object:e.object.uuid,distance:e.distance,hysteresis:e.hysteresis})}return t}}const QT=new ZS,ZT=new WS,eR=new WS,tR=new ZS,nR=new Rw,rR=new ZS,iR=new xw,aR=new Rw,oR=new Tw;class sR extends dA{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Cb,this.bindMatrix=new Rw,this.bindMatrixInverse=new Rw,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;null===this.boundingBox&&(this.boundingBox=new nw),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,rR),this.boundingBox.expandByPoint(rR)}computeBoundingSphere(){const e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new xw),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,rR),this.boundingSphere.expandByPoint(rR)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,r=this.matrixWorld;void 0!==n&&(null===this.boundingSphere&&this.computeBoundingSphere(),iR.copy(this.boundingSphere),iR.applyMatrix4(r),!1!==e.ray.intersectsSphere(iR)&&(aR.copy(r).invert(),oR.copy(e.ray).applyMatrix4(aR),null!==this.boundingBox&&!1===oR.intersectsBox(this.boundingBox)||this._computeIntersections(e,t,oR)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new WS,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Cb?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Tb?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;ZT.fromBufferAttribute(r.attributes.skinIndex,e),eR.fromBufferAttribute(r.attributes.skinWeight,e),QT.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let i=0;i<4;i++){const e=eR.getComponent(i);if(0!==e){const r=ZT.getComponent(i);nR.multiplyMatrices(n.bones[r].matrixWorld,n.boneInverses[r]),t.addScaledVector(tR.copy(QT).applyMatrix4(nR),e)}}return t.applyMatrix4(this.bindMatrixInverse)}}class lR extends nE{constructor(){super(),this.isBone=!0,this.type="Bone"}}class cR extends VS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(null,arguments.length>5?arguments[5]:void 0,arguments.length>6?arguments[6]:void 0,arguments.length>7?arguments[7]:void 0,arguments.length>8&&void 0!==arguments[8]?arguments[8]:Fb,arguments.length>9&&void 0!==arguments[9]?arguments[9]:Fb,arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0,arguments.length>10?arguments[10]:void 0,arguments.length>11?arguments[11]:void 0),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const uR=new Rw,dR=new Rw;class hR{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.uuid=fS(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Rw)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new Rw;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let i=0,a=e.length;i<a;i++){const r=e[i]?e[i].matrixWorld:dR;uR.multiplyMatrices(r,t[i]),uR.toArray(n,16*i)}null!==r&&(r.needsUpdate=!0)}clone(){return new hR(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=4*Math.ceil(e/4),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new cR(t,e,e,lx,ex);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const r=e.bones[n];let i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new lR),this.bones.push(i),this.boneInverses.push((new Rw).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){const i=t[r];e.bones.push(i.uuid);const a=n[r];e.boneInverses.push(a.toArray())}return e}}class pR extends PE{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const fR=new Rw,mR=new Rw,gR=[],vR=new nw,yR=new Rw,bR=new dA,xR=new xw;class _R extends dA{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new pR(new Float32Array(16*n),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<n;r++)this.setMatrixAt(r,yR)}computeBoundingBox(){const e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new nw),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,fR),vR.copy(e.boundingBox).applyMatrix4(fR),this.boundingBox.union(vR)}computeBoundingSphere(){const e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new xw),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,fR),xR.copy(e.boundingSphere).applyMatrix4(fR),this.boundingSphere.union(xR)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.morphTexture&&(this.morphTexture=e.morphTexture.clone()),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}getMorphAt(e,t){const n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,i=e*(n.length+1)+1;for(let a=0;a<n.length;a++)n[a]=r[i+a]}raycast(e,t){const n=this.matrixWorld,r=this.count;if(bR.geometry=this.geometry,bR.material=this.material,void 0!==bR.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),xR.copy(this.boundingSphere),xR.applyMatrix4(n),!1!==e.ray.intersectsSphere(xR)))for(let i=0;i<r;i++){this.getMatrixAt(i,fR),mR.multiplyMatrices(n,fR),bR.matrixWorld=mR,bR.raycast(e,gR);for(let e=0,n=gR.length;e<n;e++){const n=gR[e];n.instanceId=i,n.object=this,t.push(n)}gR.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new pR(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}setMorphAt(e,t){const n=t.morphTargetInfluences,r=n.length+1;null===this.morphTexture&&(this.morphTexture=new cR(new Float32Array(r*this.count),r,this.count,px,ex));const i=this.morphTexture.source.data.data;let a=0;for(let l=0;l<n.length;l++)a+=n[l];const o=this.geometry.morphTargetsRelative?1:1-a,s=r*e;i[s]=o,i.set(n,s+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null),this}}function SR(e,t){return e.z-t.z}function wR(e,t){return t.z-e.z}class ER{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n){const r=this.pool,i=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const a=r[this.index];i.push(a),this.index++,a.start=e.start,a.count=e.count,a.z=t,a.index=n}reset(){this.list.length=0,this.index=0}}const AR=new Rw,MR=new Rw,CR=new Rw,TR=new yE(1,1,1),RR=new Rw,PR=new LA,BR=new nw,IR=new xw,DR=new ZS,LR=new ZS,kR=new ZS,OR=new ER,NR=new dA,FR=[];function UR(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){const i=e.count;for(let a=0;a<i;a++)for(let i=0;i<r;i++)t.setComponent(a+n,i,e.getComponent(a,i))}else t.array.set(e.array,n*r);t.needsUpdate=!0}class zR extends dA{get maxInstanceCount(){return this._maxInstanceCount}constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2*t,r=arguments.length>3?arguments[3]:void 0;super(new JE,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawInfo=[],this._drawRanges=[],this._reservedRanges=[],this._bounds=[],this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._visibilityChanged=!0,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}_initMatricesTexture(){let e=Math.sqrt(4*this._maxInstanceCount);e=4*Math.ceil(e/4),e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new cR(t,e,e,lx,ex);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new cR(t,e,e,fx,Zb);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new cR(t,e,e,lx,ex);n.colorSpace=kS.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,r=this._maxIndexCount;if(!1===this._geometryInitialized){for(const r in e.attributes){const i=e.getAttribute(r),{array:a,itemSize:o,normalized:s}=i,l=new a.constructor(n*o),c=new PE(l,o,s);t.setAttribute(r,c)}if(null!==e.getIndex()){const e=n>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new PE(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(Boolean(e.getIndex())!==Boolean(t.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new nw);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(!1===t[n].active)continue;const r=t[n].geometryIndex;this.getMatrixAt(n,AR),this.getBoundingBoxAt(r,BR).applyMatrix4(AR),e.union(BR)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new xw);const e=this.boundingSphere,t=this._drawInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(!1===t[n].active)continue;const r=t[n].geometryIndex;this.getMatrixAt(n,AR),this.getBoundingSphereAt(r,IR).applyMatrix4(AR),e.union(IR)}}addInstance(e){if(this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:e});const t=this._drawInfo.length-1,n=this._matricesTexture,r=n.image.data;CR.toArray(r,16*t),n.needsUpdate=!0;const i=this._colorsTexture;return i&&(TR.toArray(i.image.data,4*t),i.needsUpdate=!0),t}addGeometry(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let i=null;const a=this._reservedRanges,o=this._drawRanges,s=this._bounds;0!==this._geometryCount&&(i=a[a.length-1]),r.vertexCount=-1===t?e.getAttribute("position").count:t,r.vertexStart=null===i?0:i.vertexStart+i.vertexCount;const l=e.getIndex(),c=null!==l;if(c&&(r.indexCount=-1===n?l.count:n,r.indexStart=null===i?0:i.indexStart+i.indexCount),-1!==r.indexStart&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const u=this._geometryCount;return this._geometryCount++,a.push(r),o.push({start:c?r.indexStart:r.vertexStart,count:-1}),s.push({boxInitialized:!1,box:new nw,sphereInitialized:!1,sphere:new xw}),this.setGeometryAt(u,e),u}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,r=null!==n.getIndex(),i=n.getIndex(),a=t.getIndex(),o=this._reservedRanges[e];if(r&&a.count>o.indexCount||t.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const s=o.vertexStart,l=o.vertexCount;for(const h in n.attributes){const e=t.getAttribute(h),r=n.getAttribute(h);UR(e,r,s);const i=e.itemSize;for(let t=e.count,n=l;t<n;t++){const e=s+t;for(let t=0;t<i;t++)r.setComponent(e,t,0)}r.needsUpdate=!0,r.addUpdateRange(s*i,l*i)}if(r){const e=o.indexStart;for(let t=0;t<a.count;t++)i.setX(e+t,s+a.getX(t));for(let t=a.count,n=o.indexCount;t<n;t++)i.setX(e+t,s);i.needsUpdate=!0,i.addUpdateRange(e,o.indexCount)}const c=this._bounds[e];null!==t.boundingBox?(c.box.copy(t.boundingBox),c.boxInitialized=!0):c.boxInitialized=!1,null!==t.boundingSphere?(c.sphere.copy(t.boundingSphere),c.sphereInitialized=!0):c.sphereInitialized=!1;const u=this._drawRanges[e],d=t.getAttribute("position");return u.count=r?a.count:d.count,this._visibilityChanged=!0,e}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this._bounds[e],r=n.box,i=this.geometry;if(!1===n.boxInitialized){r.makeEmpty();const t=i.index,a=i.attributes.position,o=this._drawRanges[e];for(let e=o.start,n=o.start+o.count;e<n;e++){let n=e;t&&(n=t.getX(n)),r.expandByPoint(DR.fromBufferAttribute(a,n))}n.boxInitialized=!0}return t.copy(r),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this._bounds[e],r=n.sphere,i=this.geometry;if(!1===n.sphereInitialized){r.makeEmpty(),this.getBoundingBoxAt(e,BR),BR.getCenter(r.center);const t=i.index,a=i.attributes.position,o=this._drawRanges[e];let s=0;for(let e=o.start,n=o.start+o.count;e<n;e++){let n=e;t&&(n=t.getX(n)),DR.fromBufferAttribute(a,n),s=Math.max(s,r.center.distanceToSquared(DR))}r.radius=Math.sqrt(s),n.sphereInitialized=!0}return t.copy(r),t}setMatrixAt(e,t){const n=this._drawInfo,r=this._matricesTexture,i=this._matricesTexture.image.data;return e>=n.length||!1===n[e].active||(t.toArray(i,16*e),r.needsUpdate=!0),this}getMatrixAt(e,t){const n=this._drawInfo,r=this._matricesTexture.image.data;return e>=n.length||!1===n[e].active?null:t.fromArray(r,16*e)}setColorAt(e,t){null===this._colorsTexture&&this._initColorsTexture();const n=this._colorsTexture,r=this._colorsTexture.image.data,i=this._drawInfo;return e>=i.length||!1===i[e].active||(t.toArray(r,4*e),n.needsUpdate=!0),this}getColorAt(e,t){const n=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||!1===r[e].active?null:t.fromArray(n,4*e)}setVisibleAt(e,t){const n=this._drawInfo;return e>=n.length||!1===n[e].active||n[e].visible===t||(n[e].visible=t,this._visibilityChanged=!0),this}getVisibleAt(e){const t=this._drawInfo;return!(e>=t.length||!1===t[e].active)&&t[e].visible}raycast(e,t){const n=this._drawInfo,r=this._drawRanges,i=this.matrixWorld,a=this.geometry;NR.material=this.material,NR.geometry.index=a.index,NR.geometry.attributes=a.attributes,null===NR.geometry.boundingBox&&(NR.geometry.boundingBox=new nw),null===NR.geometry.boundingSphere&&(NR.geometry.boundingSphere=new xw);for(let o=0,s=n.length;o<s;o++){if(!n[o].visible||!n[o].active)continue;const a=n[o].geometryIndex,s=r[a];NR.geometry.setDrawRange(s.start,s.count),this.getMatrixAt(o,NR.matrixWorld).premultiply(i),this.getBoundingBoxAt(a,NR.geometry.boundingBox),this.getBoundingSphereAt(a,NR.geometry.boundingSphere),NR.raycast(e,FR);for(let e=0,n=FR.length;e<n;e++){const n=FR[e];n.object=this,n.batchId=o,t.push(n)}FR.length=0}NR.material=null,NR.geometry.index=null,NR.geometry.attributes={},NR.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=null!==e.boundingBox?e.boundingBox.clone():null,this.boundingSphere=null!==e.boundingSphere?e.boundingSphere.clone():null,this._drawRanges=e._drawRanges.map((e=>({...e}))),this._reservedRanges=e._reservedRanges.map((e=>({...e}))),this._drawInfo=e._drawInfo.map((e=>({...e}))),this._bounds=e._bounds.map((e=>({boxInitialized:e.boxInitialized,box:e.box.clone(),sphereInitialized:e.sphereInitialized,sphere:e.sphere.clone()}))),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,n,r,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=r.getIndex(),o=null===a?1:a.array.BYTES_PER_ELEMENT,s=this._drawInfo,l=this._multiDrawStarts,c=this._multiDrawCounts,u=this._drawRanges,d=this.perObjectFrustumCulled,h=this._indirectTexture,p=h.image.data;d&&(RR.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),PR.setFromProjectionMatrix(RR,e.coordinateSystem));let f=0;if(this.sortObjects){MR.copy(this.matrixWorld).invert(),DR.setFromMatrixPosition(n.matrixWorld).applyMatrix4(MR),LR.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(MR);for(let n=0,r=s.length;n<r;n++)if(s[n].visible&&s[n].active){const e=s[n].geometryIndex;this.getMatrixAt(n,AR),this.getBoundingSphereAt(e,IR).applyMatrix4(AR);let t=!1;if(d&&(t=!PR.intersectsSphere(IR)),!t){const t=kR.subVectors(IR.center,DR).dot(LR);OR.push(u[e],t,n)}}const e=OR.list,t=this.customSort;null===t?e.sort(i.transparent?wR:SR):t.call(this,e,n);for(let n=0,r=e.length;n<r;n++){const t=e[n];l[f]=t.start*o,c[f]=t.count,p[f]=t.index,f++}OR.reset()}else for(let m=0,g=s.length;m<g;m++)if(s[m].visible&&s[m].active){const e=s[m].geometryIndex;let t=!1;if(d&&(this.getMatrixAt(m,AR),this.getBoundingSphereAt(e,IR).applyMatrix4(AR),t=!PR.intersectsSphere(IR)),!t){const t=u[e];l[f]=t.start*o,c[f]=t.count,p[f]=m,f++}}h.needsUpdate=!0,this._multiDrawCount=f,this._visibilityChanged=!1}onBeforeShadow(e,t,n,r,i,a){this.onBeforeRender(e,null,r,i,a)}}class HR extends _E{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new yE(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const GR=new ZS,jR=new ZS,VR=new Rw,WR=new Tw,XR=new xw,JR=new ZS,$R=new ZS;class KR extends nE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new JE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new HR;super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)GR.fromBufferAttribute(t,e-1),jR.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=GR.distanceTo(jR);e.setAttribute("lineDistance",new UE(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),XR.copy(n.boundingSphere),XR.applyMatrix4(r),XR.radius+=i,!1===e.ray.intersectsSphere(XR))return;VR.copy(r).invert(),WR.copy(e.ray).applyMatrix4(VR);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=this.isLineSegments?2:1,c=n.index,u=n.attributes.position;if(null!==c){const n=Math.max(0,a.start),r=Math.min(c.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=l){const n=c.getX(i),r=c.getX(i+1),a=YR(this,e,WR,s,n,r);a&&t.push(a)}if(this.isLineLoop){const i=c.getX(r-1),a=c.getX(n),o=YR(this,e,WR,s,i,a);o&&t.push(o)}}else{const n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=l){const n=YR(this,e,WR,s,i,i+1);n&&t.push(n)}if(this.isLineLoop){const i=YR(this,e,WR,s,r-1,n);i&&t.push(i)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function YR(e,t,n,r,i,a){const o=e.geometry.attributes.position;GR.fromBufferAttribute(o,i),jR.fromBufferAttribute(o,a);if(n.distanceSqToSegment(GR,jR,JR,$R)>r)return;JR.applyMatrix4(e.matrixWorld);const s=t.ray.origin.distanceTo(JR);return s<t.near||s>t.far?void 0:{distance:s,point:$R.clone().applyMatrix4(e.matrixWorld),index:i,face:null,faceIndex:null,object:e}}const qR=new ZS,QR=new ZS;class ZR extends KR{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)qR.fromBufferAttribute(t,e),QR.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+qR.distanceTo(QR);e.setAttribute("lineDistance",new UE(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class eP extends KR{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class tP extends _E{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new yE(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const nP=new Rw,rP=new Tw,iP=new xw,aP=new ZS;class oP extends nE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new JE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new tP;super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),iP.copy(n.boundingSphere),iP.applyMatrix4(r),iP.radius+=i,!1===e.ray.intersectsSphere(iP))return;nP.copy(r).invert(),rP.copy(e.ray).applyMatrix4(nP);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);n<i;n++){const i=l.getX(n);aP.fromBufferAttribute(c,i),sP(aP,i,s,r,e,t,this)}}else{for(let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);n<i;n++)aP.fromBufferAttribute(c,n),sP(aP,n,s,r,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function sP(e,t,n,r,i,a,o){const s=rP.distanceSqToPoint(e);if(s<n){const n=new ZS;rP.closestPointToPoint(e,n),n.applyMatrix4(r);const l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:o})}}class lP extends VS{constructor(e,t,n,r,i,a,o,s,l){super(e,t,n,r,i,a,o,s,l),this.isVideoTexture=!0,this.minFilter=void 0!==a?a:jb,this.magFilter=void 0!==i?i:jb,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class cP extends VS{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Fb,this.minFilter=Fb,this.generateMipmaps=!1,this.needsUpdate=!0}}class uP extends VS{constructor(e,t,n,r,i,a,o,s,l,c,u,d){super(null,a,o,s,l,c,r,i,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class dP extends uP{constructor(e,t,n,r,i,a){super(e,t,n,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Ob,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class hP extends uP{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Pb),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class pP extends VS{constructor(e,t,n,r,i,a,o,s,l){super(e,t,n,r,i,a,o,s,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class fP{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let a;a=t||e*n[i-1];let o,s=0,l=i-1;for(;s<=l;)if(r=Math.floor(s+(l-s)/2),o=n[r]-a,o<0)s=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(r=l,n[r]===a)return r/(i-1);const c=n[r];return(r+(a-c)/(n[r+1]-c))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new _S:new ZS);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new ZS,r=[],i=[],a=[],o=new ZS,s=new Rw;for(let h=0;h<=e;h++){const t=h/e;r[h]=this.getTangentAt(t,new ZS)}i[0]=new ZS,a[0]=new ZS;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),d<=l&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let h=1;h<=e;h++){if(i[h]=i[h-1].clone(),a[h]=a[h-1].clone(),o.crossVectors(r[h-1],r[h]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(mS(r[h-1].dot(r[h]),-1,1));i[h].applyMatrix4(s.makeRotationAxis(o,e))}a[h].crossVectors(r[h],i[h])}if(!0===t){let t=Math.acos(mS(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,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 mP extends fP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const i=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=i?0:n),!0!==this.aClockwise||i||(r===n?r=-n:r-=n);const a=this.aStartAngle+e*r;let o=this.aX+this.xRadius*Math.cos(a),s=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=o-this.aX,r=s-this.aY;o=n*e-r*t+this.aX,s=n*t+r*e+this.aY}return t.set(o,s)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class gP extends mP{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type="ArcCurve"}}function vP(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let l=(t-e)/a-(n-e)/(a+o)+(n-t)/o,c=(n-t)/o-(r-t)/(o+s)+(r-n)/s;l*=o,c*=o,i(t,n,l,c)},calc:function(i){const a=i*i;return e+t*i+n*a+r*(a*i)}}}const yP=new ZS,bP=new vP,xP=new vP,_P=new vP;class SP extends fP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS,n=this.points,r=n.length,i=(r-(this.closed?0:1))*e;let a,o,s=Math.floor(i),l=i-s;this.closed?s+=s>0?0:(Math.floor(Math.abs(s)/r)+1)*r:0===l&&s===r-1&&(s=r-2,l=1),this.closed||s>0?a=n[(s-1)%r]:(yP.subVectors(n[0],n[1]).add(n[0]),a=yP);const c=n[s%r],u=n[(s+1)%r];if(this.closed||s+2<r?o=n[(s+2)%r]:(yP.subVectors(n[r-1],n[r-2]).add(n[r-1]),o=yP),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(a.distanceToSquared(c),e),n=Math.pow(c.distanceToSquared(u),e),r=Math.pow(u.distanceToSquared(o),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),bP.initNonuniformCatmullRom(a.x,c.x,u.x,o.x,t,n,r),xP.initNonuniformCatmullRom(a.y,c.y,u.y,o.y,t,n,r),_P.initNonuniformCatmullRom(a.z,c.z,u.z,o.z,t,n,r)}else"catmullrom"===this.curveType&&(bP.initCatmullRom(a.x,c.x,u.x,o.x,this.tension),xP.initCatmullRom(a.y,c.y,u.y,o.y,this.tension),_P.initCatmullRom(a.z,c.z,u.z,o.z,this.tension));return t.set(bP.calc(l),xP.calc(l),_P.calc(l)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new ZS).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function wP(e,t,n,r,i){const a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function EP(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function AP(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}class MP extends fP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new _S,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new _S,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new _S;super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S,n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(AP(e,n.x,r.x,i.x,a.x),AP(e,n.y,r.y,i.y,a.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class CP extends fP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ZS,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new ZS;super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS,n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(AP(e,n.x,r.x,i.x,a.x),AP(e,n.y,r.y,i.y,a.y),AP(e,n.z,r.z,i.z,a.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class TP extends fP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new _S,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S;super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S).subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class RP extends fP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS;super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS).subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class PP extends fP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new _S,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new _S;super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S,n=this.v0,r=this.v1,i=this.v2;return t.set(EP(e,n.x,r.x,i.x),EP(e,n.y,r.y,i.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class BP extends fP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ZS;super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS,n=this.v0,r=this.v1,i=this.v2;return t.set(EP(e,n.x,r.x,i.x),EP(e,n.y,r.y,i.y),EP(e,n.z,r.z,i.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class IP extends fP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S,n=this.points,r=(n.length-1)*e,i=Math.floor(r),a=r-i,o=n[0===i?i:i-1],s=n[i],l=n[i>n.length-2?n.length-1:i+1],c=n[i>n.length-3?n.length-1:i+2];return t.set(wP(a,o.x,s.x,l.x,c.x),wP(a,o.y,s.y,l.y,c.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new _S).fromArray(n))}return this}}var DP=Object.freeze({__proto__:null,ArcCurve:gP,CatmullRomCurve3:SP,CubicBezierCurve:MP,CubicBezierCurve3:CP,EllipseCurve:mP,LineCurve:TP,LineCurve3:RP,QuadraticBezierCurve:PP,QuadraticBezierCurve3:BP,SplineCurve:IP});class LP extends fP{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new DP[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const e=r[i]-n,a=this.curves[i],o=a.getLength(),s=0===o?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12;const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const a=i[r],o=a.isEllipseCurve?2*e:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o);for(let e=0;e<s.length;e++){const r=s[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new DP[n.type]).fromJSON(n))}return this}}class kP extends LP{constructor(e){super(),this.type="Path",this.currentPoint=new _S,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new TP(this.currentPoint.clone(),new _S(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new PP(this.currentPoint.clone(),new _S(e,t),new _S(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,a){const o=new MP(this.currentPoint.clone(),new _S(e,t),new _S(n,r),new _S(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new IP(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,a){const o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this}absarc(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this}ellipse(e,t,n,r,i,a,o,s){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,a,o,s),this}absellipse(e,t,n,r,i,a,o,s){const l=new mP(e,t,n,r,i,a,o,s);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.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 OP extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new _S(0,-.5),new _S(.5,0),new _S(0,.5)],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=mS(r,0,2*Math.PI);const i=[],a=[],o=[],s=[],l=[],c=1/t,u=new ZS,d=new _S,h=new ZS,p=new ZS,f=new ZS;let m=0,g=0;for(let v=0;v<=e.length-1;v++)switch(v){case 0:m=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,h.x=1*g,h.y=-m,h.z=0*g,f.copy(h),h.normalize(),s.push(h.x,h.y,h.z);break;case e.length-1:s.push(f.x,f.y,f.z);break;default:m=e[v+1].x-e[v].x,g=e[v+1].y-e[v].y,h.x=1*g,h.y=-m,h.z=0*g,p.copy(h),h.x+=f.x,h.y+=f.y,h.z+=f.z,h.normalize(),s.push(h.x,h.y,h.z),f.copy(p)}for(let v=0;v<=t;v++){const i=n+v*c*r,h=Math.sin(i),p=Math.cos(i);for(let n=0;n<=e.length-1;n++){u.x=e[n].x*h,u.y=e[n].y,u.z=e[n].x*p,a.push(u.x,u.y,u.z),d.x=v/t,d.y=n/(e.length-1),o.push(d.x,d.y);const r=s[3*n+0]*h,i=s[3*n+1],c=s[3*n+0]*p;l.push(r,i,c)}}for(let v=0;v<t;v++)for(let t=0;t<e.length-1;t++){const n=t+v*e.length,r=n,a=n+e.length,o=n+e.length+1,s=n+1;i.push(r,a,s),i.push(o,s,a)}this.setIndex(i),this.setAttribute("position",new UE(a,3)),this.setAttribute("uv",new UE(o,2)),this.setAttribute("normal",new UE(l,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new OP(e.points,e.segments,e.phiStart,e.phiLength)}}class NP extends OP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;const i=new kP;i.absarc(0,-t/2,e,1.5*Math.PI,0),i.absarc(0,t/2,e,0,.5*Math.PI),super(i.getPoints(n),r),this.type="CapsuleGeometry",this.parameters={radius:e,length:t,capSegments:n,radialSegments:r}}static fromJSON(e){return new NP(e.radius,e.length,e.capSegments,e.radialSegments)}}class FP extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],a=[],o=[],s=[],l=new ZS,c=new _S;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(let u=0,d=3;u<=t;u++,d+=3){const i=n+u/t*r;l.x=e*Math.cos(i),l.y=e*Math.sin(i),a.push(l.x,l.y,l.z),o.push(0,0,1),c.x=(a[d]/e+1)/2,c.y=(a[d+1]/e+1)/2,s.push(c.x,c.y)}for(let u=1;u<=t;u++)i.push(u,u+1,0);this.setIndex(i),this.setAttribute("position",new UE(a,3)),this.setAttribute("normal",new UE(o,3)),this.setAttribute("uv",new UE(s,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new FP(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class UP extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};const l=this;r=Math.floor(r),i=Math.floor(i);const c=[],u=[],d=[],h=[];let p=0;const f=[],m=n/2;let g=0;function v(n){const i=p,a=new _S,f=new ZS;let v=0;const y=!0===n?e:t,b=!0===n?1:-1;for(let e=1;e<=r;e++)u.push(0,m*b,0),d.push(0,b,0),h.push(.5,.5),p++;const x=p;for(let e=0;e<=r;e++){const t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);f.x=y*i,f.y=m*b,f.z=y*n,u.push(f.x,f.y,f.z),d.push(0,b,0),a.x=.5*n+.5,a.y=.5*i*b+.5,h.push(a.x,a.y),p++}for(let e=0;e<r;e++){const t=i+e,r=x+e;!0===n?c.push(r,r+1,t):c.push(r+1,r,t),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const a=new ZS,v=new ZS;let y=0;const b=(t-e)/n;for(let l=0;l<=i;l++){const c=[],g=l/i,y=g*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*s+o,l=Math.sin(i),f=Math.cos(i);v.x=y*l,v.y=-g*n+m,v.z=y*f,u.push(v.x,v.y,v.z),a.set(l,b,f).normalize(),d.push(a.x,a.y,a.z),h.push(t,1-g),c.push(p++)}f.push(c)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=f[t][e],r=f[t+1][e],i=f[t+1][e+1],a=f[t][e+1];c.push(n,r,a),c.push(r,i,a),y+=6}l.addGroup(g,y,0),g+=y}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new UE(u,3)),this.setAttribute("normal",new UE(d,3)),this.setAttribute("uv",new UE(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new UP(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class zP extends UP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;super(0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}static fromJSON(e){return new zP(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class HP extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const i=[],a=[];function o(e,t,n,r){const i=r+1,a=[];for(let o=0;o<=i;o++){a[o]=[];const r=e.clone().lerp(n,o/i),s=t.clone().lerp(n,o/i),l=i-o;for(let e=0;e<=l;e++)a[o][e]=0===e&&o===i?r:r.clone().lerp(s,e/l)}for(let o=0;o<i;o++)for(let e=0;e<2*(i-o)-1;e++){const t=Math.floor(e/2);e%2===0?(s(a[o][t+1]),s(a[o+1][t]),s(a[o][t])):(s(a[o][t+1]),s(a[o+1][t+1]),s(a[o+1][t]))}}function s(e){i.push(e.x,e.y,e.z)}function l(t,n){const r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function c(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new ZS,r=new ZS,i=new ZS;for(let a=0;a<t.length;a+=3)l(t[a+0],n),l(t[a+1],r),l(t[a+2],i),o(n,r,i,e)}(r),function(e){const t=new ZS;for(let n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){const e=new ZS;for(let n=0;n<i.length;n+=3){e.x=i[n+0],e.y=i[n+1],e.z=i[n+2];const r=u(e)/2/Math.PI+.5,o=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);a.push(r,1-o)}var t;(function(){const e=new ZS,t=new ZS,n=new ZS,r=new ZS,o=new _S,s=new _S,l=new _S;for(let d=0,h=0;d<i.length;d+=9,h+=6){e.set(i[d+0],i[d+1],i[d+2]),t.set(i[d+3],i[d+4],i[d+5]),n.set(i[d+6],i[d+7],i[d+8]),o.set(a[h+0],a[h+1]),s.set(a[h+2],a[h+3]),l.set(a[h+4],a[h+5]),r.copy(e).add(t).add(n).divideScalar(3);const p=u(r);c(o,h+0,e,p),c(s,h+2,t,p),c(l,h+4,n,p)}})(),function(){for(let e=0;e<a.length;e+=6){const t=a[e+0],n=a[e+2],r=a[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);i>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new UE(i,3)),this.setAttribute("normal",new UE(i.slice(),3)),this.setAttribute("uv",new UE(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new HP(e.vertices,e.indices,e.radius,e.details)}}class GP extends HP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2,r=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new GP(e.radius,e.detail)}}const jP=new ZS,VP=new ZS,WP=new ZS,XP=new pE;class JP extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,r=Math.pow(10,n),i=Math.cos(hS*t),a=e.getIndex(),o=e.getAttribute("position"),s=a?a.count:o.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),d={},h=[];for(let e=0;e<s;e+=3){a?(l[0]=a.getX(e),l[1]=a.getX(e+1),l[2]=a.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:n,c:s}=XP;if(t.fromBufferAttribute(o,l[0]),n.fromBufferAttribute(o,l[1]),s.fromBufferAttribute(o,l[2]),XP.getNormal(WP),u[0]=`${Math.round(t.x*r)},${Math.round(t.y*r)},${Math.round(t.z*r)}`,u[1]=`${Math.round(n.x*r)},${Math.round(n.y*r)},${Math.round(n.z*r)}`,u[2]=`${Math.round(s.x*r)},${Math.round(s.y*r)},${Math.round(s.z*r)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=u[e],r=u[t],a=XP[c[e]],o=XP[c[t]],s=`${n}_${r}`,p=`${r}_${n}`;p in d&&d[p]?(WP.dot(d[p].normal)<=i&&(h.push(a.x,a.y,a.z),h.push(o.x,o.y,o.z)),d[p]=null):s in d||(d[s]={index0:l[e],index1:l[t],normal:WP.clone()})}}for(const e in d)if(d[e]){const{index0:t,index1:n}=d[e];jP.fromBufferAttribute(o,t),VP.fromBufferAttribute(o,n),h.push(jP.x,jP.y,jP.z),h.push(VP.x,VP.y,VP.z)}this.setAttribute("position",new UE(h,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class $P extends kP{constructor(e){super(e),this.uuid=fS(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new kP).fromJSON(n))}return this}}const KP=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;const r=t&&t.length,i=r?t[0]*n:e.length;let a=YP(e,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,c,u,d,h,p;if(r&&(a=function(e,t,n,r){const i=[];let a,o,s,l,c;for(a=0,o=t.length;a<o;a++)s=t[a]*r,l=a<o-1?t[a+1]*r:e.length,c=YP(e,s,l,r,!1),c===c.next&&(c.steiner=!0),i.push(sB(c));for(i.sort(rB),a=0;a<i.length;a++)n=iB(i[a],n);return n}(e,t,a,n)),e.length>80*n){s=c=e[0],l=u=e[1];for(let t=n;t<i;t+=n)d=e[t],h=e[t+1],d<s&&(s=d),h<l&&(l=h),d>c&&(c=d),h>u&&(u=h);p=Math.max(c-s,u-l),p=0!==p?32767/p:0}return QP(a,o,n,s,l,p,0),o};function YP(e,t,n,r,i){let a,o;if(i===function(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(a=t;a<n;a+=r)o=vB(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=vB(a,e[a],e[a+1],o);return o&&dB(o,o.next)&&(yB(o),o=o.next),o}function qP(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!dB(r,r.next)&&0!==uB(r.prev,r,r.next))r=r.next;else{if(yB(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function QP(e,t,n,r,i,a,o){if(!e)return;!o&&a&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=oB(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,a,o,s,l,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<c&&(s++,r=r.nextZ,r);t++);for(l=c;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1)}(i)}(e,r,i,a);let s,l,c=e;for(;e.prev!==e.next;)if(s=e.prev,l=e.next,a?eB(e,r,i,a):ZP(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),yB(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?QP(e=tB(qP(e),t,n),t,n,r,i,a,2):2===o&&nB(e,t,n,r,i,a):QP(qP(e),t,n,r,i,a,1);break}}function ZP(e){const t=e.prev,n=e,r=e.next;if(uB(t,n,r)>=0)return!1;const i=t.x,a=n.x,o=r.x,s=t.y,l=n.y,c=r.y,u=i<a?i<o?i:o:a<o?a:o,d=s<l?s<c?s:c:l<c?l:c,h=i>a?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c;let f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=h&&f.y>=d&&f.y<=p&&lB(i,s,a,l,o,c,f.x,f.y)&&uB(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function eB(e,t,n,r){const i=e.prev,a=e,o=e.next;if(uB(i,a,o)>=0)return!1;const s=i.x,l=a.x,c=o.x,u=i.y,d=a.y,h=o.y,p=s<l?s<c?s:c:l<c?l:c,f=u<d?u<h?u:h:d<h?d:h,m=s>l?s>c?s:c:l>c?l:c,g=u>d?u>h?u:h:d>h?d:h,v=oB(p,f,t,n,r),y=oB(m,g,t,n,r);let b=e.prevZ,x=e.nextZ;for(;b&&b.z>=v&&x&&x.z<=y;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==o&&lB(s,u,l,d,c,h,b.x,b.y)&&uB(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&lB(s,u,l,d,c,h,x.x,x.y)&&uB(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;b&&b.z>=v;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==o&&lB(s,u,l,d,c,h,b.x,b.y)&&uB(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&lB(s,u,l,d,c,h,x.x,x.y)&&uB(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function tB(e,t,n){let r=e;do{const i=r.prev,a=r.next.next;!dB(i,a)&&hB(i,r,r.next,a)&&mB(i,a)&&mB(a,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(a.i/n|0),yB(r),yB(r.next),r=e=a),r=r.next}while(r!==e);return qP(r)}function nB(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&cB(o,e)){let s=gB(o,e);return o=qP(o,o.next),s=qP(s,s.next),QP(o,t,n,r,i,a,0),void QP(s,t,n,r,i,a,0)}e=e.next}o=o.next}while(o!==e)}function rB(e,t){return e.x-t.x}function iB(e,t){const n=function(e,t){let n,r=t,i=-1/0;const a=e.x,o=e.y;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){const e=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=a&&e>i&&(i=e,n=r.x<r.next.x?r:r.next,e===a))return n}r=r.next}while(r!==t);if(!n)return null;const s=n,l=n.x,c=n.y;let u,d=1/0;r=n;do{a>=r.x&&r.x>=l&&a!==r.x&&lB(o<c?a:i,o,l,c,o<c?i:a,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(a-r.x),mB(r,e)&&(u<d||u===d&&(r.x>n.x||r.x===n.x&&aB(n,r)))&&(n=r,d=u)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;const r=gB(n,e);return qP(r,r.next),qP(n,n.next)}function aB(e,t){return uB(e.prev,e,t.prev)<0&&uB(t.next,e,e.next)<0}function oB(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function sB(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function lB(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function cB(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&hB(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(mB(e,t)&&mB(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!==n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(uB(e.prev,e,t.prev)||uB(e,t.prev,t))||dB(e,t)&&uB(e.prev,e,e.next)>0&&uB(t.prev,t,t.next)>0)}function uB(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function dB(e,t){return e.x===t.x&&e.y===t.y}function hB(e,t,n,r){const i=fB(uB(e,t,n)),a=fB(uB(e,t,r)),o=fB(uB(n,r,e)),s=fB(uB(n,r,t));return i!==a&&o!==s||(!(0!==i||!pB(e,n,t))||(!(0!==a||!pB(e,r,t))||(!(0!==o||!pB(n,e,r))||!(0!==s||!pB(n,t,r)))))}function pB(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function fB(e){return e>0?1:e<0?-1:0}function mB(e,t){return uB(e.prev,e,e.next)<0?uB(e,t,e.next)>=0&&uB(e,e.prev,t)>=0:uB(e,t,e.prev)<0||uB(e,e.next,t)<0}function gB(e,t){const n=new bB(e.i,e.x,e.y),r=new bB(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function vB(e,t,n,r){const i=new bB(e,t,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 yB(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function bB(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class xB{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return xB.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];_B(e),SB(n,e);let a=e.length;t.forEach(_B);for(let s=0;s<t.length;s++)r.push(a),a+=t[s].length,SB(n,t[s]);const o=KP(n,r);for(let s=0;s<o.length;s+=3)i.push(o.slice(s,s+3));return i}}function _B(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function SB(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class wB extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $P([new _S(.5,.5),new _S(-.5,.5),new _S(-.5,-.5),new _S(.5,-.5)]),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],i=[];for(let o=0,s=e.length;o<s;o++){a(e[o])}function a(e){const a=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:.2,d=void 0!==t.bevelSize?t.bevelSize:u-.1,h=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:EB;let g,v,y,b,x,_=!1;f&&(g=f.getSpacedPoints(s),_=!0,c=!1,v=f.computeFrenetFrames(s,!1),y=new ZS,b=new ZS,x=new ZS),c||(p=0,u=0,d=0,h=0);const S=e.extractPoints(o);let w=S.shape;const E=S.holes;if(!xB.isClockWise(w)){w=w.reverse();for(let e=0,t=E.length;e<t;e++){const t=E[e];xB.isClockWise(t)&&(E[e]=t.reverse())}}const A=xB.triangulateShape(w,E),M=w;for(let t=0,n=E.length;t<n;t++){const e=E[t];w=w.concat(e)}function C(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,n)}const T=w.length,R=A.length;function P(e,t,n){let r,i,a;const o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,c=n.y-e.y,u=o*o+s*s,d=o*c-s*l;if(Math.abs(d)>Number.EPSILON){const d=Math.sqrt(u),h=Math.sqrt(l*l+c*c),p=t.x-s/d,f=t.y+o/d,m=((n.x-c/h-p)*c-(n.y+l/h-f)*l)/(o*c-s*l);r=p+o*m-e.x,i=f+s*m-e.y;const g=r*r+i*i;if(g<=2)return new _S(r,i);a=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(c)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new _S(r/a,i/a)}const B=[];for(let t=0,n=M.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),B[t]=P(M[t],M[r],M[i]);const I=[];let D,L=B.concat();for(let t=0,n=E.length;t<n;t++){const e=E[t];D=[];for(let t=0,n=e.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),D[t]=P(e[t],e[r],e[i]);I.push(D),L=L.concat(D)}for(let t=0;t<p;t++){const e=t/p,n=u*Math.cos(e*Math.PI/2),r=d*Math.sin(e*Math.PI/2)+h;for(let t=0,i=M.length;t<i;t++){const e=C(M[t],B[t],r);N(e.x,e.y,-n)}for(let t=0,i=E.length;t<i;t++){const e=E[t];D=I[t];for(let t=0,i=e.length;t<i;t++){const i=C(e[t],D[t],r);N(i.x,i.y,-n)}}}const k=d+h;for(let t=0;t<T;t++){const e=c?C(w[t],L[t],k):w[t];_?(b.copy(v.normals[0]).multiplyScalar(e.x),y.copy(v.binormals[0]).multiplyScalar(e.y),x.copy(g[0]).add(b).add(y),N(x.x,x.y,x.z)):N(e.x,e.y,0)}for(let t=1;t<=s;t++)for(let e=0;e<T;e++){const n=c?C(w[e],L[e],k):w[e];_?(b.copy(v.normals[t]).multiplyScalar(n.x),y.copy(v.binormals[t]).multiplyScalar(n.y),x.copy(g[t]).add(b).add(y),N(x.x,x.y,x.z)):N(n.x,n.y,l/s*t)}for(let t=p-1;t>=0;t--){const e=t/p,n=u*Math.cos(e*Math.PI/2),r=d*Math.sin(e*Math.PI/2)+h;for(let t=0,i=M.length;t<i;t++){const e=C(M[t],B[t],r);N(e.x,e.y,l+n)}for(let t=0,i=E.length;t<i;t++){const e=E[t];D=I[t];for(let t=0,i=e.length;t<i;t++){const i=C(e[t],D[t],r);_?N(i.x,i.y+g[s-1].y,g[s-1].x+n):N(i.x,i.y,l+n)}}}function O(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+2*p;e<n;e++){const n=T*e,a=T*(e+1);U(t+r+n,t+i+n,t+i+a,t+r+a)}}}function N(e,t,n){a.push(e),a.push(t),a.push(n)}function F(e,t,i){z(e),z(t),z(i);const a=r.length/3,o=m.generateTopUV(n,r,a-3,a-2,a-1);H(o[0]),H(o[1]),H(o[2])}function U(e,t,i,a){z(e),z(t),z(a),z(t),z(i),z(a);const o=r.length/3,s=m.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);H(s[0]),H(s[1]),H(s[3]),H(s[1]),H(s[2]),H(s[3])}function z(e){r.push(a[3*e+0]),r.push(a[3*e+1]),r.push(a[3*e+2])}function H(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(c){let e=0,t=T*e;for(let n=0;n<R;n++){const e=A[n];F(e[2]+t,e[1]+t,e[0]+t)}e=s+2*p,t=T*e;for(let n=0;n<R;n++){const e=A[n];F(e[0]+t,e[1]+t,e[2]+t)}}else{for(let e=0;e<R;e++){const t=A[e];F(t[2],t[1],t[0])}for(let e=0;e<R;e++){const t=A[e];F(t[0]+T*s,t[1]+T*s,t[2]+T*s)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;O(M,t),t+=M.length;for(let n=0,r=E.length;n<r;n++){const e=E[n];O(e,t),t+=e.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new UE(r,3)),this.setAttribute("uv",new UE(i,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let r=0,i=e.length;r<i;r++){const t=e[r];n.shapes.push(t.uuid)}else n.shapes.push(e.uuid);n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let i=0,a=e.shapes.length;i<a;i++){const r=t[e.shapes[i]];n.push(r)}const r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new DP[r.type]).fromJSON(r)),new wB(n,e.options)}}const EB={generateTopUV:function(e,t,n,r,i){const a=t[3*n],o=t[3*n+1],s=t[3*r],l=t[3*r+1],c=t[3*i],u=t[3*i+1];return[new _S(a,o),new _S(s,l),new _S(c,u)]},generateSideWallUV:function(e,t,n,r,i,a){const o=t[3*n],s=t[3*n+1],l=t[3*n+2],c=t[3*r],u=t[3*r+1],d=t[3*r+2],h=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(s-u)<Math.abs(o-c)?[new _S(o,1-l),new _S(c,1-d),new _S(h,1-f),new _S(m,1-v)]:[new _S(s,1-l),new _S(u,1-d),new _S(p,1-f),new _S(g,1-v)]}};class AB extends HP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new AB(e.radius,e.detail)}}class MB extends HP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new MB(e.radius,e.detail)}}class CB extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},n=Math.max(3,n),r=Math.max(1,r);const o=[],s=[],l=[],c=[];let u=e;const d=(t-e)/r,h=new ZS,p=new _S;for(let f=0;f<=r;f++){for(let e=0;e<=n;e++){const r=i+e/n*a;h.x=u*Math.cos(r),h.y=u*Math.sin(r),s.push(h.x,h.y,h.z),l.push(0,0,1),p.x=(h.x/t+1)/2,p.y=(h.y/t+1)/2,c.push(p.x,p.y)}u+=d}for(let f=0;f<r;f++){const e=f*(n+1);for(let t=0;t<n;t++){const r=t+e,i=r,a=r+n+1,s=r+n+2,l=r+1;o.push(i,a,l),o.push(a,s,l)}}this.setIndex(o),this.setAttribute("position",new UE(s,3)),this.setAttribute("normal",new UE(l,3)),this.setAttribute("uv",new UE(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new CB(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class TB extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $P([new _S(0,.5),new _S(-.5,-.5),new _S(.5,-.5)]),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],i=[],a=[];let o=0,s=0;if(!1===Array.isArray(e))l(e);else for(let c=0;c<e.length;c++)l(e[c]),this.addGroup(o,s,c),o+=s,s=0;function l(e){const o=r.length/3,l=e.extractPoints(t);let c=l.shape;const u=l.holes;!1===xB.isClockWise(c)&&(c=c.reverse());for(let t=0,n=u.length;t<n;t++){const e=u[t];!0===xB.isClockWise(e)&&(u[t]=e.reverse())}const d=xB.triangulateShape(c,u);for(let t=0,n=u.length;t<n;t++){const e=u[t];c=c.concat(e)}for(let t=0,n=c.length;t<n;t++){const e=c[t];r.push(e.x,e.y,0),i.push(0,0,1),a.push(e.x,e.y)}for(let t=0,r=d.length;t<r;t++){const e=d[t],r=e[0]+o,i=e[1]+o,a=e[2]+o;n.push(r,i,a),s+=3}}this.setIndex(n),this.setAttribute("position",new UE(r,3)),this.setAttribute("normal",new UE(i,3)),this.setAttribute("uv",new UE(a,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){const r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}return new TB(n,e.curveSegments)}}class RB extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const s=Math.min(a+o,Math.PI);let l=0;const c=[],u=new ZS,d=new ZS,h=[],p=[],f=[],m=[];for(let g=0;g<=n;g++){const h=[],v=g/n;let y=0;0===g&&0===a?y=.5/t:g===n&&s===Math.PI&&(y=-.5/t);for(let n=0;n<=t;n++){const s=n/t;u.x=-e*Math.cos(r+s*i)*Math.sin(a+v*o),u.y=e*Math.cos(a+v*o),u.z=e*Math.sin(r+s*i)*Math.sin(a+v*o),p.push(u.x,u.y,u.z),d.copy(u).normalize(),f.push(d.x,d.y,d.z),m.push(s+y,1-v),h.push(l++)}c.push(h)}for(let g=0;g<n;g++)for(let e=0;e<t;e++){const t=c[g][e+1],r=c[g][e],i=c[g+1][e],o=c[g+1][e+1];(0!==g||a>0)&&h.push(t,r,o),(g!==n-1||s<Math.PI)&&h.push(r,i,o)}this.setIndex(h),this.setAttribute("position",new UE(p,3)),this.setAttribute("normal",new UE(f,3)),this.setAttribute("uv",new UE(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new RB(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class PB extends HP{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new PB(e.radius,e.detail)}}class BB extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const a=[],o=[],s=[],l=[],c=new ZS,u=new ZS,d=new ZS;for(let h=0;h<=n;h++)for(let a=0;a<=r;a++){const p=a/r*i,f=h/n*Math.PI*2;u.x=(e+t*Math.cos(f))*Math.cos(p),u.y=(e+t*Math.cos(f))*Math.sin(p),u.z=t*Math.sin(f),o.push(u.x,u.y,u.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),d.subVectors(u,c).normalize(),s.push(d.x,d.y,d.z),l.push(a/r),l.push(h/n)}for(let h=1;h<=n;h++)for(let e=1;e<=r;e++){const t=(r+1)*h+e-1,n=(r+1)*(h-1)+e-1,i=(r+1)*(h-1)+e,o=(r+1)*h+e;a.push(t,n,o),a.push(n,i,o)}this.setIndex(a),this.setAttribute("position",new UE(o,3)),this.setAttribute("normal",new UE(s,3)),this.setAttribute("uv",new UE(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new BB(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class IB extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},n=Math.floor(n),r=Math.floor(r);const o=[],s=[],l=[],c=[],u=new ZS,d=new ZS,h=new ZS,p=new ZS,f=new ZS,m=new ZS,g=new ZS;for(let y=0;y<=n;++y){const o=y/n*i*Math.PI*2;v(o,i,a,e,h),v(o+.01,i,a,e,p),m.subVectors(p,h),g.addVectors(p,h),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=r;++e){const i=e/r*Math.PI*2,a=-t*Math.cos(i),o=t*Math.sin(i);u.x=h.x+(a*g.x+o*f.x),u.y=h.y+(a*g.y+o*f.y),u.z=h.z+(a*g.z+o*f.z),s.push(u.x,u.y,u.z),d.subVectors(u,h).normalize(),l.push(d.x,d.y,d.z),c.push(y/n),c.push(e/r)}}for(let y=1;y<=n;y++)for(let e=1;e<=r;e++){const t=(r+1)*(y-1)+(e-1),n=(r+1)*y+(e-1),i=(r+1)*y+e,a=(r+1)*(y-1)+e;o.push(t,n,a),o.push(n,i,a)}function v(e,t,n,r,i){const a=Math.cos(e),o=Math.sin(e),s=n/t*e,l=Math.cos(s);i.x=r*(2+l)*.5*a,i.y=r*(2+l)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(o),this.setAttribute("position",new UE(s,3)),this.setAttribute("normal",new UE(l,3)),this.setAttribute("uv",new UE(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new IB(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class DB extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new BP(new ZS(-1,-1,0),new ZS(-1,1,0),new ZS(1,1,0)),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new ZS,s=new ZS,l=new _S;let c=new ZS;const u=[],d=[],h=[],p=[];function f(i){c=e.getPointAt(i/t,c);const l=a.normals[i],h=a.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),a=-Math.cos(t);s.x=a*l.x+i*h.x,s.y=a*l.y+i*h.y,s.z=a*l.z+i*h.z,s.normalize(),d.push(s.x,s.y,s.z),o.x=c.x+n*s.x,o.y=c.y+n*s.y,o.z=c.z+n*s.z,u.push(o.x,o.y,o.z)}}!function(){for(let e=0;e<t;e++)f(e);f(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)l.x=e/t,l.y=n/r,h.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),a=(r+1)*e+t,o=(r+1)*(e-1)+t;p.push(n,i,o),p.push(i,a,o)}}()}(),this.setIndex(p),this.setAttribute("position",new UE(u,3)),this.setAttribute("normal",new UE(d,3)),this.setAttribute("uv",new UE(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new DB((new DP[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class LB extends JE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,r=new ZS,i=new ZS;if(null!==e.index){const a=e.attributes.position,o=e.index;let s=e.groups;0===s.length&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,l=s.length;e<l;++e){const l=s[e],c=l.start;for(let e=c,s=c+l.count;e<s;e+=3)for(let l=0;l<3;l++){const s=o.getX(e+l),c=o.getX(e+(l+1)%3);r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,c),!0===kB(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{const a=e.attributes.position;for(let e=0,o=a.count/3;e<o;e++)for(let s=0;s<3;s++){const o=3*e+s,l=3*e+(s+1)%3;r.fromBufferAttribute(a,o),i.fromBufferAttribute(a,l),!0===kB(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new UE(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function kB(e,t,n){const r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}var OB=Object.freeze({__proto__:null,BoxGeometry:pA,CapsuleGeometry:NP,CircleGeometry:FP,ConeGeometry:zP,CylinderGeometry:UP,DodecahedronGeometry:GP,EdgesGeometry:JP,ExtrudeGeometry:wB,IcosahedronGeometry:AB,LatheGeometry:OP,OctahedronGeometry:MB,PlaneGeometry:NA,PolyhedronGeometry:HP,RingGeometry:CB,ShapeGeometry:TB,SphereGeometry:RB,TetrahedronGeometry:PB,TorusGeometry:BB,TorusKnotGeometry:IB,TubeGeometry:DB,WireframeGeometry:LB});class NB extends _E{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new yE(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class FB extends yA{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class UB extends _E{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new yE(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new yE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=m_,this.normalScale=new _S(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Uw,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class zB extends UB{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new _S(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return mS(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new yE(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new yE(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new yE(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!==e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!==e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!==e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!==e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!==e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!==e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class HB extends _E{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new yE(16777215),this.specular=new yE(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new yE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=m_,this.normalScale=new _S(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Uw,this.combine=gb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class GB extends _E{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new yE(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new yE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=m_,this.normalScale=new _S(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 jB extends _E{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=m_,this.normalScale=new _S(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 VB extends _E{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new yE(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new yE(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=m_,this.normalScale=new _S(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Uw,this.combine=gb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class WB extends _E{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new yE(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=m_,this.normalScale=new _S(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 XB extends HR{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 JB(e,t,n){return!e||!n&&e.constructor===t?e:"number"===typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function $B(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function KB(e){const t=e.length,n=new Array(t);for(let r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n}function YB(e,t,n){const r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){const r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function qB(e,t,n,r){let i=1,a=e[0];for(;void 0!==a&&void 0===a[r];)a=e[i++];if(void 0===a)return;let o=a[r];if(void 0!==o)if(Array.isArray(o))do{o=a[r],void 0!==o&&(t.push(a.time),n.push.apply(n,o)),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[r],void 0!==o&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++]}while(void 0!==a);else do{o=a[r],void 0!==o&&(t.push(a.time),n.push(o)),a=e[i++]}while(void 0!==a)}const QB={convertArray:JB,isTypedArray:$B,getKeyframeOrder:KB,sortedArray:YB,flattenJSON:qB,subclip:function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30;const a=e.clone();a.name=t;const o=[];for(let l=0;l<a.tracks.length;++l){const e=a.tracks[l],t=e.getValueSize(),s=[],c=[];for(let a=0;a<e.times.length;++a){const o=e.times[a]*i;if(!(o<n||o>=r)){s.push(e.times[a]);for(let n=0;n<t;++n)c.push(e.values[a*t+n])}}0!==s.length&&(e.times=JB(s,e.times.constructor),e.values=JB(c,e.values.constructor),o.push(e))}a.tracks=o;let s=1/0;for(let l=0;l<a.tracks.length;++l)s>a.tracks[l].times[0]&&(s=a.tracks[l].times[0]);for(let l=0;l<a.tracks.length;++l)a.tracks[l].shift(-1*s);return a.resetDuration(),a},makeClipAdditive:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);const i=n.tracks.length,a=t/r;for(let o=0;o<i;++o){const t=n.tracks[o],r=t.ValueTypeName;if("bool"===r||"string"===r)continue;const i=e.tracks.find((function(e){return e.name===t.name&&e.ValueTypeName===r}));if(void 0===i)continue;let s=0;const l=t.getValueSize();t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=l/3);let c=0;const u=i.getValueSize();i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);const d=t.times.length-1;let h;if(a<=t.times[0]){const e=s,n=l-s;h=t.values.slice(e,n)}else if(a>=t.times[d]){const e=d*l+s,n=e+l-s;h=t.values.slice(e,n)}else{const e=t.createInterpolant(),n=s,r=l-s;e.evaluate(a),h=e.resultBuffer.slice(n,r)}if("quaternion"===r){(new QS).fromArray(h).normalize().conjugate().toArray(h)}const p=i.times.length;for(let e=0;e<p;++e){const t=e*u+c;if("quaternion"===r)QS.multiplyQuaternionsFlat(i.values,t,h,0,i.values,t);else{const e=u-2*c;for(let n=0;n<e;++n)i.values[t+n]-=h[n]}}}return e.blendMode=s_,e}};class ZB{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let a;n:{r:if(!(e<r)){for(let a=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(i=r,r=t[++n],e<r)break t}a=t.length;break n}if(e>=i)break e;{const o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(r=i,i=t[--n-1],e>=i)break t}a=n,n=0}}for(;n<a;){const r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let a=0;a!==r;++a)t[a]=n[i+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class eI extends ZB{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:r_,endingEnd:r_}}intervalChanged_(e,t,n){const r=this.parameterPositions;let i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case i_:i=e,o=2*t-n;break;case a_:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case i_:a=e,s=2*n-t;break;case a_:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*c,this._offsetNext=a*c}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,h=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-d*m+2*d*f-d*p,v=(1+d)*m+(-1.5-2*d)*f+(-.5+d)*p+1,y=(-1-h)*m+(1.5+h)*f+.5*p,b=h*m-h*f;for(let x=0;x!==o;++x)i[x]=g*a[c+x]+v*a[l+x]+y*a[s+x]+b*a[u+x];return i}}class tI extends ZB{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=(n-t)/(r-t),u=1-c;for(let d=0;d!==o;++d)i[d]=a[l+d]*u+a[s+d]*c;return i}}class nI extends ZB{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class rI{constructor(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=JB(t,this.TimeBufferType),this.values=JB(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:JB(e.times,Array),values:JB(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new nI(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new tI(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new eI(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case e_:t=this.InterpolantFactoryMethodDiscrete;break;case t_:t=this.InterpolantFactoryMethodLinear;break;case n_:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return e_;case this.InterpolantFactoryMethodLinear:return t_;case this.InterpolantFactoryMethodSmooth:return n_}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);const e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==i;o++){const t=n[o];if("number"===typeof t&&isNaN(t)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,t),e=!1;break}if(null!==a&&a>t){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,t,a),e=!1;break}a=t}if(void 0!==r&&$B(r))for(let o=0,s=r.length;o!==s;++o){const t=r[o];if(isNaN(t)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,t),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===n_,i=e.length-1;let a=1;for(let o=1;o<i;++o){let i=!1;const s=e[o];if(s!==e[o+1]&&(1!==o||s!==e[0]))if(r)i=!0;else{const e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){const n=t[e+o];if(n!==t[r+o]||n!==t[a+o]){i=!0;break}}}if(i){if(o!==a){e[a]=e[o];const r=o*n,i=a*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++a}}if(i>0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}rI.prototype.TimeBufferType=Float32Array,rI.prototype.ValueBufferType=Float32Array,rI.prototype.DefaultInterpolation=t_;class iI extends rI{constructor(e,t,n){super(e,t,n)}}iI.prototype.ValueTypeName="bool",iI.prototype.ValueBufferType=Array,iI.prototype.DefaultInterpolation=e_,iI.prototype.InterpolantFactoryMethodLinear=void 0,iI.prototype.InterpolantFactoryMethodSmooth=void 0;class aI extends rI{}aI.prototype.ValueTypeName="color";class oI extends rI{}oI.prototype.ValueTypeName="number";class sI extends ZB{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t);let l=e*o;for(let c=l+o;l!==c;l+=4)QS.slerpFlat(i,0,a,l-o,a,l,s);return i}}class lI extends rI{InterpolantFactoryMethodLinear(e){return new sI(this.times,this.values,this.getValueSize(),e)}}lI.prototype.ValueTypeName="quaternion",lI.prototype.InterpolantFactoryMethodSmooth=void 0;class cI extends rI{constructor(e,t,n){super(e,t,n)}}cI.prototype.ValueTypeName="string",cI.prototype.ValueBufferType=Array,cI.prototype.DefaultInterpolation=e_,cI.prototype.InterpolantFactoryMethodLinear=void 0,cI.prototype.InterpolantFactoryMethodSmooth=void 0;class uI extends rI{}uI.prototype.ValueTypeName="vector";class dI{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o_;this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=fS(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(hI(n[a]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,a=n.length;i!==a;++i)t.push(rI.toJSON(n[i]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,a=[];for(let o=0;o<i;o++){let e=[],s=[];e.push((o+i-1)%i,o,(o+1)%i),s.push(0,1,0);const l=KB(e);e=YB(e,1,l),s=YB(s,1,l),r||0!==e[0]||(e.push(i),s.push(s[0])),a.push(new oI(".morphTargetInfluences["+t[o].name+"]",e,s).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let o=0,s=e.length;o<s;o++){const t=e[o],n=t.name.match(i);if(n&&n.length>1){const e=n[1];let i=r[e];i||(r[e]=i=[]),i.push(t)}}const a=[];for(const o in r)a.push(this.CreateFromMorphTargetSequence(o,r[o],t,n));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const a=[],o=[];qB(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode;let s=e.length||-1;const l=e.hierarchy||[];for(let c=0;c<l.length;c++){const e=l[c].keys;if(e&&0!==e.length)if(e[0].morphTargets){const t={};let n;for(n=0;n<e.length;n++)if(e[n].morphTargets)for(let r=0;r<e[n].morphTargets.length;r++)t[e[n].morphTargets[r]]=-1;for(const i in t){const t=[],a=[];for(let r=0;r!==e[n].morphTargets.length;++r){const r=e[n];t.push(r.time),a.push(r.morphTarget===i?1:0)}r.push(new oI(".morphTargetInfluence["+i+"]",t,a))}s=t.length*a}else{const i=".bones["+t[c].name+"]";n(uI,i+".position",e,"pos",r),n(lI,i+".quaternion",e,"rot",r),n(uI,i+".scale",e,"scl",r)}}if(0===r.length)return null;return new this(i,s,r,o)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function hI(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return oI;case"vector":case"vector2":case"vector3":case"vector4":return uI;case"color":return aI;case"quaternion":return lI;case"bool":case"boolean":return iI;case"string":return cI}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];qB(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const pI={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class fI{constructor(e,t,n){const r=this;let i,a=!1,o=0,s=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){s++,!1===a&&void 0!==r.onStart&&r.onStart(e,o,s),a=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,s),o===s&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const mI=new fI;class gI{constructor(e){this.manager=void 0!==e?e:mI,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}gI.DEFAULT_MATERIAL_NAME="__DEFAULT";const vI={};class yI extends Error{constructor(e,t){super(e),this.response=t}}class bI extends gI{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=pI.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==vI[e])return void vI[e].push({onLoad:t,onProgress:n,onError:r});vI[e]=[],vI[e].push({onLoad:t,onProgress:n,onError:r});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,s=this.responseType;fetch(a).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"===typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=vI[e],r=t.body.getReader(),i=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),a=i?parseInt(i):0,o=0!==a;let s=0;const l=new ReadableStream({start(e){!function t(){r.read().then((r=>{let{done:i,value:l}=r;if(i)e.close();else{s+=l.byteLength;const r=new ProgressEvent("progress",{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(l),t()}}),(t=>{e.error(t)}))}()}});return new Response(l)}throw new yI(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(s){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then((e=>r.decode(e)))}}})).then((t=>{pI.add(e,t);const n=vI[e];delete vI[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onLoad&&r.onLoad(t)}})).catch((t=>{const n=vI[e];if(void 0===n)throw this.manager.itemError(e),t;delete vI[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class xI extends gI{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new bI(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(a){r?r(a):console.error(a),i.manager.itemError(e)}}),n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=dI.parse(e[n]);t.push(r)}return t}}class _I extends gI{constructor(e){super(e)}load(e,t,n,r){const i=this,a=[],o=new uP,s=new bI(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(i.withCredentials);let l=0;function c(c){s.load(e[c],(function(e){const n=i.parse(e,!0);a[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(o.minFilter=jb),o.image=a,o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,r)}if(Array.isArray(e))for(let u=0,d=e.length;u<d;++u)c(u);else s.load(e,(function(e){const n=i.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){a[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)a[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),a[t].format=n.format,a[t].width=n.width,a[t].height=n.height}o.image=a}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=jb),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,r);return o}}class SI extends gI{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=pI.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;const o=CS("img");function s(){c(),pI.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){c(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function c(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}class wI extends gI{constructor(e){super(e)}load(e,t,n,r){const i=new MA;i.colorSpace=y_;const a=new SI(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let o=0;function s(n){a.load(e[n],(function(e){i.images[n]=e,o++,6===o&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(let l=0;l<e.length;++l)s(l);return i}}class EI extends gI{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new cR,o=new bI(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(i.withCredentials),o.load(e,(function(e){let n;try{n=i.parse(e)}catch(cO){if(void 0===r)return void console.error(cO);r(cO)}void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:Ob,a.wrapT=void 0!==n.wrapT?n.wrapT:Ob,a.magFilter=void 0!==n.magFilter?n.magFilter:jb,a.minFilter=void 0!==n.minFilter?n.minFilter:jb,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.colorSpace&&(a.colorSpace=n.colorSpace),void 0!==n.flipY&&(a.flipY=n.flipY),void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=Xb),1===n.mipmapCount&&(a.minFilter=jb),void 0!==n.generateMipmaps&&(a.generateMipmaps=n.generateMipmaps),a.needsUpdate=!0,t&&t(a,n)}),n,r),a}}class AI extends gI{constructor(e){super(e)}load(e,t,n,r){const i=new VS,a=new SI(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}class MI extends nE{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;super(),this.isLight=!0,this.type="Light",this.color=new yE(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(t.object.target=this.target.uuid),t}}class CI extends MI{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(nE.DEFAULT_UP),this.updateMatrix(),this.groundColor=new yE(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const TI=new Rw,RI=new ZS,PI=new ZS;class BI{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _S(512,512),this.map=null,this.mapPass=null,this.matrix=new Rw,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new LA,this._frameExtents=new _S(1,1),this._viewportCount=1,this._viewports=[new WS(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;RI.setFromMatrixPosition(e.matrixWorld),t.position.copy(RI),PI.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(PI),t.updateMatrixWorld(),TI.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(TI),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(TI)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 1!==this.intensity&&(e.intensity=this.intensity),0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class II extends BI{constructor(){super(new wA(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*pS*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class DI extends MI{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2;super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(nE.DEFAULT_UP),this.updateMatrix(),this.target=new nE,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new II}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const LI=new Rw,kI=new ZS,OI=new ZS;class NI extends BI{constructor(){super(new wA(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new _S(4,2),this._viewportCount=6,this._viewports=[new WS(2,1,1,1),new WS(0,1,1,1),new WS(3,1,1,1),new WS(1,1,1,1),new WS(3,0,1,1),new WS(1,0,1,1)],this._cubeDirections=[new ZS(1,0,0),new ZS(-1,0,0),new ZS(0,0,1),new ZS(0,0,-1),new ZS(0,1,0),new ZS(0,-1,0)],this._cubeUps=[new ZS(0,1,0),new ZS(0,1,0),new ZS(0,1,0),new ZS(0,1,0),new ZS(0,0,1),new ZS(0,0,-1)]}updateMatrices(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),kI.setFromMatrixPosition(e.matrixWorld),n.position.copy(kI),OI.copy(n.position),OI.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(OI),n.updateMatrixWorld(),r.makeTranslation(-kI.x,-kI.y,-kI.z),LI.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(LI)}}class FI extends MI{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new NI}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class UI extends BI{constructor(){super(new YA(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class zI extends MI{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(nE.DEFAULT_UP),this.updateMatrix(),this.target=new nE,this.shadow=new UI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class HI extends MI{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class GI extends MI{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class jI{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new ZS)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}class VI extends MI{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new jI;super(void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class WI extends gI{constructor(e){super(e),this.textures={}}load(e,t,n,r){const i=this,a=new bI(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(a){r?r(a):console.error(a),i.manager.itemError(e)}}),n,r)}parse(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const r=WI.createMaterialFromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=(new yE).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.dispersion&&(r.dispersion=e.dispersion),void 0!==e.iridescence&&(r.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(r.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(r.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(r.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(r.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(r.depthFunc=e.depthFunc),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(r.blendSrc=e.blendSrc),void 0!==e.blendDst&&(r.blendDst=e.blendDst),void 0!==e.blendEquation&&(r.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(r.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(r.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(r.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==r.blendColor&&r.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(r.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),void 0!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(r.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"===typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const i in e.uniforms){const t=e.uniforms[i];switch(r.uniforms[i]={},t.type){case"t":r.uniforms[i].value=n(t.value);break;case"c":r.uniforms[i].value=(new yE).setHex(t.value);break;case"v2":r.uniforms[i].value=(new _S).fromArray(t.value);break;case"v3":r.uniforms[i].value=(new ZS).fromArray(t.value);break;case"v4":r.uniforms[i].value=(new WS).fromArray(t.value);break;case"m3":r.uniforms[i].value=(new SS).fromArray(t.value);break;case"m4":r.uniforms[i].value=(new Rw).fromArray(t.value);break;default:r.uniforms[i].value=t.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(r.glslVersion=e.glslVersion),void 0!==e.extensions)for(const i in e.extensions)r.extensions[i]=e.extensions[i];if(void 0!==e.lights&&(r.lights=e.lights),void 0!==e.clipping&&(r.clipping=e.clipping),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new _S).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapRotation&&r.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new _S).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(r.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),void 0!==e.anisotropyMap&&(r.anisotropyMap=n(e.anisotropyMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:NB,SpriteMaterial:DT,RawShaderMaterial:FB,ShaderMaterial:yA,PointsMaterial:tP,MeshPhysicalMaterial:zB,MeshStandardMaterial:UB,MeshPhongMaterial:HB,MeshToonMaterial:GB,MeshNormalMaterial:jB,MeshLambertMaterial:VB,MeshDepthMaterial:lT,MeshDistanceMaterial:cT,MeshBasicMaterial:SE,MeshMatcapMaterial:WB,LineDashedMaterial:XB,LineBasicMaterial:HR,Material:_E}[e]}}class XI{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),"undefined"!==typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let r=0,i=e.length;r<i;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch(n){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!==typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class JI extends JE{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class $I extends gI{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new bI(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(a){r?r(a):console.error(a),i.manager.itemError(e)}}),n,r)}parse(e){const t={},n={};function r(e,r){if(void 0!==t[r])return t[r];const i=e.interleavedBuffers[r],a=function(e,t){if(void 0!==n[t])return n[t];const r=e.arrayBuffers,i=r[t],a=new Uint32Array(i).buffer;return n[t]=a,a}(e,i.buffer),o=MS(i.type,a),s=new PT(o,i.stride);return s.uuid=i.uuid,t[r]=s,s}const i=e.isInstancedBufferGeometry?new JI:new JE,a=e.data.index;if(void 0!==a){const e=MS(a.type,a.array);i.setIndex(new PE(e,1))}const o=e.data.attributes;for(const u in o){const t=o[u];let n;if(t.isInterleavedBufferAttribute){const i=r(e.data,t.data);n=new IT(i,t.itemSize,t.offset,t.normalized)}else{const e=MS(t.type,t.array);n=new(t.isInstancedBufferAttribute?pR:PE)(e,t.itemSize,t.normalized)}void 0!==t.name&&(n.name=t.name),void 0!==t.usage&&n.setUsage(t.usage),i.setAttribute(u,n)}const s=e.data.morphAttributes;if(s)for(const u in s){const t=s[u],n=[];for(let i=0,a=t.length;i<a;i++){const a=t[i];let o;if(a.isInterleavedBufferAttribute){const t=r(e.data,a.data);o=new IT(t,a.itemSize,a.offset,a.normalized)}else{const e=MS(a.type,a.array);o=new PE(e,a.itemSize,a.normalized)}void 0!==a.name&&(o.name=a.name),n.push(o)}i.morphAttributes[u]=n}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let u=0,d=l.length;u!==d;++u){const e=l[u];i.addGroup(e.start,e.count,e.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new ZS;void 0!==c.center&&e.fromArray(c.center),i.boundingSphere=new xw(e,c.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}class KI extends gI{constructor(e){super(e)}load(e,t,n,r){const i=this,a=""===this.path?XI.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;const o=new bI(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){let a=null;try{a=JSON.parse(n)}catch(cO){return void 0!==r&&r(cO),void console.error("THREE:ObjectLoader: Can't parse "+e+".",cO.message)}const o=a.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())return void 0!==r&&r(new Error("THREE.ObjectLoader: Can't load "+e)),void console.error("THREE.ObjectLoader: Can't load "+e);i.parse(a,t)}),n,r)}async loadAsync(e,t){const n=""===this.path?XI.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const r=new bI(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const i=await r.loadAsync(e,t),a=JSON.parse(i),o=a.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(a)}parse(e,t){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),a=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),o=this.parseTextures(e.textures,a),s=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,i,s,o,n),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),this.bindLightTargets(l),void 0!==t){let e=!1;for(const t in a)if(a[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),i=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o,a,t),l=this.parseSkeletons(e.skeletons,s);return this.bindSkeletons(s,l),this.bindLightTargets(s),s}parseShapes(e){const t={};if(void 0!==e)for(let n=0,r=e.length;n<r;n++){const r=(new $P).fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(let i=0,a=e.length;i<a;i++){const t=(new hR).fromJSON(e[i],r);n[t.uuid]=t}return n}parseGeometries(e,t){const n={};if(void 0!==e){const r=new $I;for(let i=0,a=e.length;i<a;i++){let a;const o=e[i];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(o);break;default:o.type in OB?a=OB[o.type].fromJSON(o,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${o.type}"`)}a.uuid=o.uuid,void 0!==o.name&&(a.name=o.name),void 0!==o.userData&&(a.userData=o.userData),n[o.uuid]=a}}return n}parseMaterials(e,t){const n={},r={};if(void 0!==e){const i=new WI;i.setTextures(t);for(let t=0,a=e.length;t<a;t++){const a=e[t];void 0===n[a.uuid]&&(n[a.uuid]=i.parse(a)),r[a.uuid]=n[a.uuid]}}return r}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const r=e[n],i=dI.parse(r);t[i.uuid]=i}return t}parseImages(e,t){const n=this,r={};let i;function a(e){if("string"===typeof e){const t=e;return function(e){return n.manager.itemStart(e),i.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:MS(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new fI(t);i=new SI(n),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){const n=e[t],i=n.url;if(Array.isArray(i)){const e=[];for(let t=0,n=i.length;t<n;t++){const n=a(i[t]);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new cR(n.data,n.width,n.height)))}r[n.uuid]=new HS(e)}else{const e=a(n.url);r[n.uuid]=new HS(e)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;async function i(e){if("string"===typeof e){const n=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await r.loadAsync(i)}return e.data?{data:MS(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){r=new SI(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){const r=e[t],a=r.url;if(Array.isArray(a)){const e=[];for(let t=0,n=a.length;t<n;t++){const n=a[t],r=await i(n);null!==r&&(r instanceof HTMLImageElement?e.push(r):e.push(new cR(r.data,r.width,r.height)))}n[r.uuid]=new HS(e)}else{const e=await i(r.url);n[r.uuid]=new HS(e)}}}return n}parseTextures(e,t){function n(e,t){return"number"===typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const r={};if(void 0!==e)for(let i=0,a=e.length;i<a;i++){const a=e[i];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===t[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const o=t[a.image],s=o.data;let l;Array.isArray(s)?(l=new MA,6===s.length&&(l.needsUpdate=!0)):(l=s&&s.data?new cR:new VS,s&&(l.needsUpdate=!0)),l.source=o,l.uuid=a.uuid,void 0!==a.name&&(l.name=a.name),void 0!==a.mapping&&(l.mapping=n(a.mapping,YI)),void 0!==a.channel&&(l.channel=a.channel),void 0!==a.offset&&l.offset.fromArray(a.offset),void 0!==a.repeat&&l.repeat.fromArray(a.repeat),void 0!==a.center&&l.center.fromArray(a.center),void 0!==a.rotation&&(l.rotation=a.rotation),void 0!==a.wrap&&(l.wrapS=n(a.wrap[0],qI),l.wrapT=n(a.wrap[1],qI)),void 0!==a.format&&(l.format=a.format),void 0!==a.internalFormat&&(l.internalFormat=a.internalFormat),void 0!==a.type&&(l.type=a.type),void 0!==a.colorSpace&&(l.colorSpace=a.colorSpace),void 0!==a.minFilter&&(l.minFilter=n(a.minFilter,QI)),void 0!==a.magFilter&&(l.magFilter=n(a.magFilter,QI)),void 0!==a.anisotropy&&(l.anisotropy=a.anisotropy),void 0!==a.flipY&&(l.flipY=a.flipY),void 0!==a.generateMipmaps&&(l.generateMipmaps=a.generateMipmaps),void 0!==a.premultiplyAlpha&&(l.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(l.unpackAlignment=a.unpackAlignment),void 0!==a.compareFunction&&(l.compareFunction=a.compareFunction),void 0!==a.userData&&(l.userData=a.userData),r[a.uuid]=l}return r}parseObject(e,t,n,r,i){let a,o,s;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];void 0===n[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(n[i])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}function u(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),r[e]}switch(e.type){case"Scene":a=new RT,void 0!==e.background&&(Number.isInteger(e.background)?a.background=new yE(e.background):a.background=u(e.background)),void 0!==e.environment&&(a.environment=u(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?a.fog=new TT(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(a.fog=new CT(e.fog.color,e.fog.density)),""!==e.fog.name&&(a.fog.name=e.fog.name)),void 0!==e.backgroundBlurriness&&(a.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(a.backgroundIntensity=e.backgroundIntensity),void 0!==e.backgroundRotation&&a.backgroundRotation.fromArray(e.backgroundRotation),void 0!==e.environmentIntensity&&(a.environmentIntensity=e.environmentIntensity),void 0!==e.environmentRotation&&a.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":a=new wA(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(a.focus=e.focus),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.filmGauge&&(a.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(a.filmOffset=e.filmOffset),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new YA(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new HI(e.color,e.intensity);break;case"DirectionalLight":a=new zI(e.color,e.intensity),a.target=e.target||"";break;case"PointLight":a=new FI(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new GI(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new DI(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),a.target=e.target||"";break;case"HemisphereLight":a=new CI(e.color,e.groundColor,e.intensity);break;case"LightProbe":a=(new VI).fromJSON(e);break;case"SkinnedMesh":o=l(e.geometry),s=c(e.material),a=new sR(o,s),void 0!==e.bindMode&&(a.bindMode=e.bindMode),void 0!==e.bindMatrix&&a.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(a.skeleton=e.skeleton);break;case"Mesh":o=l(e.geometry),s=c(e.material),a=new dA(o,s);break;case"InstancedMesh":o=l(e.geometry),s=c(e.material);const t=e.count,n=e.instanceMatrix,r=e.instanceColor;a=new _R(o,s,t),a.instanceMatrix=new pR(new Float32Array(n.array),16),void 0!==r&&(a.instanceColor=new pR(new Float32Array(r.array),r.itemSize));break;case"BatchedMesh":o=l(e.geometry),s=c(e.material),a=new zR(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,s),a.geometry=o,a.perObjectFrustumCulled=e.perObjectFrustumCulled,a.sortObjects=e.sortObjects,a._drawRanges=e.drawRanges,a._reservedRanges=e.reservedRanges,a._visibility=e.visibility,a._active=e.active,a._bounds=e.bounds.map((e=>{const t=new nw;t.min.fromArray(e.boxMin),t.max.fromArray(e.boxMax);const n=new xw;return n.radius=e.sphereRadius,n.center.fromArray(e.sphereCenter),{boxInitialized:e.boxInitialized,box:t,sphereInitialized:e.sphereInitialized,sphere:n}})),a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._geometryCount=e.geometryCount,a._matricesTexture=u(e.matricesTexture.uuid),void 0!==e.colorsTexture&&(a._colorsTexture=u(e.colorsTexture.uuid));break;case"LOD":a=new qT;break;case"Line":a=new KR(l(e.geometry),c(e.material));break;case"LineLoop":a=new eP(l(e.geometry),c(e.material));break;case"LineSegments":a=new ZR(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":a=new oP(l(e.geometry),c(e.material));break;case"Sprite":a=new JT(c(e.material));break;case"Group":a=new vT;break;case"Bone":a=new lR;break;default:a=new nE}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.up&&a.up.fromArray(e.up),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(a.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e<o.length;e++)a.add(this.parseObject(o[e],t,n,r,i))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];a.animations.push(i[n])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(a.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],r=a.getObjectByProperty("uuid",n.object);void 0!==r&&a.addLevel(r,n.distance,n.hysteresis)}}return a}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}bindLightTargets(e){e.traverse((function(t){if(t.isDirectionalLight||t.isSpotLight){const n=t.target,r=e.getObjectByProperty("uuid",n);t.target=void 0!==r?r:new nE}}))}}const YI={UVMapping:Rb,CubeReflectionMapping:Pb,CubeRefractionMapping:Bb,EquirectangularReflectionMapping:Ib,EquirectangularRefractionMapping:Db,CubeUVReflectionMapping:Lb},qI={RepeatWrapping:kb,ClampToEdgeWrapping:Ob,MirroredRepeatWrapping:Nb},QI={NearestFilter:Fb,NearestMipmapNearestFilter:Ub,NearestMipmapLinearFilter:Hb,LinearFilter:jb,LinearMipmapNearestFilter:Vb,LinearMipmapLinearFilter:Xb};class ZI extends gI{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=pI.get(e);if(void 0!==a)return i.manager.itemStart(e),a.then?void a.then((n=>{t&&t(n),i.manager.itemEnd(e)})).catch((e=>{r&&r(e)})):(setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a);const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader;const s=fetch(e,o).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){return pI.add(e,n),t&&t(n),i.manager.itemEnd(e),n})).catch((function(t){r&&r(t),pI.remove(e),i.manager.itemError(e),i.manager.itemEnd(e)}));pI.add(e,s),i.manager.itemStart(e)}}let eD;class tD{static getContext(){return void 0===eD&&(eD=new(window.AudioContext||window.webkitAudioContext)),eD}static setContext(e){eD=e}}class nD extends gI{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new bI(this.manager);function o(t){r?r(t):console.error(t),i.manager.itemError(e)}a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(e){try{const n=e.slice(0);tD.getContext().decodeAudioData(n,(function(e){t(e)})).catch(o)}catch(n){o(n)}}),n,r)}}const rD=new Rw,iD=new Rw,aD=new Rw;class oD{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new wA,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new wA,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,aD.copy(e.projectionMatrix);const n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan(hS*t.fov*.5)/t.zoom;let a,o;iD.elements[12]=-n,rD.elements[12]=n,a=-i*t.aspect+r,o=i*t.aspect+r,aD.elements[0]=2*t.near/(o-a),aD.elements[8]=(o+a)/(o-a),this.cameraL.projectionMatrix.copy(aD),a=-i*t.aspect-r,o=i*t.aspect-r,aD.elements[0]=2*t.near/(o-a),aD.elements[8]=(o+a)/(o-a),this.cameraR.projectionMatrix.copy(aD)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(iD),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(rD)}}class sD{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=lD(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=lD();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function lD(){return("undefined"===typeof performance?Date:performance).now()}const cD=new ZS,uD=new QS,dD=new ZS,hD=new ZS;class pD extends nE{constructor(){super(),this.type="AudioListener",this.context=tD.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new sD}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(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 null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(cD,uD,dD),hD.set(0,0,-1).applyQuaternion(uD),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(cD.x,e),t.positionY.linearRampToValueAtTime(cD.y,e),t.positionZ.linearRampToValueAtTime(cD.z,e),t.forwardX.linearRampToValueAtTime(hD.x,e),t.forwardY.linearRampToValueAtTime(hD.y,e),t.forwardZ.linearRampToValueAtTime(hD.z,e),t.upX.linearRampToValueAtTime(n.x,e),t.upY.linearRampToValueAtTime(n.y,e),t.upZ.linearRampToValueAtTime(n.z,e)}else t.setPosition(cD.x,cD.y,cD.z),t.setOrientation(hD.x,hD.y,hD.z,n.x,n.y,n.z)}}class fD extends nE{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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const mD=new ZS,gD=new QS,vD=new ZS,yD=new ZS;class bD extends fD{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(mD,gD,vD),yD.set(0,0,1).applyQuaternion(gD);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(mD.x,e),t.positionY.linearRampToValueAtTime(mD.y,e),t.positionZ.linearRampToValueAtTime(mD.z,e),t.orientationX.linearRampToValueAtTime(yD.x,e),t.orientationY.linearRampToValueAtTime(yD.y,e),t.orientationZ.linearRampToValueAtTime(yD.z,e)}else t.setPosition(mD.x,mD.y,mD.z),t.setOrientation(yD.x,yD.y,yD.z)}}class xD{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2048;this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class _D{constructor(e,t,n){let r,i,a;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,i=e*r+r;let a=this.cumulativeWeight;if(0===a){for(let e=0;e!==r;++e)n[i+e]=n[e];a=t}else{a+=t;const e=t/a;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=a}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(n,r,e,1-i,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let s=t,l=t+t;s!==l;++s)if(n[s]!==n[s+t]){o.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let a=0;a!==i;++a)e[t+a]=e[n+a]}_slerp(e,t,n,r){QS.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){const a=this._workIndex*i;QS.multiplyQuaternionsFlat(e,a,e,t,e,n),QS.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){const a=1-r;for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]*a+e[n+o]*r}}_lerpAdditive(e,t,n,r,i){for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]+e[n+a]*r}}}const SD="\\[\\]\\.:\\/",wD=new RegExp("["+SD+"]","g"),ED="[^"+SD+"]",AD="[^"+SD.replace("\\.","")+"]",MD=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",ED)+/(WCOD+)?/.source.replace("WCOD",AD)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ED)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ED)+"$"),CD=["material","materials","bones","map"];class TD{constructor(e,t,n){this.path=t,this.parsedPath=n||TD.parseTrackName(t),this.node=TD.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new TD.Composite(e,t,n):new TD(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(wD,"")}static parseTrackName(e){const t=MD.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==CD.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r<e.length;r++){const i=e[r];if(i.name===t||i.uuid===t)return i;const a=n(i.children);if(a)return a}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let i=t.propertyIndex;if(e||(e=TD.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const a=e[r];if(void 0===a){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let o=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}s=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=i}else void 0!==a.fromArray&&void 0!==a.toArray?(s=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(s=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=r;this.getValue=this.GetterByBindingType[s],this.setValue=this.SetterByBindingTypeAndVersioning[s][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}TD.Composite=class{constructor(e,t,n){const r=n||TD.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},TD.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},TD.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},TD.prototype.GetterByBindingType=[TD.prototype._getValue_direct,TD.prototype._getValue_array,TD.prototype._getValue_arrayElement,TD.prototype._getValue_toArray],TD.prototype.SetterByBindingTypeAndVersioning=[[TD.prototype._setValue_direct,TD.prototype._setValue_direct_setNeedsUpdate,TD.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[TD.prototype._setValue_array,TD.prototype._setValue_array_setNeedsUpdate,TD.prototype._setValue_array_setMatrixWorldNeedsUpdate],[TD.prototype._setValue_arrayElement,TD.prototype._setValue_arrayElement_setNeedsUpdate,TD.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[TD.prototype._setValue_fromArray,TD.prototype._setValue_fromArray_setNeedsUpdate,TD.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class RD{constructor(){this.isAnimationObjectGroup=!0,this.uuid=fS(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,r=arguments.length;n!==r;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,a=i.length;let o,s=e.length,l=this.nCachedObjects_;for(let c=0,u=arguments.length;c!==u;++c){const u=arguments[c],d=u.uuid;let h=t[d];if(void 0===h){h=s++,t[d]=h,e.push(u);for(let e=0,t=a;e!==t;++e)i[e].push(new TD(u,n[e],r[e]))}else if(h<l){o=e[h];const s=--l,c=e[s];t[c.uuid]=h,e[h]=c,t[d]=s,e[s]=u;for(let e=0,t=a;e!==t;++e){const t=i[e],a=t[s];let o=t[h];t[h]=a,void 0===o&&(o=new TD(u,n[e],r[e])),t[s]=o}}else e[h]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a],s=o.uuid,l=t[s];if(void 0!==l&&l>=i){const a=i++,c=e[a];t[c.uuid]=l,e[l]=c,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[a],i=t[l];t[l]=r,t[a]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o].uuid,l=t[s];if(void 0!==l)if(delete t[s],l<i){const o=--i,s=e[o],c=--a,u=e[c];t[s.uuid]=l,e[l]=s,t[u.uuid]=o,e[o]=u,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[o],i=t[c];t[l]=r,t[o]=i,t.pop()}}else{const i=--a,o=e[i];i>0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(let d=c,h=s.length;d!==h;++d){const n=s[d];u[d]=new TD(n,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}class PD{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.blendMode;this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,a=i.length,o=new Array(a),s={endingStart:r_,endingEnd:r_};for(let l=0;l!==a;++l){const e=i[l].createInterpolant(null);o[l]=e,e.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Qx,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&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,a=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const s=o.parameterPositions,l=o.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;r<0||0===n?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===s_)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);else for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const a=n===Zx;if(0===e)return-1===i?r:a&&1===(1&i)?t-r:r;if(n===qx){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(a&&1===(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=i_,r.endingEnd=i_):(r.endingStart=e?this.zeroSlopeAtStart?i_:r_:a_,r.endingEnd=t?this.zeroSlopeAtEnd?i_:r_:a_)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}const BD=new Float32Array(1);class ID extends cS{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName;let c=l[s];void 0===c&&(c={},l[s]=c);for(let u=0;u!==i;++u){const e=r[u],i=e.name;let l=c[i];if(void 0!==l)++l.referenceCount,a[u]=l;else{if(l=a[u],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,s,i));continue}const r=t&&t._propertyBindings[u].binding.parsedPath;l=new _D(TD.create(n,i,r),e.ValueTypeName,e.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,s,i),a[u]=l}o[u].resultBuffer=l.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0===n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0===--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,i=this._actionsByClip;let a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{const t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,s[c]=l,s.pop(),e._byClipCacheIndex=null;delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const e=t[n];0===--e.referenceCount&&this._removeInactiveBinding(e)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,i=this._bindings;let a=r[t];void 0===a&&(a={},r[t]=a),a[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new tI(new Float32Array(2),new Float32Array(2),1,BD),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}clipAction(e,t,n){const r=t||this._root,i=r.uuid;let a="string"===typeof e?dI.findByName(r,e):e;const o=null!==a?a.uuid:e,s=this._actionsByClip[o];let l=null;if(void 0===n&&(n=null!==a?a.blendMode:o_),void 0!==s){const e=s.actionByRoot[i];if(void 0!==e&&e.blendMode===n)return e;l=s.knownActions[0],null===a&&(a=l._clip)}if(null===a)return null;const c=new PD(this,a,t,n);return this._bindAction(c,l),this._addInactiveAction(c,o,i),c}existingAction(e,t){const n=t||this._root,r=n.uuid,i="string"===typeof e?dI.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let l=0;l!==n;++l){t[l]._update(r,e,i,a)}const o=this._bindings,s=this._nActiveBindings;for(let l=0;l!==s;++l)o[l].apply(a);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){const r=e[n];this._deactivateAction(r);const i=r._cacheIndex,a=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,a._cacheIndex=i,t[i]=a,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const i in n){const e=n[i].actionByRoot[t];void 0!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}const r=this._bindingsByRootAndName[t];if(void 0!==r)for(const i in r){const e=r[i];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class DD{constructor(e){this.value=e}clone(){return new DD(void 0===this.value.clone?this.value:this.value.clone())}}let LD=0;class kD extends cS{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:LD++}),this.name="",this.usage=Y_,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,r=t.length;n<r;n++){const e=Array.isArray(t[n])?t[n]:[t[n]];for(let t=0;t<e.length;t++)this.uniforms.push(e[t].clone())}return this}clone(){return(new this.constructor).copy(this)}}class OD extends PT{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class ND{constructor(e,t,n,r,i){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const FD=new Rw;class UD{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;this.ray=new Tw(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new zw,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return FD.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(FD),this}intersectObject(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return HD(e,this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),t.sort(zD),t}intersectObjects(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let r=0,i=e.length;r<i;r++)HD(e[r],this,n,t);return n.sort(zD),n}}function zD(e,t){return e.distance-t.distance}function HD(e,t,n,r){let i=!0;if(e.layers.test(t.layers)){!1===e.raycast(t,n)&&(i=!1)}if(!0===i&&!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)HD(r[e],t,n,!0)}}class GD{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(mS(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class jD{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}}class VD{constructor(e,t,n,r){VD.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){const i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}}const WD=new _S;class XD{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new _S(1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _S(-1/0,-1/0);this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=WD.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,WD).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 JD=new ZS,$D=new ZS;class KD{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS;this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){JD.subVectors(e,this.start),$D.subVectors(this.end,this.start);const n=$D.dot($D);let r=$D.dot(JD)/n;return t&&(r=mS(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const YD=new ZS;class qD extends nE{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new JE,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,o=1,s=32;a<s;a++,o++){const e=a/s*Math.PI*2,t=o/s*Math.PI*2;r.push(Math.cos(e),Math.sin(e),1,Math.cos(t),Math.sin(t),1)}n.setAttribute("position",new UE(r,3));const i=new HR({fog:!1,toneMapped:!1});this.cone=new ZR(n,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),YD.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(YD),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const QD=new ZS,ZD=new Rw,eL=new Rw;class tL extends ZR{constructor(e){const t=nL(e),n=new JE,r=[],i=[],a=new yE(0,0,1),o=new yE(0,1,0);for(let s=0;s<t.length;s++){const e=t[s];e.parent&&e.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new UE(r,3)),n.setAttribute("color",new UE(i,3));super(n,new HR({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");eL.copy(this.root.matrixWorld).invert();for(let i=0,a=0;i<t.length;i++){const e=t[i];e.parent&&e.parent.isBone&&(ZD.multiplyMatrices(eL,e.matrixWorld),QD.setFromMatrixPosition(ZD),r.setXYZ(a,QD.x,QD.y,QD.z),ZD.multiplyMatrices(eL,e.parent.matrixWorld),QD.setFromMatrixPosition(ZD),r.setXYZ(a+1,QD.x,QD.y,QD.z),a+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function nL(e){const t=[];!0===e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push.apply(t,nL(e.children[n]));return t}class rL extends dA{constructor(e,t,n){super(new RB(t,4,2),new SE({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const iL=new ZS,aL=new yE,oL=new yE;class sL extends nE{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const r=new MB(t);r.rotateY(.5*Math.PI),this.material=new SE({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new PE(a,3)),this.add(new dA(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");aL.copy(this.light.color),oL.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const r=e<n/2?aL:oL;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(iL.setFromMatrixPosition(this.light.matrixWorld).negate())}}class lL extends ZR{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;n=new yE(n),r=new yE(r);const i=t/2,a=e/t,o=e/2,s=[],l=[];for(let u=0,d=0,h=-o;u<=t;u++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);const e=u===i?n:r;e.toArray(l,d),d+=3,e.toArray(l,d),d+=3,e.toArray(l,d),d+=3,e.toArray(l,d),d+=3}const c=new JE;c.setAttribute("position",new UE(s,3)),c.setAttribute("color",new UE(l,3));super(c,new HR({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class cL extends ZR{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4473924,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8947848;i=new yE(i),a=new yE(a);const o=[],s=[];if(t>1)for(let c=0;c<t;c++){const n=c/t*(2*Math.PI),r=Math.sin(n)*e,l=Math.cos(n)*e;o.push(0,0,0),o.push(r,0,l);const u=1&c?i:a;s.push(u.r,u.g,u.b),s.push(u.r,u.g,u.b)}for(let c=0;c<n;c++){const t=1&c?i:a,l=e-e/n*c;for(let e=0;e<r;e++){let n=e/r*(2*Math.PI),i=Math.sin(n)*l,a=Math.cos(n)*l;o.push(i,0,a),s.push(t.r,t.g,t.b),n=(e+1)/r*(2*Math.PI),i=Math.sin(n)*l,a=Math.cos(n)*l,o.push(i,0,a),s.push(t.r,t.g,t.b)}}const l=new JE;l.setAttribute("position",new UE(o,3)),l.setAttribute("color",new UE(s,3));super(l,new HR({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const uL=new ZS,dL=new ZS,hL=new ZS;class pL extends nE{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",void 0===t&&(t=1);let r=new JE;r.setAttribute("position",new UE([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const i=new HR({fog:!1,toneMapped:!1});this.lightPlane=new KR(r,i),this.add(this.lightPlane),r=new JE,r.setAttribute("position",new UE([0,0,0,0,0,1],3)),this.targetLine=new KR(r,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),uL.setFromMatrixPosition(this.light.matrixWorld),dL.setFromMatrixPosition(this.light.target.matrixWorld),hL.subVectors(dL,uL),this.lightPlane.lookAt(dL),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(dL),this.targetLine.scale.z=hL.length()}}const fL=new ZS,mL=new bA;class gL extends ZR{constructor(e){const t=new JE,n=new HR({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],a={};function o(e,t){s(e),s(t)}function s(e){r.push(0,0,0),i.push(0,0,0),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4"),t.setAttribute("position",new UE(r,3)),t.setAttribute("color",new UE(i,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();const l=new yE(16755200),c=new yE(16711680),u=new yE(43775),d=new yE(16777215),h=new yE(3355443);this.setColors(l,c,u,d,h)}setColors(e,t,n,r,i){const a=this.geometry.getAttribute("color");a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,n.r,n.g,n.b),a.setXYZ(33,n.r,n.g,n.b),a.setXYZ(34,n.r,n.g,n.b),a.setXYZ(35,n.r,n.g,n.b),a.setXYZ(36,n.r,n.g,n.b),a.setXYZ(37,n.r,n.g,n.b),a.setXYZ(38,r.r,r.g,r.b),a.setXYZ(39,r.r,r.g,r.b),a.setXYZ(40,i.r,i.g,i.b),a.setXYZ(41,i.r,i.g,i.b),a.setXYZ(42,i.r,i.g,i.b),a.setXYZ(43,i.r,i.g,i.b),a.setXYZ(44,i.r,i.g,i.b),a.setXYZ(45,i.r,i.g,i.b),a.setXYZ(46,i.r,i.g,i.b),a.setXYZ(47,i.r,i.g,i.b),a.setXYZ(48,i.r,i.g,i.b),a.setXYZ(49,i.r,i.g,i.b),a.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap;mL.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),vL("c",t,e,mL,0,0,-1),vL("t",t,e,mL,0,0,1),vL("n1",t,e,mL,-1,-1,-1),vL("n2",t,e,mL,1,-1,-1),vL("n3",t,e,mL,-1,1,-1),vL("n4",t,e,mL,1,1,-1),vL("f1",t,e,mL,-1,-1,1),vL("f2",t,e,mL,1,-1,1),vL("f3",t,e,mL,-1,1,1),vL("f4",t,e,mL,1,1,1),vL("u1",t,e,mL,.7,1.1,-1),vL("u2",t,e,mL,-.7,1.1,-1),vL("u3",t,e,mL,0,2,-1),vL("cf1",t,e,mL,-1,0,1),vL("cf2",t,e,mL,1,0,1),vL("cf3",t,e,mL,0,-1,1),vL("cf4",t,e,mL,0,1,1),vL("cn1",t,e,mL,-1,0,-1),vL("cn2",t,e,mL,1,0,-1),vL("cn3",t,e,mL,0,-1,-1),vL("cn4",t,e,mL,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function vL(e,t,n,r,i,a,o){fL.set(i,a,o).unproject(r);const s=t[e];if(void 0!==s){const e=n.getAttribute("position");for(let t=0,n=s.length;t<n;t++)e.setXYZ(s[t],fL.x,fL.y,fL.z)}}const yL=new nw;class bL extends ZR{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new JE;i.setIndex(new PE(n,1)),i.setAttribute("position",new PE(r,3)),super(i,new HR({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&yL.setFromObject(this.object),yL.isEmpty())return;const t=yL.min,n=yL.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class xL extends ZR{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new JE;r.setIndex(new PE(n,1)),r.setAttribute("position",new UE([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new HR({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class _L extends KR{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16776960,r=new JE;r.setAttribute("position",new UE([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),r.computeBoundingSphere(),super(r,new HR({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const i=new JE;i.setAttribute("position",new UE([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),i.computeBoundingSphere(),this.add(new dA(i,new SE({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const SL=new ZS;let wL,EL;class AL extends nE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ZS(0,0,1),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ZS(0,0,0),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16776960,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.2*n,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.2*i;super(),this.type="ArrowHelper",void 0===wL&&(wL=new JE,wL.setAttribute("position",new UE([0,0,0,0,1,0],3)),EL=new UP(0,.5,1,5,1),EL.translate(0,-.5,0)),this.position.copy(t),this.line=new KR(wL,new HR({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new dA(EL,new SE({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{SL.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(SL,t)}}setLength(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2*e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.2*t;this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class ML extends ZR{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new JE;n.setAttribute("position",new UE(t,3)),n.setAttribute("color",new UE([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new HR({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const r=new yE,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class CL{constructor(){this.type="ShapePath",this.color=new yE,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new kP,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const n=t.length;let r=!1;for(let i=n-1,a=0;a<n;i=a++){let n=t[i],o=t[a],s=o.x-n.x,l=o.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[a],s=-s,o=t[i],l=-l),e.y<n.y||e.y>o.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-s*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}const n=xB.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,a,o;const s=[];if(1===r.length)return a=r[0],o=new $P,o.curves=a.curves,s.push(o),s;let l=!n(r[0].getPoints());l=e?!l:l;const c=[],u=[];let d,h,p=[],f=0;u[f]=void 0,p[f]=[];for(let m=0,g=r.length;m<g;m++)a=r[m],d=a.getPoints(),i=n(d),i=e?!i:i,i?(!l&&u[f]&&f++,u[f]={s:new $P,p:d},u[f].s.curves=a.curves,l&&f++,p[f]=[]):p[f].push({h:a,p:d[0]});if(!u[0])return function(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new $P;i.curves=r.curves,t.push(i)}return t}(r);if(u.length>1){let e=!1,n=0;for(let t=0,r=u.length;t<r;t++)c[t]=[];for(let r=0,i=u.length;r<i;r++){const i=p[r];for(let a=0;a<i.length;a++){const o=i[a];let s=!0;for(let i=0;i<u.length;i++)t(o.p,u[i].p)&&(r!==i&&n++,s?(s=!1,c[i].push(o)):e=!0);s&&c[r].push(o)}}n>0&&!1===e&&(p=c)}for(let m=0,g=u.length;m<g;m++){o=u[m].s,s.push(o),h=p[m];for(let e=0,t=h.length;e<t;e++)o.holes.push(h[e].h)}return s}}class TL extends cS{constructor(e,t){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(){}disconnect(){}dispose(){}update(){}}class RL extends JS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(e,t,{...r,count:n}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Sy}})),"undefined"!==typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Sy);var PL=n(7205);const BL=[];function IL(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e===t;if(e===t)return!0;if(!e||!t)return!1;const r=e.length;if(t.length!==r)return!1;for(let i=0;i<r;i++)if(!n(e[i],t[i]))return!1;return!0}function DL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};null===t&&(t=[e]);for(const o of BL)if(IL(t,o.keys,o.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(o,"error"))throw o.error;if(Object.prototype.hasOwnProperty.call(o,"response"))return r.lifespan&&r.lifespan>0&&(o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.remove,r.lifespan)),o.response;if(!n)throw o.promise}const i={keys:t,equal:r.equal,remove:()=>{const e=BL.indexOf(i);-1!==e&&BL.splice(e,1)},promise:(a=e,"object"===typeof a&&"function"===typeof a.then?e:e(...t)).then((e=>{i.response=e,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))})).catch((e=>i.error=e))};var a;if(BL.push(i),!n)throw i.promise}const LL=(e,t,n)=>DL(e,t,!1,n);var kL=n(2016),OL=n.n(kL),NL=n(8853);const FL={},UL=e=>{Object.assign(FL,e)};var zL,HL;const GL=e=>"colorSpace"in e||"outputColorSpace"in e,jL=()=>{var e;return null!=(e=FL.ColorManagement)?e:null},VL=e=>e&&e.isOrthographicCamera,WL="undefined"!==typeof window&&(null!=(zL=window.document)&&zL.createElement||"ReactNative"===(null==(HL=window.navigator)?void 0:HL.product))?t.useLayoutEffect:t.useEffect;function XL(e){const n=t.useRef(e);return WL((()=>{n.current=e}),[e]),n}function JL(e){let{set:t}=e;return WL((()=>(t(new Promise((()=>null))),()=>t(!1))),[t]),null}class $L extends t.Component{constructor(){super(...arguments),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}$L.getDerivedStateFromError=()=>({error:!0});const KL="__default",YL=new Map,qL=e=>e&&!!e.memoized&&!!e.changes;function QL(e){var t;const n="undefined"!==typeof window?null!=(t=window.devicePixelRatio)?t:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],n),e[1]):e}const ZL=e=>{var t;return null==(t=e.__r3f)?void 0:t.root.getState()};function ek(e){let t=e.__r3f.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}const tk={obj:e=>e===Object(e)&&!tk.arr(e)&&"function"!==typeof e,fun:e=>"function"===typeof e,str:e=>"string"===typeof e,num:e=>"number"===typeof e,boo:e=>"boolean"===typeof e,und:e=>void 0===e,arr:e=>Array.isArray(e),equ(e,t){let{arrays:n="shallow",objects:r="reference",strict:i=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(typeof e!==typeof t||!!e!==!!t)return!1;if(tk.str(e)||tk.num(e)||tk.boo(e))return e===t;const a=tk.obj(e);if(a&&"reference"===r)return e===t;const o=tk.arr(e);if(o&&"reference"===n)return e===t;if((o||a)&&e===t)return!0;let s;for(s in e)if(!(s in t))return!1;if(a&&"shallow"===n&&"shallow"===r){for(s in i?t:e)if(!tk.equ(e[s],t[s],{strict:i,objects:"reference"}))return!1}else for(s in i?t:e)if(e[s]!==t[s])return!1;if(tk.und(s)){if(o&&0===e.length&&0===t.length)return!0;if(a&&0===Object.keys(e).length&&0===Object.keys(t).length)return!0;if(e!==t)return!1}return!0}};function nk(e){const t={nodes:{},materials:{}};return e&&e.traverse((e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material)})),t}function rk(e,t){return e.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...t},e}function ik(e,t){let n=e;if(t.includes("-")){const r=t.split("-"),i=r.pop();return n=r.reduce(((e,t)=>e[t]),e),{target:n,key:i}}return{target:n,key:t}}const ak=/-\d+$/;function ok(e,t,n){if(tk.str(n)){if(ak.test(n)){const t=n.replace(ak,""),{target:r,key:i}=ik(e,t);Array.isArray(r[i])||(r[i]=[])}const{target:r,key:i}=ik(e,n);t.__r3f.previousAttach=r[i],r[i]=t}else t.__r3f.previousAttach=n(e,t)}function sk(e,t,n){var r,i;if(tk.str(n)){const{target:r,key:i}=ik(e,n),a=t.__r3f.previousAttach;void 0===a?delete r[i]:r[i]=a}else null==(r=t.__r3f)||null==r.previousAttach||r.previousAttach(e,t);null==(i=t.__r3f)||delete i.previousAttach}function lk(e,t){let{children:n,key:r,ref:i,...a}=t,{children:o,key:s,ref:l,...c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const d=e.__r3f,h=Object.entries(a),p=[];if(u){const e=Object.keys(c);for(let t=0;t<e.length;t++)a.hasOwnProperty(e[t])||h.unshift([e[t],KL+"remove"])}h.forEach((t=>{let[n,r]=t;var i;if(null!=(i=e.__r3f)&&i.primitive&&"object"===n)return;if(tk.equ(r,c[n]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(n))return p.push([n,r,!0,[]]);let o=[];n.includes("-")&&(o=n.split("-")),p.push([n,r,!1,o]);for(const e in a){const t=a[e];e.startsWith(`${n}-`)&&p.push([e,t,!1,e.split("-")])}}));const f={...a};return null!=d&&d.memoizedProps&&null!=d&&d.memoizedProps.args&&(f.args=d.memoizedProps.args),null!=d&&d.memoizedProps&&null!=d&&d.memoizedProps.attach&&(f.attach=d.memoizedProps.attach),{memoized:f,changes:p}}const ck="undefined"!==typeof process&&!1;function uk(e,t){var n;const r=e.__r3f,i=null==r?void 0:r.root,a=null==i||null==i.getState?void 0:i.getState(),{memoized:o,changes:s}=qL(t)?t:lk(e,t),l=null==r?void 0:r.eventCount;e.__r3f&&(e.__r3f.memoizedProps=o);for(let c=0;c<s.length;c++){let[t,n,i,o]=s[c];if(GL(e)){const e=3001,r="srgb",i="srgb-linear";"encoding"===t?(t="colorSpace",n=n===e?r:i):"outputEncoding"===t&&(t="outputColorSpace",n=n===e?r:i)}let l=e,u=l[t];if(o.length&&(u=o.reduce(((e,t)=>e[t]),e),!u||!u.set)){const[n,...r]=o.reverse();l=r.reverse().reduce(((e,t)=>e[t]),e),t=n}if(n===KL+"remove")if(l.constructor){let e=YL.get(l.constructor);e||(e=new l.constructor,YL.set(l.constructor,e)),n=e[t]}else n=0;if(i&&r)n?r.handlers[t]=n:delete r.handlers[t],r.eventCount=Object.keys(r.handlers).length;else if(u&&u.set&&(u.copy||u instanceof zw)){if(Array.isArray(n))u.fromArray?u.fromArray(n):u.set(...n);else if(u.copy&&n&&n.constructor&&(ck?u.constructor.name===n.constructor.name:u.constructor===n.constructor))u.copy(n);else if(void 0!==n){const e=u instanceof yE;!e&&u.setScalar?u.setScalar(n):u instanceof zw&&n instanceof zw?u.mask=n.mask:u.set(n),!jL()&&a&&!a.linear&&e&&u.convertSRGBToLinear()}}else if(l[t]=n,l[t]instanceof VS&&l[t].format===lx&&l[t].type===$b&&a){const e=l[t];GL(e)&&GL(a.gl)?e.colorSpace=a.gl.outputColorSpace:e.encoding=a.gl.outputEncoding}dk(e)}if(r&&r.parent&&e.raycast&&l!==r.eventCount){const t=ek(e).getState().internal,n=t.interaction.indexOf(e);n>-1&&t.interaction.splice(n,1),r.eventCount&&t.interaction.push(e)}return!(1===s.length&&"onUpdate"===s[0][0])&&s.length&&null!=(n=e.__r3f)&&n.parent&&hk(e),e}function dk(e){var t,n;const r=null==(t=e.__r3f)||null==(n=t.root)||null==n.getState?void 0:n.getState();r&&0===r.internal.frames&&r.invalidate()}function hk(e){null==e.onUpdate||e.onUpdate(e)}function pk(e,t){e.manual||(VL(e)?(e.left=t.width/-2,e.right=t.width/2,e.top=t.height/2,e.bottom=t.height/-2):e.aspect=t.width/t.height,e.updateProjectionMatrix(),e.updateMatrixWorld())}function fk(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function mk(e,t,n,r){const i=n.get(t);i&&(n.delete(t),0===n.size&&(e.delete(r),i.target.releasePointerCapture(r)))}function gk(e){function t(e){return e.filter((e=>["Move","Over","Enter","Out","Leave"].some((t=>{var n;return null==(n=e.__r3f)?void 0:n.handlers["onPointer"+t]}))))}function n(t){const{internal:n}=e.getState();for(const e of n.hovered.values())if(!t.length||!t.find((t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId))){const r=e.eventObject.__r3f,i=null==r?void 0:r.handlers;if(n.hovered.delete(fk(e)),null!=r&&r.eventCount){const n={...e,intersections:t};null==i.onPointerOut||i.onPointerOut(n),null==i.onPointerLeave||i.onPointerLeave(n)}}}function r(e,t){for(let n=0;n<t.length;n++){const r=t[n].__r3f;null==r||null==r.handlers.onPointerMissed||r.handlers.onPointerMissed(e)}}return{handlePointer:function(i){switch(i){case"onPointerLeave":case"onPointerCancel":return()=>n([]);case"onLostPointerCapture":return t=>{const{internal:r}=e.getState();"pointerId"in t&&r.capturedMap.has(t.pointerId)&&requestAnimationFrame((()=>{r.capturedMap.has(t.pointerId)&&(r.capturedMap.delete(t.pointerId),n([]))}))}}return function(a){const{onPointerMissed:o,internal:s}=e.getState();s.lastEvent.current=a;const l="onPointerMove"===i,c="onClick"===i||"onContextMenu"===i||"onDoubleClick"===i,u=function(t,n){const r=e.getState(),i=new Set,a=[],o=n?n(r.internal.interaction):r.internal.interaction;for(let e=0;e<o.length;e++){const t=ZL(o[e]);t&&(t.raycaster.camera=void 0)}r.previousRoot||null==r.events.compute||r.events.compute(t,r);let s=o.flatMap((function(e){const n=ZL(e);return n&&n.events.enabled&&null!==n.raycaster.camera?(void 0===n.raycaster.camera&&(null==n.events.compute||n.events.compute(t,n,null==(r=n.previousRoot)?void 0:r.getState()),void 0===n.raycaster.camera&&(n.raycaster.camera=null)),n.raycaster.camera?n.raycaster.intersectObject(e,!0):[]):[];var r})).sort(((e,t)=>{const n=ZL(e.object),r=ZL(t.object);return n&&r&&r.events.priority-n.events.priority||e.distance-t.distance})).filter((e=>{const t=fk(e);return!i.has(t)&&(i.add(t),!0)}));r.events.filter&&(s=r.events.filter(s,r));for(const e of s){let t=e.object;for(;t;){var l;null!=(l=t.__r3f)&&l.eventCount&&a.push({...e,eventObject:t}),t=t.parent}}if("pointerId"in t&&r.internal.capturedMap.has(t.pointerId))for(let e of r.internal.capturedMap.get(t.pointerId).values())i.has(fk(e.intersection))||a.push(e.intersection);return a}(a,l?t:void 0),d=c?function(t){const{internal:n}=e.getState(),r=t.offsetX-n.initialClick[0],i=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(r*r+i*i))}(a):0;"onPointerDown"===i&&(s.initialClick=[a.offsetX,a.offsetY],s.initialHits=u.map((e=>e.eventObject))),c&&!u.length&&d<=2&&(r(a,s.interaction),o&&o(a)),l&&n(u),function(t,r,i,a){const o=e.getState();if(t.length){const e={stopped:!1};for(const s of t){const l=ZL(s.object)||o,{raycaster:c,pointer:u,camera:d,internal:h}=l,p=new ZS(u.x,u.y,0).unproject(d),f=e=>{var t,n;return null!=(t=null==(n=h.capturedMap.get(e))?void 0:n.has(s.eventObject))&&t},m=e=>{const t={intersection:s,target:r.target};h.capturedMap.has(e)?h.capturedMap.get(e).set(s.eventObject,t):h.capturedMap.set(e,new Map([[s.eventObject,t]])),r.target.setPointerCapture(e)},g=e=>{const t=h.capturedMap.get(e);t&&mk(h.capturedMap,s.eventObject,t,e)};let v={};for(let e in r){let t=r[e];"function"!==typeof t&&(v[e]=t)}let y={...s,...v,pointer:u,intersections:t,stopped:e.stopped,delta:i,unprojectedPoint:p,ray:c.ray,camera:d,stopPropagation(){const i="pointerId"in r&&h.capturedMap.get(r.pointerId);(!i||i.has(s.eventObject))&&(y.stopped=e.stopped=!0,h.hovered.size&&Array.from(h.hovered.values()).find((e=>e.eventObject===s.eventObject)))&&n([...t.slice(0,t.indexOf(s)),s])},target:{hasPointerCapture:f,setPointerCapture:m,releasePointerCapture:g},currentTarget:{hasPointerCapture:f,setPointerCapture:m,releasePointerCapture:g},nativeEvent:r};if(a(y),!0===e.stopped)break}}}(u,a,d,(function(e){const t=e.eventObject,n=t.__r3f,o=null==n?void 0:n.handlers;if(null!=n&&n.eventCount)if(l){if(o.onPointerOver||o.onPointerEnter||o.onPointerOut||o.onPointerLeave){const t=fk(e),n=s.hovered.get(t);n?n.stopped&&e.stopPropagation():(s.hovered.set(t,e),null==o.onPointerOver||o.onPointerOver(e),null==o.onPointerEnter||o.onPointerEnter(e))}null==o.onPointerMove||o.onPointerMove(e)}else{const n=o[i];n?c&&!s.initialHits.includes(t)||(r(a,s.interaction.filter((e=>!s.initialHits.includes(e)))),n(e)):c&&s.initialHits.includes(t)&&r(a,s.interaction.filter((e=>!s.initialHits.includes(e))))}}))}}}}const vk=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],yk=e=>!(null==e||!e.render),bk=t.createContext(null),xk=(e,n)=>{const r=$g(((r,i)=>{const a=new ZS,o=new ZS,s=new ZS;function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i().camera,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i().size;const{width:r,height:l,top:c,left:u}=n,d=r/l;t instanceof ZS?s.copy(t):s.set(...t);const h=e.getWorldPosition(a).distanceTo(s);if(VL(e))return{width:r/e.zoom,height:l/e.zoom,top:c,left:u,factor:1,distance:h,aspect:d};{const t=e.fov*Math.PI/180,n=2*Math.tan(t/2)*h,i=n*(r/l);return{width:i,height:n,top:c,left:u,factor:r/i,distance:h,aspect:d}}}let c;const u=e=>r((t=>({performance:{...t.performance,current:e}}))),d=new _S,h={set:r,get:i,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return e(i(),t)},advance:(e,t)=>n(e,t,i()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new sD,pointer:d,mouse:d,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const e=i();c&&clearTimeout(c),e.performance.current!==e.performance.min&&u(e.performance.min),c=setTimeout((()=>u(i().performance.max)),e.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:l},setEvents:e=>r((t=>({...t,events:{...t.events,...e}}))),setSize:(e,t,n,a,s)=>{const c=i().camera,u={width:e,height:t,top:a||0,left:s||0,updateStyle:n};r((e=>({size:u,viewport:{...e.viewport,...l(c,o,u)}})))},setDpr:e=>r((t=>{const n=QL(e);return{viewport:{...t.viewport,dpr:n,initialDpr:t.viewport.initialDpr||n}}})),setFrameloop:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always";const t=i().clock;t.stop(),t.elapsedTime=0,"never"!==e&&(t.start(),t.elapsedTime=0),r((()=>({frameloop:e})))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:t.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(e,t,n)=>{const r=i().internal;return r.priority=r.priority+(t>0?1:0),r.subscribers.push({ref:e,priority:t,store:n}),r.subscribers=r.subscribers.sort(((e,t)=>e.priority-t.priority)),()=>{const n=i().internal;null!=n&&n.subscribers&&(n.priority=n.priority-(t>0?1:0),n.subscribers=n.subscribers.filter((t=>t.ref!==e)))}}}};return h})),i=r.getState();let a=i.size,o=i.viewport.dpr,s=i.camera;return r.subscribe((()=>{const{camera:e,size:t,viewport:n,gl:i,set:l}=r.getState();if(t.width!==a.width||t.height!==a.height||n.dpr!==o){var c;a=t,o=n.dpr,pk(e,t),i.setPixelRatio(n.dpr);const r=null!=(c=t.updateStyle)?c:"undefined"!==typeof HTMLCanvasElement&&i.domElement instanceof HTMLCanvasElement;i.setSize(t.width,t.height,r)}e!==s&&(s=e,l((t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}}))))})),r.subscribe((t=>e(t))),r};let _k,Sk=new Set,wk=new Set,Ek=new Set;function Ak(e,t){if(e.size)for(const{callback:n}of e.values())n(t)}function Mk(e,t){switch(e){case"before":return Ak(Sk,t);case"after":return Ak(wk,t);case"tail":return Ak(Ek,t)}}let Ck,Tk;function Rk(e,t,n){let r=t.clock.getDelta();for("never"===t.frameloop&&"number"===typeof e&&(r=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),Ck=t.internal.subscribers,_k=0;_k<Ck.length;_k++)Tk=Ck[_k],Tk.ref.current(Tk.store.getState(),r,n);return!t.internal.priority&&t.gl.render&&t.gl.render(t.scene,t.camera),t.internal.frames=Math.max(0,t.internal.frames-1),"always"===t.frameloop?1:t.internal.frames}function Pk(){const e=t.useContext(bk);if(!e)throw new Error("R3F: Hooks can only be used within the Canvas component!");return e}function Bk(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e,t=arguments.length>1?arguments[1]:void 0;return Pk()(e,t)}function Ik(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=Pk(),r=n.getState().internal.subscribe,i=XL(e);return WL((()=>r(i,t,n)),[t,r,n]),null}const Dk=new WeakMap;function Lk(e,t){return function(n){let r=Dk.get(n);r||(r=new n,Dk.set(n,r)),e&&e(r);for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return Promise.all(a.map((e=>new Promise(((n,i)=>r.load(e,(e=>{e.scene&&Object.assign(e,nk(e.scene)),n(e)}),t,(t=>i(new Error(`Could not load ${e}: ${null==t?void 0:t.message}`)))))))))}}function kk(e,t,n,r){const i=Array.isArray(t)?t:[t],a=LL(Lk(n,r),[e,...i],{equal:tk.equ});return Array.isArray(t)?a:a[0]}kk.preload=function(e,t,n){const r=Array.isArray(t)?t:[t];return((e,t,n)=>{DL(e,t,!0,n)})(Lk(n),[e,...r])},kk.clear=function(e,t){return(e=>{if(void 0===e||0===e.length)BL.splice(0,BL.length);else{const t=BL.find((t=>IL(e,t.keys,t.equal)));t&&t.remove()}})([e,...Array.isArray(t)?t:[t]])};const Ok=new Map,{invalidate:Nk,advance:Fk}=function(e){let t,n,r,i=!1,a=!1;function o(s){n=requestAnimationFrame(o),i=!0,t=0,Mk("before",s),a=!0;for(const n of e.values()){var l;r=n.store.getState(),!r.internal.active||!("always"===r.frameloop||r.internal.frames>0)||null!=(l=r.gl.xr)&&l.isPresenting||(t+=Rk(s,r))}if(a=!1,Mk("after",s),0===t)return Mk("tail",s),i=!1,cancelAnimationFrame(n)}return{loop:o,invalidate:function t(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;var s;if(!n)return e.forEach((e=>t(e.store.getState(),r)));null!=(s=n.gl.xr)&&s.isPresenting||!n.internal.active||"never"===n.frameloop||(n.internal.frames=r>1?Math.min(60,n.internal.frames+r):a?2:1,i||(i=!0,requestAnimationFrame(o)))},advance:function(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;if(n&&Mk("before",t),r)Rk(t,r,i);else for(const a of e.values())Rk(t,a.store.getState());n&&Mk("after",t)}}}(Ok),{reconciler:Uk,applyProps:zk}=function(e,t){function n(e,t,n){let r,{args:i=[],attach:a,...o}=t,s=`${e[0].toUpperCase()}${e.slice(1)}`;if("primitive"===e){if(void 0===o.object)throw new Error("R3F: Primitives without 'object' are invalid!");r=rk(o.object,{type:e,root:n,attach:a,primitive:!0})}else{const t=FL[s];if(!t)throw new Error(`R3F: ${s} 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(i))throw new Error("R3F: The args prop must be an array!");r=rk(new t(...i),{type:e,root:n,attach:a,memoizedProps:{args:i}})}return void 0===r.__r3f.attach&&(r instanceof JE?r.__r3f.attach="geometry":r instanceof _E&&(r.__r3f.attach="material")),"inject"!==s&&uk(r,o),r}function r(e,t){let n=!1;var r,i;t&&(null!=(r=t.__r3f)&&r.attach?ok(e,t,t.__r3f.attach):t.isObject3D&&e.isObject3D&&(e.add(t),n=!0),n||null==(i=e.__r3f)||i.objects.push(t),t.__r3f||rk(t,{}),t.__r3f.parent=e,hk(t),dk(t))}function i(e,t,n){let r=!1;if(t){var i,a;if(null!=(i=t.__r3f)&&i.attach)ok(e,t,t.__r3f.attach);else if(t.isObject3D&&e.isObject3D){t.parent=e,t.dispatchEvent({type:"added"}),e.dispatchEvent({type:"childadded",child:t});const i=e.children.filter((e=>e!==t)),a=i.indexOf(n);e.children=[...i.slice(0,a),t,...i.slice(a)],r=!0}r||null==(a=e.__r3f)||a.objects.push(t),t.__r3f||rk(t,{}),t.__r3f.parent=e,hk(t),dk(t)}}function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e&&[...e].forEach((e=>o(t,e,n)))}function o(e,t,n){if(t){var r,i,o;if(t.__r3f&&(t.__r3f.parent=null),null!=(r=e.__r3f)&&r.objects&&(e.__r3f.objects=e.__r3f.objects.filter((e=>e!==t))),null!=(i=t.__r3f)&&i.attach)sk(e,t,t.__r3f.attach);else if(t.isObject3D&&e.isObject3D){var s;e.remove(t),null!=(s=t.__r3f)&&s.root&&function(e,t){const{internal:n}=e.getState();n.interaction=n.interaction.filter((e=>e!==t)),n.initialHits=n.initialHits.filter((e=>e!==t)),n.hovered.forEach(((e,r)=>{e.eventObject!==t&&e.object!==t||n.hovered.delete(r)})),n.capturedMap.forEach(((e,r)=>{mk(n.capturedMap,t,e,r)}))}(ek(t),t)}const c=null==(o=t.__r3f)?void 0:o.primitive,u=!c&&(void 0===n?null!==t.dispose:n);var l;if(!c)a(null==(l=t.__r3f)?void 0:l.objects,t,u),a(t.children,t,u);if(delete t.__r3f,u&&t.dispose&&"Scene"!==t.type){const e=()=>{try{t.dispose()}catch(e){}};"undefined"===typeof IS_REACT_ACT_ENVIRONMENT?(0,NL.unstable_scheduleCallback)(NL.unstable_IdlePriority,e):e()}dk(e)}}const s=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters."),l=OL()({createInstance:n,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(e,t)=>{if(!t)return;const n=e.getState().scene;n.__r3f&&(n.__r3f.root=e,r(n,t))},removeChildFromContainer:(e,t)=>{t&&o(e.getState().scene,t)},insertInContainerBefore:(e,t,n)=>{if(!t||!n)return;const r=e.getState().scene;r.__r3f&&i(r,t,n)},getRootHostContext:()=>null,getChildHostContext:e=>e,finalizeInitialChildren(e){var t;const n=null!=(t=null==e?void 0:e.__r3f)?t:{};return Boolean(n.handlers)},prepareUpdate(e,t,n,r){var i;if((null!=(i=null==e?void 0:e.__r3f)?i:{}).primitive&&r.object&&r.object!==e)return[!0];{const{args:t=[],children:i,...a}=r,{args:o=[],children:s,...l}=n;if(!Array.isArray(t))throw new Error("R3F: the args prop must be an array!");if(t.some(((e,t)=>e!==o[t])))return[!0];const c=lk(e,a,l,!0);return c.changes.length?[!1,c]:null}},commitUpdate(e,t,i,a,s,l){let[c,u]=t;c?function(e,t,i,a){var s;const l=null==(s=e.__r3f)?void 0:s.parent;if(!l)return;const c=n(t,i,e.__r3f.root);if(e.children){for(const t of e.children)t.__r3f&&r(c,t);e.children=e.children.filter((e=>!e.__r3f))}e.__r3f.objects.forEach((e=>r(c,e))),e.__r3f.objects=[],e.__r3f.autoRemovedBeforeAppend||o(l,e),c.parent&&(c.__r3f.autoRemovedBeforeAppend=!0),r(l,c),c.raycast&&c.__r3f.eventCount&&ek(c).getState().internal.interaction.push(c);[a,a.alternate].forEach((e=>{null!==e&&(e.stateNode=c,e.ref&&("function"===typeof e.ref?e.ref(c):e.ref.current=c))}))}(e,i,s,l):uk(e,u)},commitMount(e,t,n,r){var i;const a=null!=(i=e.__r3f)?i:{};e.raycast&&a.handlers&&a.eventCount&&ek(e).getState().internal.interaction.push(e)},getPublicInstance:e=>e,prepareForCommit:()=>null,preparePortalMount:e=>rk(e.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(e){var t;const{attach:n,parent:r}=null!=(t=e.__r3f)?t:{};n&&r&&sk(r,e,n),e.isObject3D&&(e.visible=!1),dk(e)},unhideInstance(e,t){var n;const{attach:r,parent:i}=null!=(n=e.__r3f)?n:{};r&&i&&ok(i,e,r),(e.isObject3D&&null==t.visible||t.visible)&&(e.visible=!0),dk(e)},createTextInstance:s,hideTextInstance:s,unhideTextInstance:s,getCurrentEventPriority:()=>t?t():PL.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:"undefined"!==typeof performance&&tk.fun(performance.now)?performance.now:tk.fun(Date.now)?Date.now:()=>0,scheduleTimeout:tk.fun(setTimeout)?setTimeout:void 0,cancelTimeout:tk.fun(clearTimeout)?clearTimeout:void 0});return{reconciler:l,applyProps:uk}}(0,(function(){var e;const t="undefined"!==typeof self&&self||"undefined"!==typeof window&&window;if(!t)return PL.DefaultEventPriority;switch(null==(e=t.event)?void 0:e.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return PL.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return PL.ContinuousEventPriority;default:return PL.DefaultEventPriority}})),Hk={objects:"shallow",strict:!1},Gk=(e,t)=>{const n="function"===typeof e?e(t):e;return yk(n)?n:new MT({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...e})};function jk(e){const t=Ok.get(e),n=null==t?void 0:t.fiber,r=null==t?void 0:t.store;t&&console.warn("R3F.createRoot should only be called once!");const i="function"===typeof reportError?reportError:console.error,a=r||xk(Nk,Fk),o=n||Uk.createContainer(a,PL.ConcurrentRoot,null,!1,null,"",i,null);let s;t||Ok.set(e,{fiber:o,store:a});let l,c=!1;return{configure(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{gl:n,size:r,scene:i,events:o,onCreated:u,shadows:d=!1,linear:h=!1,flat:p=!1,legacy:f=!1,orthographic:m=!1,frameloop:g="always",dpr:v=[1,2],performance:y,raycaster:b,camera:x,onPointerMissed:_}=t,S=a.getState(),w=S.gl;S.gl||S.set({gl:w=Gk(n,e)});let E=S.raycaster;E||S.set({raycaster:E=new UD});const{params:A,...M}=b||{};if(tk.equ(M,E,Hk)||zk(E,{...M}),tk.equ(A,E.params,Hk)||zk(E,{params:{...E.params,...A}}),!S.camera||S.camera===l&&!tk.equ(l,x,Hk)){l=x;const e=x instanceof bA,t=e?x:m?new YA(0,0,0,0,.1,1e3):new wA(75,0,.1,1e3);e||(t.position.z=5,x&&(zk(t,x),("aspect"in x||"left"in x||"right"in x||"bottom"in x||"top"in x)&&(t.manual=!0,t.updateProjectionMatrix())),S.camera||null!=x&&x.rotation||t.lookAt(0,0,0)),S.set({camera:t}),E.camera=t}if(!S.scene){let e;i instanceof RT?e=i:(e=new RT,i&&zk(e,i)),S.set({scene:rk(e)})}if(!S.xr){var C;const e=(e,t)=>{const n=a.getState();"never"!==n.frameloop&&Fk(e,!0,n,t)},t=()=>{const t=a.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||Nk(t)},n={connect(){const e=a.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){const e=a.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"===typeof(null==(C=w.xr)?void 0:C.addEventListener)&&n.connect(),S.set({xr:n})}if(w.shadowMap){const e=w.shadowMap.enabled,t=w.shadowMap.type;if(w.shadowMap.enabled=!!d,tk.boo(d))w.shadowMap.type=By;else if(tk.str(d)){var T;const e={basic:Ry,percentage:Py,soft:By,variance:Iy};w.shadowMap.type=null!=(T=e[d])?T:By}else tk.obj(d)&&Object.assign(w.shadowMap,d);e===w.shadowMap.enabled&&t===w.shadowMap.type||(w.shadowMap.needsUpdate=!0)}const R=jL();if(R&&("enabled"in R?R.enabled=!f:"legacyMode"in R&&(R.legacyMode=f)),!c){zk(w,{outputEncoding:h?3e3:3001,toneMapping:p?bb:wb})}S.legacy!==f&&S.set((()=>({legacy:f}))),S.linear!==h&&S.set((()=>({linear:h}))),S.flat!==p&&S.set((()=>({flat:p}))),!n||tk.fun(n)||yk(n)||tk.equ(n,w,Hk)||zk(w,n),o&&!S.events.handlers&&S.set({events:o(a)});const P=function(e,t){const n="undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement;if(t){const{width:e,height:r,top:i,left:a,updateStyle:o=n}=t;return{width:e,height:r,top:i,left:a,updateStyle:o}}if("undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){const{width:t,height:r,top:i,left:a}=e.parentElement.getBoundingClientRect();return{width:t,height:r,top:i,left:a,updateStyle:n}}return"undefined"!==typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0,updateStyle:n}:{width:0,height:0,top:0,left:0}}(e,r);return tk.equ(P,S.size,Hk)||S.setSize(P.width,P.height,P.updateStyle,P.top,P.left),v&&S.viewport.dpr!==QL(v)&&S.setDpr(v),S.frameloop!==g&&S.setFrameloop(g),S.onPointerMissed||S.set({onPointerMissed:_}),y&&!tk.equ(y,S.performance,Hk)&&S.set((e=>({performance:{...e.performance,...y}}))),s=u,c=!0,this},render(t){return c||this.configure(),Uk.updateContainer((0,fi.jsx)(Vk,{store:a,children:t,onCreated:s,rootElement:e}),o,null,(()=>{})),a},unmount(){Wk(e)}}}function Vk(e){let{store:t,children:n,onCreated:r,rootElement:i}=e;return WL((()=>{const e=t.getState();e.set((e=>({internal:{...e.internal,active:!0}}))),r&&r(e),t.getState().events.connected||null==e.events.connect||e.events.connect(i)}),[]),(0,fi.jsx)(bk.Provider,{value:t,children:n})}function Wk(e,t){const n=Ok.get(e),r=null==n?void 0:n.fiber;if(r){const i=null==n?void 0:n.store.getState();i&&(i.internal.active=!1),Uk.updateContainer(null,r,null,(()=>{i&&setTimeout((()=>{try{var n,r,a,o;null==i.events.disconnect||i.events.disconnect(),null==(n=i.gl)||null==(r=n.renderLists)||null==r.dispose||r.dispose(),null==(a=i.gl)||null==a.forceContextLoss||a.forceContextLoss(),null!=(o=i.gl)&&o.xr&&i.xr.disconnect(),function(e){e.dispose&&"Scene"!==e.type&&e.dispose();for(const t in e)null==t.dispose||t.dispose(),delete e[t]}(i),Ok.delete(e),t&&t(e)}catch(s){}}),500)}))}}function Xk(e){let{state:n={},children:r,container:i}=e;const{events:a,size:o,...s}=n,l=Pk(),[c]=t.useState((()=>new UD)),[u]=t.useState((()=>new _S)),d=t.useCallback(((e,t)=>{const n={...e};let r;if(Object.keys(e).forEach((r=>{(vk.includes(r)||e[r]!==t[r]&&t[r])&&delete n[r]})),t&&o){const n=t.camera;r=e.viewport.getCurrentViewport(n,new ZS,o),n!==e.camera&&pk(n,o)}return{...n,scene:i,raycaster:c,pointer:u,mouse:u,previousRoot:l,events:{...e.events,...null==t?void 0:t.events,...a},size:{...e.size,...o},viewport:{...e.viewport,...r},...s}}),[n]),[h]=t.useState((()=>{const e=l.getState(),t=$g(((t,n)=>({...e,scene:i,raycaster:c,pointer:u,mouse:u,previousRoot:l,events:{...e.events,...a},size:{...e.size,...o},...s,set:t,get:n,setEvents:e=>t((t=>({...t,events:{...t.events,...e}})))})));return t}));return t.useEffect((()=>{const e=l.subscribe((e=>h.setState((t=>d(e,t)))));return()=>{e()}}),[d]),t.useEffect((()=>{h.setState((e=>d(l.getState(),e)))}),[d]),t.useEffect((()=>()=>{h.destroy()}),[]),(0,fi.jsx)(fi.Fragment,{children:Uk.createPortal((0,fi.jsx)(bk.Provider,{value:h,children:r}),h,null)})}Uk.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:t.version});t.unstable_act;const Jk={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 $k(e){const{handlePointer:t}=gk(e);return{priority:1,enabled:!0,compute(e,t,n){t.pointer.set(e.offsetX/t.size.width*2-1,-e.offsetY/t.size.height*2+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(Jk).reduce(((e,n)=>({...e,[n]:t(n)})),{}),update:()=>{var t;const{events:n,internal:r}=e.getState();null!=(t=r.lastEvent)&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var n;const{set:r,events:i}=e.getState();null==i.disconnect||i.disconnect(),r((e=>({events:{...e.events,connected:t}}))),Object.entries(null!=(n=i.handlers)?n:[]).forEach((e=>{let[n,r]=e;const[i,a]=Jk[n];t.addEventListener(i,r,{passive:a})}))},disconnect:()=>{const{set:t,events:n}=e.getState();var r;n.connected&&(Object.entries(null!=(r=n.handlers)?r:[]).forEach((e=>{let[t,r]=e;if(n&&n.connected instanceof HTMLElement){const[e]=Jk[t];n.connected.removeEventListener(e,r)}})),t((e=>({events:{...e.events,connected:void 0}}))))}}}var Kk,Yk,qk=n(4695),Qk=n.n(qk),Zk=Object.defineProperty,eO=Object.defineProperties,tO=Object.getOwnPropertyDescriptors,nO=Object.getOwnPropertySymbols,rO=Object.prototype.hasOwnProperty,iO=Object.prototype.propertyIsEnumerable,aO=(e,t,n)=>t in e?Zk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oO=(e,t)=>{for(var n in t||(t={}))rO.call(t,n)&&aO(e,n,t[n]);if(nO)for(var n of nO(t))iO.call(t,n)&&aO(e,n,t[n]);return e};"undefined"===typeof window||!(null==(Kk=window.document)?void 0:Kk.createElement)&&"ReactNative"!==(null==(Yk=window.navigator)?void 0:Yk.product)?t.useEffect:t.useLayoutEffect;function sO(e,t,n){if(!e)return;if(!0===n(e))return e;let r=t?e.return:e.child;for(;r;){const e=sO(r,t,n);if(e)return e;r=t?null:r.sibling}}function lO(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(be){return e}}const cO=console.error;console.error=function(){const e=[...arguments].join("");if(!(null==e?void 0:e.startsWith("Warning:"))||!e.includes("useContext"))return cO.apply(this,arguments);console.error=cO};const uO=lO(t.createContext(null));class dO extends t.Component{render(){return t.createElement(uO.Provider,{value:this._reactInternals},this.props.children)}}function hO(){const e=t.useContext(uO);if(null===e)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const n=t.useId(),r=t.useMemo((()=>{for(const t of[e,null==e?void 0:e.alternate]){if(!t)continue;const e=sO(t,!1,(e=>{let t=e.memoizedState;for(;t;){if(t.memoizedState===n)return!0;t=t.next}}));if(e)return e}}),[e,n]);return r}function pO(){const e=function(){const e=hO(),[n]=t.useState((()=>new Map));n.clear();let r=e;for(;r;){if(r.type&&"object"===typeof r.type){const e=void 0===r.type._context&&r.type.Provider===r.type?r.type:r.type._context;e&&e!==uO&&!n.has(e)&&n.set(e,t.useContext(lO(e)))}r=r.return}return n}();return t.useMemo((()=>Array.from(e.keys()).reduce(((n,r)=>i=>t.createElement(n,null,t.createElement(r.Provider,((e,t)=>eO(e,tO(t)))(oO({},i),{value:e.get(r)})))),(e=>t.createElement(dO,oO({},e))))),[e])}function fO(){let{debounce:e,scroll:n,polyfill:r,offsetSize:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debounce:0,scroll:!1,offsetSize:!1};const a=r||"undefined"!==typeof window&&window.ResizeObserver,[o,s]=(0,t.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!a)return o.width=1280,o.height=800,[()=>{},o,()=>{}];const l=(0,t.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),c=e?"number"===typeof e?e:e.scroll:null,u=e?"number"===typeof e?e:e.resize:null,d=(0,t.useRef)(!1);(0,t.useEffect)((()=>(d.current=!0,()=>{d.current=!1})));const[h,p,f]=(0,t.useMemo)((()=>{const e=()=>{if(!l.current.element)return;const{left:e,top:t,width:n,height:r,bottom:a,right:o,x:c,y:u}=l.current.element.getBoundingClientRect(),h={left:e,top:t,width:n,height:r,bottom:a,right:o,x:c,y:u};l.current.element instanceof HTMLElement&&i&&(h.height=l.current.element.offsetHeight,h.width=l.current.element.offsetWidth),Object.freeze(h),d.current&&!vO(l.current.lastBounds,h)&&s(l.current.lastBounds=h)};return[e,u?Qk()(e,u):e,c?Qk()(e,c):e]}),[s,i,c,u]);function m(){l.current.scrollContainers&&(l.current.scrollContainers.forEach((e=>e.removeEventListener("scroll",f,!0))),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function g(){l.current.element&&(l.current.resizeObserver=new a(f),l.current.resizeObserver.observe(l.current.element),n&&l.current.scrollContainers&&l.current.scrollContainers.forEach((e=>e.addEventListener("scroll",f,{capture:!0,passive:!0}))))}var v,y,b;return v=f,y=Boolean(n),(0,t.useEffect)((()=>{if(y){const e=v;return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",e,!0)}}}),[v,y]),b=p,(0,t.useEffect)((()=>{const e=b;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[b]),(0,t.useEffect)((()=>{m(),g()}),[n,f,p]),(0,t.useEffect)((()=>m),[]),[e=>{e&&e!==l.current.element&&(m(),l.current.element=e,l.current.scrollContainers=mO(e),g())},o,h]}function mO(e){const t=[];if(!e||e===document.body)return t;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(e);return[n,r,i].some((e=>"auto"===e||"scroll"===e))&&t.push(e),[...t,...mO(e.parentElement)]}const gO=["x","y","top","bottom","left","right","width","height"],vO=(e,t)=>gO.every((n=>e[n]===t[n])),yO=t.forwardRef((function(n,r){let{children:i,fallback:a,resize:o,style:s,gl:l,events:c=$k,eventSource:u,eventPrefix:d,shadows:h,linear:p,flat:f,legacy:m,orthographic:g,frameloop:v,dpr:y,performance:b,raycaster:x,camera:_,scene:S,onPointerMissed:w,onCreated:E,...A}=n;t.useMemo((()=>UL(e)),[]);const M=pO(),[C,T]=fO({scroll:!0,debounce:{scroll:50,resize:0},...o}),R=t.useRef(null),P=t.useRef(null);t.useImperativeHandle(r,(()=>R.current));const B=XL(w),[I,D]=t.useState(!1),[L,k]=t.useState(!1);if(I)throw I;if(L)throw L;const O=t.useRef(null);WL((()=>{const e=R.current;T.width>0&&T.height>0&&e&&(O.current||(O.current=jk(e)),O.current.configure({gl:l,events:c,shadows:h,linear:p,flat:f,legacy:m,orthographic:g,frameloop:v,dpr:y,performance:b,raycaster:x,camera:_,scene:S,size:T,onPointerMissed:function(){return null==B.current?void 0:B.current(...arguments)},onCreated:e=>{var t;null==e.events.connect||e.events.connect(u?(t=u)&&t.hasOwnProperty("current")?u.current:u:P.current),d&&e.setEvents({compute:(e,t)=>{const n=e[d+"X"],r=e[d+"Y"];t.pointer.set(n/t.size.width*2-1,-r/t.size.height*2+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==E||E(e)}}),O.current.render((0,fi.jsx)(M,{children:(0,fi.jsx)($L,{set:k,children:(0,fi.jsx)(t.Suspense,{fallback:(0,fi.jsx)(JL,{set:D}),children:i})})})))})),t.useEffect((()=>{const e=R.current;if(e)return()=>Wk(e)}),[]);const N=u?"none":"auto";return(0,fi.jsx)("div",{ref:P,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...s},...A,children:(0,fi.jsx)("div",{ref:C,style:{width:"100%",height:"100%"},children:(0,fi.jsx)("canvas",{ref:R,style:{display:"block"},children:a})})})})),bO=t.forwardRef((function(e,t){return(0,fi.jsx)(dO,{children:(0,fi.jsx)(yO,{...e,ref:t})})}));function xO(){return xO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xO.apply(null,arguments)}var _O=Object.defineProperty,SO=(e,t,n)=>(((e,t,n)=>{t in e?_O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!==typeof t?t+"":t,n),n);const wO=new Tw,EO=new BA,AO=Math.cos(Math.PI/180*70),MO=(e,t)=>(e%t+t)%t;class CO extends cS{constructor(e,t){super(),SO(this,"object"),SO(this,"domElement"),SO(this,"enabled",!0),SO(this,"target",new ZS),SO(this,"minDistance",0),SO(this,"maxDistance",1/0),SO(this,"minZoom",0),SO(this,"maxZoom",1/0),SO(this,"minPolarAngle",0),SO(this,"maxPolarAngle",Math.PI),SO(this,"minAzimuthAngle",-1/0),SO(this,"maxAzimuthAngle",1/0),SO(this,"enableDamping",!1),SO(this,"dampingFactor",.05),SO(this,"enableZoom",!0),SO(this,"zoomSpeed",1),SO(this,"enableRotate",!0),SO(this,"rotateSpeed",1),SO(this,"enablePan",!0),SO(this,"panSpeed",1),SO(this,"screenSpacePanning",!0),SO(this,"keyPanSpeed",7),SO(this,"zoomToCursor",!1),SO(this,"autoRotate",!1),SO(this,"autoRotateSpeed",2),SO(this,"reverseOrbit",!1),SO(this,"reverseHorizontalOrbit",!1),SO(this,"reverseVerticalOrbit",!1),SO(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),SO(this,"mouseButtons",{LEFT:wy.ROTATE,MIDDLE:wy.DOLLY,RIGHT:wy.PAN}),SO(this,"touches",{ONE:Ey.ROTATE,TWO:Ey.DOLLY_PAN}),SO(this,"target0"),SO(this,"position0"),SO(this,"zoom0"),SO(this,"_domElementKeyEvents",null),SO(this,"getPolarAngle"),SO(this,"getAzimuthalAngle"),SO(this,"setPolarAngle"),SO(this,"setAzimuthalAngle"),SO(this,"getDistance"),SO(this,"listenToKeyEvents"),SO(this,"stopListenToKeyEvents"),SO(this,"saveState"),SO(this,"reset"),SO(this,"update"),SO(this,"connect"),SO(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=e=>{let t=MO(e,2*Math.PI),r=c.phi;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i<i&&(t<r?t+=2*Math.PI:r+=2*Math.PI),u.phi=t-r,n.update()},this.setAzimuthalAngle=e=>{let t=MO(e,2*Math.PI),r=c.theta;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i<i&&(t<r?t+=2*Math.PI:r+=2*Math.PI),u.theta=t-r,n.update()},this.getDistance=()=>n.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener("keydown",K),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",K),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),s=o.NONE},this.update=(()=>{const t=new ZS,i=new ZS(0,1,0),a=(new QS).setFromUnitVectors(e.up,i),p=a.clone().invert(),f=new ZS,m=new QS,g=2*Math.PI;return function(){const v=n.object.position;a.setFromUnitVectors(e.up,i),p.copy(a).invert(),t.copy(v).sub(n.target),t.applyQuaternion(a),c.setFromVector3(t),n.autoRotate&&s===o.NONE&&T(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(c.theta+=u.theta*n.dampingFactor,c.phi+=u.phi*n.dampingFactor):(c.theta+=u.theta,c.phi+=u.phi);let y=n.minAzimuthAngle,b=n.maxAzimuthAngle;isFinite(y)&&isFinite(b)&&(y<-Math.PI?y+=g:y>Math.PI&&(y-=g),b<-Math.PI?b+=g:b>Math.PI&&(b-=g),c.theta=y<=b?Math.max(y,Math.min(b,c.theta)):c.theta>(y+b)/2?Math.max(y,c.theta):Math.min(b,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(h,n.dampingFactor):n.target.add(h),n.zoomToCursor&&E||n.object.isOrthographicCamera?c.radius=O(c.radius):c.radius=O(c.radius*d),t.setFromSpherical(c),t.applyQuaternion(p),v.copy(n.target).add(t),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),!0===n.enableDamping?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,h.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),h.set(0,0,0));let x=!1;if(n.zoomToCursor&&E){let r=null;if(n.object instanceof wA&&n.object.isPerspectiveCamera){const e=t.length();r=O(e*d);const i=e-r;n.object.position.addScaledVector(S,i),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const e=new ZS(w.x,w.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),x=!0;const i=new ZS(w.x,w.y,0);i.unproject(n.object),n.object.position.sub(i).add(e),n.object.updateMatrixWorld(),r=t.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==r&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(wO.origin.copy(n.object.position),wO.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(wO.direction))<AO?e.lookAt(n.target):(EO.setFromNormalAndCoplanarPoint(n.object.up,n.target),wO.intersectPlane(EO,n.target))))}else n.object instanceof YA&&n.object.isOrthographicCamera&&(x=1!==d,x&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix()));return d=1,E=!1,!!(x||f.distanceToSquared(n.object.position)>l||8*(1-m.dot(n.object.quaternion))>l)&&(n.dispatchEvent(r),f.copy(n.object.position),m.copy(n.object.quaternion),x=!1,!0)}})(),this.connect=e=>{n.domElement=e,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",Y),n.domElement.addEventListener("pointerdown",W),n.domElement.addEventListener("pointercancel",J),n.domElement.addEventListener("wheel",$)},this.dispose=()=>{var e,t,r,i,a,o;n.domElement&&(n.domElement.style.touchAction="auto"),null==(e=n.domElement)||e.removeEventListener("contextmenu",Y),null==(t=n.domElement)||t.removeEventListener("pointerdown",W),null==(r=n.domElement)||r.removeEventListener("pointercancel",J),null==(i=n.domElement)||i.removeEventListener("wheel",$),null==(a=n.domElement)||a.ownerDocument.removeEventListener("pointermove",X),null==(o=n.domElement)||o.ownerDocument.removeEventListener("pointerup",J),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",K)};const n=this,r={type:"change"},i={type:"start"},a={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=o.NONE;const l=1e-6,c=new GD,u=new GD;let d=1;const h=new ZS,p=new _S,f=new _S,m=new _S,g=new _S,v=new _S,y=new _S,b=new _S,x=new _S,_=new _S,S=new ZS,w=new _S;let E=!1;const A=[],M={};function C(){return Math.pow(.95,n.zoomSpeed)}function T(e){n.reverseOrbit||n.reverseHorizontalOrbit?u.theta+=e:u.theta-=e}function R(e){n.reverseOrbit||n.reverseVerticalOrbit?u.phi+=e:u.phi-=e}const P=(()=>{const e=new ZS;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),h.add(e)}})(),B=(()=>{const e=new ZS;return function(t,r){!0===n.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),h.add(e)}})(),I=(()=>{const e=new ZS;return function(t,r){const i=n.domElement;if(i&&n.object instanceof wA&&n.object.isPerspectiveCamera){const a=n.object.position;e.copy(a).sub(n.target);let o=e.length();o*=Math.tan(n.object.fov/2*Math.PI/180),P(2*t*o/i.clientHeight,n.object.matrix),B(2*r*o/i.clientHeight,n.object.matrix)}else i&&n.object instanceof YA&&n.object.isOrthographicCamera?(P(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),B(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function D(e){n.object instanceof wA&&n.object.isPerspectiveCamera||n.object instanceof YA&&n.object.isOrthographicCamera?d/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function L(e){n.object instanceof wA&&n.object.isPerspectiveCamera||n.object instanceof YA&&n.object.isOrthographicCamera?d*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function k(e){if(!n.zoomToCursor||!n.domElement)return;E=!0;const t=n.domElement.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top,a=t.width,o=t.height;w.x=r/a*2-1,w.y=-i/o*2+1,S.set(w.x,w.y,1).unproject(n.object).sub(n.object.position).normalize()}function O(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function N(e){p.set(e.clientX,e.clientY)}function F(e){g.set(e.clientX,e.clientY)}function U(){if(1==A.length)p.set(A[0].pageX,A[0].pageY);else{const e=.5*(A[0].pageX+A[1].pageX),t=.5*(A[0].pageY+A[1].pageY);p.set(e,t)}}function z(){if(1==A.length)g.set(A[0].pageX,A[0].pageY);else{const e=.5*(A[0].pageX+A[1].pageX),t=.5*(A[0].pageY+A[1].pageY);g.set(e,t)}}function H(){const e=A[0].pageX-A[1].pageX,t=A[0].pageY-A[1].pageY,n=Math.sqrt(e*e+t*t);b.set(0,n)}function G(e){if(1==A.length)f.set(e.pageX,e.pageY);else{const t=Q(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);f.set(n,r)}m.subVectors(f,p).multiplyScalar(n.rotateSpeed);const t=n.domElement;t&&(T(2*Math.PI*m.x/t.clientHeight),R(2*Math.PI*m.y/t.clientHeight)),p.copy(f)}function j(e){if(1==A.length)v.set(e.pageX,e.pageY);else{const t=Q(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);v.set(n,r)}y.subVectors(v,g).multiplyScalar(n.panSpeed),I(y.x,y.y),g.copy(v)}function V(e){const t=Q(e),r=e.pageX-t.x,i=e.pageY-t.y,a=Math.sqrt(r*r+i*i);x.set(0,a),_.set(0,Math.pow(x.y/b.y,n.zoomSpeed)),D(_.y),b.copy(x)}function W(e){var t,r;!1!==n.enabled&&(0===A.length&&(null==(t=n.domElement)||t.ownerDocument.addEventListener("pointermove",X),null==(r=n.domElement)||r.ownerDocument.addEventListener("pointerup",J)),function(e){A.push(e)}(e),"touch"===e.pointerType?function(e){switch(q(e),A.length){case 1:switch(n.touches.ONE){case Ey.ROTATE:if(!1===n.enableRotate)return;U(),s=o.TOUCH_ROTATE;break;case Ey.PAN:if(!1===n.enablePan)return;z(),s=o.TOUCH_PAN;break;default:s=o.NONE}break;case 2:switch(n.touches.TWO){case Ey.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&H(),n.enablePan&&z(),s=o.TOUCH_DOLLY_PAN;break;case Ey.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&H(),n.enableRotate&&U(),s=o.TOUCH_DOLLY_ROTATE;break;default:s=o.NONE}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}(e):function(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case wy.DOLLY:if(!1===n.enableZoom)return;!function(e){k(e),b.set(e.clientX,e.clientY)}(e),s=o.DOLLY;break;case wy.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;F(e),s=o.PAN}else{if(!1===n.enableRotate)return;N(e),s=o.ROTATE}break;case wy.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;N(e),s=o.ROTATE}else{if(!1===n.enablePan)return;F(e),s=o.PAN}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}(e))}function X(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(q(e),s){case o.TOUCH_ROTATE:if(!1===n.enableRotate)return;G(e),n.update();break;case o.TOUCH_PAN:if(!1===n.enablePan)return;j(e),n.update();break;case o.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&V(e),n.enablePan&&j(e)}(e),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&V(e),n.enableRotate&&G(e)}(e),n.update();break;default:s=o.NONE}}(e):function(e){if(!1===n.enabled)return;switch(s){case o.ROTATE:if(!1===n.enableRotate)return;!function(e){f.set(e.clientX,e.clientY),m.subVectors(f,p).multiplyScalar(n.rotateSpeed);const t=n.domElement;t&&(T(2*Math.PI*m.x/t.clientHeight),R(2*Math.PI*m.y/t.clientHeight)),p.copy(f),n.update()}(e);break;case o.DOLLY:if(!1===n.enableZoom)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,b),_.y>0?D(C()):_.y<0&&L(C()),b.copy(x),n.update()}(e);break;case o.PAN:if(!1===n.enablePan)return;!function(e){v.set(e.clientX,e.clientY),y.subVectors(v,g).multiplyScalar(n.panSpeed),I(y.x,y.y),g.copy(v),n.update()}(e)}}(e))}function J(e){var t,r,i;!function(e){delete M[e.pointerId];for(let t=0;t<A.length;t++)if(A[t].pointerId==e.pointerId)return void A.splice(t,1)}(e),0===A.length&&(null==(t=n.domElement)||t.releasePointerCapture(e.pointerId),null==(r=n.domElement)||r.ownerDocument.removeEventListener("pointermove",X),null==(i=n.domElement)||i.ownerDocument.removeEventListener("pointerup",J)),n.dispatchEvent(a),s=o.NONE}function $(e){!1===n.enabled||!1===n.enableZoom||s!==o.NONE&&s!==o.ROTATE||(e.preventDefault(),n.dispatchEvent(i),function(e){k(e),e.deltaY<0?L(C()):e.deltaY>0&&D(C()),n.update()}(e),n.dispatchEvent(a))}function K(e){!1!==n.enabled&&!1!==n.enablePan&&function(e){let t=!1;switch(e.code){case n.keys.UP:I(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:I(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:I(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:I(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}(e)}function Y(e){!1!==n.enabled&&e.preventDefault()}function q(e){let t=M[e.pointerId];void 0===t&&(t=new _S,M[e.pointerId]=t),t.set(e.pageX,e.pageY)}function Q(e){const t=e.pointerId===A[0].pointerId?A[1]:A[0];return M[t.pointerId]}void 0!==t&&this.connect(t),this.update()}}const TO=t.forwardRef(((e,n)=>{let{makeDefault:r,camera:i,regress:a,domElement:o,enableDamping:s=!0,keyEvents:l=!1,onChange:c,onStart:u,onEnd:d,...h}=e;const p=Bk((e=>e.invalidate)),f=Bk((e=>e.camera)),m=Bk((e=>e.gl)),g=Bk((e=>e.events)),v=Bk((e=>e.setEvents)),y=Bk((e=>e.set)),b=Bk((e=>e.get)),x=Bk((e=>e.performance)),_=i||f,S=o||g.connected||m.domElement,w=t.useMemo((()=>new CO(_)),[_]);return Ik((()=>{w.enabled&&w.update()}),-1),t.useEffect((()=>(l&&w.connect(!0===l?S:l),w.connect(S),()=>{w.dispose()})),[l,S,a,w,p]),t.useEffect((()=>{const e=e=>{p(),a&&x.regress(),c&&c(e)},t=e=>{u&&u(e)},n=e=>{d&&d(e)};return w.addEventListener("change",e),w.addEventListener("start",t),w.addEventListener("end",n),()=>{w.removeEventListener("start",t),w.removeEventListener("end",n),w.removeEventListener("change",e)}}),[c,u,d,w,p,v]),t.useEffect((()=>{if(r){const e=b().controls;return y({controls:w}),()=>y({controls:e})}}),[r,w]),t.createElement("primitive",xO({ref:n,object:w,enableDamping:s},h))}));class RO extends dA{constructor(e,t){var n,r;const i=(a=e)&&a.isCubeTexture;var a;const o=(null!=(r=i?null==(n=e.image[0])?void 0:n.width:e.image.width)?r:1024)/4,s=Math.floor(Math.log2(o)),l=Math.pow(2,s),c=[i?"#define ENVMAP_TYPE_CUBE":"","#define CUBEUV_TEXEL_WIDTH "+1/(3*Math.max(l,112)),"#define CUBEUV_TEXEL_HEIGHT "+1/(4*l),`#define CUBEUV_MAX_MIP ${s}.0`].join("\n")+`\n        #define ENVMAP_TYPE_CUBE_UV\n        varying vec3 vWorldPosition;\n        uniform float radius;\n        uniform float height;\n        uniform float angle;\n        #ifdef ENVMAP_TYPE_CUBE\n            uniform samplerCube map;\n        #else\n            uniform sampler2D map;\n        #endif\n        // From: https://www.shadertoy.com/view/4tsBD7\n        float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n        {\n            float d = dot ( rd, n );\n            \n            if( d > 0.0 ) { return 1e6; }\n            \n            vec3  o = ro - c;\n            float t = - dot( n, o ) / d;\n            vec3  q = o + rd * t;\n            \n            return ( dot( q, q ) < r * r ) ? t : 1e6;\n        }\n        // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n        float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) \n        {\n            vec3 oc = ro - ce;\n            float b = dot( oc, rd );\n            float c = dot( oc, oc ) - ra * ra;\n            float h = b * b - c;\n            \n            if( h < 0.0 ) { return -1.0; }\n            \n            h = sqrt( h );\n            \n            return - b + h;\n        }\n        vec3 project() \n        {\n            vec3 p = normalize( vWorldPosition );\n            vec3 camPos = cameraPosition;\n            camPos.y -= height;\n            float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n            if( intersection > 0.0 ) {\n                \n                vec3 h = vec3( 0.0, - height, 0.0 );\n                float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n                p = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n            } else {\n                p = vec3( 0.0, 1.0, 0.0 );\n            }\n            return p;\n        }\n        #include <common>\n        #include <cube_uv_reflection_fragment>\n        void main() \n        {\n            vec3 projectedWorldPosition = project();\n            \n            #ifdef ENVMAP_TYPE_CUBE\n                vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n            #else\n                vec3 direction = normalize( projectedWorldPosition );\n                vec2 uv = equirectUv( direction );\n                vec3 outcolor = texture2D( map, uv ).rgb;\n            #endif\n            gl_FragColor = vec4( outcolor, 1.0 );\n            #include <tonemapping_fragment>\n            #include <${parseInt(Sy.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}>\n        }\n        `,u={map:{value:e},height:{value:(null==t?void 0:t.height)||15},radius:{value:(null==t?void 0:t.radius)||100}};super(new AB(1,16),new yA({uniforms:u,fragmentShader:c,vertexShader:"\n        varying vec3 vWorldPosition;\n        void main() \n        {\n            vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n            vWorldPosition = worldPosition.xyz;\n            \n            gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n        }\n        ",side:ky}))}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}class PO extends EI{constructor(e){super(e),this.type=tx}parse(e){const t=function(e,t){switch(e){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(t||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(t||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(t||""));default:throw new Error("THREE.RGBELoader: Memory Error: "+(t||""))}},n=function(e,t,n){t=t||1024;let r=e.pos,i=-1,a=0,o="",s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=s.indexOf("\n"))&&a<t&&r<e.byteLength;)o+=s,a+=s.length,r+=128,s+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<i&&(!1!==n&&(e.pos+=a+i+1),o+s.slice(0,i))},r=function(e,t,n,r){const i=e[t+3],a=Math.pow(2,i-128)/255;n[r+0]=e[t+0]*a,n[r+1]=e[t+1]*a,n[r+2]=e[t+2]*a,n[r+3]=1},i=function(e,t,n,r){const i=e[t+3],a=Math.pow(2,i-128)/255;n[r+0]=CE.toHalfFloat(Math.min(e[t+0]*a,65504)),n[r+1]=CE.toHalfFloat(Math.min(e[t+1]*a,65504)),n[r+2]=CE.toHalfFloat(Math.min(e[t+2]*a,65504)),n[r+3]=CE.toHalfFloat(1)},a=new Uint8Array(e);a.pos=0;const o=function(e){const r=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,i=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,a=/^\s*FORMAT=(\S+)\s*$/,o=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,s={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,c;for((e.pos>=e.byteLength||!(l=n(e)))&&t(1,"no header found"),(c=l.match(/^#\?(\S+)/))||t(3,"bad initial token"),s.valid|=1,s.programtype=c[1],s.string+=l+"\n";l=n(e),!1!==l;)if(s.string+=l+"\n","#"!==l.charAt(0)){if((c=l.match(r))&&(s.gamma=parseFloat(c[1])),(c=l.match(i))&&(s.exposure=parseFloat(c[1])),(c=l.match(a))&&(s.valid|=2,s.format=c[1]),(c=l.match(o))&&(s.valid|=4,s.height=parseInt(c[1],10),s.width=parseInt(c[2],10)),2&s.valid&&4&s.valid)break}else s.comments+=l+"\n";return 2&s.valid||t(3,"missing format specifier"),4&s.valid||t(3,"missing image size specifier"),s}(a),s=o.width,l=o.height,c=function(e,n,r){const i=n;if(i<8||i>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,"wrong scanline width");const a=new Uint8Array(4*n*r);a.length||t(4,"unable to allocate buffer space");let o=0,s=0;const l=4*i,c=new Uint8Array(4),u=new Uint8Array(l);let d=r;for(;d>0&&s<e.byteLength;){s+4>e.byteLength&&t(1),c[0]=e[s++],c[1]=e[s++],c[2]=e[s++],c[3]=e[s++],2==c[0]&&2==c[1]&&(c[2]<<8|c[3])==i||t(3,"bad rgbe scanline format");let n,r=0;for(;r<l&&s<e.byteLength;){n=e[s++];const i=n>128;if(i&&(n-=128),(0===n||r+n>l)&&t(3,"bad scanline data"),i){const t=e[s++];for(let e=0;e<n;e++)u[r++]=t}else u.set(e.subarray(s,s+n),r),r+=n,s+=n}const h=i;for(let e=0;e<h;e++){let t=0;a[o]=u[e+t],t+=i,a[o+1]=u[e+t],t+=i,a[o+2]=u[e+t],t+=i,a[o+3]=u[e+t],o+=4}d--}return a}(a.subarray(a.pos),s,l);let u,d,h;switch(this.type){case ex:h=c.length/4;const e=new Float32Array(4*h);for(let n=0;n<h;n++)r(c,4*n,e,4*n);u=e,d=ex;break;case tx:h=c.length/4;const t=new Uint16Array(4*h);for(let n=0;n<h;n++)i(c,4*n,t,4*n);u=t,d=tx;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:s,height:l,data:u,header:o.string,gamma:o.gamma,exposure:o.exposure,type:d}}setDataType(e){return this.type=e,this}load(e,t,n,r){return super.load(e,(function(e,n){switch(e.type){case ex:case tx:"colorSpace"in e?e.colorSpace="srgb-linear":e.encoding=3e3,e.minFilter=jb,e.magFilter=jb,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)}),n,r)}}var BO=Uint8Array,IO=Uint16Array,DO=Uint32Array,LO=new BO([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),kO=new BO([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),OO=new BO([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),NO=function(e,t){for(var n=new IO(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new DO(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]},FO=NO(LO,2),UO=FO[0],zO=FO[1];UO[28]=258,zO[258]=28;for(var HO=NO(kO,0),GO=HO[0],jO=(HO[1],new IO(32768)),VO=0;VO<32768;++VO){var WO=(43690&VO)>>>1|(21845&VO)<<1;WO=(61680&(WO=(52428&WO)>>>2|(13107&WO)<<2))>>>4|(3855&WO)<<4,jO[VO]=((65280&WO)>>>8|(255&WO)<<8)>>>1}var XO=function(e,t,n){for(var r=e.length,i=0,a=new IO(t);i<r;++i)++a[e[i]-1];var o,s=new IO(t);for(i=0;i<t;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new IO(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)o[jO[d]>>>l]=c}else for(o=new IO(r),i=0;i<r;++i)e[i]&&(o[i]=jO[s[e[i]-1]++]>>>15-e[i]);return o},JO=new BO(288);for(VO=0;VO<144;++VO)JO[VO]=8;for(VO=144;VO<256;++VO)JO[VO]=9;for(VO=256;VO<280;++VO)JO[VO]=7;for(VO=280;VO<288;++VO)JO[VO]=8;var $O=new BO(32);for(VO=0;VO<32;++VO)$O[VO]=5;var KO=XO(JO,9,1),YO=XO($O,5,1),qO=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},QO=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},ZO=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},eN=function(e){return(e/8|0)+(7&e&&1)},tN=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof IO?IO:e instanceof DO?DO:BO)(n-t);return r.set(e.subarray(t,n)),r},nN=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new BO(0);var i=!t||n,a=!n||n.i;n||(n={}),t||(t=new BO(3*r));var o=function(e){var n=t.length;if(e>n){var r=new BO(Math.max(2*n,e));r.set(t),t=r}},s=n.f||0,l=n.p||0,c=n.b||0,u=n.l,d=n.d,h=n.m,p=n.n,f=8*r;do{if(!u){n.f=s=QO(e,l,1);var m=QO(e,l+1,3);if(l+=3,!m){var g=e[(C=eN(l)+4)-4]|e[C-3]<<8,v=C+g;if(v>r){if(a)throw"unexpected EOF";break}i&&o(c+g),t.set(e.subarray(C,v),c),n.b=c+=g,n.p=l=8*v;continue}if(1==m)u=KO,d=YO,h=9,p=5;else{if(2!=m)throw"invalid block type";var y=QO(e,l,31)+257,b=QO(e,l+10,15)+4,x=y+QO(e,l+5,31)+1;l+=14;for(var _=new BO(x),S=new BO(19),w=0;w<b;++w)S[OO[w]]=QO(e,l+3*w,7);l+=3*b;var E=qO(S),A=(1<<E)-1,M=XO(S,E,1);for(w=0;w<x;){var C,T=M[QO(e,l,A)];if(l+=15&T,(C=T>>>4)<16)_[w++]=C;else{var R=0,P=0;for(16==C?(P=3+QO(e,l,3),l+=2,R=_[w-1]):17==C?(P=3+QO(e,l,7),l+=3):18==C&&(P=11+QO(e,l,127),l+=7);P--;)_[w++]=R}}var B=_.subarray(0,y),I=_.subarray(y);h=qO(B),p=qO(I),u=XO(B,h,1),d=XO(I,p,1)}if(l>f){if(a)throw"unexpected EOF";break}}i&&o(c+131072);for(var D=(1<<h)-1,L=(1<<p)-1,k=l;;k=l){var O=(R=u[ZO(e,l)&D])>>>4;if((l+=15&R)>f){if(a)throw"unexpected EOF";break}if(!R)throw"invalid length/literal";if(O<256)t[c++]=O;else{if(256==O){k=l,u=null;break}var N=O-254;if(O>264){var F=LO[w=O-257];N=QO(e,l,(1<<F)-1)+UO[w],l+=F}var U=d[ZO(e,l)&L],z=U>>>4;if(!U)throw"invalid distance";l+=15&U;I=GO[z];if(z>3){F=kO[z];I+=ZO(e,l)&(1<<F)-1,l+=F}if(l>f){if(a)throw"unexpected EOF";break}i&&o(c+131072);for(var H=c+N;c<H;c+=4)t[c]=t[c-I],t[c+1]=t[c+1-I],t[c+2]=t[c+2-I],t[c+3]=t[c+3-I];c=H}}n.l=u,n.p=k,n.b=c,u&&(s=1,n.m=h,n.d=d,n.n=p)}while(!s);return c==t.length?t:tN(t,0,c)},rN=new BO(0),iN=function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function aN(e,t){return nN((iN(e),e.subarray(2,-4)),t)}var oN="undefined"!=typeof TextDecoder&&new TextDecoder;try{oN.decode(rN,{stream:!0}),1}catch(uz){}const sN="colorSpace"in new VS;class lN extends EI{constructor(e){super(e),this.type=tx}parse(e){const t=65536,n=14,r=65537,i=16384,a=Math.pow(2.7182818,2.2);const o={l:0,c:0,lc:0};function s(e,t,n,r,i){for(;n<e;)t=t<<8|H(r,i),n+=8;n-=e,o.l=t>>n&(1<<e)-1,o.c=t,o.lc=n}const l=new Array(59);function c(e,t,n,i,a,c,u){for(var d=n,h=0,p=0;a<=c;a++){if(d.value-n.value>i)return!1;s(6,h,p,e,d);var f=o.l;if(h=o.c,p=o.lc,u[a]=f,63==f){if(d.value-n.value>i)throw"Something wrong with hufUnpackEncTable";s(8,h,p,e,d);var m=o.l+6;if(h=o.c,p=o.lc,a+m>c+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)u[a++]=0;a--}else if(f>=59){if(a+(m=f-59+2)>c+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)u[a++]=0;a--}}!function(e){for(var t=0;t<=58;++t)l[t]=0;for(t=0;t<r;++t)l[e[t]]+=1;var n=0;for(t=58;t>0;--t){var i=n+l[t]>>1;l[t]=n,n=i}for(t=0;t<r;++t){var a=e[t];a>0&&(e[t]=a|l[a]++<<6)}}(u)}function u(e){return 63&e}function d(e){return e>>6}const h={c:0,lc:0};function p(e,t,n,r){e=e<<8|H(n,r),t+=8,h.c=e,h.lc=t}const f={c:0,lc:0};function m(e,t,n,r,i,a,o,s,l,c){if(e==t){r<8&&(p(n,r,i,o),n=h.c,r=h.lc);var u=n>>(r-=8);u=new Uint8Array([u])[0];if(l.value+u>c)return!1;for(var d=s[l.value-1];u-- >0;)s[l.value++]=d}else{if(!(l.value<c))return!1;s[l.value++]=e}f.c=n,f.lc=r}function g(e){return 65535&e}function v(e){var t=g(e);return t>32767?t-65536:t}const y={a:0,b:0};function b(e,t){var n=v(e),r=v(t),i=n+(1&r)+(r>>1),a=i,o=i-r;y.a=a,y.b=o}function x(e,t){var n=g(e),r=g(t),i=n-(r>>1)&65535,a=r+i-32768&65535;y.a=a,y.b=i}function _(e,t,n,r,i,a,o){for(var s,l=o<16384,c=n>i?i:n,u=1;u<=c;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var d,h,p,f,m=0,g=m+a*(i-s),v=a*u,_=a*s,S=r*u,w=r*s;m<=g;m+=_){for(var E=m,A=m+r*(n-s);E<=A;E+=w){var M=E+S,C=(T=E+v)+S;l?(b(e[E+t],e[T+t]),d=y.a,p=y.b,b(e[M+t],e[C+t]),h=y.a,f=y.b,b(d,h),e[E+t]=y.a,e[M+t]=y.b,b(p,f),e[T+t]=y.a,e[C+t]=y.b):(x(e[E+t],e[T+t]),d=y.a,p=y.b,x(e[M+t],e[C+t]),h=y.a,f=y.b,x(d,h),e[E+t]=y.a,e[M+t]=y.b,x(p,f),e[T+t]=y.a,e[C+t]=y.b)}if(n&u){var T=E+v;l?b(e[E+t],e[T+t]):x(e[E+t],e[T+t]),d=y.a,e[T+t]=y.b,e[E+t]=d}}if(i&u)for(E=m,A=m+r*(n-s);E<=A;E+=w){M=E+S;l?b(e[E+t],e[M+t]):x(e[E+t],e[M+t]),d=y.a,e[M+t]=y.b,e[E+t]=d}s=u,u>>=1}return m}function S(e,t,a,o,s,l){var g=a.value,v=z(t,a),y=z(t,a);a.value+=4;var b=z(t,a);if(a.value+=4,v<0||v>=r||y<0||y>=r)throw"Something wrong with HUF_ENCSIZE";var x=new Array(r),_=new Array(i);if(function(e){for(var t=0;t<i;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}(_),c(e,0,a,o-(a.value-g),v,y,x),b>8*(o-(a.value-g)))throw"Something wrong with hufUncompress";!function(e,t,r,i){for(;t<=r;t++){var a=d(e[t]),o=u(e[t]);if(a>>o)throw"Invalid table entry";if(o>n){if((h=i[a>>o-n]).len)throw"Invalid table entry";if(h.lit++,h.p){var s=h.p;h.p=new Array(h.lit);for(var l=0;l<h.lit-1;++l)h.p[l]=s[l]}else h.p=new Array(1);h.p[h.lit-1]=t}else if(o){var c=0;for(l=1<<n-o;l>0;l--){var h;if((h=i[(a<<n-o)+c]).len||h.p)throw"Invalid table entry";h.len=o,h.lit=t,c++}}}}(x,v,y,_),function(e,t,r,i,a,o,s,l,c,g){for(var v=0,y=0,b=l,x=Math.trunc(a.value+(o+7)/8);a.value<x;)for(p(v,y,r,a),v=h.c,y=h.lc;y>=n;)if((E=t[v>>y-n&16383]).len)y-=E.len,m(E.lit,s,v,y,r,0,a,c,g,b),v=f.c,y=f.lc;else{if(!E.p)throw"hufDecode issues";var _;for(_=0;_<E.lit;_++){for(var S=u(e[E.p[_]]);y<S&&a.value<x;)p(v,y,r,a),v=h.c,y=h.lc;if(y>=S&&d(e[E.p[_]])==(v>>y-S&(1<<S)-1)){y-=S,m(E.p[_],s,v,y,r,0,a,c,g,b),v=f.c,y=f.lc;break}}if(_==E.lit)throw"hufDecode issues"}var w=8-o&7;for(v>>=w,y-=w;y>0;){var E;if(!(E=t[v<<n-y&16383]).len)throw"hufDecode issues";y-=E.len,m(E.lit,s,v,y,r,0,a,c,g,b),v=f.c,y=f.lc}}(x,_,e,0,a,b,y,l,s,{value:0})}function w(e){for(var t=1;t<e.length;t++){var n=e[t-1]+e[t]-128;e[t]=n}}function E(e,t){for(var n=0,r=Math.floor((e.length+1)/2),i=0,a=e.length-1;!(i>a)&&(t[i++]=e[n++],!(i>a));)t[i++]=e[r++]}function A(e){for(var t=e.byteLength,n=new Array,r=0,i=new DataView(e);t>0;){var a=i.getInt8(r++);if(a<0){t-=(s=-a)+1;for(var o=0;o<s;o++)n.push(i.getUint8(r++))}else{var s=a;t-=2;var l=i.getUint8(r++);for(o=0;o<s+1;o++)n.push(l)}}return n}function M(e,t,n){for(var r,i=1;i<64;)65280==(r=t[e.value])?i=64:r>>8==255?i+=255&r:(n[i]=r,i++),e.value++}function C(e,t){t[0]=X(e[0]),t[1]=X(e[1]),t[2]=X(e[5]),t[3]=X(e[6]),t[4]=X(e[14]),t[5]=X(e[15]),t[6]=X(e[27]),t[7]=X(e[28]),t[8]=X(e[2]),t[9]=X(e[4]),t[10]=X(e[7]),t[11]=X(e[13]),t[12]=X(e[16]),t[13]=X(e[26]),t[14]=X(e[29]),t[15]=X(e[42]),t[16]=X(e[3]),t[17]=X(e[8]),t[18]=X(e[12]),t[19]=X(e[17]),t[20]=X(e[25]),t[21]=X(e[30]),t[22]=X(e[41]),t[23]=X(e[43]),t[24]=X(e[9]),t[25]=X(e[11]),t[26]=X(e[18]),t[27]=X(e[24]),t[28]=X(e[31]),t[29]=X(e[40]),t[30]=X(e[44]),t[31]=X(e[53]),t[32]=X(e[10]),t[33]=X(e[19]),t[34]=X(e[23]),t[35]=X(e[32]),t[36]=X(e[39]),t[37]=X(e[45]),t[38]=X(e[52]),t[39]=X(e[54]),t[40]=X(e[20]),t[41]=X(e[22]),t[42]=X(e[33]),t[43]=X(e[38]),t[44]=X(e[46]),t[45]=X(e[51]),t[46]=X(e[55]),t[47]=X(e[60]),t[48]=X(e[21]),t[49]=X(e[34]),t[50]=X(e[37]),t[51]=X(e[47]),t[52]=X(e[50]),t[53]=X(e[56]),t[54]=X(e[59]),t[55]=X(e[61]),t[56]=X(e[35]),t[57]=X(e[36]),t[58]=X(e[48]),t[59]=X(e[49]),t[60]=X(e[57]),t[61]=X(e[58]),t[62]=X(e[62]),t[63]=X(e[63])}function T(e){const t=.5*Math.cos(.7853975),n=.5*Math.cos(3.14159/16),r=.5*Math.cos(3.14159/8),i=.5*Math.cos(3*3.14159/16),a=.5*Math.cos(.981746875),o=.5*Math.cos(3*3.14159/8),s=.5*Math.cos(1.374445625);for(var l=new Array(4),c=new Array(4),u=new Array(4),d=new Array(4),h=0;h<8;++h){var p=8*h;l[0]=r*e[p+2],l[1]=o*e[p+2],l[2]=r*e[p+6],l[3]=o*e[p+6],c[0]=n*e[p+1]+i*e[p+3]+a*e[p+5]+s*e[p+7],c[1]=i*e[p+1]-s*e[p+3]-n*e[p+5]-a*e[p+7],c[2]=a*e[p+1]-n*e[p+3]+s*e[p+5]+i*e[p+7],c[3]=s*e[p+1]-a*e[p+3]+i*e[p+5]-n*e[p+7],u[0]=t*(e[p+0]+e[p+4]),u[3]=t*(e[p+0]-e[p+4]),u[1]=l[0]+l[3],u[2]=l[1]-l[2],d[0]=u[0]+u[1],d[1]=u[3]+u[2],d[2]=u[3]-u[2],d[3]=u[0]-u[1],e[p+0]=d[0]+c[0],e[p+1]=d[1]+c[1],e[p+2]=d[2]+c[2],e[p+3]=d[3]+c[3],e[p+4]=d[3]-c[3],e[p+5]=d[2]-c[2],e[p+6]=d[1]-c[1],e[p+7]=d[0]-c[0]}for(var f=0;f<8;++f)l[0]=r*e[16+f],l[1]=o*e[16+f],l[2]=r*e[48+f],l[3]=o*e[48+f],c[0]=n*e[8+f]+i*e[24+f]+a*e[40+f]+s*e[56+f],c[1]=i*e[8+f]-s*e[24+f]-n*e[40+f]-a*e[56+f],c[2]=a*e[8+f]-n*e[24+f]+s*e[40+f]+i*e[56+f],c[3]=s*e[8+f]-a*e[24+f]+i*e[40+f]-n*e[56+f],u[0]=t*(e[f]+e[32+f]),u[3]=t*(e[f]-e[32+f]),u[1]=l[0]+l[3],u[2]=l[1]-l[2],d[0]=u[0]+u[1],d[1]=u[3]+u[2],d[2]=u[3]-u[2],d[3]=u[0]-u[1],e[0+f]=d[0]+c[0],e[8+f]=d[1]+c[1],e[16+f]=d[2]+c[2],e[24+f]=d[3]+c[3],e[32+f]=d[3]-c[3],e[40+f]=d[2]-c[2],e[48+f]=d[1]-c[1],e[56+f]=d[0]-c[0]}function R(e){for(var t=0;t<64;++t){var n=e[0][t],r=e[1][t],i=e[2][t];e[0][t]=n+1.5747*i,e[1][t]=n-.1873*r-.4682*i,e[2][t]=n+1.8556*r}}function P(e,t,n){for(var r=0;r<64;++r)t[n+r]=CE.toHalfFloat(B(e[r]))}function B(e){return e<=1?Math.sign(e)*Math.pow(Math.abs(e),2.2):Math.sign(e)*Math.pow(a,Math.abs(e)-1)}function I(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function D(e){var t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),n=new Uint8Array(A(t)),r=new Uint8Array(n.length);return w(n),E(n,r),new DataView(r.buffer)}function L(e){var t=aN(e.array.slice(e.offset.value,e.offset.value+e.size)),n=new Uint8Array(t.length);return w(t),E(t,n),new DataView(n.buffer)}function k(e){for(var n=e.viewer,r={value:e.offset.value},i=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),a=new Uint8Array(8192),o=0,s=new Array(e.channels),l=0;l<e.channels;l++)s[l]={},s[l].start=o,s[l].end=s[l].start,s[l].nx=e.width,s[l].ny=e.lines,s[l].size=e.type,o+=s[l].nx*s[l].ny*s[l].size;var c=J(n,r),u=J(n,r);if(u>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(c<=u)for(l=0;l<u-c+1;l++)a[l+c]=G(n,r);var d=new Uint16Array(t),h=function(e,n){for(var r=0,i=0;i<t;++i)(0==i||e[i>>3]&1<<(7&i))&&(n[r++]=i);for(var a=r-1;r<t;)n[r++]=0;return a}(a,d),p=z(n,r);S(e.array,n,r,p,i,o);for(l=0;l<e.channels;++l)for(var f=s[l],m=0;m<s[l].size;++m)_(i,f.start+m,f.nx,f.size,f.ny,f.nx*f.size,h);!function(e,t,n){for(var r=0;r<n;++r)t[r]=e[t[r]]}(d,i,o);for(var g=0,v=new Uint8Array(i.buffer.byteLength),y=0;y<e.lines;y++)for(var b=0;b<e.channels;b++){var x=(f=s[b]).nx*f.size,w=new Uint8Array(i.buffer,2*f.end,2*x);v.set(w,g),g+=2*x,f.end+=x}return new DataView(v.buffer)}function O(e){var t=aN(e.array.slice(e.offset.value,e.offset.value+e.size));const n=e.lines*e.channels*e.width,r=1==e.type?new Uint16Array(n):new Uint32Array(n);let i=0,a=0;const o=new Array(4);for(let s=0;s<e.lines;s++)for(let n=0;n<e.channels;n++){let n=0;switch(e.type){case 1:o[0]=i,o[1]=o[0]+e.width,i=o[1]+e.width;for(let i=0;i<e.width;++i){n+=t[o[0]++]<<8|t[o[1]++],r[a]=n,a++}break;case 2:o[0]=i,o[1]=o[0]+e.width,o[2]=o[1]+e.width,i=o[2]+e.width;for(let i=0;i<e.width;++i){n+=t[o[0]++]<<24|t[o[1]++]<<16|t[o[2]++]<<8,r[a]=n,a++}}}return new DataView(r.buffer)}function N(e){var t=e.viewer,n={value:e.offset.value},r=new Uint8Array(e.width*e.lines*(e.channels*e.type*2)),i={version:j(t,n),unknownUncompressedSize:j(t,n),unknownCompressedSize:j(t,n),acCompressedSize:j(t,n),dcCompressedSize:j(t,n),rleCompressedSize:j(t,n),rleUncompressedSize:j(t,n),rleRawSize:j(t,n),totalAcUncompressedCount:j(t,n),totalDcUncompressedCount:j(t,n),acCompression:j(t,n)};if(i.version<2)throw"EXRLoader.parse: "+Z.compression+" version "+i.version+" is unsupported";for(var a=new Array,o=J(t,n)-2;o>0;){var s=F(t.buffer,n),l=G(t,n),c=l>>2&3,u=new Int8Array([(l>>4)-1])[0],d=G(t,n);a.push({name:s,index:u,type:d,compression:c}),o-=s.length+3}for(var h=Z.channels,p=new Array(e.channels),f=0;f<e.channels;++f){var m=p[f]={},g=h[f];m.name=g.name,m.compression=0,m.decoded=!1,m.type=g.pixelType,m.pLinear=g.pLinear,m.width=e.width,m.height=e.lines}for(var v={idx:new Array(3)},y=0;y<e.channels;++y)for(m=p[y],f=0;f<a.length;++f){var b=a[f];m.name==b.name&&(m.compression=b.compression,b.index>=0&&(v.idx[b.index]=y),m.offset=y)}if(i.acCompressedSize>0)switch(i.acCompression){case 0:var x=new Uint16Array(i.totalAcUncompressedCount);S(e.array,t,n,i.acCompressedSize,x,i.totalAcUncompressedCount);break;case 1:var _=aN(e.array.slice(n.value,n.value+i.totalAcUncompressedCount));x=new Uint16Array(_.buffer);n.value+=i.totalAcUncompressedCount}if(i.dcCompressedSize>0){var w={array:e.array,offset:n,size:i.dcCompressedSize},E=new Uint16Array(L(w).buffer);n.value+=i.dcCompressedSize}if(i.rleRawSize>0){var B=A((_=aN(e.array.slice(n.value,n.value+i.rleCompressedSize))).buffer);n.value+=i.rleCompressedSize}var I=0,D=new Array(p.length);for(f=0;f<D.length;++f)D[f]=new Array;for(var k=0;k<e.lines;++k)for(var O=0;O<p.length;++O)D[O].push(I),I+=p[O].width*e.type*2;!function(e,t,n,r,i,a){var o=new DataView(a.buffer),s=n[e.idx[0]].width,l=n[e.idx[0]].height,c=Math.floor(s/8),u=Math.ceil(s/8),d=Math.ceil(l/8),h=s-8*(u-1),p=l-8*(d-1),f={value:0},m=new Array(3),g=new Array(3),v=new Array(3),y=new Array(3),b=new Array(3);for(let M=0;M<3;++M)b[M]=t[e.idx[M]],m[M]=M<1?0:m[M-1]+u*d,g[M]=new Float32Array(64),v[M]=new Uint16Array(64),y[M]=new Uint16Array(64*u);for(let I=0;I<d;++I){var x=8;I==d-1&&(x=p);var _=8;for(let e=0;e<u;++e){e==u-1&&(_=h);for(let e=0;e<3;++e)v[e].fill(0),v[e][0]=i[m[e]++],M(f,r,v[e]),C(v[e],g[e]),T(g[e]);R(g);for(let t=0;t<3;++t)P(g[t],y[t],64*e)}let t=0;for(let r=0;r<3;++r){const i=n[e.idx[r]].type;for(let e=8*I;e<8*I+x;++e){t=b[r][e];for(let n=0;n<c;++n){const a=64*n+8*(7&e);o.setUint16(t+0*i,y[r][a+0],!0),o.setUint16(t+2*i,y[r][a+1],!0),o.setUint16(t+4*i,y[r][a+2],!0),o.setUint16(t+6*i,y[r][a+3],!0),o.setUint16(t+8*i,y[r][a+4],!0),o.setUint16(t+10*i,y[r][a+5],!0),o.setUint16(t+12*i,y[r][a+6],!0),o.setUint16(t+14*i,y[r][a+7],!0),t+=16*i}}if(c!=u)for(let e=8*I;e<8*I+x;++e){const t=b[r][e]+8*c*2*i,n=64*c+8*(7&e);for(let e=0;e<_;++e)o.setUint16(t+2*e*i,y[r][n+e],!0)}}}for(var S=new Uint16Array(s),w=(o=new DataView(a.buffer),0);w<3;++w){n[e.idx[w]].decoded=!0;var E=n[e.idx[w]].type;if(2==n[w].type)for(var A=0;A<l;++A){const e=b[w][A];for(var B=0;B<s;++B)S[B]=o.getUint16(e+2*B*E,!0);for(B=0;B<s;++B)o.setFloat32(e+2*B*E,X(S[B]),!0)}}}(v,D,p,x,E,r);for(f=0;f<p.length;++f){if(!(m=p[f]).decoded){if(2!==m.compression)throw"EXRLoader.parse: unsupported channel compression";var N=0,U=0;for(k=0;k<e.lines;++k){for(var z=D[f][N],H=0;H<m.width;++H){for(var V=0;V<2*m.type;++V)r[z++]=B[U+V*m.width*m.height];U++}N++}}}return new DataView(r.buffer)}function F(e,t){for(var n=new Uint8Array(e),r=0;0!=n[t.value+r];)r+=1;var i=(new TextDecoder).decode(n.slice(t.value,t.value+r));return t.value=t.value+r+1,i}function U(e,t){var n=e.getInt32(t.value,!0);return t.value=t.value+4,n}function z(e,t){var n=e.getUint32(t.value,!0);return t.value=t.value+4,n}function H(e,t){var n=e[t.value];return t.value=t.value+1,n}function G(e,t){var n=e.getUint8(t.value);return t.value=t.value+1,n}const j=function(e,t){let n;return n="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,n};function V(e,t){var n=e.getFloat32(t.value,!0);return t.value+=4,n}function W(e,t){return CE.toHalfFloat(V(e,t))}function X(e){var t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:Math.pow(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}function J(e,t){var n=e.getUint16(t.value,!0);return t.value+=2,n}function $(e,t){return X(J(e,t))}function K(e,t,n,r,i){return"string"===r||"stringvector"===r||"iccProfile"===r?function(e,t,n){var r=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+n));return t.value=t.value+n,r}(t,n,i):"chlist"===r?function(e,t,n,r){for(var i=n.value,a=[];n.value<i+r-1;){var o=F(t,n),s=U(e,n),l=G(e,n);n.value+=3;var c=U(e,n),u=U(e,n);a.push({name:o,pixelType:s,pLinear:l,xSampling:c,ySampling:u})}return n.value+=1,a}(e,t,n,i):"chromaticities"===r?function(e,t){return{redX:V(e,t),redY:V(e,t),greenX:V(e,t),greenY:V(e,t),blueX:V(e,t),blueY:V(e,t),whiteX:V(e,t),whiteY:V(e,t)}}(e,n):"compression"===r?function(e,t){return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][G(e,t)]}(e,n):"box2i"===r?function(e,t){return{xMin:z(e,t),yMin:z(e,t),xMax:z(e,t),yMax:z(e,t)}}(e,n):"lineOrder"===r?function(e,t){return["INCREASING_Y"][G(e,t)]}(e,n):"float"===r?V(e,n):"v2f"===r?function(e,t){return[V(e,t),V(e,t)]}(e,n):"v3f"===r?function(e,t){return[V(e,t),V(e,t),V(e,t)]}(e,n):"int"===r?U(e,n):"rational"===r?function(e,t){return[U(e,t),z(e,t)]}(e,n):"timecode"===r?function(e,t){return[z(e,t),z(e,t)]}(e,n):"preview"===r?(n.value+=i,"skipped"):void(n.value+=i)}const Y=new DataView(e),q=new Uint8Array(e),Q={value:0},Z=function(e,t,n){const r={};if(20000630!=e.getUint32(0,!0))throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";r.version=e.getUint8(4);const i=e.getUint8(5);r.spec={singleTile:!!(2&i),longName:!!(4&i),deepFormat:!!(8&i),multiPart:!!(16&i)},n.value=8;for(var a=!0;a;){var o=F(t,n);if(0==o)a=!1;else{var s=F(t,n),l=K(e,t,n,s,z(e,n));void 0===l?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${s}'.`):r[o]=l}}if(0!=(-5&i))throw console.error("EXRHeader:",r),"THREE.EXRLoader: provided file is currently unsupported.";return r}(Y,e,Q),ee=function(e,t,n,r,i){const a={size:0,viewer:t,array:n,offset:r,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:e.channels[0].pixelType,uncompress:null,getter:null,format:null,[sN?"colorSpace":"encoding"]:null};switch(e.compression){case"NO_COMPRESSION":a.lines=1,a.uncompress=I;break;case"RLE_COMPRESSION":a.lines=1,a.uncompress=D;break;case"ZIPS_COMPRESSION":a.lines=1,a.uncompress=L;break;case"ZIP_COMPRESSION":a.lines=16,a.uncompress=L;break;case"PIZ_COMPRESSION":a.lines=32,a.uncompress=k;break;case"PXR24_COMPRESSION":a.lines=16,a.uncompress=O;break;case"DWAA_COMPRESSION":a.lines=32,a.uncompress=N;break;case"DWAB_COMPRESSION":a.lines=256,a.uncompress=N;break;default:throw"EXRLoader.parse: "+e.compression+" is unsupported"}if(a.scanlineBlockSize=a.lines,1==a.type)switch(i){case ex:a.getter=$,a.inputSize=2;break;case tx:a.getter=J,a.inputSize=2}else{if(2!=a.type)throw"EXRLoader.parse: unsupported pixelType "+a.type+" for "+e.compression+".";switch(i){case ex:a.getter=V,a.inputSize=4;break;case tx:a.getter=W,a.inputSize=4}}a.blockCount=(e.dataWindow.yMax+1)/a.scanlineBlockSize;for(var o=0;o<a.blockCount;o++)j(t,r);a.outputChannels=3==a.channels?4:a.channels;const s=a.width*a.height*a.outputChannels;switch(i){case ex:a.byteArray=new Float32Array(s),a.channels<a.outputChannels&&a.byteArray.fill(1,0,s);break;case tx:a.byteArray=new Uint16Array(s),a.channels<a.outputChannels&&a.byteArray.fill(15360,0,s);break;default:console.error("THREE.EXRLoader: unsupported type: ",i)}return a.bytesPerLine=a.width*a.inputSize*a.channels,4==a.outputChannels?a.format=lx:a.format=px,sN?a.colorSpace="srgb-linear":a.encoding=3e3,a}(Z,Y,q,Q,this.type),te={value:0},ne={R:0,G:1,B:2,A:3,Y:0};for(let re=0;re<ee.height/ee.scanlineBlockSize;re++){const e=z(Y,Q);ee.size=z(Y,Q),ee.lines=e+ee.scanlineBlockSize>ee.height?ee.height-e:ee.scanlineBlockSize;const t=ee.size<ee.lines*ee.bytesPerLine?ee.uncompress(ee):I(ee);Q.value+=ee.size;for(let n=0;n<ee.scanlineBlockSize;n++){const e=n+re*ee.scanlineBlockSize;if(e>=ee.height)break;for(let r=0;r<ee.channels;r++){const i=ne[Z.channels[r].name];for(let a=0;a<ee.width;a++){te.value=(n*(ee.channels*ee.width)+r*ee.width+a)*ee.inputSize;const o=(ee.height-1-e)*(ee.width*ee.outputChannels)+a*ee.outputChannels+i;ee.byteArray[o]=ee.getter(t,te)}}}}return{header:Z,width:ee.width,height:ee.height,data:ee.byteArray,format:ee.format,[sN?"colorSpace":"encoding"]:ee[sN?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,r){return super.load(e,(function(e,n){sN?e.colorSpace=n.colorSpace:e.encoding=n.encoding,e.minFilter=jb,e.magFilter=jb,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,n)}),n,r)}}const cN=(e,t,n)=>{let r;switch(e){case $b:r=new Uint8ClampedArray(t*n*4);break;case tx:r=new Uint16Array(t*n*4);break;case Zb:r=new Uint32Array(t*n*4);break;case Kb:r=new Int8Array(t*n*4);break;case Yb:r=new Int16Array(t*n*4);break;case Qb:r=new Int32Array(t*n*4);break;case ex:r=new Float32Array(t*n*4);break;default:throw new Error("Unsupported data type")}return r};let uN;class dN{constructor(e){var t,n,r,i,a,o,s,l,c,u,d,h,p,f,m,g;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(uz){throw this._renderer.setRenderTarget(null),uz}this._renderer.setRenderTarget(null)},this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const v={format:lx,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:void 0!==(null===(t=e.renderTargetOptions)||void 0===t?void 0:t.anisotropy)?null===(n=e.renderTargetOptions)||void 0===n?void 0:n.anisotropy:1,generateMipmaps:void 0!==(null===(r=e.renderTargetOptions)||void 0===r?void 0:r.generateMipmaps)&&(null===(i=e.renderTargetOptions)||void 0===i?void 0:i.generateMipmaps),magFilter:void 0!==(null===(a=e.renderTargetOptions)||void 0===a?void 0:a.magFilter)?null===(o=e.renderTargetOptions)||void 0===o?void 0:o.magFilter:jb,minFilter:void 0!==(null===(s=e.renderTargetOptions)||void 0===s?void 0:s.minFilter)?null===(l=e.renderTargetOptions)||void 0===l?void 0:l.minFilter:jb,samples:void 0!==(null===(c=e.renderTargetOptions)||void 0===c?void 0:c.samples)?null===(u=e.renderTargetOptions)||void 0===u?void 0:u.samples:void 0,wrapS:void 0!==(null===(d=e.renderTargetOptions)||void 0===d?void 0:d.wrapS)?null===(h=e.renderTargetOptions)||void 0===h?void 0:h.wrapS:Ob,wrapT:void 0!==(null===(p=e.renderTargetOptions)||void 0===p?void 0:p.wrapT)?null===(f=e.renderTargetOptions)||void 0===f?void 0:f.wrapT:Ob};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=dN.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new RT,this._camera=new YA,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!((e,t,n,r)=>{if(void 0!==uN)return uN;const i=new JS(1,1,r);t.setRenderTarget(i);const a=new dA(new NA,new SE({color:16777215}));t.render(a,n),t.setRenderTarget(null);const o=cN(e,i.width,i.height);return t.readRenderTargetPixels(i,0,0,i.width,i.height,o),i.dispose(),a.geometry.dispose(),a.material.dispose(),uN=0!==o[0],uN})(this._type,this._renderer,this._camera,v)){let e;if(this._type===tx)e=this._renderer.extensions.has("EXT_color_buffer_float")?ex:void 0;void 0!==e?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${ex}`),this._type=e):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new dA(new NA,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new JS(this.width,this.height,v),this._renderTarget.texture.mapping=void 0!==(null===(m=e.renderTargetOptions)||void 0===m?void 0:m.mapping)?null===(g=e.renderTargetOptions)||void 0===g?void 0:g.mapping:Rb}static instantiateRenderer(){const e=new MT;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=cN(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const t=new cR(this.toArray(),this.width,this.height,lx,this._type,(null===e||void 0===e?void 0:e.mapping)||Rb,(null===e||void 0===e?void 0:e.wrapS)||Ob,(null===e||void 0===e?void 0:e.wrapT)||Ob,(null===e||void 0===e?void 0:e.magFilter)||jb,(null===e||void 0===e?void 0:e.minFilter)||jb,(null===e||void 0===e?void 0:e.anisotropy)||1,b_);return t.generateMipmaps=void 0!==(null===e||void 0===e?void 0:e.generateMipmaps)&&(null===e||void 0===e?void 0:e.generateMipmaps),t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof yA&&Object.values(this.material.uniforms).forEach((e=>{e.value instanceof VS&&e.value.dispose()})),Object.values(this.material).forEach((e=>{e instanceof VS&&e.dispose()})),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}class hN extends yA{constructor(e){let{gamma:t,offsetHdr:n,offsetSdr:r,gainMapMin:i,gainMapMax:a,maxDisplayBoost:o,hdrCapacityMin:s,hdrCapacityMax:l,sdr:c,gainMap:u}=e;super({name:"GainMapDecoderMaterial",vertexShader:"\nvarying vec2 vUv;\n\nvoid main() {\n  vUv = uv;\n  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\n// min half float value\n#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 )\n// max half float value\n#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 )\n\nuniform sampler2D sdr;\nuniform sampler2D gainMap;\nuniform vec3 gamma;\nuniform vec3 offsetHdr;\nuniform vec3 offsetSdr;\nuniform vec3 gainMapMin;\nuniform vec3 gainMapMax;\nuniform float weightFactor;\n\nvarying vec2 vUv;\n\nvoid main() {\n  vec3 rgb = texture2D( sdr, vUv ).rgb;\n  vec3 recovery = texture2D( gainMap, vUv ).rgb;\n  vec3 logRecovery = pow( recovery, gamma );\n  vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery;\n  vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr;\n  vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));\n  gl_FragColor = vec4( clampedHdrColor , 1.0 );\n}\n",uniforms:{sdr:{value:c},gainMap:{value:u},gamma:{value:new ZS(1/t[0],1/t[1],1/t[2])},offsetHdr:{value:(new ZS).fromArray(n)},offsetSdr:{value:(new ZS).fromArray(r)},gainMapMin:{value:(new ZS).fromArray(i)},gainMapMax:{value:(new ZS).fromArray(a)},weightFactor:{value:(Math.log2(o)-s)/(l-s)}},blending:Oy,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=o,this._hdrCapacityMin=s,this._hdrCapacityMax=l,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class pN extends Error{}class fN extends Error{}const mN=(e,t,n)=>{var r;let i;const a=null===(r=e.attributes.getNamedItem(t))||void 0===r?void 0:r.nodeValue;if(a)i=a;else{const r=e.getElementsByTagName(t)[0];if(!r){if(n)return n;throw new Error(`Can't find ${t} in gainmap metadata`)}{const e=r.getElementsByTagName("rdf:li");if(3!==e.length)throw new Error(`Gainmap metadata contains an array of items for ${t} but its length is not 3`);i=Array.from(e).map((e=>e.innerHTML))}}return i};class gN{constructor(e){this.options={debug:!(!e||void 0===e.debug)&&e.debug,extractFII:!e||void 0===e.extractFII||e.extractFII,extractNonFII:!e||void 0===e.extractNonFII||e.extractNonFII}}extract(e){return new Promise(((t,n)=>{const r=this.options.debug,i=new DataView(e.buffer);if(65496!==i.getUint16(0))return void n(new Error("Not a valid jpeg"));const a=i.byteLength;let o,s=2,l=0;for(;s<a;){if(++l>250)return void n(new Error(`Found no marker after ${l} loops \ud83d\ude35`));if(255!==i.getUint8(s))return void n(new Error(`Not a valid marker at offset 0x${s.toString(16)}, found: 0x${i.getUint8(s).toString(16)}`));if(o=i.getUint8(s+1),r&&console.log(`Marker: ${o.toString(16)}`),226===o){r&&console.log("Found APP2 marker (0xffe2)");const e=s+4;if(1297106432===i.getUint32(e)){const r=e+4;let a;if(18761===i.getUint16(r))a=!1;else{if(19789!==i.getUint16(r))return void n(new Error("No valid endianness marker found in TIFF header"));a=!0}if(42!==i.getUint16(r+2,!a))return void n(new Error("Not valid TIFF data! (no 0x002A marker)"));const o=i.getUint32(r+4,!a);if(o<8)return void n(new Error("Not valid TIFF data! (First offset less than 8)"));const s=r+o,l=i.getUint16(s,!a),c=s+2;let u=0;for(let e=c;e<c+12*l;e+=12)45057===i.getUint16(e,!a)&&(u=i.getUint32(e+8,!a));const d=s+2+12*l+4,h=[];for(let e=d;e<d+16*u;e+=16){const t={MPType:i.getUint32(e,!a),size:i.getUint32(e+4,!a),dataOffset:i.getUint32(e+8,!a),dependantImages:i.getUint32(e+12,!a),start:-1,end:-1,isFII:!1};t.dataOffset?(t.start=r+t.dataOffset,t.isFII=!1):(t.start=0,t.isFII=!0),t.end=t.start+t.size,h.push(t)}if(this.options.extractNonFII&&h.length){const e=new Blob([i]),n=[];for(const t of h){if(t.isFII&&!this.options.extractFII)continue;const r=e.slice(t.start,t.end+1,"image/jpeg");n.push(r)}t(n)}}}s+=2+i.getUint16(s+2)}}))}}const vN=async e=>{const t=(e=>{var t,n;let r;r="undefined"!==typeof TextDecoder?(new TextDecoder).decode(e):e.toString();let i=r.indexOf("<x:xmpmeta");const a=new DOMParser;for(;-1!==i;){const e=r.indexOf("x:xmpmeta>",i);r.slice(i,e+10);const o=r.slice(i,e+10);try{const e=a.parseFromString(o,"text/xml").getElementsByTagName("rdf:Description")[0],r=mN(e,"hdrgm:GainMapMin","0"),i=mN(e,"hdrgm:GainMapMax"),s=mN(e,"hdrgm:Gamma","1"),l=mN(e,"hdrgm:OffsetSDR","0.015625"),c=mN(e,"hdrgm:OffsetHDR","0.015625");let u=null===(t=e.attributes.getNamedItem("hdrgm:HDRCapacityMin"))||void 0===t?void 0:t.nodeValue;u||(u="0");const d=null===(n=e.attributes.getNamedItem("hdrgm:HDRCapacityMax"))||void 0===n?void 0:n.nodeValue;if(!d)throw new Error("Incomplete gainmap metadata");return{gainMapMin:Array.isArray(r)?r.map((e=>parseFloat(e))):[parseFloat(r),parseFloat(r),parseFloat(r)],gainMapMax:Array.isArray(i)?i.map((e=>parseFloat(e))):[parseFloat(i),parseFloat(i),parseFloat(i)],gamma:Array.isArray(s)?s.map((e=>parseFloat(e))):[parseFloat(s),parseFloat(s),parseFloat(s)],offsetSdr:Array.isArray(l)?l.map((e=>parseFloat(e))):[parseFloat(l),parseFloat(l),parseFloat(l)],offsetHdr:Array.isArray(c)?c.map((e=>parseFloat(e))):[parseFloat(c),parseFloat(c),parseFloat(c)],hdrCapacityMin:parseFloat(u),hdrCapacityMax:parseFloat(d)}}catch(uz){}i=r.indexOf("<x:xmpmeta",e)}})(e);if(!t)throw new fN("Gain map XMP metadata not found");const n=new gN({extractFII:!0,extractNonFII:!0}),r=await n.extract(e);if(2!==r.length)throw new pN("Gain map recovery image not found");return{sdr:new Uint8Array(await r[0].arrayBuffer()),gainMap:new Uint8Array(await r[1].arrayBuffer()),metadata:t}},yN=e=>new Promise(((t,n)=>{const r=document.createElement("img");r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=URL.createObjectURL(e)}));class bN extends gI{constructor(e,t){super(t),e&&(this._renderer=e),this._internalLoadingManager=new fI}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const e=new hN({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new VS,sdr:new VS});return new dN({width:16,height:16,type:tx,colorSpace:b_,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(e,t,n,r){const i=r?new Blob([r],{type:"image/jpeg"}):void 0,a=new Blob([n],{type:"image/jpeg"});let o,s,l=!1;if("undefined"===typeof createImageBitmap){const e=await Promise.all([i?yN(i):Promise.resolve(void 0),yN(a)]);s=e[0],o=e[1],l=!0}else{const e=await Promise.all([i?createImageBitmap(i,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(a,{imageOrientation:"flipY"})]);s=e[0],o=e[1]}const c=new VS(s||new ImageData(2,2),Rb,Ob,Ob,jb,Jb,lx,$b,1,b_);c.flipY=l,c.needsUpdate=!0;const u=new VS(o,Rb,Ob,Ob,jb,Jb,lx,$b,1,y_);u.flipY=l,u.needsUpdate=!0,e.width=o.width,e.height=o.height,e.material.gainMap=c,e.material.sdr=u,e.material.gainMapMin=t.gainMapMin,e.material.gainMapMax=t.gainMapMax,e.material.offsetHdr=t.offsetHdr,e.material.offsetSdr=t.offsetSdr,e.material.gamma=t.gamma,e.material.hdrCapacityMin=t.hdrCapacityMin,e.material.hdrCapacityMax=t.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,t.hdrCapacityMax),e.material.needsUpdate=!0,e.render()}}class xN extends bN{load(e,t,n,r){let[i,a,o]=e;const s=this.prepareQuadRenderer();let l,c,u;const d=async()=>{if(l&&c&&u){try{await this.render(s,u,l,c)}catch(cO){return this.manager.itemError(i),this.manager.itemError(a),this.manager.itemError(o),"function"===typeof r&&r(cO),void s.disposeOnDemandRenderer()}"function"===typeof t&&t(s),this.manager.itemEnd(i),this.manager.itemEnd(a),this.manager.itemEnd(o),s.disposeOnDemandRenderer()}};let h=!0,p=0,f=0,m=!0,g=0,v=0,y=!0,b=0,x=0;const _=()=>{if("function"===typeof n){n(new ProgressEvent("progress",{lengthComputable:h&&m&&y,loaded:f+v+x,total:p+g+b}))}};this.manager.itemStart(i),this.manager.itemStart(a),this.manager.itemStart(o);const S=new bI(this._internalLoadingManager);S.setResponseType("arraybuffer"),S.setRequestHeader(this.requestHeader),S.setPath(this.path),S.setWithCredentials(this.withCredentials),S.load(i,(async e=>{if("string"===typeof e)throw new Error("Invalid sdr buffer");l=e,await d()}),(e=>{h=e.lengthComputable,f=e.loaded,p=e.total,_()}),(e=>{this.manager.itemError(i),"function"===typeof r&&r(e)}));const w=new bI(this._internalLoadingManager);w.setResponseType("arraybuffer"),w.setRequestHeader(this.requestHeader),w.setPath(this.path),w.setWithCredentials(this.withCredentials),w.load(a,(async e=>{if("string"===typeof e)throw new Error("Invalid gainmap buffer");c=e,await d()}),(e=>{m=e.lengthComputable,v=e.loaded,g=e.total,_()}),(e=>{this.manager.itemError(a),"function"===typeof r&&r(e)}));const E=new bI(this._internalLoadingManager);return E.setRequestHeader(this.requestHeader),E.setPath(this.path),E.setWithCredentials(this.withCredentials),E.load(o,(async e=>{if("string"!==typeof e)throw new Error("Invalid metadata string");u=JSON.parse(e),await d()}),(e=>{y=e.lengthComputable,x=e.loaded,b=e.total,_()}),(e=>{this.manager.itemError(o),"function"===typeof r&&r(e)})),s}}class _N extends bN{load(e,t,n,r){const i=this.prepareQuadRenderer(),a=new bI(this._internalLoadingManager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(this.withCredentials),this.manager.itemStart(e),a.load(e,(async n=>{if("string"===typeof n)throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const a=new Uint8Array(n);let o,s,l;try{const e=await vN(a);o=e.sdr,s=e.gainMap,l=e.metadata}catch(uz){if(!(uz instanceof fN||uz instanceof pN))throw uz;console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),l={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},o=a}try{await this.render(i,l,o,s)}catch(cO){return this.manager.itemError(e),"function"===typeof r&&r(cO),void i.disposeOnDemandRenderer()}"function"===typeof t&&t(i),this.manager.itemEnd(e),i.disposeOnDemandRenderer()}),n,(t=>{this.manager.itemError(e),"function"===typeof r&&r(t)})),i}}const SN={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},wN=3e3,EN=3001,AN="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",MN=e=>Array.isArray(e),CN=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function TN(){let{files:e=CN,path:n="",preset:r,encoding:i,extensions:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=null,s=!1;r&&(BN(r),e=SN[r],n=AN),s=MN(e);const{extension:l,isCubemap:c}=IN(e);if(o=DN(l),!o)throw new Error("useEnvironment: Unrecognized file extension: "+e);const u=Bk((e=>e.gl));(0,t.useLayoutEffect)((()=>{"webp"!==l&&"jpg"!==l&&"jpeg"!==l||u.domElement.addEventListener("webglcontextlost",(function(){kk.clear(o,s?[e]:e)}),{once:!0})}),[e,u.domElement]);const d=kk(o,s?[e]:e,(e=>{"webp"!==l&&"jpg"!==l&&"jpeg"!==l||e.setRenderer(u),null==e.setPath||e.setPath(n),a&&a(e)}));let h=s?d[0]:d;var p;"jpg"!==l&&"jpeg"!==l&&"webp"!==l||(h=null==(p=h.renderTarget)?void 0:p.texture);return h.mapping=c?Pb:Ib,"colorSpace"in h?h.colorSpace=(null!==i&&void 0!==i?i:c)?"srgb":"srgb-linear":h.encoding=(null!==i&&void 0!==i?i:c)?EN:wN,h}const RN={files:CN,path:"",preset:void 0,extensions:void 0};TN.preload=e=>{const t={...RN,...e};let{files:n,path:r=""}=t;const{preset:i,extensions:a}=t;i&&(BN(i),n=SN[i],r=AN);const{extension:o}=IN(n);if("webp"===o||"jpg"===o||"jpeg"===o)throw new Error("useEnvironment: Preloading gainmaps is not supported");const s=DN(o);if(!s)throw new Error("useEnvironment: Unrecognized file extension: "+n);kk.preload(s,MN(n)?[n]:n,(e=>{null==e.setPath||e.setPath(r),a&&a(e)}))};const PN={files:CN,preset:void 0};function BN(e){if(!(e in SN))throw new Error("Preset must be one of: "+Object.keys(SN).join(", "))}function IN(e){var t;const n=MN(e)&&6===e.length,r=MN(e)&&3===e.length&&e.some((e=>e.endsWith("json"))),i=MN(e)?e[0]:e;return{extension:n?"cube":r?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":null==(t=i.split(".").pop())||null==(t=t.split("?"))||null==(t=t.shift())?void 0:t.toLowerCase(),isCubemap:n,isGainmap:r}}function DN(e){return"cube"===e?wI:"hdr"===e?PO:"exr"===e?lN:"jpg"===e||"jpeg"===e?_N:"webp"===e?xN:null}TN.clear=e=>{const t={...PN,...e};let{files:n}=t;const{preset:r}=t;r&&(BN(r),n=SN[r]);const{extension:i}=IN(n),a=DN(i);if(!a)throw new Error("useEnvironment: Unrecognized file extension: "+n);kk.clear(a,MN(n)?[n]:n)};const LN=e=>{return(t=e).current&&t.current.isScene?e.current:e;var t};function kN(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};var a,o,s,l,c;i={backgroundBlurriness:null!==(a=i.blur)&&void 0!==a?a:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};const u=LN(t||n),d=u.background,h=u.environment,p={backgroundBlurriness:u.backgroundBlurriness,backgroundIntensity:u.backgroundIntensity,backgroundRotation:null!==(o=null==(s=u.backgroundRotation)||null==s.clone?void 0:s.clone())&&void 0!==o?o:[0,0,0],environmentIntensity:u.environmentIntensity,environmentRotation:null!==(l=null==(c=u.environmentRotation)||null==c.clone?void 0:c.clone())&&void 0!==l?l:[0,0,0]};return"only"!==e&&(u.environment=r),e&&(u.background=r),zk(u,i),()=>{"only"!==e&&(u.environment=h),e&&(u.background=d),zk(u,p)}}function ON(e){let{scene:n,background:r=!1,map:i,...a}=e;const o=Bk((e=>e.scene));return t.useLayoutEffect((()=>{if(i)return kN(r,n,o,i,a)})),null}function NN(e){let{background:n=!1,scene:r,blur:i,backgroundBlurriness:a,backgroundIntensity:o,backgroundRotation:s,environmentIntensity:l,environmentRotation:c,...u}=e;const d=TN(u),h=Bk((e=>e.scene));return t.useLayoutEffect((()=>kN(n,r,h,d,{blur:i,backgroundBlurriness:a,backgroundIntensity:o,backgroundRotation:s,environmentIntensity:l,environmentRotation:c}))),null}function FN(e){let{children:n,near:r=1,far:i=1e3,resolution:a=256,frames:o=1,map:s,background:l=!1,blur:c,backgroundBlurriness:u,backgroundIntensity:d,backgroundRotation:h,environmentIntensity:p,environmentRotation:f,scene:m,files:g,path:v,preset:y,extensions:b}=e;const x=Bk((e=>e.gl)),_=Bk((e=>e.scene)),S=t.useRef(null),[w]=t.useState((()=>new RT)),E=t.useMemo((()=>{const e=new CA(a);return e.texture.type=tx,e}),[a]);t.useLayoutEffect((()=>(1===o&&S.current.update(x,w),kN(l,m,_,E.texture,{blur:c,backgroundBlurriness:u,backgroundIntensity:d,backgroundRotation:h,environmentIntensity:p,environmentRotation:f}))),[n,w,E.texture,m,_,l,o,x]);let A=1;return Ik((()=>{(o===1/0||A<o)&&(S.current.update(x,w),A++)})),t.createElement(t.Fragment,null,function(e,t,n){return(0,fi.jsx)(Xk,{children:e,container:t,state:n},t.uuid)}(t.createElement(t.Fragment,null,n,t.createElement("cubeCamera",{ref:S,args:[r,i,E]}),g||y?t.createElement(NN,{background:!0,files:g,preset:y,path:v,extensions:b}):s?t.createElement(ON,{background:!0,map:s,extensions:b}):null),w))}function UN(e){var n,r,i,a;const o=TN(e),s=e.map||o;t.useMemo((()=>UL({GroundProjectedEnvImpl:RO})),[]);const l=t.useMemo((()=>[s]),[s]),c=null==(n=e.ground)?void 0:n.height,u=null==(r=e.ground)?void 0:r.radius,d=null!==(i=null==(a=e.ground)?void 0:a.scale)&&void 0!==i?i:1e3;return t.createElement(t.Fragment,null,t.createElement(ON,xO({},e,{map:s})),t.createElement("groundProjectedEnvImpl",{args:l,scale:d,height:c,radius:u}))}function zN(e){return e.ground?t.createElement(UN,e):e.map?t.createElement(ON,e):e.children?t.createElement(FN,e):t.createElement(NN,e)}const HN=new WeakMap;class GN extends gI{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const i=new bI(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{const n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)}),n,r)}decodeDracoFile(e,t,n,r){const i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(const s in t.attributeTypes){const e=t.attributeTypes[s];void 0!==e.BYTES_PER_ELEMENT&&(t.attributeTypes[s]=e.name)}const n=JSON.stringify(t);if(HN.has(e)){const t=HN.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then((n=>(r=n,new Promise(((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return o.catch((()=>!0)).then((()=>{r&&i&&this._releaseTask(r,i)})),HN.set(e,{key:n,promise:o}),o}_createGeometry(e){const t=new JE;e.index&&t.setIndex(new PE(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n],i=r.name,a=r.array,o=r.itemSize;t.setAttribute(i,new PE(a,o))}return t}_loadLibrary(e,t){const n=new bI(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise(((t,r)=>{n.load(e,t,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!==typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const r=jN.toString(),i=["/* draco decoder */",n,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function jN(){let e,t;function n(e,t,n,r,i,a){const o=a.num_components(),s=n.num_points()*o,l=s*i.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),u=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,a,c,l,u);const d=new i(e.HEAPF32.buffer,u,s).slice();return e._free(u),{name:r,array:d,itemSize:o}}onmessage=function(r){const i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const r=i.buffer,a=i.taskConfig;t.then((e=>{const t=e.draco,o=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(r),r.byteLength);try{const e=function(e,t,r,i){const a=i.attributeIDs,o=i.attributeTypes;let s,l;const c=t.GetEncodedGeometryType(r);if(c===e.TRIANGULAR_MESH)s=new e.Mesh,l=t.DecodeBufferToMesh(r,s);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");s=new e.PointCloud,l=t.DecodeBufferToPointCloud(r,s)}if(!l.ok()||0===s.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const u={index:null,attributes:[]};for(const d in a){const r=self[o[d]];let l,c;if(i.useUniqueIDs)c=a[d],l=t.GetAttributeByUniqueId(s,c);else{if(c=t.GetAttributeId(s,e[a[d]]),-1===c)continue;l=t.GetAttribute(s,c)}u.attributes.push(n(e,t,s,d,r,l))}c===e.TRIANGULAR_MESH&&(u.index=function(e,t,n){const r=n.num_faces(),i=3*r,a=4*i,o=e._malloc(a);t.GetTrianglesUInt32Array(n,a,o);const s=new Uint32Array(e.HEAPF32.buffer,o,i).slice();return e._free(o),{array:s,itemSize:1}}(e,t,s));return e.destroy(s),u}(t,o,s,a),r=e.attributes.map((e=>e.array.buffer));e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},r)}catch(cO){console.error(cO),self.postMessage({type:"error",id:i.id,error:cO.message})}finally{t.destroy(s),t.destroy(o)}}))}}}let VN;const WN=()=>{if(VN)return VN;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!==typeof WebAssembly)return{supported:!1};let n,r="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(e)&&(r="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");const i=WebAssembly.instantiate(function(e){const n=new Uint8Array(e.length);for(let t=0;t<e.length;++t){const r=e.charCodeAt(t);n[t]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let r=0;for(let i=0;i<e.length;++i)n[r++]=n[i]<60?t[n[i]]:64*(n[i]-60)+n[++i];return n.buffer.slice(0,r)}(r),{}).then((e=>{n=e.instance,n.exports.__wasm_call_ctors()}));function a(e,t,r,i,a,o){const s=n.exports.sbrk,l=r+3&-4,c=s(l*i),u=s(a.length),d=new Uint8Array(n.exports.memory.buffer);d.set(a,u);const h=e(c,r,i,u,a.length);if(0===h&&o&&o(c,l,i),t.set(d.subarray(c,c+r*i)),s(c-s(0)),0!==h)throw new Error(`Malformed buffer data: ${h}`)}const o={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},s={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return VN={ready:i,supported:!0,decodeVertexBuffer(e,t,r,i,s){a(n.exports.meshopt_decodeVertexBuffer,e,t,r,i,n.exports[o[s]])},decodeIndexBuffer(e,t,r,i){a(n.exports.meshopt_decodeIndexBuffer,e,t,r,i)},decodeIndexSequence(e,t,r,i){a(n.exports.meshopt_decodeIndexSequence,e,t,r,i)},decodeGltfBuffer(e,t,r,i,l,c){a(n.exports[s[l]],e,t,r,i,n.exports[o[c]])}},VN};function XN(e,t){if(t===l_)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===u_||t===c_){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const r=n.count-2,i=[];if(n)if(t===u_)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2===0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=e.clone();return a.setIndex(i),a.clearGroups(),a}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}const JN=parseInt(Sy.replace(/\D+/g,""));function $N(e){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(uz){return t}}const KN="srgb",YN="srgb-linear";class qN extends gI{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new rF(e)})),this.register((function(e){return new iF(e)})),this.register((function(e){return new pF(e)})),this.register((function(e){return new fF(e)})),this.register((function(e){return new mF(e)})),this.register((function(e){return new oF(e)})),this.register((function(e){return new sF(e)})),this.register((function(e){return new lF(e)})),this.register((function(e){return new cF(e)})),this.register((function(e){return new nF(e)})),this.register((function(e){return new uF(e)})),this.register((function(e){return new aF(e)})),this.register((function(e){return new hF(e)})),this.register((function(e){return new dF(e)})),this.register((function(e){return new eF(e)})),this.register((function(e){return new gF(e)})),this.register((function(e){return new vF(e)}))}load(e,t,n,r){const i=this;let a;if(""!==this.resourcePath)a=this.resourcePath;else if(""!==this.path){const t=XI.extractUrlBase(e);a=XI.resolveURL(t,this.path)}else a=XI.extractUrlBase(e);this.manager.itemStart(e);const o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},s=new bI(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{i.parse(n,a,(function(n){t(n),i.manager.itemEnd(e)}),o)}catch(uz){o(uz)}}),n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i;const a={},o={};if("string"===typeof e)i=JSON.parse(e);else if(e instanceof ArrayBuffer){if($N(new Uint8Array(e.slice(0,4)))===yF){try{a[ZN.KHR_BINARY_GLTF]=new _F(e)}catch(cO){return void(r&&r(cO))}i=JSON.parse(a[ZN.KHR_BINARY_GLTF].content)}else i=JSON.parse($N(new Uint8Array(e)))}else i=e;if(void 0===i.asset||i.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const s=new XF(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(let l=0;l<this.pluginCallbacks.length;l++){const e=this.pluginCallbacks[l](s);e.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[e.name]=e,a[e.name]=!0}if(i.extensionsUsed)for(let l=0;l<i.extensionsUsed.length;++l){const e=i.extensionsUsed[l],t=i.extensionsRequired||[];switch(e){case ZN.KHR_MATERIALS_UNLIT:a[e]=new tF;break;case ZN.KHR_DRACO_MESH_COMPRESSION:a[e]=new SF(i,this.dracoLoader);break;case ZN.KHR_TEXTURE_TRANSFORM:a[e]=new wF;break;case ZN.KHR_MESH_QUANTIZATION:a[e]=new EF;break;default:t.indexOf(e)>=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}s.setExtensions(a),s.setPlugins(o),s.parse(n,r)}parseAsync(e,t){const n=this;return new Promise((function(r,i){n.parse(e,t,r,i)}))}}function QN(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const ZN={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class eF{constructor(e){this.parser=e,this.name=ZN.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const i=t.json,a=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let o;const s=new yE(16777215);void 0!==a.color&&s.setRGB(a.color[0],a.color[1],a.color[2],YN);const l=void 0!==a.range?a.range:0;switch(a.type){case"directional":o=new zI(s),o.target.position.set(0,0,-1),o.add(o.target);break;case"point":o=new FI(s),o.distance=l;break;case"spot":o=new DI(s),o.distance=l,a.spot=a.spot||{},a.spot.innerConeAngle=void 0!==a.spot.innerConeAngle?a.spot.innerConeAngle:0,a.spot.outerConeAngle=void 0!==a.spot.outerConeAngle?a.spot.outerConeAngle:Math.PI/4,o.angle=a.spot.outerConeAngle,o.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return o.position.set(0,0,0),o.decay=2,zF(o,a),void 0!==a.intensity&&(o.intensity=a.intensity),o.name=t.createUniqueName(a.name||"light_"+e),r=Promise.resolve(o),t.cache.add(n,r),r}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return n._getNodeRef(t.cache,i,e)}))}}class tF{constructor(){this.name=ZN.KHR_MATERIALS_UNLIT}getMaterialType(){return SE}extendParams(e,t,n){const r=[];e.color=new yE(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],YN),e.opacity=t[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture,KN))}return Promise.all(r)}}class nF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class rF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&i.push(n.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&i.push(n.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(i.push(n.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){const e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new _S(e,e)}return Promise.all(i)}}class iF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_DISPERSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.dispersion=void 0!==r.dispersion?r.dispersion:0,Promise.resolve()}}class aF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];return void 0!==a.iridescenceFactor&&(t.iridescence=a.iridescenceFactor),void 0!==a.iridescenceTexture&&i.push(n.assignTexture(t,"iridescenceMap",a.iridescenceTexture)),void 0!==a.iridescenceIor&&(t.iridescenceIOR=a.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==a.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),void 0!==a.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),void 0!==a.iridescenceThicknessTexture&&i.push(n.assignTexture(t,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(i)}}class oF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new yE(0,0,0),t.sheenRoughness=0,t.sheen=1;const a=r.extensions[this.name];if(void 0!==a.sheenColorFactor){const e=a.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],YN)}return void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&i.push(n.assignTexture(t,"sheenColorMap",a.sheenColorTexture,KN)),void 0!==a.sheenRoughnessTexture&&i.push(n.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(i)}}class sF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];return void 0!==a.transmissionFactor&&(t.transmission=a.transmissionFactor),void 0!==a.transmissionTexture&&i.push(n.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(i)}}class lF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&i.push(n.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;const o=a.attenuationColor||[1,1,1];return t.attenuationColor=(new yE).setRGB(o[0],o[1],o[2],YN),Promise.all(i)}}class cF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class uF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&i.push(n.assignTexture(t,"specularIntensityMap",a.specularTexture));const o=a.specularColorFactor||[1,1,1];return t.specularColor=(new yE).setRGB(o[0],o[1],o[2],YN),void 0!==a.specularColorTexture&&i.push(n.assignTexture(t,"specularColorMap",a.specularColorTexture,KN)),Promise.all(i)}}class dF{constructor(e){this.parser=e,this.name=ZN.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];return t.bumpScale=void 0!==a.bumpFactor?a.bumpFactor:1,void 0!==a.bumpTexture&&i.push(n.assignTexture(t,"bumpMap",a.bumpTexture)),Promise.all(i)}}class hF{constructor(e){this.parser=e,this.name=ZN.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?zB:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],a=r.extensions[this.name];return void 0!==a.anisotropyStrength&&(t.anisotropy=a.anisotropyStrength),void 0!==a.anisotropyRotation&&(t.anisotropyRotation=a.anisotropyRotation),void 0!==a.anisotropyTexture&&i.push(n.assignTexture(t,"anisotropyMap",a.anisotropyTexture)),Promise.all(i)}}class pF{constructor(e){this.parser=e,this.name=ZN.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const i=r.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,a)}}class fF{constructor(e){this.parser=e,this.name=ZN.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const a=i.extensions[t],o=r.images[a.source];let s=n.textureLoader;if(o.uri){const e=n.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class mF{constructor(e){this.parser=e,this.name=ZN.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const a=i.extensions[t],o=r.images[a.source];let s=n.textureLoader;if(o.uri){const e=n.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class gF{constructor(e){this.name=ZN.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],r=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then((function(t){const n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t}))}))}return null}}class vF{constructor(e){this.name=ZN.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||void 0===n.mesh)return null;const r=t.meshes[n.mesh];for(const s of r.primitives)if(s.mode!==TF.TRIANGLES&&s.mode!==TF.TRIANGLE_STRIP&&s.mode!==TF.TRIANGLE_FAN&&void 0!==s.mode)return null;const i=n.extensions[this.name].attributes,a=[],o={};for(const s in i)a.push(this.parser.getDependency("accessor",i[s]).then((e=>(o[s]=e,o[s]))));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then((e=>{const t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(const a of n){const e=new Rw,t=new ZS,n=new QS,s=new ZS(1,1,1),l=new _R(a.geometry,a.material,r);for(let i=0;i<r;i++)o.TRANSLATION&&t.fromBufferAttribute(o.TRANSLATION,i),o.ROTATION&&n.fromBufferAttribute(o.ROTATION,i),o.SCALE&&s.fromBufferAttribute(o.SCALE,i),l.setMatrixAt(i,e.compose(t,n,s));for(const r in o)if("_COLOR_0"===r){const e=o[r];l.instanceColor=new pR(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==r&&"ROTATION"!==r&&"SCALE"!==r&&a.geometry.setAttribute(r,o[r]);nE.prototype.copy.call(l,a),this.parser.assignFinalMaterial(l),i.push(l)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]})))}}const yF="glTF",bF=1313821514,xF=5130562;class _F{constructor(e){this.name=ZN.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:$N(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==yF)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,r=new DataView(e,12);let i=0;for(;i<n;){const t=r.getUint32(i,!0);i+=4;const n=r.getUint32(i,!0);if(i+=4,n===bF){const n=new Uint8Array(e,12+i,t);this.content=$N(n)}else if(n===xF){const n=12+i;this.body=e.slice(n,n+t)}i+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class SF{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ZN.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},l={};for(const c in a){const e=DF[c]||c.toLowerCase();o[e]=a[c]}for(const c in e.attributes){const t=DF[c]||c.toLowerCase();if(void 0!==a[c]){const r=n.accessors[e.attributes[c]],i=RF[r.componentType];l[t]=i.name,s[t]=!0===r.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t,n){r.decodeDracoFile(e,(function(e){for(const t in e.attributes){const n=e.attributes[t],r=s[t];void 0!==r&&(n.normalized=r)}t(e)}),o,l,YN,n)}))}))}}class wF{constructor(){this.name=ZN.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&t.texCoord!==e.channel||void 0!==t.offset||void 0!==t.rotation||void 0!==t.scale?(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e):e}}class EF{constructor(){this.name=ZN.KHR_MESH_QUANTIZATION}}class AF extends ZB{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let a=0;a!==r;a++)t[a]=n[i+a];return t}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,c=r-t,u=(n-t)/c,d=u*u,h=d*u,p=e*l,f=p-l,m=-2*h+3*d,g=h-d,v=1-m,y=g-d+u;for(let b=0;b!==o;b++){const e=a[f+b+o],t=a[f+b+s]*c,n=a[p+b+o],r=a[p+b]*c;i[b]=v*e+y*t+m*n+g*r}return i}}const MF=new QS;class CF extends AF{interpolate_(e,t,n,r){const i=super.interpolate_(e,t,n,r);return MF.fromArray(i).normalize().toArray(i),i}}const TF={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},RF={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},PF={9728:Fb,9729:jb,9984:Ub,9985:Vb,9986:Hb,9987:Xb},BF={33071:Ob,33648:Nb,10497:kb},IF={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},DF={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...JN>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},LF={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},kF={CUBICSPLINE:void 0,LINEAR:t_,STEP:e_},OF="OPAQUE",NF="MASK",FF="BLEND";function UF(e,t,n){for(const r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function zF(e,t){void 0!==t.extras&&("object"===typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function HF(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){const n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function GF(e){let t;const n=e.extensions&&e.extensions[ZN.KHR_DRACO_MESH_COMPRESSION];if(t=n?"draco:"+n.bufferView+":"+n.indices+":"+jF(n.attributes):e.indices+":"+jF(e.attributes)+":"+e.mode,void 0!==e.targets)for(let r=0,i=e.targets.length;r<i;r++)t+=":"+jF(e.targets[r]);return t}function jF(e){let t="";const n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function VF(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}const WF=new Rw;class XF{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new QN,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=!1,i=-1;"undefined"!==typeof navigator&&"undefined"!==typeof navigator.userAgent&&(n=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),r=navigator.userAgent.indexOf("Firefox")>-1,i=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"===typeof createImageBitmap||n||r&&i<98?this.textureLoader=new AI(this.options.manager):this.textureLoader=new ZI(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new bI(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return UF(i,a,r),zF(a,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(a)}))).then((function(){for(const e of a.scenes)e.updateMatrixWorld();e(a)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,i=t.length;r<i;r++){const n=t[r].joints;for(let t=0,r=n.length;t<r;t++)e[n[t]].isBone=!0}for(let r=0,i=e.length;r<i;r++){const t=e[r];void 0!==t.mesh&&(this._addNodeRef(this.meshCache,t.mesh),void 0!==t.skin&&(n[t.mesh].isSkinnedMesh=!0)),void 0!==t.camera&&this._addNodeRef(this.cameraCache,t.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),i=(e,t)=>{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[r,a]of e.children.entries())i(a,t.children[r])};return i(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne((function(e){return e.loadNode&&e.loadNode(t)}));break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne((function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)})),!r)throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[ZN.KHR_BINARY_GLTF].body);const r=this.options;return new Promise((function(e,i){n.load(XI.resolveURL(t.uri,r.path),e,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse){const e=IF[r.type],t=RF[r.componentType],n=!0===r.normalized,i=new t(r.count*e);return Promise.resolve(new PE(i,e,n))}const i=[];return void 0!==r.bufferView?i.push(this.getDependency("bufferView",r.bufferView)):i.push(null),void 0!==r.sparse&&(i.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(i).then((function(e){const i=e[0],a=IF[r.type],o=RF[r.componentType],s=o.BYTES_PER_ELEMENT,l=s*a,c=r.byteOffset||0,u=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,d=!0===r.normalized;let h,p;if(u&&u!==l){const e=Math.floor(c/u),n="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count;let l=t.cache.get(n);l||(h=new o(i,e*u,r.count*u/s),l=new PT(h,u/s),t.cache.add(n,l)),p=new IT(l,a,c%u/s,d)}else h=null===i?new o(r.count*a):new o(i,c,r.count*a),p=new PE(h,a,d);if(void 0!==r.sparse){const t=IF.SCALAR,n=RF[r.sparse.indices.componentType],s=r.sparse.indices.byteOffset||0,l=r.sparse.values.byteOffset||0,c=new n(e[1],s,r.sparse.count*t),u=new o(e[2],l,r.sparse.count*a);null!==i&&(p=new PE(p.array.slice(),p.itemSize,p.normalized));for(let e=0,r=c.length;e<r;e++){const t=c[e];if(p.setX(t,u[e*a]),a>=2&&p.setY(t,u[e*a+1]),a>=3&&p.setZ(t,u[e*a+2]),a>=4&&p.setW(t,u[e*a+3]),a>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r];let a=this.textureLoader;if(i.uri){const e=n.manager.getHandler(i.uri);null!==e&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){const r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[s])return this.textureCache[s];const l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"===typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);const n=(i.samplers||{})[a.sampler]||{};return t.magFilter=PF[n.magFilter]||jb,t.minFilter=PF[n.minFilter]||Xb,t.wrapS=BF[n.wrapS]||kb,t.wrapT=BF[n.wrapT]||kb,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[s]=l,l}loadImageSource(e,t){const n=this,r=this.json,i=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const a=r.images[e],o=self.URL||self.webkitURL;let s=a.uri||"",l=!1;if(void 0!==a.bufferView)s=n.getDependency("bufferView",a.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s}));else if(void 0===a.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(s).then((function(e){return new Promise((function(n,r){let a=n;!0===t.isImageBitmapLoader&&(a=function(e){const t=new VS(e);t.needsUpdate=!0,n(t)}),t.load(XI.resolveURL(e,i.path),a,void 0,r)}))})).then((function(e){var t;return!0===l&&o.revokeObjectURL(s),zF(e,a),e.userData.mimeType=a.mimeType||((t=a.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",s),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,n,r){const i=this;return this.getDependency("texture",n.index).then((function(a){if(!a)return null;if(void 0!==n.texCoord&&n.texCoord>0&&((a=a.clone()).channel=n.texCoord),i.extensions[ZN.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[ZN.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(a);a=i.extensions[ZN.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return void 0!==r&&("number"===typeof r&&(r=3001===r?KN:YN),"colorSpace"in a?a.colorSpace=r:a.encoding=r===KN?3001:3e3),e[t]=a,a}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new tP,_E.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new HR,_E.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e="ClonedMaterial:"+n.uuid+":";r&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return UB}loadMaterial(e){const t=this,n=this.json,r=this.extensions,i=n.materials[e];let a;const o={},s=[];if((i.extensions||{})[ZN.KHR_MATERIALS_UNLIT]){const e=r[ZN.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),s.push(e.extendParams(o,i,t))}else{const n=i.pbrMetallicRoughness||{};if(o.color=new yE(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],YN),o.opacity=e[3]}void 0!==n.baseColorTexture&&s.push(t.assignTexture(o,"map",n.baseColorTexture,KN)),o.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,o.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(s.push(t.assignTexture(o,"metalnessMap",n.metallicRoughnessTexture)),s.push(t.assignTexture(o,"roughnessMap",n.metallicRoughnessTexture))),a=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),s.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===i.doubleSided&&(o.side=ky);const l=i.alphaMode||OF;if(l===FF?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===NF&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&a!==SE&&(s.push(t.assignTexture(o,"normalMap",i.normalTexture)),o.normalScale=new _S(1,1),void 0!==i.normalTexture.scale)){const e=i.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==i.occlusionTexture&&a!==SE&&(s.push(t.assignTexture(o,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&a!==SE){const e=i.emissiveFactor;o.emissive=(new yE).setRGB(e[0],e[1],e[2],YN)}return void 0!==i.emissiveTexture&&a!==SE&&s.push(t.assignTexture(o,"emissiveMap",i.emissiveTexture,KN)),Promise.all(s).then((function(){const n=new a(o);return i.name&&(n.name=i.name),zF(n,i),t.associations.set(n,{materials:e}),i.extensions&&UF(r,n,i),n}))}createUniqueName(e){const t=TD.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[ZN.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return JF(n,e,t)}))}const a=[];for(let o=0,s=e.length;o<s;o++){const n=e[o],s=GF(n),l=r[s];if(l)a.push(l.promise);else{let e;e=n.extensions&&n.extensions[ZN.KHR_DRACO_MESH_COMPRESSION]?i(n):JF(new JE,n,t),r[s]={primitive:n,promise:e},a.push(e)}}return Promise.all(a)}loadMesh(e){const t=this,n=this.json,r=this.extensions,i=n.meshes[e],a=i.primitives,o=[];for(let l=0,c=a.length;l<c;l++){const e=void 0===a[l].material?(void 0===(s=this.cache).DefaultMaterial&&(s.DefaultMaterial=new UB({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Dy})),s.DefaultMaterial):this.getDependency("material",a[l].material);o.push(e)}var s;return o.push(t.loadGeometries(a)),Promise.all(o).then((function(n){const o=n.slice(0,n.length-1),s=n[n.length-1],l=[];for(let u=0,d=s.length;u<d;u++){const n=s[u],c=a[u];let d;const h=o[u];if(c.mode===TF.TRIANGLES||c.mode===TF.TRIANGLE_STRIP||c.mode===TF.TRIANGLE_FAN||void 0===c.mode)d=!0===i.isSkinnedMesh?new sR(n,h):new dA(n,h),!0===d.isSkinnedMesh&&d.normalizeSkinWeights(),c.mode===TF.TRIANGLE_STRIP?d.geometry=XN(d.geometry,c_):c.mode===TF.TRIANGLE_FAN&&(d.geometry=XN(d.geometry,u_));else if(c.mode===TF.LINES)d=new ZR(n,h);else if(c.mode===TF.LINE_STRIP)d=new KR(n,h);else if(c.mode===TF.LINE_LOOP)d=new eP(n,h);else{if(c.mode!==TF.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+c.mode);d=new oP(n,h)}Object.keys(d.geometry.morphAttributes).length>0&&HF(d,i),d.name=t.createUniqueName(i.name||"mesh_"+e),zF(d,i),c.extensions&&UF(r,d,c),t.assignFinalMaterial(d),l.push(d)}for(let r=0,i=l.length;r<i;r++)t.associations.set(l[r],{meshes:e,primitives:r});if(1===l.length)return i.extensions&&UF(r,l[0],i),l[0];const c=new vT;i.extensions&&UF(r,c,i),t.associations.set(c,{meshes:e});for(let e=0,t=l.length;e<t;e++)c.add(l[e]);return c}))}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new wA(xS.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new YA(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),zF(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,i=t.joints.length;r<i;r++)n.push(this._loadNodeShallow(t.joints[r]));return void 0!==t.inverseBindMatrices?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then((function(e){const n=e.pop(),r=e,i=[],a=[];for(let o=0,s=r.length;o<s;o++){const e=r[o];if(e){i.push(e);const t=new Rw;null!==n&&t.fromArray(n.array,16*o),a.push(t)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[o])}return new hR(i,a)}))}loadAnimation(e){const t=this.json,n=this,r=t.animations[e],i=r.name?r.name:"animation_"+e,a=[],o=[],s=[],l=[],c=[];for(let u=0,d=r.channels.length;u<d;u++){const e=r.channels[u],t=r.samplers[e.sampler],n=e.target,i=n.node,d=void 0!==r.parameters?r.parameters[t.input]:t.input,h=void 0!==r.parameters?r.parameters[t.output]:t.output;void 0!==n.node&&(a.push(this.getDependency("node",i)),o.push(this.getDependency("accessor",d)),s.push(this.getDependency("accessor",h)),l.push(t),c.push(n))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(l),Promise.all(c)]).then((function(e){const t=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=[];for(let i=0,c=t.length;i<c;i++){const e=t[i],c=r[i],u=a[i],d=o[i],h=s[i];if(void 0===e)continue;e.updateMatrix&&e.updateMatrix();const p=n._createAnimationTracks(e,c,u,d,h);if(p)for(let t=0;t<p.length;t++)l.push(p[t])}return new dI(i,void 0,l)}))}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){const t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}loadNode(e){const t=this,n=this.json.nodes[e],r=t._loadNodeShallow(e),i=[],a=n.children||[];for(let s=0,l=a.length;s<l;s++)i.push(t.getDependency("node",a[s]));const o=void 0===n.skin?Promise.resolve(null):t.getDependency("skin",n.skin);return Promise.all([r,Promise.all(i),o]).then((function(e){const t=e[0],n=e[1],r=e[2];null!==r&&t.traverse((function(e){e.isSkinnedMesh&&e.bind(r,WF)}));for(let i=0,a=n.length;i<a;i++)t.add(n[i]);return t}))}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];const i=t.nodes[e],a=i.name?r.createUniqueName(i.name):"",o=[],s=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return s&&o.push(s),void 0!==i.camera&&o.push(r.getDependency("camera",i.camera).then((function(e){return r._getNodeRef(r.cameraCache,i.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){o.push(e)})),this.nodeCache[e]=Promise.all(o).then((function(t){let o;if(o=!0===i.isBone?new lR:t.length>1?new vT:1===t.length?t[0]:new nE,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),zF(o,i),i.extensions&&UF(n,o,i),void 0!==i.matrix){const e=new Rw;e.fromArray(i.matrix),o.applyMatrix4(e)}else void 0!==i.translation&&o.position.fromArray(i.translation),void 0!==i.rotation&&o.quaternion.fromArray(i.rotation),void 0!==i.scale&&o.scale.fromArray(i.scale);return r.associations.has(o)||r.associations.set(o,{}),r.associations.get(o).nodes=e,o})),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,i=new vT;n.name&&(i.name=r.createUniqueName(n.name)),zF(i,n),n.extensions&&UF(t,i,n);const a=n.nodes||[],o=[];for(let s=0,l=a.length;s<l;s++)o.push(r.getDependency("node",a[s]));return Promise.all(o).then((function(e){for(let t=0,n=e.length;t<n;t++)i.add(e[t]);return r.associations=(e=>{const t=new Map;for(const[n,i]of r.associations)(n instanceof _E||n instanceof VS)&&t.set(n,i);return e.traverse((e=>{const n=r.associations.get(e);null!=n&&t.set(e,n)})),t})(i),i}))}_createAnimationTracks(e,t,n,r,i){const a=[],o=e.name?e.name:e.uuid,s=[];let l;switch(LF[i.path]===LF.weights?e.traverse((function(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)})):s.push(o),LF[i.path]){case LF.weights:l=oI;break;case LF.rotation:l=lI;break;case LF.position:case LF.scale:l=uI;break;default:if(1===n.itemSize)l=oI;else l=uI}const c=void 0!==r.interpolation?kF[r.interpolation]:t_,u=this._getArrayFromAccessor(n);for(let d=0,h=s.length;d<h;d++){const e=new l(s[d]+"."+LF[i.path],t.array,u,c);"CUBICSPLINE"===r.interpolation&&this._createCubicSplineTrackInterpolant(e),a.push(e)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const e=VF(t.constructor),n=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=t[r]*e;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof lI?CF:AF)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function JF(e,t,n){const r=t.attributes,i=[];function a(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(const o in r){const t=DF[o]||o.toLowerCase();t in e.attributes||i.push(a(r[o],t))}if(void 0!==t.indices&&!e.index){const r=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));i.push(r)}return zF(e,t),function(e,t,n){const r=t.attributes,i=new nw;if(void 0===r.POSITION)return;{const e=n.json.accessors[r.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new ZS(t[0],t[1],t[2]),new ZS(a[0],a[1],a[2])),e.normalized){const t=VF(RF[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}const a=t.targets;if(void 0!==a){const e=new ZS,t=new ZS;for(let r=0,i=a.length;r<i;r++){const i=a[r];if(void 0!==i.POSITION){const r=n.json.accessors[i.POSITION],a=r.min,o=r.max;if(void 0!==a&&void 0!==o){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),r.normalized){const e=VF(RF[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;const o=new xw;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}(e,t,n),Promise.all(i).then((function(){return void 0!==t.targets?function(e,t,n){let r=!1,i=!1,a=!1;for(let c=0,u=t.length;c<u;c++){const e=t[c];if(void 0!==e.POSITION&&(r=!0),void 0!==e.NORMAL&&(i=!0),void 0!==e.COLOR_0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(e);const o=[],s=[],l=[];for(let c=0,u=t.length;c<u;c++){const u=t[c];if(r){const t=void 0!==u.POSITION?n.getDependency("accessor",u.POSITION):e.attributes.position;o.push(t)}if(i){const t=void 0!==u.NORMAL?n.getDependency("accessor",u.NORMAL):e.attributes.normal;s.push(t)}if(a){const t=void 0!==u.COLOR_0?n.getDependency("accessor",u.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(l)]).then((function(t){const n=t[0],o=t[1],s=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),a&&(e.morphAttributes.color=s),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}let $F=null,KF="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function YF(e,t,n){return r=>{n&&n(r),e&&($F||($F=new GN),$F.setDecoderPath("string"===typeof e?e:KF),r.setDRACOLoader($F)),t&&r.setMeshoptDecoder("function"===typeof WN?WN():WN)}}function qF(e){return kk(qN,e,YF(!(arguments.length>1&&void 0!==arguments[1])||arguments[1],!(arguments.length>2&&void 0!==arguments[2])||arguments[2],arguments.length>3?arguments[3]:void 0))}qF.preload=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0;return kk.preload(qN,e,YF(t,n,r))},qF.clear=e=>kk.clear(qN,e),qF.setDecoderPath=e=>{KF=e};function QF(e,n,r){const i=Bk((e=>e.size)),a=Bk((e=>e.viewport)),o="number"===typeof e?e:i.width*a.dpr,s="number"===typeof n?n:i.height*a.dpr,l=("number"===typeof e?r:e)||{},{samples:c=0,depth:u,...d}=l,h=t.useMemo((()=>{const e=new JS(o,s,{minFilter:jb,magFilter:jb,type:tx,...d});return u&&(e.depthTexture=new _M(o,s,ex)),e.samples=c,e}),[]);return t.useLayoutEffect((()=>{h.setSize(o,s),c&&(h.samples=c)}),[c,h,o,s]),t.useEffect((()=>()=>h.dispose()),[]),h}function ZF(e,t,n,r){const i=class extends yA{constructor(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=Object.entries(e);super({uniforms:a.reduce(((e,t)=>{let[n,r]=t;return{...e,...vA.clone({[n]:{value:r}})}}),{}),vertexShader:t,fragmentShader:n}),this.key="",a.forEach((e=>{let[t]=e;return Object.defineProperty(this,t,{get:()=>this.uniforms[t].value,set:e=>this.uniforms[t].value=e})})),Object.assign(this,i),r&&r(this)}};return i.key=xS.generateUUID(),i}const eU=ZF({},"void main() { }","void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard;  }");class tU extends zB{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.uniforms={chromaticAberration:{value:.05},transmission:{value:0},_transmission:{value:1},transmissionMap:{value:null},roughness:{value:0},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:1/0},attenuationColor:{value:new yE("white")},anisotropicBlur:{value:.1},time:{value:0},distortion:{value:0},distortionScale:{value:.5},temporalDistortion:{value:0},buffer:{value:null}},this.onBeforeCompile=n=>{n.uniforms={...n.uniforms,...this.uniforms},this.anisotropy>0&&(n.defines.USE_ANISOTROPY=""),t?n.defines.USE_SAMPLER="":n.defines.USE_TRANSMISSION="",n.fragmentShader="\n      uniform float chromaticAberration;         \n      uniform float anisotropicBlur;      \n      uniform float time;\n      uniform float distortion;\n      uniform float distortionScale;\n      uniform float temporalDistortion;\n      uniform sampler2D buffer;\n\n      vec3 random3(vec3 c) {\n        float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0)));\n        vec3 r;\n        r.z = fract(512.0*j);\n        j *= .125;\n        r.x = fract(512.0*j);\n        j *= .125;\n        r.y = fract(512.0*j);\n        return r-0.5;\n      }\n\n      uint hash( uint x ) {\n        x += ( x << 10u );\n        x ^= ( x >>  6u );\n        x += ( x <<  3u );\n        x ^= ( x >> 11u );\n        x += ( x << 15u );\n        return x;\n      }\n\n      // Compound versions of the hashing algorithm I whipped together.\n      uint hash( uvec2 v ) { return hash( v.x ^ hash(v.y)                         ); }\n      uint hash( uvec3 v ) { return hash( v.x ^ hash(v.y) ^ hash(v.z)             ); }\n      uint hash( uvec4 v ) { return hash( v.x ^ hash(v.y) ^ hash(v.z) ^ hash(v.w) ); }\n\n      // Construct a float with half-open range [0:1] using low 23 bits.\n      // All zeroes yields 0.0, all ones yields the next smallest representable value below 1.0.\n      float floatConstruct( uint m ) {\n        const uint ieeeMantissa = 0x007FFFFFu; // binary32 mantissa bitmask\n        const uint ieeeOne      = 0x3F800000u; // 1.0 in IEEE binary32\n        m &= ieeeMantissa;                     // Keep only mantissa bits (fractional part)\n        m |= ieeeOne;                          // Add fractional part to 1.0\n        float  f = uintBitsToFloat( m );       // Range [1:2]\n        return f - 1.0;                        // Range [0:1]\n      }\n\n      // Pseudo-random value in half-open range [0:1].\n      float randomBase( float x ) { return floatConstruct(hash(floatBitsToUint(x))); }\n      float randomBase( vec2  v ) { return floatConstruct(hash(floatBitsToUint(v))); }\n      float randomBase( vec3  v ) { return floatConstruct(hash(floatBitsToUint(v))); }\n      float randomBase( vec4  v ) { return floatConstruct(hash(floatBitsToUint(v))); }\n      float rand(float seed) {\n        float result = randomBase(vec3(gl_FragCoord.xy, seed));\n        return result;\n      }\n\n      const float F3 =  0.3333333;\n      const float G3 =  0.1666667;\n\n      float snoise(vec3 p) {\n        vec3 s = floor(p + dot(p, vec3(F3)));\n        vec3 x = p - s + dot(s, vec3(G3));\n        vec3 e = step(vec3(0.0), x - x.yzx);\n        vec3 i1 = e*(1.0 - e.zxy);\n        vec3 i2 = 1.0 - e.zxy*(1.0 - e);\n        vec3 x1 = x - i1 + G3;\n        vec3 x2 = x - i2 + 2.0*G3;\n        vec3 x3 = x - 1.0 + 3.0*G3;\n        vec4 w, d;\n        w.x = dot(x, x);\n        w.y = dot(x1, x1);\n        w.z = dot(x2, x2);\n        w.w = dot(x3, x3);\n        w = max(0.6 - w, 0.0);\n        d.x = dot(random3(s), x);\n        d.y = dot(random3(s + i1), x1);\n        d.z = dot(random3(s + i2), x2);\n        d.w = dot(random3(s + 1.0), x3);\n        w *= w;\n        w *= w;\n        d *= w;\n        return dot(d, vec4(52.0));\n      }\n\n      float snoiseFractal(vec3 m) {\n        return 0.5333333* snoise(m)\n              +0.2666667* snoise(2.0*m)\n              +0.1333333* snoise(4.0*m)\n              +0.0666667* snoise(8.0*m);\n      }\n"+n.fragmentShader,n.fragmentShader=n.fragmentShader.replace("#include <transmission_pars_fragment>","\n        #ifdef USE_TRANSMISSION\n          // Transmission code is based on glTF-Sampler-Viewer\n          // https://github.com/KhronosGroup/glTF-Sample-Viewer\n          uniform float _transmission;\n          uniform float thickness;\n          uniform float attenuationDistance;\n          uniform vec3 attenuationColor;\n          #ifdef USE_TRANSMISSIONMAP\n            uniform sampler2D transmissionMap;\n          #endif\n          #ifdef USE_THICKNESSMAP\n            uniform sampler2D thicknessMap;\n          #endif\n          uniform vec2 transmissionSamplerSize;\n          uniform sampler2D transmissionSamplerMap;\n          uniform mat4 modelMatrix;\n          uniform mat4 projectionMatrix;\n          varying vec3 vWorldPosition;\n          vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n            // Direction of refracted light.\n            vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n            // Compute rotation-independant scaling of the model matrix.\n            vec3 modelScale;\n            modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n            modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n            modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n            // The thickness is specified in local space.\n            return normalize( refractionVector ) * thickness * modelScale;\n          }\n          float applyIorToRoughness( const in float roughness, const in float ior ) {\n            // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and\n            // an IOR of 1.5 results in the default amount of microfacet refraction.\n            return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n          }\n          vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n            float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );            \n            #ifdef USE_SAMPLER\n              #ifdef texture2DLodEXT\n                return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod);\n              #else\n                return texture2D(transmissionSamplerMap, fragCoord.xy, framebufferLod);\n              #endif\n            #else\n              return texture2D(buffer, fragCoord.xy);\n            #endif\n          }\n          vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n            if ( isinf( attenuationDistance ) ) {\n              // Attenuation distance is +\u221e, i.e. the transmitted color is not attenuated at all.\n              return radiance;\n            } else {\n              // Compute light attenuation using Beer's law.\n              vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n              vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); // Beer's law\n              return transmittance * radiance;\n            }\n          }\n          vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n            const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n            const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n            const in vec3 attenuationColor, const in float attenuationDistance ) {\n            vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n            vec3 refractedRayExit = position + transmissionRay;\n            // Project refracted vector on the framebuffer, while mapping to normalized device coordinates.\n            vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n            vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n            refractionCoords += 1.0;\n            refractionCoords /= 2.0;\n            // Sample framebuffer to get pixel the refracted ray hits.\n            vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n            vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n            // Get the specular component.\n            vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n            return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n          }\n        #endif\n"),n.fragmentShader=n.fragmentShader.replace("#include <transmission_fragment>",`  \n        // Improve the refraction to use the world pos\n        material.transmission = _transmission;\n        material.transmissionAlpha = 1.0;\n        material.thickness = thickness;\n        material.attenuationDistance = attenuationDistance;\n        material.attenuationColor = attenuationColor;\n        #ifdef USE_TRANSMISSIONMAP\n          material.transmission *= texture2D( transmissionMap, vUv ).r;\n        #endif\n        #ifdef USE_THICKNESSMAP\n          material.thickness *= texture2D( thicknessMap, vUv ).g;\n        #endif\n        \n        vec3 pos = vWorldPosition;\n        float runningSeed = 0.0;\n        vec3 v = normalize( cameraPosition - pos );\n        vec3 n = inverseTransformDirection( normal, viewMatrix );\n        vec3 transmission = vec3(0.0);\n        float transmissionR, transmissionB, transmissionG;\n        float randomCoords = rand(runningSeed++);\n        float thickness_smear = thickness * max(pow(roughnessFactor, 0.33), anisotropicBlur);\n        vec3 distortionNormal = vec3(0.0);\n        vec3 temporalOffset = vec3(time, -time, -time) * temporalDistortion;\n        if (distortion > 0.0) {\n          distortionNormal = distortion * vec3(snoiseFractal(vec3((pos * distortionScale + temporalOffset))), snoiseFractal(vec3(pos.zxy * distortionScale - temporalOffset)), snoiseFractal(vec3(pos.yxz * distortionScale + temporalOffset)));\n        }\n        for (float i = 0.0; i < ${e}.0; i ++) {\n          vec3 sampleNorm = normalize(n + roughnessFactor * roughnessFactor * 2.0 * normalize(vec3(rand(runningSeed++) - 0.5, rand(runningSeed++) - 0.5, rand(runningSeed++) - 0.5)) * pow(rand(runningSeed++), 0.33) + distortionNormal);\n          transmissionR = getIBLVolumeRefraction(\n            sampleNorm, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n            pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness  + thickness_smear * (i + randomCoords) / float(${e}),\n            material.attenuationColor, material.attenuationDistance\n          ).r;\n          transmissionG = getIBLVolumeRefraction(\n            sampleNorm, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n            pos, modelMatrix, viewMatrix, projectionMatrix, material.ior  * (1.0 + chromaticAberration * (i + randomCoords) / float(${e})) , material.thickness + thickness_smear * (i + randomCoords) / float(${e}),\n            material.attenuationColor, material.attenuationDistance\n          ).g;\n          transmissionB = getIBLVolumeRefraction(\n            sampleNorm, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n            pos, modelMatrix, viewMatrix, projectionMatrix, material.ior * (1.0 + 2.0 * chromaticAberration * (i + randomCoords) / float(${e})), material.thickness + thickness_smear * (i + randomCoords) / float(${e}),\n            material.attenuationColor, material.attenuationDistance\n          ).b;\n          transmission.r += transmissionR;\n          transmission.g += transmissionG;\n          transmission.b += transmissionB;\n        }\n        transmission /= ${e}.0;\n        totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n`)},Object.keys(this.uniforms).forEach((e=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:t=>this.uniforms[e].value=t})))}}const nU=t.forwardRef(((e,n)=>{let{buffer:r,transmissionSampler:i=!1,backside:a=!1,side:o=Dy,transmission:s=1,thickness:l=0,backsideThickness:c=0,backsideEnvMapIntensity:u=1,samples:d=10,resolution:h,backsideResolution:p,background:f,anisotropy:m,anisotropicBlur:g,...v}=e;UL({MeshTransmissionMaterial:tU});const y=t.useRef(null),[b]=t.useState((()=>new eU)),x=QF(p||h),_=QF(h);let S,w,E,A;return Ik((e=>{y.current.time=e.clock.getElapsedTime(),y.current.buffer!==_.texture||i||(A=y.current.__r3f.parent,A&&(E=e.gl.toneMapping,S=e.scene.background,w=y.current.envMapIntensity,e.gl.toneMapping=bb,f&&(e.scene.background=f),A.material=b,a&&(e.gl.setRenderTarget(x),e.gl.render(e.scene,e.camera),A.material=y.current,A.material.buffer=x.texture,A.material.thickness=c,A.material.side=Ly,A.material.envMapIntensity=u),e.gl.setRenderTarget(_),e.gl.render(e.scene,e.camera),A.material=y.current,A.material.thickness=l,A.material.side=o,A.material.buffer=_.texture,A.material.envMapIntensity=w,e.scene.background=S,e.gl.setRenderTarget(null),e.gl.toneMapping=E))})),t.useImperativeHandle(n,(()=>y.current),[]),t.createElement("meshTransmissionMaterial",xO({args:[d,i],ref:y},v,{buffer:r||_.texture,_transmission:s,anisotropicBlur:null!==g&&void 0!==g?g:m,transmission:i?s:0,thickness:l,side:o}))})),rU="original001",iU=`${window.location.origin}/assets/models/bear5.glb`;function aU(){const{nodes:e}=qF(iU),{viewport:n}=Bk();console.log("BEAR NODES"),console.log(e);const r=t.useRef(null);Ik((()=>{r.current&&(r.current.rotation.y+=.004)}));const i=_y({thickness:{value:1.7,min:0,max:3,step:.5},roughness:{value:0,min:0,max:1,step:.1},transmission:{value:1,min:0,max:1,step:.1},ior:{value:.6,min:0,max:3,step:.1},chromaticAberration:{value:.92,min:0,max:1},backside:{value:!0},textDistance:{value:.5,min:-2,max:3},textColor:{value:"#2d8fd2"}}),a=e[rU];if(!a)return console.error(`Node ${rU} not found.`),null;const o=a;return(0,fi.jsx)("group",{scale:n.width/3,children:o.geometry&&o.material&&(0,fi.jsx)("mesh",{ref:r,geometry:o.geometry,material:o.material,rotation:[0,0,0],scale:2,children:(0,fi.jsx)(nU,{...i})})})}console.log("MODEL_LOCATION"),console.log(iU);const oU=Qt.h1`
  font-size: 74px;
  margin: 0;
  line-height: 1;

  @media only screen and (max-width: 1000px) {
    font-size: 60px;
  }

  @media only screen and (max-width: 450px) {
    font-size: 50px;
  }
`,sU=(Qt.h1`
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
`,Qt.h2`
  font-size: 40px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
`,Qt.h3`
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
`,Qt.h4`
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
`,Qt.p`
  color: lightgray;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;

  @media only screen and (max-width: 1000px) {
    font-size: 20px;
  }

  @media only screen and (max-width: 450px) {
    font-size: 16px;
  }
`),lU=Qt.p`
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
`,cU=(Qt(lU)`
  font-weight: 700;
`,Qt(lU)`
  font-weight: 500;
`,Qt(lU)`
  font-size: 14px;
`,Qt.span`
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
`),uU=(Qt(cU)`
  font-size: 10px;
`,Qt.section`
  height: 100vh;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0 6%; //move this later
`),dU=Qt.div`
  height: 100%;
  scroll-snap-align: center;
  display: flex;
  justify-content: space-between;
  position: relative; // Keep relative positioning for absolute children

  @media only screen and (max-width: 900px) {
    flex-direction: column; // Stack components on small screens
    align-items: center; // Center content if desired
  }
`,hU=Qt.div`
  flex: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  text-align: left;
  position: relative; // Ensure text is above the 3D model

  @media only screen and (max-width: 900px) {
    flex: 1;
    align-items: center;
    text-align: center;
    transform: translate(0, -5%);
    z-index: 10; // Higher z-index to stay above the model
  }
`,pU=Qt.h2`
  color: #2d8fd2;
  margin: 0;
  opacity: 0.96;

  @media only screen and (max-width: 900px) {
    font-size: 22px;
  }
`,fU=Qt.div`
  flex: 2;
  position: relative; // Maintain relative positioning

  @media only screen and (max-width: 900px) {
    position: absolute; // Set to absolute positioning on smaller screens
    top: 50%; // Move below the Left component
    left: 50%;
    transform: translate(-50%, -50%); // Center horizontally
    height: 800px; // Set height or remove as needed
    z-index: 1; 
    opacity:0.5;
  }
`,mU=()=>{const{t:e}=mo();return(0,fi.jsx)(uU,{children:(0,fi.jsxs)(dU,{children:[(0,fi.jsxs)(hU,{children:[(0,fi.jsx)(oU,{children:e("home.hero.title")}),(0,fi.jsx)(pU,{children:"- Save, Build, Achieve"})]}),(0,fi.jsx)(fU,{children:(0,fi.jsx)(bO,{className:"hero-canvas",children:(0,fi.jsxs)(t.Suspense,{fallback:null,children:[(0,fi.jsx)(TO,{enableZoom:!1}),(0,fi.jsx)("ambientLight",{intensity:1}),(0,fi.jsx)("directionalLight",{position:[3,2,1]}),(0,fi.jsx)(zN,{preset:"city"}),(0,fi.jsx)(aU,{})]})})})]})})},gU=Qt.section`
  height: 100vh;
  scroll-snap-align: center;
  display: flex;
  justify-content: center;

  background: url('./assets/images/bg.jpeg');
  background: #2d90d25f;
  padding: 0 6%; //move this later
`,vU=Qt.div`
  height: 100vh;
  scroll-snap-align: center;
  width: 1400px;
  display: flex;
  justify-content: space-between;
`,yU=Qt.div`
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;

  @media only screen and (max-width: 768px) {
    align-items: center;
    text-align: center;
  }
`,bU=()=>{const{t:e}=mo();return(0,fi.jsx)(gU,{id:"home-mission",children:(0,fi.jsx)(vU,{children:(0,fi.jsxs)(yU,{children:[(0,fi.jsx)(oU,{children:e("home.mission.title")}),(0,fi.jsx)(sU,{style:{color:"lightgray"},children:e("home.mission.text")})]})})})},xU="SOL_M_Solana_0",_U=`${window.location.origin}/assets/models/solana.glb`;function SU(){const{nodes:e}=qF(_U),{viewport:n,size:r}=Bk(),i=t.useRef(null);Ik((()=>{i.current&&(i.current.rotation.y+=.004)}));const a=_y({thickness:{value:1.7,min:0,max:3,step:.5},roughness:{value:0,min:0,max:1,step:.1},transmission:{value:1,min:0,max:1,step:.1},ior:{value:.6,min:0,max:3,step:.1},chromaticAberration:{value:.92,min:0,max:1},backside:{value:!0},textDistance:{value:.5,min:-2,max:3},textColor:{value:"#2d8fd2"}}),o=e[xU];if(!o)return console.error(`Node ${xU} not found.`),null;const s=o,l=Math.min(n.width/7,n.height/7);return(0,fi.jsx)("group",{scale:[l,l,l],children:s.geometry&&s.material&&(0,fi.jsx)("mesh",{ref:i,geometry:s.geometry,material:s.material,rotation:[90,180,180],children:(0,fi.jsx)(nU,{...a})})})}const wU=Qt.section`
  /* height: 100vh; */
  scroll-snap-align: center;
  display: flex;
  justify-content: center;
  /* background: #4c366c; */
  background: black;
  padding: 4% 6%; //move this later
`,EU=Qt.div`
  position: relative;
  height: 100vh;
  scroll-snap-align: center;
  width: 1400px;
  display: flex;
  justify-content: space-between;
`,AU=Qt.div`
  flex: 4;
  position: relative;

  @media only screen and (max-width: 768px) {
    position: absolute;
    z-index: 0;
    top:50%;
    left:50%;
    transform: translate(-50%, -50%);
    opacity:0.7;
  }
`,MU=Qt.div`
  flex: 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  max-width: 800px;
  z-index: 1;

  @media only screen and (max-width: 768px) {
    align-items: center;
    text-align: center;
  }
`,CU=Qt.p`
  text-align: center;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
`,TU=()=>{const{t:e}=mo();return(0,fi.jsx)(wU,{id:"home-tokenomics",children:(0,fi.jsxs)(EU,{children:[(0,fi.jsx)(AU,{children:(0,fi.jsx)(bO,{children:(0,fi.jsxs)(t.Suspense,{fallback:null,children:[(0,fi.jsx)(TO,{enableZoom:!1}),(0,fi.jsx)("ambientLight",{intensity:1}),(0,fi.jsx)("directionalLight",{position:[3,2,1]}),(0,fi.jsx)(zN,{preset:"city"}),(0,fi.jsx)(SU,{})]})})}),(0,fi.jsxs)(MU,{children:[(0,fi.jsx)(oU,{children:e("home.tokenomics.title")}),(0,fi.jsx)(CU,{children:(0,fi.jsx)(sU,{children:e("home.tokenomics.paragraph1")})}),(0,fi.jsxs)(CU,{children:[(0,fi.jsx)(sU,{style:{fontWeight:700,padding:"18px"},children:e("home.tokenomics.paragraph2.bold")}),(0,fi.jsx)(sU,{children:e("home.tokenomics.paragraph2.normal")})]}),(0,fi.jsxs)(CU,{children:[(0,fi.jsx)(sU,{style:{fontWeight:700,padding:"18px"},children:e("home.tokenomics.paragraph3.bold")}),(0,fi.jsx)(sU,{children:e("home.tokenomics.paragraph3.normal")})]})]})]})})},RU=Qt.section`
  height: 100vh;
  scroll-snap-align: center;
  display: flex;
  justify-content: center;
  padding: 0 6%; //move this later
`,PU=Qt.div`
  height: 100vh;
  scroll-snap-align: center;
  width: 1400px;
  display: flex;
  justify-content: space-between;
  padding:0 4%;
`,BU=Qt.div`
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  align-items: center;
  text-align: center;

  /* @media only screen and (max-width: 768px) {
    align-items: center;
    text-align: center;
  } */
`,IU=Qt.form`
  width: 500px;
  display: flex;
  flex-direction: column;
  gap: 25px;


  @media only screen and (max-width: 768px) {
    width: 300px;
  }
`,DU=()=>{const{t:e}=mo(),n=(0,t.useRef)(null),[r,i]=(0,t.useState)(!0),[a,o]=(0,t.useState)("");t.useEffect((()=>{i(!Si.validate(a))}),[a]);return(0,fi.jsx)(RU,{id:"home-learn-more",children:(0,fi.jsx)(PU,{children:(0,fi.jsxs)(BU,{children:[(0,fi.jsx)(oU,{children:e("home.want_to_learn_more.title")}),(0,fi.jsx)(sU,{style:{color:"lightgray"},children:e("home.want_to_learn_more.intro")}),(0,fi.jsxs)(IU,{ref:n,onSubmit:async e=>{e.preventDefault();try{const e={access_key:"cb8e130e-6fe7-4718-8874-d770a64aa4c3",email:a};(await fetch("https://api.web3forms.com/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok?(alert("Form submitted successfully"),o("")):alert("Error sending form")}catch(cO){alert("Error sending form")}},action:"https://api.web3forms.com/submit",method:"POST",children:[(0,fi.jsx)(Vi,{type:"hidden",name:"access_key",value:"cb8e130e-6fe7-4718-8874-d770a64aa4c3"}),(0,fi.jsx)(Vi,{placeholder:"add your email",name:"email",type:"email",onChange:e=>o(e.target.value),value:a}),(0,fi.jsx)(Xi,{type:"submit",disabled:r,label:"Apply to be a beta tester",onClick:()=>console.log("test")})]})]})})})},LU=Qt.div`

  position: relative;
  text-align: center;
  min-height: 100vh;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overflow-y: auto;
  scrollbar-width: none;
  color: white;
  background: url('./assets/images/bg.jpeg');
  background-color: rgba(0, 0, 0, 0.8);
  background-blend-mode: multiply;
  background-size: cover;
  background-position: center;

  &::-webkit-scrollbar {
    display: none;
  }
`;const kU=function(){return(0,fi.jsxs)(LU,{className:"page-home",children:[(0,fi.jsx)(by,{hidden:!0}),(0,fi.jsx)(mU,{}),(0,fi.jsx)(bU,{}),(0,fi.jsx)(TU,{}),(0,fi.jsx)(DU,{})]})};function OU(){return(0,fi.jsx)("div",{children:"Careers"})}const NU=Qt.div`
  background-color: white;
  border-radius: ${e=>`${e.radius}px`||"10px"};
  box-shadow: '0 4px 8px rgba(0, 0, 0, 0.1)';
  padding: ${e=>e.padding||"20px"};
  display: ${e=>e.display||"block"};
  height: ${e=>e.height||"100%"};
  width: ${e=>e.width||"100%"};
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.7) 100%
  );
`,FU=e=>{let{children:t,radius:n,padding:r,display:i,height:a,width:o}=e;return(0,fi.jsx)(NU,{radius:n,padding:r,display:i,height:a,width:o,children:t})},UU=Qt.div`
  position: relative;
  text-align: center;
  height: 100vh;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overflow-y: auto;
  scrollbar-width: none;
  color: white;
  background: url('./assets/images/bg.jpeg');
  background-color: rgba(0, 0, 0, 0.8);
  background-blend-mode: multiply;
  background-size: cover;
  background-position: center;

  display: flex;
  justify-content: space-between;
  align-items: center;

  &::-webkit-scrollbar {
    display: none;
  }

  .auth-brand-section,
  .auth-form-section {
    flex: 1;
    height: 100%;
    padding: 2% 3%;
  }

  .auth-brand-section {
  }

  .auth-form-section {
  }
`;function zU(){return(0,fi.jsxs)(UU,{children:[(0,fi.jsx)("div",{className:"auth-brand-section",children:(0,fi.jsx)(oU,{children:"The Future of Social Security"})}),(0,fi.jsx)("div",{className:"auth-form-section",children:(0,fi.jsx)(FU,{radius:28,children:(0,fi.jsx)("h1",{children:"hi"})})})]})}function HU(){return(0,fi.jsx)("div",{children:"SignUp"})}function GU(){return(0,fi.jsx)("div",{children:"PrivacyPolicyPage"})}function jU(){return(0,fi.jsx)("div",{children:"TermsAndConditionsPage"})}function VU(){return(0,fi.jsx)("div",{children:"Dashboard"})}function WU(){return(0,fi.jsx)("div",{children:"Settings"})}function XU(){return(0,fi.jsx)("div",{children:"NotFound"})}function JU(){return JU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JU.apply(this,arguments)}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(uz){}function $U(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=JU({},t,{errors:KU(t.errors)})),t}function KU(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&"RouteErrorResponse"===i.__type)n[r]=new Fn(i.status,i.statusText,i.data,!0===i.internal);else if(i&&"Error"===i.__type){if(i.__subType){let e=window[i.__subType];if("function"===typeof e)try{let t=new e(i.message);t.stack="",n[r]=t}catch(uz){}}if(null==n[r]){let e=new Error(i.message);e.stack="",n[r]=e}}else n[r]=i;return n}const YU=t.createContext({isTransitioning:!1});const qU=t.createContext(new Map);const QU=r.startTransition,ZU=Lo.flushSync;r.useId;function ez(e){ZU?ZU(e):e()}class tz{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}}function nz(e){let{fallbackElement:n,router:r,future:i}=e,[a,o]=t.useState(r.state),[s,l]=t.useState(),[c,u]=t.useState({isTransitioning:!1}),[d,h]=t.useState(),[p,f]=t.useState(),[m,g]=t.useState(),v=t.useRef(new Map),{v7_startTransition:y}=i||{},b=t.useCallback((e=>{y?function(e){QU?QU(e):e()}(e):e()}),[y]),x=t.useCallback(((e,t)=>{let{deletedFetchers:n,unstable_flushSync:i,unstable_viewTransitionOpts:a}=t;n.forEach((e=>v.current.delete(e))),e.fetchers.forEach(((e,t)=>{void 0!==e.data&&v.current.set(t,e.data)}));let s=null==r.window||null==r.window.document||"function"!==typeof r.window.document.startViewTransition;if(a&&!s){if(i){ez((()=>{p&&(d&&d.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:a.currentLocation,nextLocation:a.nextLocation})}));let t=r.window.document.startViewTransition((()=>{ez((()=>o(e)))}));return t.finished.finally((()=>{ez((()=>{h(void 0),f(void 0),l(void 0),u({isTransitioning:!1})}))})),void ez((()=>f(t)))}p?(d&&d.resolve(),p.skipTransition(),g({state:e,currentLocation:a.currentLocation,nextLocation:a.nextLocation})):(l(e),u({isTransitioning:!0,flushSync:!1,currentLocation:a.currentLocation,nextLocation:a.nextLocation}))}else i?ez((()=>o(e))):b((()=>o(e)))}),[r.window,p,d,v,b]);t.useLayoutEffect((()=>r.subscribe(x)),[r,x]),t.useEffect((()=>{c.isTransitioning&&!c.flushSync&&h(new tz)}),[c]),t.useEffect((()=>{if(d&&s&&r.window){let e=s,t=d.promise,n=r.window.document.startViewTransition((async()=>{b((()=>o(e))),await t}));n.finished.finally((()=>{h(void 0),f(void 0),l(void 0),u({isTransitioning:!1})})),f(n)}}),[b,s,d,r.window]),t.useEffect((()=>{d&&s&&a.location.key===s.location.key&&d.resolve()}),[d,p,a.location,s]),t.useEffect((()=>{!c.isTransitioning&&m&&(l(m.state),u({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),g(void 0))}),[c.isTransitioning,m]),t.useEffect((()=>{}),[]);let _=t.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),S=r.basename||"/",w=t.useMemo((()=>({router:r,navigator:_,static:!1,basename:S})),[r,_,S]),E=t.useMemo((()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath})),[r.future.v7_relativeSplatPath]);return t.createElement(t.Fragment,null,t.createElement(Gr.Provider,{value:w},t.createElement(jr.Provider,{value:a},t.createElement(qU.Provider,{value:v.current},t.createElement(YU.Provider,{value:c},t.createElement(hi,{basename:S,location:a.location,navigationType:a.historyAction,navigator:_,future:E},a.initialized||r.future.v7_partialHydration?t.createElement(rz,{routes:r.routes,future:r.future,state:a}):n))))),null)}const rz=t.memo(iz);function iz(e){let{routes:t,future:n,state:r}=e;return Zr(t,void 0,r,n)}"undefined"!==typeof window&&"undefined"!==typeof window.document&&window.document.createElement;var az,oz;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(az||(az={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(oz||(oz={}));const sz=e=>{let{element:t}=e;return t},lz=function(e,t){return Qn({basename:null==t?void 0:t.basename,future:JU({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:(n={window:null==t?void 0:t.window},void 0===n&&(n={}),un((function(e,t){let{pathname:n,search:r,hash:i}=e.location;return sn("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:ln(t)}),null,n)),hydrationData:(null==t?void 0:t.hydrationData)||$U(),routes:e,mapRouteProperties:pi,unstable_dataStrategy:null==t?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnNavigation:null==t?void 0:t.unstable_patchRoutesOnNavigation,window:null==t?void 0:t.window}).initialize();var n}([{path:"/",element:(0,fi.jsx)(ca,{}),children:[{path:"/",element:(0,fi.jsx)(kU,{})},{path:"careers",element:(0,fi.jsx)(OU,{})},{path:"privacy-policy",element:(0,fi.jsx)(GU,{})},{path:"terms",element:(0,fi.jsx)(jU,{})},{path:"auth",element:(0,fi.jsx)(zU,{})},{path:"signup",element:(0,fi.jsx)(HU,{})},{path:"dashboard",element:(0,fi.jsx)(sz,{element:(0,fi.jsx)(VU,{})})},{path:"settings",element:(0,fi.jsx)(sz,{element:(0,fi.jsx)(WU,{})})},{path:"*",element:(0,fi.jsx)(XU,{})}]}]);function cz(){return(0,fi.jsx)(nz,{router:lz})}i.createRoot(document.getElementById("root")).render((0,fi.jsx)(t.StrictMode,{children:(0,fi.jsx)(cz,{})})),a()})()})();
//# sourceMappingURL=main.ec3c5280.js.map